|
|
var H$ = Object.defineProperty; var W$ = (e, t, n) => t in e ? H$(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var uP = (e, t, n) => (W$(e, typeof t != "symbol" ? t + "" : t, n), n); function GR(e, t) { for (var n = 0; n < t.length; n++) { const r = t[n]; if (typeof r != "string" && !Array.isArray(r)) { for (const i in r) if (i !== "default" && !(i in e)) { const s = Object.getOwnPropertyDescriptor(r, i); s && Object.defineProperty(e, i, s.get ? s : { enumerable: !0, get: () => r[i] }) } } } return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" })) } (function () { const t = document.createElement("link").relList; if (t && t.supports && t.supports("modulepreload")) return; for (const i of document.querySelectorAll('link[rel="modulepreload"]')) r(i); new MutationObserver(i => { for (const s of i) if (s.type === "childList") for (const c of s.addedNodes) c.tagName === "LINK" && c.rel === "modulepreload" && r(c) }).observe(document, { childList: !0, subtree: !0 }); function n(i) { const s = {}; return i.integrity && (s.integrity = i.integrity), i.referrerpolicy && (s.referrerPolicy = i.referrerpolicy), i.crossorigin === "use-credentials" ? s.credentials = "include" : i.crossorigin === "anonymous" ? s.credentials = "omit" : s.credentials = "same-origin", s } function r(i) { if (i.ep) return; i.ep = !0; const s = n(i); fetch(i.href, s) } })(); var Gs = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function GC(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e } var C = { exports: {} }, ar = {};/**
|
|
|
* @license React
|
|
|
* react.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var rm = Symbol.for("react.element"), G$ = Symbol.for("react.portal"), q$ = Symbol.for("react.fragment"), Z$ = Symbol.for("react.strict_mode"), X$ = Symbol.for("react.profiler"), Y$ = Symbol.for("react.provider"), Q$ = Symbol.for("react.context"), J$ = Symbol.for("react.forward_ref"), e8 = Symbol.for("react.suspense"), t8 = Symbol.for("react.memo"), n8 = Symbol.for("react.lazy"), cP = Symbol.iterator; function r8(e) { return e === null || typeof e != "object" ? null : (e = cP && e[cP] || e["@@iterator"], typeof e == "function" ? e : null) } var qR = { isMounted: function () { return !1 }, enqueueForceUpdate: function () { }, enqueueReplaceState: function () { }, enqueueSetState: function () { } }, ZR = Object.assign, XR = {}; function vf(e, t, n) { this.props = e, this.context = t, this.refs = XR, this.updater = n || qR } vf.prototype.isReactComponent = {}; vf.prototype.setState = function (e, t) { if (typeof e != "object" && typeof e != "function" && e != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); this.updater.enqueueSetState(this, e, t, "setState") }; vf.prototype.forceUpdate = function (e) { this.updater.enqueueForceUpdate(this, e, "forceUpdate") }; function YR() { } YR.prototype = vf.prototype; function qC(e, t, n) { this.props = e, this.context = t, this.refs = XR, this.updater = n || qR } var ZC = qC.prototype = new YR; ZC.constructor = qC; ZR(ZC, vf.prototype); ZC.isPureReactComponent = !0; var dP = Array.isArray, QR = Object.prototype.hasOwnProperty, XC = { current: null }, JR = { key: !0, ref: !0, __self: !0, __source: !0 }; function eM(e, t, n) { var r, i = {}, s = null, c = null; if (t != null) for (r in t.ref !== void 0 && (c = t.ref), t.key !== void 0 && (s = "" + t.key), t) QR.call(t, r) && !JR.hasOwnProperty(r) && (i[r] = t[r]); var o = arguments.length - 2; if (o === 1) i.children = n; else if (1 < o) { for (var f = Array(o), p = 0; p < o; p++)f[p] = arguments[p + 2]; i.children = f } if (e && e.defaultProps) for (r in o = e.defaultProps, o) i[r] === void 0 && (i[r] = o[r]); return { $$typeof: rm, type: e, key: s, ref: c, props: i, _owner: XC.current } } function i8(e, t) { return { $$typeof: rm, type: e.type, key: t, ref: e.ref, props: e.props, _owner: e._owner } } function YC(e) { return typeof e == "object" && e !== null && e.$$typeof === rm } function o8(e) { var t = { "=": "=0", ":": "=2" }; return "$" + e.replace(/[=:]/g, function (n) { return t[n] }) } var fP = /\/+/g; function N_(e, t) { return typeof e == "object" && e !== null && e.key != null ? o8("" + e.key) : t.toString(36) } function Tg(e, t, n, r, i) { var s = typeof e; (s === "undefined" || s === "boolean") && (e = null); var c = !1; if (e === null) c = !0; else switch (s) { case "string": case "number": c = !0; break; case "object": switch (e.$$typeof) { case rm: case G$: c = !0 } }if (c) return c = e, i = i(c), e = r === "" ? "." + N_(c, 0) : r, dP(i) ? (n = "", e != null && (n = e.replace(fP, "$&/") + "/"), Tg(i, t, n, "", function (p) { return p })) : i != null && (YC(i) && (i = i8(i, n + (!i.key || c && c.key === i.key ? "" : ("" + i.key).replace(fP, "$&/") + "/") + e)), t.push(i)), 1; if (c = 0, r = r === "" ? "." : r + ":", dP(e)) for (var o = 0; o < e.length; o++) { s = e[o]; var f = r + N_(s, o); c += Tg(s, t, n, f, i) } else if (f = r8(e), typeof f == "function") for (e = f.call(e), o = 0; !(s = e.next()).done;)s = s.value, f = r + N_(s, o++), c += Tg(s, t, n, f, i); else if (s === "object") throw t = String(e), Error("Objects are not valid as a React child (found: " + (t === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : t) + "). If you meant to render a collection of children, use an array instead."); return c } function Fv(e, t, n) { if (e == null) return e; var r = [], i = 0; return Tg(e, r, "", "", function (s) { return t.call(n, s, i++) }), r } function a8(e) { if (e._status === -1) { var t = e._result; t = t(), t.then(function (n) { (e._status === 0 || e._status === -1) && (e._status = 1, e._result = n) }, function (n) { (e._status === 0 || e._status === -1) && (e._status = 2, e._result = n) }), e._status === -1 && (e._status = 0, e._result = t) } if (e._status === 1) return e._result.default; throw e._result } var So = { current: null }, kg = { transition: null }, s8 = { ReactCurrentDispatcher: So, ReactCurrentBatchConfig: kg, ReactCurrentOwner: XC }; ar.Children = { map: Fv, forEach: function (e, t, n) { Fv(e, function () { t.apply(this, arguments) }, n) }, count: function (e) { var t = 0; return Fv(e, function () { t++ }), t }, toArray: function (e) { return Fv(e, function (t) { return t }) || [] }, only: function (e) { if (!YC(e)) throw Error("React.Children.only expected to receive a single React element child."); return e } }; ar.Component = vf; ar.Fragment = q$; ar.Profiler = X$; ar.PureComponent = qC; ar.StrictMode = Z$; ar.Suspense = e8; ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = s8; ar.cloneElement = function (e, t, n) { if (e == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + e + "."); var r = ZR({}, e.props), i = e.key, s = e.ref, c = e._owner; if (t != null) { if (t.ref !== void 0 && (s = t.ref, c = XC.current), t.key !== void 0 && (i = "" + t.key), e.type && e.type.defaultProps) var o = e.type.defaultProps; for (f in t) QR.call(t, f) && !JR.hasOwnProperty(f) && (r[f] = t[f] === void 0 && o !== void 0 ? o[f] : t[f]) } var f = arguments.length - 2; if (f === 1) r.children = n; else if (1 < f) { o = Array(f); for (var p = 0; p < f; p++)o[p] = arguments[p + 2]; r.children = o } return { $$typeof: rm, type: e.type, key: i, ref: s, props: r, _owner: c } }; ar.createContext = function (e) { return e = { $$typeof: Q$, _currentValue: e, _currentValue2: e, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, e.Provider = { $$typeof: Y$, _context: e }, e.Consumer = e }; ar.createElement = eM; ar.createFactory = function (e) { var t = eM.bind(null, e); return t.type = e, t }; ar.createRef = function () { return { current: null } }; ar.forwardRef = function (e) { return { $$typeof: J$, render: e } }; ar.isValidElement = YC; ar.lazy = function (e) { return { $$typeof: n8, _payload: { _status: -1, _result: e }, _init: a8 } }; ar.memo = function (e, t) { return { $$typeof: t8, type: e, compare: t === void 0 ? null : t } }; ar.startTransition = function (e) { var t = kg.transition; kg.transition = {}; try { e() } finally { kg.transition = t } }; ar.unstable_act = function () { throw Error("act(...) is not supported in production builds of React.") }; ar.useCallback = function (e, t) { return So.current.useCallback(e, t) }; ar.useContext = function (e) { return So.current.useContext(e) }; ar.useDebugValue = function () { }; ar.useDeferredValue = function (e) { return So.current.useDeferredValue(e) }; ar.useEffect = function (e, t) { return So.current.useEffect(e, t) }; ar.useId = function () { return So.current.useId() }; ar.useImperativeHandle = function (e, t, n) { return So.current.useImperativeHandle(e, t, n) }; ar.useInsertionEffect = function (e, t) { return So.current.useInsertionEffect(e, t) }; ar.useLayoutEffect = function (e, t) { return So.current.useLayoutEffect(e, t) }; ar.useMemo = function (e, t) { return So.current.useMemo(e, t) }; ar.useReducer = function (e, t, n) { return So.current.useReducer(e, t, n) }; ar.useRef = function (e) { return So.current.useRef(e) }; ar.useState = function (e) { return So.current.useState(e) }; ar.useSyncExternalStore = function (e, t, n) { return So.current.useSyncExternalStore(e, t, n) }; ar.useTransition = function () { return So.current.useTransition() }; ar.version = "18.2.0"; (function (e) { e.exports = ar })(C); const tr = GC(C.exports), ny = GR({ __proto__: null, default: tr }, [C.exports]); var mb = {}, pu = { exports: {} }, ta = {}, tM = { exports: {} }, nM = {};/**
|
|
|
* @license React
|
|
|
* scheduler.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/(function (e) { function t(oe, ye) { var Ie = oe.length; oe.push(ye); e: for (; 0 < Ie;) { var Te = Ie - 1 >>> 1, Pe = oe[Te]; if (0 < i(Pe, ye)) oe[Te] = ye, oe[Ie] = Pe, Ie = Te; else break e } } function n(oe) { return oe.length === 0 ? null : oe[0] } function r(oe) { if (oe.length === 0) return null; var ye = oe[0], Ie = oe.pop(); if (Ie !== ye) { oe[0] = Ie; e: for (var Te = 0, Pe = oe.length, De = Pe >>> 1; Te < De;) { var Re = 2 * (Te + 1) - 1, ke = oe[Re], Oe = Re + 1, $e = oe[Oe]; if (0 > i(ke, Ie)) Oe < Pe && 0 > i($e, ke) ? (oe[Te] = $e, oe[Oe] = Ie, Te = Oe) : (oe[Te] = ke, oe[Re] = Ie, Te = Re); else if (Oe < Pe && 0 > i($e, Ie)) oe[Te] = $e, oe[Oe] = Ie, Te = Oe; else break e } } return ye } function i(oe, ye) { var Ie = oe.sortIndex - ye.sortIndex; return Ie !== 0 ? Ie : oe.id - ye.id } if (typeof performance == "object" && typeof performance.now == "function") { var s = performance; e.unstable_now = function () { return s.now() } } else { var c = Date, o = c.now(); e.unstable_now = function () { return c.now() - o } } var f = [], p = [], v = 1, y = null, w = 3, P = !1, k = !1, A = !1, N = typeof setTimeout == "function" ? setTimeout : null, R = typeof clearTimeout == "function" ? clearTimeout : null, M = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function O(oe) { for (var ye = n(p); ye !== null;) { if (ye.callback === null) r(p); else if (ye.startTime <= oe) r(p), ye.sortIndex = ye.expirationTime, t(f, ye); else break; ye = n(p) } } function z(oe) { if (A = !1, O(oe), !k) if (n(f) !== null) k = !0, ie(B); else { var ye = n(p); ye !== null && ce(z, ye.startTime - oe) } } function B(oe, ye) { k = !1, A && (A = !1, R(j), j = -1), P = !0; var Ie = w; try { for (O(ye), y = n(f); y !== null && (!(y.expirationTime > ye) || oe && !se());) { var Te = y.callback; if (typeof Te == "function") { y.callback = null, w = y.priorityLevel; var Pe = Te(y.expirationTime <= ye); ye = e.unstable_now(), typeof Pe == "function" ? y.callback = Pe : y === n(f) && r(f), O(ye) } else r(f); y = n(f) } if (y !== null) var De = !0; else { var Re = n(p); Re !== null && ce(z, Re.startTime - ye), De = !1 } return De } finally { y = null, w = Ie, P = !1 } } var V = !1, G = null, j = -1, X = 5, Y = -1; function se() { return !(e.unstable_now() - Y < X) } function ee() { if (G !== null) { var oe = e.unstable_now(); Y = oe; var ye = !0; try { ye = G(!0, oe) } finally { ye ? Z() : (V = !1, G = null) } } else V = !1 } var Z; if (typeof M == "function") Z = function () { M(ee) }; else if (typeof MessageChannel < "u") { var J = new MessageChannel, ve = J.port2; J.port1.onmessage = ee, Z = function () { ve.postMessage(null) } } else Z = function () { N(ee, 0) }; function ie(oe) { G = oe, V || (V = !0, Z()) } function ce(oe, ye) { j = N(function () { oe(e.unstable_now()) }, ye) } e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function (oe) { oe.callback = null }, e.unstable_continueExecution = function () { k || P || (k = !0, ie(B)) }, e.unstable_forceFrameRate = function (oe) { 0 > oe || 125 < oe ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : X = 0 < oe ? Math.floor(1e3 / oe) : 5 }, e.unstable_getCurrentPriorityLevel = function () { return w }, e.unstable_getFirstCallbackNode = function () { return n(f) }, e.unstable_next = function (oe) { switch (w) { case 1: case 2: case 3: var ye = 3; break; default: ye = w }var Ie = w; w = ye; try { return oe() } finally { w = Ie } }, e.unstable_pauseExecution = function () { }, e.unstable_requestPaint = function () { }, e.unstable_runWithPriority = function (oe, ye) { switch (oe) { case 1: case 2: case 3: case 4: case 5: break; default: oe = 3 }var Ie = w; w = oe; try { return ye() } finally { w = Ie } }, e.unstable_scheduleCallback = function (oe, ye, Ie) { var Te = e.unstable_now(); switch (typeof Ie == "object" && Ie !== null ? (Ie = Ie.delay, Ie = typeof Ie == "number" && 0 < Ie ? Te + Ie : Te) : Ie = Te, oe) { case 1: var Pe = -1; break; case 2: Pe = 250; break; case 5: Pe = 1073741823; break; case 4: Pe = 1e4; break; default: Pe = 5e3 }return Pe = Ie + Pe, oe = { id: v++, callback: ye, priorityLevel: oe, startTime: Ie, expirationTime: Pe, sortIndex: -1 }, Ie > Te ? (oe.sortIndex = Ie, t(p, oe), n(f) === null && oe === n(p) && (A ? (R(j), j = -1) : A = !0, ce(z, Ie - Te))) : (oe.sortIndex = Pe, t(f, oe), k || P || (k = !0, ie(B))), oe }, e.unstable_shouldYield = se, e.unstable_wrapCallback = function (oe) { var ye = w; return function () { var Ie = w; w = ye; try { return oe.apply(this, arguments) } finally { w = Ie } } } })(nM); (function (e) { e.exports = nM })(tM);/**
|
|
|
* @license React
|
|
|
* react-dom.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var rM = C.exports, Jo = tM.exports; function Ht(e) { for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, n = 1; n < arguments.length; n++)t += "&args[]=" + encodeURIComponent(arguments[n]); return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." } var iM = new Set, wp = {}; function Tc(e, t) { Zd(e, t), Zd(e + "Capture", t) } function Zd(e, t) { for (wp[e] = t, e = 0; e < t.length; e++)iM.add(t[e]) } var tl = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), vb = Object.prototype.hasOwnProperty, l8 = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, hP = {}, pP = {}; function u8(e) { return vb.call(pP, e) ? !0 : vb.call(hP, e) ? !1 : l8.test(e) ? pP[e] = !0 : (hP[e] = !0, !1) } function c8(e, t, n, r) { if (n !== null && n.type === 0) return !1; switch (typeof t) { case "function": case "symbol": return !0; case "boolean": return r ? !1 : n !== null ? !n.acceptsBooleans : (e = e.toLowerCase().slice(0, 5), e !== "data-" && e !== "aria-"); default: return !1 } } function d8(e, t, n, r) { if (t === null || typeof t > "u" || c8(e, t, n, r)) return !0; if (r) return !1; if (n !== null) switch (n.type) { case 3: return !t; case 4: return t === !1; case 5: return isNaN(t); case 6: return isNaN(t) || 1 > t }return !1 } function Eo(e, t, n, r, i, s, c) { this.acceptsBooleans = t === 2 || t === 3 || t === 4, this.attributeName = r, this.attributeNamespace = i, this.mustUseProperty = n, this.propertyName = e, this.type = t, this.sanitizeURL = s, this.removeEmptyString = c } var qi = {}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function (e) { qi[e] = new Eo(e, 0, !1, e, null, !1, !1) });[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function (e) { var t = e[0]; qi[t] = new Eo(t, 1, !1, e[1], null, !1, !1) });["contentEditable", "draggable", "spellCheck", "value"].forEach(function (e) { qi[e] = new Eo(e, 2, !1, e.toLowerCase(), null, !1, !1) });["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function (e) { qi[e] = new Eo(e, 2, !1, e, null, !1, !1) }); "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function (e) { qi[e] = new Eo(e, 3, !1, e.toLowerCase(), null, !1, !1) });["checked", "multiple", "muted", "selected"].forEach(function (e) { qi[e] = new Eo(e, 3, !0, e, null, !1, !1) });["capture", "download"].forEach(function (e) { qi[e] = new Eo(e, 4, !1, e, null, !1, !1) });["cols", "rows", "size", "span"].forEach(function (e) { qi[e] = new Eo(e, 6, !1, e, null, !1, !1) });["rowSpan", "start"].forEach(function (e) { qi[e] = new Eo(e, 5, !1, e.toLowerCase(), null, !1, !1) }); var QC = /[\-:]([a-z])/g; function JC(e) { return e[1].toUpperCase() } "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function (e) { var t = e.replace(QC, JC); qi[t] = new Eo(t, 1, !1, e, null, !1, !1) }); "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function (e) { var t = e.replace(QC, JC); qi[t] = new Eo(t, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1) });["xml:base", "xml:lang", "xml:space"].forEach(function (e) { var t = e.replace(QC, JC); qi[t] = new Eo(t, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1) });["tabIndex", "crossOrigin"].forEach(function (e) { qi[e] = new Eo(e, 1, !1, e.toLowerCase(), null, !1, !1) }); qi.xlinkHref = new Eo("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1);["src", "href", "action", "formAction"].forEach(function (e) { qi[e] = new Eo(e, 1, !1, e.toLowerCase(), null, !0, !0) }); function eS(e, t, n, r) { var i = qi.hasOwnProperty(t) ? qi[t] : null; (i !== null ? i.type !== 0 : r || !(2 < t.length) || t[0] !== "o" && t[0] !== "O" || t[1] !== "n" && t[1] !== "N") && (d8(t, n, i, r) && (n = null), r || i === null ? u8(t) && (n === null ? e.removeAttribute(t) : e.setAttribute(t, "" + n)) : i.mustUseProperty ? e[i.propertyName] = n === null ? i.type === 3 ? !1 : "" : n : (t = i.attributeName, r = i.attributeNamespace, n === null ? e.removeAttribute(t) : (i = i.type, n = i === 3 || i === 4 && n === !0 ? "" : "" + n, r ? e.setAttributeNS(r, t, n) : e.setAttribute(t, n)))) } var ul = rM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, $v = Symbol.for("react.element"), wd = Symbol.for("react.portal"), Cd = Symbol.for("react.fragment"), tS = Symbol.for("react.strict_mode"), gb = Symbol.for("react.profiler"), oM = Symbol.for("react.provider"), aM = Symbol.for("react.context"), nS = Symbol.for("react.forward_ref"), yb = Symbol.for("react.suspense"), xb = Symbol.for("react.suspense_list"), rS = Symbol.for("react.memo"), Bl = Symbol.for("react.lazy"), sM = Symbol.for("react.offscreen"), mP = Symbol.iterator; function Rh(e) { return e === null || typeof e != "object" ? null : (e = mP && e[mP] || e["@@iterator"], typeof e == "function" ? e : null) } var ti = Object.assign, O_; function Gh(e) {
|
|
|
if (O_ === void 0) try { throw Error() } catch (n) { var t = n.stack.trim().match(/\n( *(at )?)/); O_ = t && t[1] || "" } return `
|
|
|
`+ O_ + e
|
|
|
} var D_ = !1; function L_(e, t) {
|
|
|
if (!e || D_) return ""; D_ = !0; var n = Error.prepareStackTrace; Error.prepareStackTrace = void 0; try { if (t) if (t = function () { throw Error() }, Object.defineProperty(t.prototype, "props", { set: function () { throw Error() } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(t, []) } catch (p) { var r = p } Reflect.construct(e, [], t) } else { try { t.call() } catch (p) { r = p } e.call(t.prototype) } else { try { throw Error() } catch (p) { r = p } e() } } catch (p) {
|
|
|
if (p && r && typeof p.stack == "string") {
|
|
|
for (var i = p.stack.split(`
|
|
|
`), s = r.stack.split(`
|
|
|
`), c = i.length - 1, o = s.length - 1; 1 <= c && 0 <= o && i[c] !== s[o];)o--; for (; 1 <= c && 0 <= o; c--, o--)if (i[c] !== s[o]) {
|
|
|
if (c !== 1 || o !== 1) do if (c--, o--, 0 > o || i[c] !== s[o]) {
|
|
|
var f = `
|
|
|
`+ i[c].replace(" at new ", " at "); return e.displayName && f.includes("<anonymous>") && (f = f.replace("<anonymous>", e.displayName)), f
|
|
|
} while (1 <= c && 0 <= o); break
|
|
|
}
|
|
|
}
|
|
|
} finally { D_ = !1, Error.prepareStackTrace = n } return (e = e ? e.displayName || e.name : "") ? Gh(e) : ""
|
|
|
} function f8(e) { switch (e.tag) { case 5: return Gh(e.type); case 16: return Gh("Lazy"); case 13: return Gh("Suspense"); case 19: return Gh("SuspenseList"); case 0: case 2: case 15: return e = L_(e.type, !1), e; case 11: return e = L_(e.type.render, !1), e; case 1: return e = L_(e.type, !0), e; default: return "" } } function _b(e) { if (e == null) return null; if (typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case Cd: return "Fragment"; case wd: return "Portal"; case gb: return "Profiler"; case tS: return "StrictMode"; case yb: return "Suspense"; case xb: return "SuspenseList" }if (typeof e == "object") switch (e.$$typeof) { case aM: return (e.displayName || "Context") + ".Consumer"; case oM: return (e._context.displayName || "Context") + ".Provider"; case nS: var t = e.render; return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e; case rS: return t = e.displayName || null, t !== null ? t : _b(e.type) || "Memo"; case Bl: t = e._payload, e = e._init; try { return _b(e(t)) } catch { } }return null } function h8(e) { var t = e.type; switch (e.tag) { case 24: return "Cache"; case 9: return (t.displayName || "Context") + ".Consumer"; case 10: return (t._context.displayName || "Context") + ".Provider"; case 18: return "DehydratedFragment"; case 11: return e = t.render, e = e.displayName || e.name || "", t.displayName || (e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"); case 7: return "Fragment"; case 5: return t; case 4: return "Portal"; case 3: return "Root"; case 6: return "Text"; case 16: return _b(t); case 8: return t === tS ? "StrictMode" : "Mode"; case 22: return "Offscreen"; case 12: return "Profiler"; case 21: return "Scope"; case 13: return "Suspense"; case 19: return "SuspenseList"; case 25: return "TracingMarker"; case 1: case 0: case 17: case 2: case 14: case 15: if (typeof t == "function") return t.displayName || t.name || null; if (typeof t == "string") return t }return null } function su(e) { switch (typeof e) { case "boolean": case "number": case "string": case "undefined": return e; case "object": return e; default: return "" } } function lM(e) { var t = e.type; return (e = e.nodeName) && e.toLowerCase() === "input" && (t === "checkbox" || t === "radio") } function p8(e) { var t = lM(e) ? "checked" : "value", n = Object.getOwnPropertyDescriptor(e.constructor.prototype, t), r = "" + e[t]; if (!e.hasOwnProperty(t) && typeof n < "u" && typeof n.get == "function" && typeof n.set == "function") { var i = n.get, s = n.set; return Object.defineProperty(e, t, { configurable: !0, get: function () { return i.call(this) }, set: function (c) { r = "" + c, s.call(this, c) } }), Object.defineProperty(e, t, { enumerable: n.enumerable }), { getValue: function () { return r }, setValue: function (c) { r = "" + c }, stopTracking: function () { e._valueTracker = null, delete e[t] } } } } function Bv(e) { e._valueTracker || (e._valueTracker = p8(e)) } function uM(e) { if (!e) return !1; var t = e._valueTracker; if (!t) return !0; var n = t.getValue(), r = ""; return e && (r = lM(e) ? e.checked ? "true" : "false" : e.value), e = r, e !== n ? (t.setValue(e), !0) : !1 } function ry(e) { if (e = e || (typeof document < "u" ? document : void 0), typeof e > "u") return null; try { return e.activeElement || e.body } catch { return e.body } } function bb(e, t) { var n = t.checked; return ti({}, t, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: n != null ? n : e._wrapperState.initialChecked }) } function vP(e, t) { var n = t.defaultValue == null ? "" : t.defaultValue, r = t.checked != null ? t.checked : t.defaultChecked; n = su(t.value != null ? t.value : n), e._wrapperState = { initialChecked: r, initialValue: n, controlled: t.type === "checkbox" || t.type === "radio" ? t.checked != null : t.value != null } } function cM(e, t) { t = t.checked, t != null && eS(e, "checked", t, !1) } function wb(e, t) { cM(e, t); var n = su(t.value), r = t.type; if (n != null) r === "number" ? (n === 0 && e.value === "" || e.value != n) && (e.value = "" + n) : e.value !== "" + n && (e.value = "" + n); else if (r === "submit" || r === "reset") { e.removeAttribute("value"); return } t.hasOwnProperty("value") ? Cb(e, t.type, n) : t.hasOwnProperty("defaultValue") && Cb(e, t.type, su(t.defaultValue)), t.checked == null && t.defaultChecked != null && (e.defaultChecked = !!t.defaultChecked) } function gP(e, t, n) { if (t.hasOwnProperty("value") || t.hasOwnProperty("defaultValue")) { var r = t.type; if (!(r !== "submit" && r !== "reset" || t.value !== void 0 && t.value !== null)) return; t = "" + e._wrapperState.initialValue, n || t === e.value || (e.value = t), e.defaultValue = t } n = e.name, n !== "" && (e.name = ""), e.defaultChecked = !!e._wrapperState.initialChecked, n !== "" && (e.name = n) } function Cb(e, t, n) { (t !== "number" || ry(e.ownerDocument) !== e) && (n == null ? e.defaultValue = "" + e._wrapperState.initialValue : e.defaultValue !== "" + n && (e.defaultValue = "" + n)) } var qh = Array.isArray; function $d(e, t, n, r) { if (e = e.options, t) { t = {}; for (var i = 0; i < n.length; i++)t["$" + n[i]] = !0; for (n = 0; n < e.length; n++)i = t.hasOwnProperty("$" + e[n].value), e[n].selected !== i && (e[n].selected = i), i && r && (e[n].defaultSelected = !0) } else { for (n = "" + su(n), t = null, i = 0; i < e.length; i++) { if (e[i].value === n) { e[i].selected = !0, r && (e[i].defaultSelected = !0); return } t !== null || e[i].disabled || (t = e[i]) } t !== null && (t.selected = !0) } } function Sb(e, t) { if (t.dangerouslySetInnerHTML != null) throw Error(Ht(91)); return ti({}, t, { value: void 0, defaultValue: void 0, children: "" + e._wrapperState.initialValue }) } function yP(e, t) { var n = t.value; if (n == null) { if (n = t.children, t = t.defaultValue, n != null) { if (t != null) throw Error(Ht(92)); if (qh(n)) { if (1 < n.length) throw Error(Ht(93)); n = n[0] } t = n } t == null && (t = ""), n = t } e._wrapperState = { initialValue: su(n) } } function dM(e, t) { var n = su(t.value), r = su(t.defaultValue); n != null && (n = "" + n, n !== e.value && (e.value = n), t.defaultValue == null && e.defaultValue !== n && (e.defaultValue = n)), r != null && (e.defaultValue = "" + r) } function xP(e) { var t = e.textContent; t === e._wrapperState.initialValue && t !== "" && t !== null && (e.value = t) } function fM(e) { switch (e) { case "svg": return "http://www.w3.org/2000/svg"; case "math": return "http://www.w3.org/1998/Math/MathML"; default: return "http://www.w3.org/1999/xhtml" } } function Eb(e, t) { return e == null || e === "http://www.w3.org/1999/xhtml" ? fM(t) : e === "http://www.w3.org/2000/svg" && t === "foreignObject" ? "http://www.w3.org/1999/xhtml" : e } var Vv, hM = function (e) { return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function (t, n, r, i) { MSApp.execUnsafeLocalFunction(function () { return e(t, n, r, i) }) } : e }(function (e, t) { if (e.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in e) e.innerHTML = t; else { for (Vv = Vv || document.createElement("div"), Vv.innerHTML = "<svg>" + t.valueOf().toString() + "</svg>", t = Vv.firstChild; e.firstChild;)e.removeChild(e.firstChild); for (; t.firstChild;)e.appendChild(t.firstChild) } }); function Cp(e, t) { if (t) { var n = e.firstChild; if (n && n === e.lastChild && n.nodeType === 3) { n.nodeValue = t; return } } e.textContent = t } var tp = { animationIterationCount: !0, aspectRatio: !0, borderImageOutset: !0, borderImageSlice: !0, borderImageWidth: !0, boxFlex: !0, boxFlexGroup: !0, boxOrdinalGroup: !0, columnCount: !0, columns: !0, flex: !0, flexGrow: !0, flexPositive: !0, flexShrink: !0, flexNegative: !0, flexOrder: !0, gridArea: !0, gridRow: !0, gridRowEnd: !0, gridRowSpan: !0, gridRowStart: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnSpan: !0, gridColumnStart: !0, fontWeight: !0, lineClamp: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, tabSize: !0, widows: !0, zIndex: !0, zoom: !0, fillOpacity: !0, floodOpacity: !0, stopOpacity: !0, strokeDasharray: !0, strokeDashoffset: !0, strokeMiterlimit: !0, strokeOpacity: !0, strokeWidth: !0 }, m8 = ["Webkit", "ms", "Moz", "O"]; Object.keys(tp).forEach(function (e) { m8.forEach(function (t) { t = t + e.charAt(0).toUpperCase() + e.substring(1), tp[t] = tp[e] }) }); function pM(e, t, n) { return t == null || typeof t == "boolean" || t === "" ? "" : n || typeof t != "number" || t === 0 || tp.hasOwnProperty(e) && tp[e] ? ("" + t).trim() : t + "px" } function mM(e, t) { e = e.style; for (var n in t) if (t.hasOwnProperty(n)) { var r = n.indexOf("--") === 0, i = pM(n, t[n], r); n === "float" && (n = "cssFloat"), r ? e.setProperty(n, i) : e[n] = i } } var v8 = ti({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 }); function Pb(e, t) { if (t) { if (v8[e] && (t.children != null || t.dangerouslySetInnerHTML != null)) throw Error(Ht(137, e)); if (t.dangerouslySetInnerHTML != null) { if (t.children != null) throw Error(Ht(60)); if (typeof t.dangerouslySetInnerHTML != "object" || !("__html" in t.dangerouslySetInnerHTML)) throw Error(Ht(61)) } if (t.style != null && typeof t.style != "object") throw Error(Ht(62)) } } function Tb(e, t) { if (e.indexOf("-") === -1) return typeof t.is == "string"; switch (e) { case "annotation-xml": case "color-profile": case "font-face": case "font-face-src": case "font-face-uri": case "font-face-format": case "font-face-name": case "missing-glyph": return !1; default: return !0 } } var kb = null; function iS(e) { return e = e.target || e.srcElement || window, e.correspondingUseElement && (e = e.correspondingUseElement), e.nodeType === 3 ? e.parentNode : e } var Ib = null, Bd = null, Vd = null; function _P(e) { if (e = am(e)) { if (typeof Ib != "function") throw Error(Ht(280)); var t = e.stateNode; t && (t = p0(t), Ib(e.stateNode, e.type, t)) } } function vM(e) { Bd ? Vd ? Vd.push(e) : Vd = [e] : Bd = e } function gM() { if (Bd) { var e = Bd, t = Vd; if (Vd = Bd = null, _P(e), t) for (e = 0; e < t.length; e++)_P(t[e]) } } function yM(e, t) { return e(t) } function xM() { } var z_ = !1; function _M(e, t, n) { if (z_) return e(t, n); z_ = !0; try { return yM(e, t, n) } finally { z_ = !1, (Bd !== null || Vd !== null) && (xM(), gM()) } } function Sp(e, t) { var n = e.stateNode; if (n === null) return null; var r = p0(n); if (r === null) return null; n = r[t]; e: switch (t) { case "onClick": case "onClickCapture": case "onDoubleClick": case "onDoubleClickCapture": case "onMouseDown": case "onMouseDownCapture": case "onMouseMove": case "onMouseMoveCapture": case "onMouseUp": case "onMouseUpCapture": case "onMouseEnter": (r = !r.disabled) || (e = e.type, r = !(e === "button" || e === "input" || e === "select" || e === "textarea")), e = !r; break e; default: e = !1 }if (e) return null; if (n && typeof n != "function") throw Error(Ht(231, t, typeof n)); return n } var Rb = !1; if (tl) try { var Mh = {}; Object.defineProperty(Mh, "passive", { get: function () { Rb = !0 } }), window.addEventListener("test", Mh, Mh), window.removeEventListener("test", Mh, Mh) } catch { Rb = !1 } function g8(e, t, n, r, i, s, c, o, f) { var p = Array.prototype.slice.call(arguments, 3); try { t.apply(n, p) } catch (v) { this.onError(v) } } var np = !1, iy = null, oy = !1, Mb = null, y8 = { onError: function (e) { np = !0, iy = e } }; function x8(e, t, n, r, i, s, c, o, f) { np = !1, iy = null, g8.apply(y8, arguments) } function _8(e, t, n, r, i, s, c, o, f) { if (x8.apply(this, arguments), np) { if (np) { var p = iy; np = !1, iy = null } else throw Error(Ht(198)); oy || (oy = !0, Mb = p) } } function kc(e) { var t = e, n = e; if (e.alternate) for (; t.return;)t = t.return; else { e = t; do t = e, (t.flags & 4098) !== 0 && (n = t.return), e = t.return; while (e) } return t.tag === 3 ? n : null } function bM(e) { if (e.tag === 13) { var t = e.memoizedState; if (t === null && (e = e.alternate, e !== null && (t = e.memoizedState)), t !== null) return t.dehydrated } return null } function bP(e) { if (kc(e) !== e) throw Error(Ht(188)) } function b8(e) { var t = e.alternate; if (!t) { if (t = kc(e), t === null) throw Error(Ht(188)); return t !== e ? null : e } for (var n = e, r = t; ;) { var i = n.return; if (i === null) break; var s = i.alternate; if (s === null) { if (r = i.return, r !== null) { n = r; continue } break } if (i.child === s.child) { for (s = i.child; s;) { if (s === n) return bP(i), e; if (s === r) return bP(i), t; s = s.sibling } throw Error(Ht(188)) } if (n.return !== r.return) n = i, r = s; else { for (var c = !1, o = i.child; o;) { if (o === n) { c = !0, n = i, r = s; break } if (o === r) { c = !0, r = i, n = s; break } o = o.sibling } if (!c) { for (o = s.child; o;) { if (o === n) { c = !0, n = s, r = i; break } if (o === r) { c = !0, r = s, n = i; break } o = o.sibling } if (!c) throw Error(Ht(189)) } } if (n.alternate !== r) throw Error(Ht(190)) } if (n.tag !== 3) throw Error(Ht(188)); return n.stateNode.current === n ? e : t } function wM(e) { return e = b8(e), e !== null ? CM(e) : null } function CM(e) { if (e.tag === 5 || e.tag === 6) return e; for (e = e.child; e !== null;) { var t = CM(e); if (t !== null) return t; e = e.sibling } return null } var SM = Jo.unstable_scheduleCallback, wP = Jo.unstable_cancelCallback, w8 = Jo.unstable_shouldYield, C8 = Jo.unstable_requestPaint, mi = Jo.unstable_now, S8 = Jo.unstable_getCurrentPriorityLevel, oS = Jo.unstable_ImmediatePriority, EM = Jo.unstable_UserBlockingPriority, ay = Jo.unstable_NormalPriority, E8 = Jo.unstable_LowPriority, PM = Jo.unstable_IdlePriority, c0 = null, hs = null; function P8(e) { if (hs && typeof hs.onCommitFiberRoot == "function") try { hs.onCommitFiberRoot(c0, e, void 0, (e.current.flags & 128) === 128) } catch { } } var ja = Math.clz32 ? Math.clz32 : I8, T8 = Math.log, k8 = Math.LN2; function I8(e) { return e >>>= 0, e === 0 ? 32 : 31 - (T8(e) / k8 | 0) | 0 } var Uv = 64, jv = 4194304; function Zh(e) { switch (e & -e) { case 1: return 1; case 2: return 2; case 4: return 4; case 8: return 8; case 16: return 16; case 32: return 32; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return e & 4194240; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return e & 130023424; case 134217728: return 134217728; case 268435456: return 268435456; case 536870912: return 536870912; case 1073741824: return 1073741824; default: return e } } function sy(e, t) { var n = e.pendingLanes; if (n === 0) return 0; var r = 0, i = e.suspendedLanes, s = e.pingedLanes, c = n & 268435455; if (c !== 0) { var o = c & ~i; o !== 0 ? r = Zh(o) : (s &= c, s !== 0 && (r = Zh(s))) } else c = n & ~i, c !== 0 ? r = Zh(c) : s !== 0 && (r = Zh(s)); if (r === 0) return 0; if (t !== 0 && t !== r && (t & i) === 0 && (i = r & -r, s = t & -t, i >= s || i === 16 && (s & 4194240) !== 0)) return t; if ((r & 4) !== 0 && (r |= n & 16), t = e.entangledLanes, t !== 0) for (e = e.entanglements, t &= r; 0 < t;)n = 31 - ja(t), i = 1 << n, r |= e[n], t &= ~i; return r } function R8(e, t) { switch (e) { case 1: case 2: case 4: return t + 250; case 8: case 16: case 32: case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return t + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return -1; case 134217728: case 268435456: case 536870912: case 1073741824: return -1; default: return -1 } } function M8(e, t) { for (var n = e.suspendedLanes, r = e.pingedLanes, i = e.expirationTimes, s = e.pendingLanes; 0 < s;) { var c = 31 - ja(s), o = 1 << c, f = i[c]; f === -1 ? ((o & n) === 0 || (o & r) !== 0) && (i[c] = R8(o, t)) : f <= t && (e.expiredLanes |= o), s &= ~o } } function Ab(e) { return e = e.pendingLanes & -1073741825, e !== 0 ? e : e & 1073741824 ? 1073741824 : 0 } function TM() { var e = Uv; return Uv <<= 1, (Uv & 4194240) === 0 && (Uv = 64), e } function F_(e) { for (var t = [], n = 0; 31 > n; n++)t.push(e); return t } function im(e, t, n) { e.pendingLanes |= t, t !== 536870912 && (e.suspendedLanes = 0, e.pingedLanes = 0), e = e.eventTimes, t = 31 - ja(t), e[t] = n } function A8(e, t) { var n = e.pendingLanes & ~t; e.pendingLanes = t, e.suspendedLanes = 0, e.pingedLanes = 0, e.expiredLanes &= t, e.mutableReadLanes &= t, e.entangledLanes &= t, t = e.entanglements; var r = e.eventTimes; for (e = e.expirationTimes; 0 < n;) { var i = 31 - ja(n), s = 1 << i; t[i] = 0, r[i] = -1, e[i] = -1, n &= ~s } } function aS(e, t) { var n = e.entangledLanes |= t; for (e = e.entanglements; n;) { var r = 31 - ja(n), i = 1 << r; i & t | e[r] & t && (e[r] |= t), n &= ~i } } var Er = 0; function kM(e) { return e &= -e, 1 < e ? 4 < e ? (e & 268435455) !== 0 ? 16 : 536870912 : 4 : 1 } var IM, sS, RM, MM, AM, Nb = !1, Kv = [], Ql = null, Jl = null, eu = null, Ep = new Map, Pp = new Map, jl = [], N8 = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); function CP(e, t) { switch (e) { case "focusin": case "focusout": Ql = null; break; case "dragenter": case "dragleave": Jl = null; break; case "mouseover": case "mouseout": eu = null; break; case "pointerover": case "pointerout": Ep.delete(t.pointerId); break; case "gotpointercapture": case "lostpointercapture": Pp.delete(t.pointerId) } } function Ah(e, t, n, r, i, s) { return e === null || e.nativeEvent !== s ? (e = { blockedOn: t, domEventName: n, eventSystemFlags: r, nativeEvent: s, targetContainers: [i] }, t !== null && (t = am(t), t !== null && sS(t)), e) : (e.eventSystemFlags |= r, t = e.targetContainers, i !== null && t.indexOf(i) === -1 && t.push(i), e) } function O8(e, t, n, r, i) { switch (t) { case "focusin": return Ql = Ah(Ql, e, t, n, r, i), !0; case "dragenter": return Jl = Ah(Jl, e, t, n, r, i), !0; case "mouseover": return eu = Ah(eu, e, t, n, r, i), !0; case "pointerover": var s = i.pointerId; return Ep.set(s, Ah(Ep.get(s) || null, e, t, n, r, i)), !0; case "gotpointercapture": return s = i.pointerId, Pp.set(s, Ah(Pp.get(s) || null, e, t, n, r, i)), !0 }return !1 } function NM(e) { var t = tc(e.target); if (t !== null) { var n = kc(t); if (n !== null) { if (t = n.tag, t === 13) { if (t = bM(n), t !== null) { e.blockedOn = t, AM(e.priority, function () { RM(n) }); return } } else if (t === 3 && n.stateNode.current.memoizedState.isDehydrated) { e.blockedOn = n.tag === 3 ? n.stateNode.containerInfo : null; return } } } e.blockedOn = null } function Ig(e) { if (e.blockedOn !== null) return !1; for (var t = e.targetContainers; 0 < t.length;) { var n = Ob(e.domEventName, e.eventSystemFlags, t[0], e.nativeEvent); if (n === null) { n = e.nativeEvent; var r = new n.constructor(n.type, n); kb = r, n.target.dispatchEvent(r), kb = null } else return t = am(n), t !== null && sS(t), e.blockedOn = n, !1; t.shift() } return !0 } function SP(e, t, n) { Ig(e) && n.delete(t) } function D8() { Nb = !1, Ql !== null && Ig(Ql) && (Ql = null), Jl !== null && Ig(Jl) && (Jl = null), eu !== null && Ig(eu) && (eu = null), Ep.forEach(SP), Pp.forEach(SP) } function Nh(e, t) { e.blockedOn === t && (e.blockedOn = null, Nb || (Nb = !0, Jo.unstable_scheduleCallback(Jo.unstable_NormalPriority, D8))) } function Tp(e) { function t(i) { return Nh(i, e) } if (0 < Kv.length) { Nh(Kv[0], e); for (var n = 1; n < Kv.length; n++) { var r = Kv[n]; r.blockedOn === e && (r.blockedOn = null) } } for (Ql !== null && Nh(Ql, e), Jl !== null && Nh(Jl, e), eu !== null && Nh(eu, e), Ep.forEach(t), Pp.forEach(t), n = 0; n < jl.length; n++)r = jl[n], r.blockedOn === e && (r.blockedOn = null); for (; 0 < jl.length && (n = jl[0], n.blockedOn === null);)NM(n), n.blockedOn === null && jl.shift() } var Ud = ul.ReactCurrentBatchConfig, ly = !0; function L8(e, t, n, r) { var i = Er, s = Ud.transition; Ud.transition = null; try { Er = 1, lS(e, t, n, r) } finally { Er = i, Ud.transition = s } } function z8(e, t, n, r) { var i = Er, s = Ud.transition; Ud.transition = null; try { Er = 4, lS(e, t, n, r) } finally { Er = i, Ud.transition = s } } function lS(e, t, n, r) { if (ly) { var i = Ob(e, t, n, r); if (i === null) q_(e, t, r, uy, n), CP(e, r); else if (O8(i, e, t, n, r)) r.stopPropagation(); else if (CP(e, r), t & 4 && -1 < N8.indexOf(e)) { for (; i !== null;) { var s = am(i); if (s !== null && IM(s), s = Ob(e, t, n, r), s === null && q_(e, t, r, uy, n), s === i) break; i = s } i !== null && r.stopPropagation() } else q_(e, t, r, null, n) } } var uy = null; function Ob(e, t, n, r) { if (uy = null, e = iS(r), e = tc(e), e !== null) if (t = kc(e), t === null) e = null; else if (n = t.tag, n === 13) { if (e = bM(t), e !== null) return e; e = null } else if (n === 3) { if (t.stateNode.current.memoizedState.isDehydrated) return t.tag === 3 ? t.stateNode.containerInfo : null; e = null } else t !== e && (e = null); return uy = e, null } function OM(e) { switch (e) { case "cancel": case "click": case "close": case "contextmenu": case "copy": case "cut": case "auxclick": case "dblclick": case "dragend": case "dragstart": case "drop": case "focusin": case "focusout": case "input": case "invalid": case "keydown": case "keypress": case "keyup": case "mousedown": case "mouseup": case "paste": case "pause": case "play": case "pointercancel": case "pointerdown": case "pointerup": case "ratechange": case "reset": case "resize": case "seeked": case "submit": case "touchcancel": case "touchend": case "touchstart": case "volumechange": case "change": case "selectionchange": case "textInput": case "compositionstart": case "compositionend": case "compositionupdate": case "beforeblur": case "afterblur": case "beforeinput": case "blur": case "fullscreenchange": case "focus": case "hashchange": case "popstate": case "select": case "selectstart": return 1; case "drag": case "dragenter": case "dragexit": case "dragleave": case "dragover": case "mousemove": case "mouseout": case "mouseover": case "pointermove": case "pointerout": case "pointerover": case "scroll": case "toggle": case "touchmove": case "wheel": case "mouseenter": case "mouseleave": case "pointerenter": case "pointerleave": return 4; case "message": switch (S8()) { case oS: return 1; case EM: return 4; case ay: case E8: return 16; case PM: return 536870912; default: return 16 }default: return 16 } } var Hl = null, uS = null, Rg = null; function DM() { if (Rg) return Rg; var e, t = uS, n = t.length, r, i = "value" in Hl ? Hl.value : Hl.textContent, s = i.length; for (e = 0; e < n && t[e] === i[e]; e++); var c = n - e; for (r = 1; r <= c && t[n - r] === i[s - r]; r++); return Rg = i.slice(e, 1 < r ? 1 - r : void 0) } function Mg(e) { var t = e.keyCode; return "charCode" in e ? (e = e.charCode, e === 0 && t === 13 && (e = 13)) : e = t, e === 10 && (e = 13), 32 <= e || e === 13 ? e : 0 } function Hv() { return !0 } function EP() { return !1 } function na(e) { function t(n, r, i, s, c) { this._reactName = n, this._targetInst = i, this.type = r, this.nativeEvent = s, this.target = c, this.currentTarget = null; for (var o in e) e.hasOwnProperty(o) && (n = e[o], this[o] = n ? n(s) : s[o]); return this.isDefaultPrevented = (s.defaultPrevented != null ? s.defaultPrevented : s.returnValue === !1) ? Hv : EP, this.isPropagationStopped = EP, this } return ti(t.prototype, { preventDefault: function () { this.defaultPrevented = !0; var n = this.nativeEvent; n && (n.preventDefault ? n.preventDefault() : typeof n.returnValue != "unknown" && (n.returnValue = !1), this.isDefaultPrevented = Hv) }, stopPropagation: function () { var n = this.nativeEvent; n && (n.stopPropagation ? n.stopPropagation() : typeof n.cancelBubble != "unknown" && (n.cancelBubble = !0), this.isPropagationStopped = Hv) }, persist: function () { }, isPersistent: Hv }), t } var gf = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function (e) { return e.timeStamp || Date.now() }, defaultPrevented: 0, isTrusted: 0 }, cS = na(gf), om = ti({}, gf, { view: 0, detail: 0 }), F8 = na(om), $_, B_, Oh, d0 = ti({}, om, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: dS, button: 0, buttons: 0, relatedTarget: function (e) { return e.relatedTarget === void 0 ? e.fromElement === e.srcElement ? e.toElement : e.fromElement : e.relatedTarget }, movementX: function (e) { return "movementX" in e ? e.movementX : (e !== Oh && (Oh && e.type === "mousemove" ? ($_ = e.screenX - Oh.screenX, B_ = e.screenY - Oh.screenY) : B_ = $_ = 0, Oh = e), $_) }, movementY: function (e) { return "movementY" in e ? e.movementY : B_ } }), PP = na(d0), $8 = ti({}, d0, { dataTransfer: 0 }), B8 = na($8), V8 = ti({}, om, { relatedTarget: 0 }), V_ = na(V8), U8 = ti({}, gf, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), j8 = na(U8), K8 = ti({}, gf, { clipboardData: function (e) { return "clipboardData" in e ? e.clipboardData : window.clipboardData } }), H8 = na(K8), W8 = ti({}, gf, { data: 0 }), TP = na(W8), G8 = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }, q8 = { 8: "Backspace", 9: "Tab", 12: "Clear", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "NumLock", 145: "ScrollLock", 224: "Meta" }, Z8 = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; function X8(e) { var t = this.nativeEvent; return t.getModifierState ? t.getModifierState(e) : (e = Z8[e]) ? !!t[e] : !1 } function dS() { return X8 } var Y8 = ti({}, om, { key: function (e) { if (e.key) { var t = G8[e.key] || e.key; if (t !== "Unidentified") return t } return e.type === "keypress" ? (e = Mg(e), e === 13 ? "Enter" : String.fromCharCode(e)) : e.type === "keydown" || e.type === "keyup" ? q8[e.keyCode] || "Unidentified" : "" }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: dS, charCode: function (e) { return e.type === "keypress" ? Mg(e) : 0 }, keyCode: function (e) { return e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0 }, which: function (e) { return e.type === "keypress" ? Mg(e) : e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0 } }), Q8 = na(Y8), J8 = ti({}, d0, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), kP = na(J8), eB = ti({}, om, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: dS }), tB = na(eB), nB = ti({}, gf, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), rB = na(nB), iB = ti({}, d0, { deltaX: function (e) { return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0 }, deltaY: function (e) { return "deltaY" in e ? e.deltaY : "wheelDeltaY" in e ? -e.wheelDeltaY : "wheelDelta" in e ? -e.wheelDelta : 0 }, deltaZ: 0, deltaMode: 0 }), oB = na(iB), aB = [9, 13, 27, 32], fS = tl && "CompositionEvent" in window, rp = null; tl && "documentMode" in document && (rp = document.documentMode); var sB = tl && "TextEvent" in window && !rp, LM = tl && (!fS || rp && 8 < rp && 11 >= rp), IP = String.fromCharCode(32), RP = !1; function zM(e, t) { switch (e) { case "keyup": return aB.indexOf(t.keyCode) !== -1; case "keydown": return t.keyCode !== 229; case "keypress": case "mousedown": case "focusout": return !0; default: return !1 } } function FM(e) { return e = e.detail, typeof e == "object" && "data" in e ? e.data : null } var Sd = !1; function lB(e, t) { switch (e) { case "compositionend": return FM(t); case "keypress": return t.which !== 32 ? null : (RP = !0, IP); case "textInput": return e = t.data, e === IP && RP ? null : e; default: return null } } function uB(e, t) { if (Sd) return e === "compositionend" || !fS && zM(e, t) ? (e = DM(), Rg = uS = Hl = null, Sd = !1, e) : null; switch (e) { case "paste": return null; case "keypress": if (!(t.ctrlKey || t.altKey || t.metaKey) || t.ctrlKey && t.altKey) { if (t.char && 1 < t.char.length) return t.char; if (t.which) return String.fromCharCode(t.which) } return null; case "compositionend": return LM && t.locale !== "ko" ? null : t.data; default: return null } } var cB = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 }; function MP(e) { var t = e && e.nodeName && e.nodeName.toLowerCase(); return t === "input" ? !!cB[e.type] : t === "textarea" } function $M(e, t, n, r) { vM(r), t = cy(t, "onChange"), 0 < t.length && (n = new cS("onChange", "change", null, n, r), e.push({ event: n, listeners: t })) } var ip = null, kp = null; function dB(e) { XM(e, 0) } function f0(e) { var t = Td(e); if (uM(t)) return e } function fB(e, t) { if (e === "change") return t } var BM = !1; if (tl) { var U_; if (tl) { var j_ = "oninput" in document; if (!j_) { var AP = document.createElement("div"); AP.setAttribute("oninput", "return;"), j_ = typeof AP.oninput == "function" } U_ = j_ } else U_ = !1; BM = U_ && (!document.documentMode || 9 < document.documentMode) } function NP() { ip && (ip.detachEvent("onpropertychange", VM), kp = ip = null) } function VM(e) { if (e.propertyName === "value" && f0(kp)) { var t = []; $M(t, kp, e, iS(e)), _M(dB, t) } } function hB(e, t, n) { e === "focusin" ? (NP(), ip = t, kp = n, ip.attachEvent("onpropertychange", VM)) : e === "focusout" && NP() } function pB(e) { if (e === "selectionchange" || e === "keyup" || e === "keydown") return f0(kp) } function mB(e, t) { if (e === "click") return f0(t) } function vB(e, t) { if (e === "input" || e === "change") return f0(t) } function gB(e, t) { return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t } var Wa = typeof Object.is == "function" ? Object.is : gB; function Ip(e, t) { if (Wa(e, t)) return !0; if (typeof e != "object" || e === null || typeof t != "object" || t === null) return !1; var n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; for (r = 0; r < n.length; r++) { var i = n[r]; if (!vb.call(t, i) || !Wa(e[i], t[i])) return !1 } return !0 } function OP(e) { for (; e && e.firstChild;)e = e.firstChild; return e } function DP(e, t) { var n = OP(e); e = 0; for (var r; n;) { if (n.nodeType === 3) { if (r = e + n.textContent.length, e <= t && r >= t) return { node: n, offset: t - e }; e = r } e: { for (; n;) { if (n.nextSibling) { n = n.nextSibling; break e } n = n.parentNode } n = void 0 } n = OP(n) } } function UM(e, t) { return e && t ? e === t ? !0 : e && e.nodeType === 3 ? !1 : t && t.nodeType === 3 ? UM(e, t.parentNode) : "contains" in e ? e.contains(t) : e.compareDocumentPosition ? !!(e.compareDocumentPosition(t) & 16) : !1 : !1 } function jM() { for (var e = window, t = ry(); t instanceof e.HTMLIFrameElement;) { try { var n = typeof t.contentWindow.location.href == "string" } catch { n = !1 } if (n) e = t.contentWindow; else break; t = ry(e.document) } return t } function hS(e) { var t = e && e.nodeName && e.nodeName.toLowerCase(); return t && (t === "input" && (e.type === "text" || e.type === "search" || e.type === "tel" || e.type === "url" || e.type === "password") || t === "textarea" || e.contentEditable === "true") } function yB(e) { var t = jM(), n = e.focusedElem, r = e.selectionRange; if (t !== n && n && n.ownerDocument && UM(n.ownerDocument.documentElement, n)) { if (r !== null && hS(n)) { if (t = r.start, e = r.end, e === void 0 && (e = t), "selectionStart" in n) n.selectionStart = t, n.selectionEnd = Math.min(e, n.value.length); else if (e = (t = n.ownerDocument || document) && t.defaultView || window, e.getSelection) { e = e.getSelection(); var i = n.textContent.length, s = Math.min(r.start, i); r = r.end === void 0 ? s : Math.min(r.end, i), !e.extend && s > r && (i = r, r = s, s = i), i = DP(n, s); var c = DP(n, r); i && c && (e.rangeCount !== 1 || e.anchorNode !== i.node || e.anchorOffset !== i.offset || e.focusNode !== c.node || e.focusOffset !== c.offset) && (t = t.createRange(), t.setStart(i.node, i.offset), e.removeAllRanges(), s > r ? (e.addRange(t), e.extend(c.node, c.offset)) : (t.setEnd(c.node, c.offset), e.addRange(t))) } } for (t = [], e = n; e = e.parentNode;)e.nodeType === 1 && t.push({ element: e, left: e.scrollLeft, top: e.scrollTop }); for (typeof n.focus == "function" && n.focus(), n = 0; n < t.length; n++)e = t[n], e.element.scrollLeft = e.left, e.element.scrollTop = e.top } } var xB = tl && "documentMode" in document && 11 >= document.documentMode, Ed = null, Db = null, op = null, Lb = !1; function LP(e, t, n) { var r = n.window === n ? n.document : n.nodeType === 9 ? n : n.ownerDocument; Lb || Ed == null || Ed !== ry(r) || (r = Ed, "selectionStart" in r && hS(r) ? r = { start: r.selectionStart, end: r.selectionEnd } : (r = (r.ownerDocument && r.ownerDocument.defaultView || window).getSelection(), r = { anchorNode: r.anchorNode, anchorOffset: r.anchorOffset, focusNode: r.focusNode, focusOffset: r.focusOffset }), op && Ip(op, r) || (op = r, r = cy(Db, "onSelect"), 0 < r.length && (t = new cS("onSelect", "select", null, t, n), e.push({ event: t, listeners: r }), t.target = Ed))) } function Wv(e, t) { var n = {}; return n[e.toLowerCase()] = t.toLowerCase(), n["Webkit" + e] = "webkit" + t, n["Moz" + e] = "moz" + t, n } var Pd = { animationend: Wv("Animation", "AnimationEnd"), animationiteration: Wv("Animation", "AnimationIteration"), animationstart: Wv("Animation", "AnimationStart"), transitionend: Wv("Transition", "TransitionEnd") }, K_ = {}, KM = {}; tl && (KM = document.createElement("div").style, "AnimationEvent" in window || (delete Pd.animationend.animation, delete Pd.animationiteration.animation, delete Pd.animationstart.animation), "TransitionEvent" in window || delete Pd.transitionend.transition); function h0(e) { if (K_[e]) return K_[e]; if (!Pd[e]) return e; var t = Pd[e], n; for (n in t) if (t.hasOwnProperty(n) && n in KM) return K_[e] = t[n]; return e } var HM = h0("animationend"), WM = h0("animationiteration"), GM = h0("animationstart"), qM = h0("transitionend"), ZM = new Map, zP = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); function mu(e, t) { ZM.set(e, t), Tc(t, [e]) } for (var H_ = 0; H_ < zP.length; H_++) { var W_ = zP[H_], _B = W_.toLowerCase(), bB = W_[0].toUpperCase() + W_.slice(1); mu(_B, "on" + bB) } mu(HM, "onAnimationEnd"); mu(WM, "onAnimationIteration"); mu(GM, "onAnimationStart"); mu("dblclick", "onDoubleClick"); mu("focusin", "onFocus"); mu("focusout", "onBlur"); mu(qM, "onTransitionEnd"); Zd("onMouseEnter", ["mouseout", "mouseover"]); Zd("onMouseLeave", ["mouseout", "mouseover"]); Zd("onPointerEnter", ["pointerout", "pointerover"]); Zd("onPointerLeave", ["pointerout", "pointerover"]); Tc("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); Tc("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); Tc("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); Tc("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); Tc("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); Tc("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); var Xh = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), wB = new Set("cancel close invalid load scroll toggle".split(" ").concat(Xh)); function FP(e, t, n) { var r = e.type || "unknown-event"; e.currentTarget = n, _8(r, t, void 0, e), e.currentTarget = null } function XM(e, t) { t = (t & 4) !== 0; for (var n = 0; n < e.length; n++) { var r = e[n], i = r.event; r = r.listeners; e: { var s = void 0; if (t) for (var c = r.length - 1; 0 <= c; c--) { var o = r[c], f = o.instance, p = o.currentTarget; if (o = o.listener, f !== s && i.isPropagationStopped()) break e; FP(i, o, p), s = f } else for (c = 0; c < r.length; c++) { if (o = r[c], f = o.instance, p = o.currentTarget, o = o.listener, f !== s && i.isPropagationStopped()) break e; FP(i, o, p), s = f } } } if (oy) throw e = Mb, oy = !1, Mb = null, e } function Kr(e, t) { var n = t[Vb]; n === void 0 && (n = t[Vb] = new Set); var r = e + "__bubble"; n.has(r) || (YM(t, e, 2, !1), n.add(r)) } function G_(e, t, n) { var r = 0; t && (r |= 4), YM(n, e, r, t) } var Gv = "_reactListening" + Math.random().toString(36).slice(2); function Rp(e) { if (!e[Gv]) { e[Gv] = !0, iM.forEach(function (n) { n !== "selectionchange" && (wB.has(n) || G_(n, !1, e), G_(n, !0, e)) }); var t = e.nodeType === 9 ? e : e.ownerDocument; t === null || t[Gv] || (t[Gv] = !0, G_("selectionchange", !1, t)) } } function YM(e, t, n, r) { switch (OM(t)) { case 1: var i = L8; break; case 4: i = z8; break; default: i = lS }n = i.bind(null, t, n, e), i = void 0, !Rb || t !== "touchstart" && t !== "touchmove" && t !== "wheel" || (i = !0), r ? i !== void 0 ? e.addEventListener(t, n, { capture: !0, passive: i }) : e.addEventListener(t, n, !0) : i !== void 0 ? e.addEventListener(t, n, { passive: i }) : e.addEventListener(t, n, !1) } function q_(e, t, n, r, i) { var s = r; if ((t & 1) === 0 && (t & 2) === 0 && r !== null) e: for (; ;) { if (r === null) return; var c = r.tag; if (c === 3 || c === 4) { var o = r.stateNode.containerInfo; if (o === i || o.nodeType === 8 && o.parentNode === i) break; if (c === 4) for (c = r.return; c !== null;) { var f = c.tag; if ((f === 3 || f === 4) && (f = c.stateNode.containerInfo, f === i || f.nodeType === 8 && f.parentNode === i)) return; c = c.return } for (; o !== null;) { if (c = tc(o), c === null) return; if (f = c.tag, f === 5 || f === 6) { r = s = c; continue e } o = o.parentNode } } r = r.return } _M(function () { var p = s, v = iS(n), y = []; e: { var w = ZM.get(e); if (w !== void 0) { var P = cS, k = e; switch (e) { case "keypress": if (Mg(n) === 0) break e; case "keydown": case "keyup": P = Q8; break; case "focusin": k = "focus", P = V_; break; case "focusout": k = "blur", P = V_; break; case "beforeblur": case "afterblur": P = V_; break; case "click": if (n.button === 2) break e; case "auxclick": case "dblclick": case "mousedown": case "mousemove": case "mouseup": case "mouseout": case "mouseover": case "contextmenu": P = PP; break; case "drag": case "dragend": case "dragenter": case "dragexit": case "dragleave": case "dragover": case "dragstart": case "drop": P = B8; break; case "touchcancel": case "touchend": case "touchmove": case "touchstart": P = tB; break; case HM: case WM: case GM: P = j8; break; case qM: P = rB; break; case "scroll": P = F8; break; case "wheel": P = oB; break; case "copy": case "cut": case "paste": P = H8; break; case "gotpointercapture": case "lostpointercapture": case "pointercancel": case "pointerdown": case "pointermove": case "pointerout": case "pointerover": case "pointerup": P = kP }var A = (t & 4) !== 0, N = !A && e === "scroll", R = A ? w !== null ? w + "Capture" : null : w; A = []; for (var M = p, O; M !== null;) { O = M; var z = O.stateNode; if (O.tag === 5 && z !== null && (O = z, R !== null && (z = Sp(M, R), z != null && A.push(Mp(M, z, O)))), N) break; M = M.return } 0 < A.length && (w = new P(w, k, null, n, v), y.push({ event: w, listeners: A })) } } if ((t & 7) === 0) { e: { if (w = e === "mouseover" || e === "pointerover", P = e === "mouseout" || e === "pointerout", w && n !== kb && (k = n.relatedTarget || n.fromElement) && (tc(k) || k[nl])) break e; if ((P || w) && (w = v.window === v ? v : (w = v.ownerDocument) ? w.defaultView || w.parentWindow : window, P ? (k = n.relatedTarget || n.toElement, P = p, k = k ? tc(k) : null, k !== null && (N = kc(k), k !== N || k.tag !== 5 && k.tag !== 6) && (k = null)) : (P = null, k = p), P !== k)) { if (A = PP, z = "onMouseLeave", R = "onMouseEnter", M = "mouse", (e === "pointerout" || e === "pointerover") && (A = kP, z = "onPointerLeave", R = "onPointerEnter", M = "pointer"), N = P == null ? w : Td(P), O = k == null ? w : Td(k), w = new A(z, M + "leave", P, n, v), w.target = N, w.relatedTarget = O, z = null, tc(v) === p && (A = new A(R, M + "enter", k, n, v), A.target = O, A.relatedTarget = N, z = A), N = z, P && k) t: { for (A = P, R = k, M = 0, O = A; O; O = hd(O))M++; for (O = 0, z = R; z; z = hd(z))O++; for (; 0 < M - O;)A = hd(A), M--; for (; 0 < O - M;)R = hd(R), O--; for (; M--;) { if (A === R || R !== null && A === R.alternate) break t; A = hd(A), R = hd(R) } A = null } else A = null; P !== null && $P(y, w, P, A, !1), k !== null && N !== null && $P(y, N, k, A, !0) } } e: { if (w = p ? Td(p) : window, P = w.nodeName && w.nodeName.toLowerCase(), P === "select" || P === "input" && w.type === "file") var B = fB; else if (MP(w)) if (BM) B = vB; else { B = pB; var V = hB } else (P = w.nodeName) && P.toLowerCase() === "input" && (w.type === "checkbox" || w.type === "radio") && (B = mB); if (B && (B = B(e, p))) { $M(y, B, n, v); break e } V && V(e, w, p), e === "focusout" && (V = w._wrapperState) && V.controlled && w.type === "number" && Cb(w, "number", w.value) } switch (V = p ? Td(p) : window, e) { case "focusin": (MP(V) || V.contentEditable === "true") && (Ed = V, Db = p, op = null); break; case "focusout": op = Db = Ed = null; break; case "mousedown": Lb = !0; break; case "contextmenu": case "mouseup": case "dragend": Lb = !1, LP(y, n, v); break; case "selectionchange": if (xB) break; case "keydown": case "keyup": LP(y, n, v) }var G; if (fS) e: { switch (e) { case "compositionstart": var j = "onCompositionStart"; break e; case "compositionend": j = "onCompositionEnd"; break e; case "compositionupdate": j = "onCompositionUpdate"; break e }j = void 0 } else Sd ? zM(e, n) && (j = "onCompositionEnd") : e === "keydown" && n.keyCode === 229 && (j = "onCompositionStart"); j && (LM && n.locale !== "ko" && (Sd || j !== "onCompositionStart" ? j === "onCompositionEnd" && Sd && (G = DM()) : (Hl = v, uS = "value" in Hl ? Hl.value : Hl.textContent, Sd = !0)), V = cy(p, j), 0 < V.length && (j = new TP(j, e, null, n, v), y.push({ event: j, listeners: V }), G ? j.data = G : (G = FM(n), G !== null && (j.data = G)))), (G = sB ? lB(e, n) : uB(e, n)) && (p = cy(p, "onBeforeInput"), 0 < p.length && (v = new TP("onBeforeInput", "beforeinput", null, n, v), y.push({ event: v, listeners: p }), v.data = G)) } XM(y, t) }) } function Mp(e, t, n) { return { instance: e, listener: t, currentTarget: n } } function cy(e, t) { for (var n = t + "Capture", r = []; e !== null;) { var i = e, s = i.stateNode; i.tag === 5 && s !== null && (i = s, s = Sp(e, n), s != null && r.unshift(Mp(e, s, i)), s = Sp(e, t), s != null && r.push(Mp(e, s, i))), e = e.return } return r } function hd(e) { if (e === null) return null; do e = e.return; while (e && e.tag !== 5); return e || null } function $P(e, t, n, r, i) { for (var s = t._reactName, c = []; n !== null && n !== r;) { var o = n, f = o.alternate, p = o.stateNode; if (f !== null && f === r) break; o.tag === 5 && p !== null && (o = p, i ? (f = Sp(n, s), f != null && c.unshift(Mp(n, f, o))) : i || (f = Sp(n, s), f != null && c.push(Mp(n, f, o)))), n = n.return } c.length !== 0 && e.push({ event: t, listeners: c }) } var CB = /\r\n?/g, SB = /\u0000|\uFFFD/g; function BP(e) {
|
|
|
return (typeof e == "string" ? e : "" + e).replace(CB, `
|
|
|
`).replace(SB, "")
|
|
|
} function qv(e, t, n) { if (t = BP(t), BP(e) !== t && n) throw Error(Ht(425)) } function dy() { } var zb = null, Fb = null; function $b(e, t) { return e === "textarea" || e === "noscript" || typeof t.children == "string" || typeof t.children == "number" || typeof t.dangerouslySetInnerHTML == "object" && t.dangerouslySetInnerHTML !== null && t.dangerouslySetInnerHTML.__html != null } var Bb = typeof setTimeout == "function" ? setTimeout : void 0, EB = typeof clearTimeout == "function" ? clearTimeout : void 0, VP = typeof Promise == "function" ? Promise : void 0, PB = typeof queueMicrotask == "function" ? queueMicrotask : typeof VP < "u" ? function (e) { return VP.resolve(null).then(e).catch(TB) } : Bb; function TB(e) { setTimeout(function () { throw e }) } function Z_(e, t) { var n = t, r = 0; do { var i = n.nextSibling; if (e.removeChild(n), i && i.nodeType === 8) if (n = i.data, n === "/$") { if (r === 0) { e.removeChild(i), Tp(t); return } r-- } else n !== "$" && n !== "$?" && n !== "$!" || r++; n = i } while (n); Tp(t) } function tu(e) { for (; e != null; e = e.nextSibling) { var t = e.nodeType; if (t === 1 || t === 3) break; if (t === 8) { if (t = e.data, t === "$" || t === "$!" || t === "$?") break; if (t === "/$") return null } } return e } function UP(e) { e = e.previousSibling; for (var t = 0; e;) { if (e.nodeType === 8) { var n = e.data; if (n === "$" || n === "$!" || n === "$?") { if (t === 0) return e; t-- } else n === "/$" && t++ } e = e.previousSibling } return null } var yf = Math.random().toString(36).slice(2), us = "__reactFiber$" + yf, Ap = "__reactProps$" + yf, nl = "__reactContainer$" + yf, Vb = "__reactEvents$" + yf, kB = "__reactListeners$" + yf, IB = "__reactHandles$" + yf; function tc(e) { var t = e[us]; if (t) return t; for (var n = e.parentNode; n;) { if (t = n[nl] || n[us]) { if (n = t.alternate, t.child !== null || n !== null && n.child !== null) for (e = UP(e); e !== null;) { if (n = e[us]) return n; e = UP(e) } return t } e = n, n = e.parentNode } return null } function am(e) { return e = e[us] || e[nl], !e || e.tag !== 5 && e.tag !== 6 && e.tag !== 13 && e.tag !== 3 ? null : e } function Td(e) { if (e.tag === 5 || e.tag === 6) return e.stateNode; throw Error(Ht(33)) } function p0(e) { return e[Ap] || null } var Ub = [], kd = -1; function vu(e) { return { current: e } } function Wr(e) { 0 > kd || (e.current = Ub[kd], Ub[kd] = null, kd--) } function jr(e, t) { kd++, Ub[kd] = e.current, e.current = t } var lu = {}, oo = vu(lu), Oo = vu(!1), vc = lu; function Xd(e, t) { var n = e.type.contextTypes; if (!n) return lu; var r = e.stateNode; if (r && r.__reactInternalMemoizedUnmaskedChildContext === t) return r.__reactInternalMemoizedMaskedChildContext; var i = {}, s; for (s in n) i[s] = t[s]; return r && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = t, e.__reactInternalMemoizedMaskedChildContext = i), i } function Do(e) { return e = e.childContextTypes, e != null } function fy() { Wr(Oo), Wr(oo) } function jP(e, t, n) { if (oo.current !== lu) throw Error(Ht(168)); jr(oo, t), jr(Oo, n) } function QM(e, t, n) { var r = e.stateNode; if (t = t.childContextTypes, typeof r.getChildContext != "function") return n; r = r.getChildContext(); for (var i in r) if (!(i in t)) throw Error(Ht(108, h8(e) || "Unknown", i)); return ti({}, n, r) } function hy(e) { return e = (e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext || lu, vc = oo.current, jr(oo, e), jr(Oo, Oo.current), !0 } function KP(e, t, n) { var r = e.stateNode; if (!r) throw Error(Ht(169)); n ? (e = QM(e, t, vc), r.__reactInternalMemoizedMergedChildContext = e, Wr(Oo), Wr(oo), jr(oo, e)) : Wr(Oo), jr(Oo, n) } var js = null, m0 = !1, X_ = !1; function JM(e) { js === null ? js = [e] : js.push(e) } function RB(e) { m0 = !0, JM(e) } function gu() { if (!X_ && js !== null) { X_ = !0; var e = 0, t = Er; try { var n = js; for (Er = 1; e < n.length; e++) { var r = n[e]; do r = r(!0); while (r !== null) } js = null, m0 = !1 } catch (i) { throw js !== null && (js = js.slice(e + 1)), SM(oS, gu), i } finally { Er = t, X_ = !1 } } return null } var Id = [], Rd = 0, py = null, my = 0, va = [], ga = 0, gc = null, qs = 1, Zs = ""; function qu(e, t) { Id[Rd++] = my, Id[Rd++] = py, py = e, my = t } function eA(e, t, n) { va[ga++] = qs, va[ga++] = Zs, va[ga++] = gc, gc = e; var r = qs; e = Zs; var i = 32 - ja(r) - 1; r &= ~(1 << i), n += 1; var s = 32 - ja(t) + i; if (30 < s) { var c = i - i % 5; s = (r & (1 << c) - 1).toString(32), r >>= c, i -= c, qs = 1 << 32 - ja(t) + i | n << i | r, Zs = s + e } else qs = 1 << s | n << i | r, Zs = e } function pS(e) { e.return !== null && (qu(e, 1), eA(e, 1, 0)) } function mS(e) { for (; e === py;)py = Id[--Rd], Id[Rd] = null, my = Id[--Rd], Id[Rd] = null; for (; e === gc;)gc = va[--ga], va[ga] = null, Zs = va[--ga], va[ga] = null, qs = va[--ga], va[ga] = null } var Qo = null, Xo = null, Yr = !1, Va = null; function tA(e, t) { var n = _a(5, null, null, 0); n.elementType = "DELETED", n.stateNode = t, n.return = e, t = e.deletions, t === null ? (e.deletions = [n], e.flags |= 16) : t.push(n) } function HP(e, t) { switch (e.tag) { case 5: var n = e.type; return t = t.nodeType !== 1 || n.toLowerCase() !== t.nodeName.toLowerCase() ? null : t, t !== null ? (e.stateNode = t, Qo = e, Xo = tu(t.firstChild), !0) : !1; case 6: return t = e.pendingProps === "" || t.nodeType !== 3 ? null : t, t !== null ? (e.stateNode = t, Qo = e, Xo = null, !0) : !1; case 13: return t = t.nodeType !== 8 ? null : t, t !== null ? (n = gc !== null ? { id: qs, overflow: Zs } : null, e.memoizedState = { dehydrated: t, treeContext: n, retryLane: 1073741824 }, n = _a(18, null, null, 0), n.stateNode = t, n.return = e, e.child = n, Qo = e, Xo = null, !0) : !1; default: return !1 } } function jb(e) { return (e.mode & 1) !== 0 && (e.flags & 128) === 0 } function Kb(e) { if (Yr) { var t = Xo; if (t) { var n = t; if (!HP(e, t)) { if (jb(e)) throw Error(Ht(418)); t = tu(n.nextSibling); var r = Qo; t && HP(e, t) ? tA(r, n) : (e.flags = e.flags & -4097 | 2, Yr = !1, Qo = e) } } else { if (jb(e)) throw Error(Ht(418)); e.flags = e.flags & -4097 | 2, Yr = !1, Qo = e } } } function WP(e) { for (e = e.return; e !== null && e.tag !== 5 && e.tag !== 3 && e.tag !== 13;)e = e.return; Qo = e } function Zv(e) { if (e !== Qo) return !1; if (!Yr) return WP(e), Yr = !0, !1; var t; if ((t = e.tag !== 3) && !(t = e.tag !== 5) && (t = e.type, t = t !== "head" && t !== "body" && !$b(e.type, e.memoizedProps)), t && (t = Xo)) { if (jb(e)) throw nA(), Error(Ht(418)); for (; t;)tA(e, t), t = tu(t.nextSibling) } if (WP(e), e.tag === 13) { if (e = e.memoizedState, e = e !== null ? e.dehydrated : null, !e) throw Error(Ht(317)); e: { for (e = e.nextSibling, t = 0; e;) { if (e.nodeType === 8) { var n = e.data; if (n === "/$") { if (t === 0) { Xo = tu(e.nextSibling); break e } t-- } else n !== "$" && n !== "$!" && n !== "$?" || t++ } e = e.nextSibling } Xo = null } } else Xo = Qo ? tu(e.stateNode.nextSibling) : null; return !0 } function nA() { for (var e = Xo; e;)e = tu(e.nextSibling) } function Yd() { Xo = Qo = null, Yr = !1 } function vS(e) { Va === null ? Va = [e] : Va.push(e) } var MB = ul.ReactCurrentBatchConfig; function $a(e, t) { if (e && e.defaultProps) { t = ti({}, t), e = e.defaultProps; for (var n in e) t[n] === void 0 && (t[n] = e[n]); return t } return t } var vy = vu(null), gy = null, Md = null, gS = null; function yS() { gS = Md = gy = null } function xS(e) { var t = vy.current; Wr(vy), e._currentValue = t } function Hb(e, t, n) { for (; e !== null;) { var r = e.alternate; if ((e.childLanes & t) !== t ? (e.childLanes |= t, r !== null && (r.childLanes |= t)) : r !== null && (r.childLanes & t) !== t && (r.childLanes |= t), e === n) break; e = e.return } } function jd(e, t) { gy = e, gS = Md = null, e = e.dependencies, e !== null && e.firstContext !== null && ((e.lanes & t) !== 0 && (No = !0), e.firstContext = null) } function wa(e) { var t = e._currentValue; if (gS !== e) if (e = { context: e, memoizedValue: t, next: null }, Md === null) { if (gy === null) throw Error(Ht(308)); Md = e, gy.dependencies = { lanes: 0, firstContext: e } } else Md = Md.next = e; return t } var nc = null; function _S(e) { nc === null ? nc = [e] : nc.push(e) } function rA(e, t, n, r) { var i = t.interleaved; return i === null ? (n.next = n, _S(t)) : (n.next = i.next, i.next = n), t.interleaved = n, rl(e, r) } function rl(e, t) { e.lanes |= t; var n = e.alternate; for (n !== null && (n.lanes |= t), n = e, e = e.return; e !== null;)e.childLanes |= t, n = e.alternate, n !== null && (n.childLanes |= t), n = e, e = e.return; return n.tag === 3 ? n.stateNode : null } var Vl = !1; function bS(e) { e.updateQueue = { baseState: e.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null } } function iA(e, t) { e = e.updateQueue, t.updateQueue === e && (t.updateQueue = { baseState: e.baseState, firstBaseUpdate: e.firstBaseUpdate, lastBaseUpdate: e.lastBaseUpdate, shared: e.shared, effects: e.effects }) } function Ys(e, t) { return { eventTime: e, lane: t, tag: 0, payload: null, callback: null, next: null } } function nu(e, t, n) { var r = e.updateQueue; if (r === null) return null; if (r = r.shared, (mr & 2) !== 0) { var i = r.pending; return i === null ? t.next = t : (t.next = i.next, i.next = t), r.pending = t, rl(e, n) } return i = r.interleaved, i === null ? (t.next = t, _S(r)) : (t.next = i.next, i.next = t), r.interleaved = t, rl(e, n) } function Ag(e, t, n) { if (t = t.updateQueue, t !== null && (t = t.shared, (n & 4194240) !== 0)) { var r = t.lanes; r &= e.pendingLanes, n |= r, t.lanes = n, aS(e, n) } } function GP(e, t) { var n = e.updateQueue, r = e.alternate; if (r !== null && (r = r.updateQueue, n === r)) { var i = null, s = null; if (n = n.firstBaseUpdate, n !== null) { do { var c = { eventTime: n.eventTime, lane: n.lane, tag: n.tag, payload: n.payload, callback: n.callback, next: null }; s === null ? i = s = c : s = s.next = c, n = n.next } while (n !== null); s === null ? i = s = t : s = s.next = t } else i = s = t; n = { baseState: r.baseState, firstBaseUpdate: i, lastBaseUpdate: s, shared: r.shared, effects: r.effects }, e.updateQueue = n; return } e = n.lastBaseUpdate, e === null ? n.firstBaseUpdate = t : e.next = t, n.lastBaseUpdate = t } function yy(e, t, n, r) { var i = e.updateQueue; Vl = !1; var s = i.firstBaseUpdate, c = i.lastBaseUpdate, o = i.shared.pending; if (o !== null) { i.shared.pending = null; var f = o, p = f.next; f.next = null, c === null ? s = p : c.next = p, c = f; var v = e.alternate; v !== null && (v = v.updateQueue, o = v.lastBaseUpdate, o !== c && (o === null ? v.firstBaseUpdate = p : o.next = p, v.lastBaseUpdate = f)) } if (s !== null) { var y = i.baseState; c = 0, v = p = f = null, o = s; do { var w = o.lane, P = o.eventTime; if ((r & w) === w) { v !== null && (v = v.next = { eventTime: P, lane: 0, tag: o.tag, payload: o.payload, callback: o.callback, next: null }); e: { var k = e, A = o; switch (w = t, P = n, A.tag) { case 1: if (k = A.payload, typeof k == "function") { y = k.call(P, y, w); break e } y = k; break e; case 3: k.flags = k.flags & -65537 | 128; case 0: if (k = A.payload, w = typeof k == "function" ? k.call(P, y, w) : k, w == null) break e; y = ti({}, y, w); break e; case 2: Vl = !0 } } o.callback !== null && o.lane !== 0 && (e.flags |= 64, w = i.effects, w === null ? i.effects = [o] : w.push(o)) } else P = { eventTime: P, lane: w, tag: o.tag, payload: o.payload, callback: o.callback, next: null }, v === null ? (p = v = P, f = y) : v = v.next = P, c |= w; if (o = o.next, o === null) { if (o = i.shared.pending, o === null) break; w = o, o = w.next, w.next = null, i.lastBaseUpdate = w, i.shared.pending = null } } while (1); if (v === null && (f = y), i.baseState = f, i.firstBaseUpdate = p, i.lastBaseUpdate = v, t = i.shared.interleaved, t !== null) { i = t; do c |= i.lane, i = i.next; while (i !== t) } else s === null && (i.shared.lanes = 0); xc |= c, e.lanes = c, e.memoizedState = y } } function qP(e, t, n) { if (e = t.effects, t.effects = null, e !== null) for (t = 0; t < e.length; t++) { var r = e[t], i = r.callback; if (i !== null) { if (r.callback = null, r = n, typeof i != "function") throw Error(Ht(191, i)); i.call(r) } } } var oA = new rM.Component().refs; function Wb(e, t, n, r) { t = e.memoizedState, n = n(r, t), n = n == null ? t : ti({}, t, n), e.memoizedState = n, e.lanes === 0 && (e.updateQueue.baseState = n) } var v0 = { isMounted: function (e) { return (e = e._reactInternals) ? kc(e) === e : !1 }, enqueueSetState: function (e, t, n) { e = e._reactInternals; var r = _o(), i = iu(e), s = Ys(r, i); s.payload = t, n != null && (s.callback = n), t = nu(e, s, i), t !== null && (Ka(t, e, i, r), Ag(t, e, i)) }, enqueueReplaceState: function (e, t, n) { e = e._reactInternals; var r = _o(), i = iu(e), s = Ys(r, i); s.tag = 1, s.payload = t, n != null && (s.callback = n), t = nu(e, s, i), t !== null && (Ka(t, e, i, r), Ag(t, e, i)) }, enqueueForceUpdate: function (e, t) { e = e._reactInternals; var n = _o(), r = iu(e), i = Ys(n, r); i.tag = 2, t != null && (i.callback = t), t = nu(e, i, r), t !== null && (Ka(t, e, r, n), Ag(t, e, r)) } }; function ZP(e, t, n, r, i, s, c) { return e = e.stateNode, typeof e.shouldComponentUpdate == "function" ? e.shouldComponentUpdate(r, s, c) : t.prototype && t.prototype.isPureReactComponent ? !Ip(n, r) || !Ip(i, s) : !0 } function aA(e, t, n) { var r = !1, i = lu, s = t.contextType; return typeof s == "object" && s !== null ? s = wa(s) : (i = Do(t) ? vc : oo.current, r = t.contextTypes, s = (r = r != null) ? Xd(e, i) : lu), t = new t(n, s), e.memoizedState = t.state !== null && t.state !== void 0 ? t.state : null, t.updater = v0, e.stateNode = t, t._reactInternals = e, r && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = i, e.__reactInternalMemoizedMaskedChildContext = s), t } function XP(e, t, n, r) { e = t.state, typeof t.componentWillReceiveProps == "function" && t.componentWillReceiveProps(n, r), typeof t.UNSAFE_componentWillReceiveProps == "function" && t.UNSAFE_componentWillReceiveProps(n, r), t.state !== e && v0.enqueueReplaceState(t, t.state, null) } function Gb(e, t, n, r) { var i = e.stateNode; i.props = n, i.state = e.memoizedState, i.refs = oA, bS(e); var s = t.contextType; typeof s == "object" && s !== null ? i.context = wa(s) : (s = Do(t) ? vc : oo.current, i.context = Xd(e, s)), i.state = e.memoizedState, s = t.getDerivedStateFromProps, typeof s == "function" && (Wb(e, t, s, n), i.state = e.memoizedState), typeof t.getDerivedStateFromProps == "function" || typeof i.getSnapshotBeforeUpdate == "function" || typeof i.UNSAFE_componentWillMount != "function" && typeof i.componentWillMount != "function" || (t = i.state, typeof i.componentWillMount == "function" && i.componentWillMount(), typeof i.UNSAFE_componentWillMount == "function" && i.UNSAFE_componentWillMount(), t !== i.state && v0.enqueueReplaceState(i, i.state, null), yy(e, n, i, r), i.state = e.memoizedState), typeof i.componentDidMount == "function" && (e.flags |= 4194308) } function Dh(e, t, n) { if (e = n.ref, e !== null && typeof e != "function" && typeof e != "object") { if (n._owner) { if (n = n._owner, n) { if (n.tag !== 1) throw Error(Ht(309)); var r = n.stateNode } if (!r) throw Error(Ht(147, e)); var i = r, s = "" + e; return t !== null && t.ref !== null && typeof t.ref == "function" && t.ref._stringRef === s ? t.ref : (t = function (c) { var o = i.refs; o === oA && (o = i.refs = {}), c === null ? delete o[s] : o[s] = c }, t._stringRef = s, t) } if (typeof e != "string") throw Error(Ht(284)); if (!n._owner) throw Error(Ht(290, e)) } return e } function Xv(e, t) { throw e = Object.prototype.toString.call(t), Error(Ht(31, e === "[object Object]" ? "object with keys {" + Object.keys(t).join(", ") + "}" : e)) } function YP(e) { var t = e._init; return t(e._payload) } function sA(e) { function t(R, M) { if (e) { var O = R.deletions; O === null ? (R.deletions = [M], R.flags |= 16) : O.push(M) } } function n(R, M) { if (!e) return null; for (; M !== null;)t(R, M), M = M.sibling; return null } function r(R, M) { for (R = new Map; M !== null;)M.key !== null ? R.set(M.key, M) : R.set(M.index, M), M = M.sibling; return R } function i(R, M) { return R = ou(R, M), R.index = 0, R.sibling = null, R } function s(R, M, O) { return R.index = O, e ? (O = R.alternate, O !== null ? (O = O.index, O < M ? (R.flags |= 2, M) : O) : (R.flags |= 2, M)) : (R.flags |= 1048576, M) } function c(R) { return e && R.alternate === null && (R.flags |= 2), R } function o(R, M, O, z) { return M === null || M.tag !== 6 ? (M = r1(O, R.mode, z), M.return = R, M) : (M = i(M, O), M.return = R, M) } function f(R, M, O, z) { var B = O.type; return B === Cd ? v(R, M, O.props.children, z, O.key) : M !== null && (M.elementType === B || typeof B == "object" && B !== null && B.$$typeof === Bl && YP(B) === M.type) ? (z = i(M, O.props), z.ref = Dh(R, M, O), z.return = R, z) : (z = Fg(O.type, O.key, O.props, null, R.mode, z), z.ref = Dh(R, M, O), z.return = R, z) } function p(R, M, O, z) { return M === null || M.tag !== 4 || M.stateNode.containerInfo !== O.containerInfo || M.stateNode.implementation !== O.implementation ? (M = i1(O, R.mode, z), M.return = R, M) : (M = i(M, O.children || []), M.return = R, M) } function v(R, M, O, z, B) { return M === null || M.tag !== 7 ? (M = dc(O, R.mode, z, B), M.return = R, M) : (M = i(M, O), M.return = R, M) } function y(R, M, O) { if (typeof M == "string" && M !== "" || typeof M == "number") return M = r1("" + M, R.mode, O), M.return = R, M; if (typeof M == "object" && M !== null) { switch (M.$$typeof) { case $v: return O = Fg(M.type, M.key, M.props, null, R.mode, O), O.ref = Dh(R, null, M), O.return = R, O; case wd: return M = i1(M, R.mode, O), M.return = R, M; case Bl: var z = M._init; return y(R, z(M._payload), O) }if (qh(M) || Rh(M)) return M = dc(M, R.mode, O, null), M.return = R, M; Xv(R, M) } return null } function w(R, M, O, z) { var B = M !== null ? M.key : null; if (typeof O == "string" && O !== "" || typeof O == "number") return B !== null ? null : o(R, M, "" + O, z); if (typeof O == "object" && O !== null) { switch (O.$$typeof) { case $v: return O.key === B ? f(R, M, O, z) : null; case wd: return O.key === B ? p(R, M, O, z) : null; case Bl: return B = O._init, w(R, M, B(O._payload), z) }if (qh(O) || Rh(O)) return B !== null ? null : v(R, M, O, z, null); Xv(R, O) } return null } function P(R, M, O, z, B) { if (typeof z == "string" && z !== "" || typeof z == "number") return R = R.get(O) || null, o(M, R, "" + z, B); if (typeof z == "object" && z !== null) { switch (z.$$typeof) { case $v: return R = R.get(z.key === null ? O : z.key) || null, f(M, R, z, B); case wd: return R = R.get(z.key === null ? O : z.key) || null, p(M, R, z, B); case Bl: var V = z._init; return P(R, M, O, V(z._payload), B) }if (qh(z) || Rh(z)) return R = R.get(O) || null, v(M, R, z, B, null); Xv(M, z) } return null } function k(R, M, O, z) { for (var B = null, V = null, G = M, j = M = 0, X = null; G !== null && j < O.length; j++) { G.index > j ? (X = G, G = null) : X = G.sibling; var Y = w(R, G, O[j], z); if (Y === null) { G === null && (G = X); break } e && G && Y.alternate === null && t(R, G), M = s(Y, M, j), V === null ? B = Y : V.sibling = Y, V = Y, G = X } if (j === O.length) return n(R, G), Yr && qu(R, j), B; if (G === null) { for (; j < O.length; j++)G = y(R, O[j], z), G !== null && (M = s(G, M, j), V === null ? B = G : V.sibling = G, V = G); return Yr && qu(R, j), B } for (G = r(R, G); j < O.length; j++)X = P(G, R, j, O[j], z), X !== null && (e && X.alternate !== null && G.delete(X.key === null ? j : X.key), M = s(X, M, j), V === null ? B = X : V.sibling = X, V = X); return e && G.forEach(function (se) { return t(R, se) }), Yr && qu(R, j), B } function A(R, M, O, z) { var B = Rh(O); if (typeof B != "function") throw Error(Ht(150)); if (O = B.call(O), O == null) throw Error(Ht(151)); for (var V = B = null, G = M, j = M = 0, X = null, Y = O.next(); G !== null && !Y.done; j++, Y = O.next()) { G.index > j ? (X = G, G = null) : X = G.sibling; var se = w(R, G, Y.value, z); if (se === null) { G === null && (G = X); break } e && G && se.alternate === null && t(R, G), M = s(se, M, j), V === null ? B = se : V.sibling = se, V = se, G = X } if (Y.done) return n(R, G), Yr && qu(R, j), B; if (G === null) { for (; !Y.done; j++, Y = O.next())Y = y(R, Y.value, z), Y !== null && (M = s(Y, M, j), V === null ? B = Y : V.sibling = Y, V = Y); return Yr && qu(R, j), B } for (G = r(R, G); !Y.done; j++, Y = O.next())Y = P(G, R, j, Y.value, z), Y !== null && (e && Y.alternate !== null && G.delete(Y.key === null ? j : Y.key), M = s(Y, M, j), V === null ? B = Y : V.sibling = Y, V = Y); return e && G.forEach(function (ee) { return t(R, ee) }), Yr && qu(R, j), B } function N(R, M, O, z) { if (typeof O == "object" && O !== null && O.type === Cd && O.key === null && (O = O.props.children), typeof O == "object" && O !== null) { switch (O.$$typeof) { case $v: e: { for (var B = O.key, V = M; V !== null;) { if (V.key === B) { if (B = O.type, B === Cd) { if (V.tag === 7) { n(R, V.sibling), M = i(V, O.props.children), M.return = R, R = M; break e } } else if (V.elementType === B || typeof B == "object" && B !== null && B.$$typeof === Bl && YP(B) === V.type) { n(R, V.sibling), M = i(V, O.props), M.ref = Dh(R, V, O), M.return = R, R = M; break e } n(R, V); break } else t(R, V); V = V.sibling } O.type === Cd ? (M = dc(O.props.children, R.mode, z, O.key), M.return = R, R = M) : (z = Fg(O.type, O.key, O.props, null, R.mode, z), z.ref = Dh(R, M, O), z.return = R, R = z) } return c(R); case wd: e: { for (V = O.key; M !== null;) { if (M.key === V) if (M.tag === 4 && M.stateNode.containerInfo === O.containerInfo && M.stateNode.implementation === O.implementation) { n(R, M.sibling), M = i(M, O.children || []), M.return = R, R = M; break e } else { n(R, M); break } else t(R, M); M = M.sibling } M = i1(O, R.mode, z), M.return = R, R = M } return c(R); case Bl: return V = O._init, N(R, M, V(O._payload), z) }if (qh(O)) return k(R, M, O, z); if (Rh(O)) return A(R, M, O, z); Xv(R, O) } return typeof O == "string" && O !== "" || typeof O == "number" ? (O = "" + O, M !== null && M.tag === 6 ? (n(R, M.sibling), M = i(M, O), M.return = R, R = M) : (n(R, M), M = r1(O, R.mode, z), M.return = R, R = M), c(R)) : n(R, M) } return N } var Qd = sA(!0), lA = sA(!1), sm = {}, ps = vu(sm), Np = vu(sm), Op = vu(sm); function rc(e) { if (e === sm) throw Error(Ht(174)); return e } function wS(e, t) { switch (jr(Op, t), jr(Np, e), jr(ps, sm), e = t.nodeType, e) { case 9: case 11: t = (t = t.documentElement) ? t.namespaceURI : Eb(null, ""); break; default: e = e === 8 ? t.parentNode : t, t = e.namespaceURI || null, e = e.tagName, t = Eb(t, e) }Wr(ps), jr(ps, t) } function Jd() { Wr(ps), Wr(Np), Wr(Op) } function uA(e) { rc(Op.current); var t = rc(ps.current), n = Eb(t, e.type); t !== n && (jr(Np, e), jr(ps, n)) } function CS(e) { Np.current === e && (Wr(ps), Wr(Np)) } var Jr = vu(0); function xy(e) { for (var t = e; t !== null;) { if (t.tag === 13) { var n = t.memoizedState; if (n !== null && (n = n.dehydrated, n === null || n.data === "$?" || n.data === "$!")) return t } else if (t.tag === 19 && t.memoizedProps.revealOrder !== void 0) { if ((t.flags & 128) !== 0) return t } else if (t.child !== null) { t.child.return = t, t = t.child; continue } if (t === e) break; for (; t.sibling === null;) { if (t.return === null || t.return === e) return null; t = t.return } t.sibling.return = t.return, t = t.sibling } return null } var Y_ = []; function SS() { for (var e = 0; e < Y_.length; e++)Y_[e]._workInProgressVersionPrimary = null; Y_.length = 0 } var Ng = ul.ReactCurrentDispatcher, Q_ = ul.ReactCurrentBatchConfig, yc = 0, ei = null, ki = null, Fi = null, _y = !1, ap = !1, Dp = 0, AB = 0; function to() { throw Error(Ht(321)) } function ES(e, t) { if (t === null) return !1; for (var n = 0; n < t.length && n < e.length; n++)if (!Wa(e[n], t[n])) return !1; return !0 } function PS(e, t, n, r, i, s) { if (yc = s, ei = t, t.memoizedState = null, t.updateQueue = null, t.lanes = 0, Ng.current = e === null || e.memoizedState === null ? LB : zB, e = n(r, i), ap) { s = 0; do { if (ap = !1, Dp = 0, 25 <= s) throw Error(Ht(301)); s += 1, Fi = ki = null, t.updateQueue = null, Ng.current = FB, e = n(r, i) } while (ap) } if (Ng.current = by, t = ki !== null && ki.next !== null, yc = 0, Fi = ki = ei = null, _y = !1, t) throw Error(Ht(300)); return e } function TS() { var e = Dp !== 0; return Dp = 0, e } function ls() { var e = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; return Fi === null ? ei.memoizedState = Fi = e : Fi = Fi.next = e, Fi } function Ca() { if (ki === null) { var e = ei.alternate; e = e !== null ? e.memoizedState : null } else e = ki.next; var t = Fi === null ? ei.memoizedState : Fi.next; if (t !== null) Fi = t, ki = e; else { if (e === null) throw Error(Ht(310)); ki = e, e = { memoizedState: ki.memoizedState, baseState: ki.baseState, baseQueue: ki.baseQueue, queue: ki.queue, next: null }, Fi === null ? ei.memoizedState = Fi = e : Fi = Fi.next = e } return Fi } function Lp(e, t) { return typeof t == "function" ? t(e) : t } function J_(e) { var t = Ca(), n = t.queue; if (n === null) throw Error(Ht(311)); n.lastRenderedReducer = e; var r = ki, i = r.baseQueue, s = n.pending; if (s !== null) { if (i !== null) { var c = i.next; i.next = s.next, s.next = c } r.baseQueue = i = s, n.pending = null } if (i !== null) { s = i.next, r = r.baseState; var o = c = null, f = null, p = s; do { var v = p.lane; if ((yc & v) === v) f !== null && (f = f.next = { lane: 0, action: p.action, hasEagerState: p.hasEagerState, eagerState: p.eagerState, next: null }), r = p.hasEagerState ? p.eagerState : e(r, p.action); else { var y = { lane: v, action: p.action, hasEagerState: p.hasEagerState, eagerState: p.eagerState, next: null }; f === null ? (o = f = y, c = r) : f = f.next = y, ei.lanes |= v, xc |= v } p = p.next } while (p !== null && p !== s); f === null ? c = r : f.next = o, Wa(r, t.memoizedState) || (No = !0), t.memoizedState = r, t.baseState = c, t.baseQueue = f, n.lastRenderedState = r } if (e = n.interleaved, e !== null) { i = e; do s = i.lane, ei.lanes |= s, xc |= s, i = i.next; while (i !== e) } else i === null && (n.lanes = 0); return [t.memoizedState, n.dispatch] } function e1(e) { var t = Ca(), n = t.queue; if (n === null) throw Error(Ht(311)); n.lastRenderedReducer = e; var r = n.dispatch, i = n.pending, s = t.memoizedState; if (i !== null) { n.pending = null; var c = i = i.next; do s = e(s, c.action), c = c.next; while (c !== i); Wa(s, t.memoizedState) || (No = !0), t.memoizedState = s, t.baseQueue === null && (t.baseState = s), n.lastRenderedState = s } return [s, r] } function cA() { } function dA(e, t) { var n = ei, r = Ca(), i = t(), s = !Wa(r.memoizedState, i); if (s && (r.memoizedState = i, No = !0), r = r.queue, kS(pA.bind(null, n, r, e), [e]), r.getSnapshot !== t || s || Fi !== null && Fi.memoizedState.tag & 1) { if (n.flags |= 2048, zp(9, hA.bind(null, n, r, i, t), void 0, null), $i === null) throw Error(Ht(349)); (yc & 30) !== 0 || fA(n, t, i) } return i } function fA(e, t, n) { e.flags |= 16384, e = { getSnapshot: t, value: n }, t = ei.updateQueue, t === null ? (t = { lastEffect: null, stores: null }, ei.updateQueue = t, t.stores = [e]) : (n = t.stores, n === null ? t.stores = [e] : n.push(e)) } function hA(e, t, n, r) { t.value = n, t.getSnapshot = r, mA(t) && vA(e) } function pA(e, t, n) { return n(function () { mA(t) && vA(e) }) } function mA(e) { var t = e.getSnapshot; e = e.value; try { var n = t(); return !Wa(e, n) } catch { return !0 } } function vA(e) { var t = rl(e, 1); t !== null && Ka(t, e, 1, -1) } function QP(e) { var t = ls(); return typeof e == "function" && (e = e()), t.memoizedState = t.baseState = e, e = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Lp, lastRenderedState: e }, t.queue = e, e = e.dispatch = DB.bind(null, ei, e), [t.memoizedState, e] } function zp(e, t, n, r) { return e = { tag: e, create: t, destroy: n, deps: r, next: null }, t = ei.updateQueue, t === null ? (t = { lastEffect: null, stores: null }, ei.updateQueue = t, t.lastEffect = e.next = e) : (n = t.lastEffect, n === null ? t.lastEffect = e.next = e : (r = n.next, n.next = e, e.next = r, t.lastEffect = e)), e } function gA() { return Ca().memoizedState } function Og(e, t, n, r) { var i = ls(); ei.flags |= e, i.memoizedState = zp(1 | t, n, void 0, r === void 0 ? null : r) } function g0(e, t, n, r) { var i = Ca(); r = r === void 0 ? null : r; var s = void 0; if (ki !== null) { var c = ki.memoizedState; if (s = c.destroy, r !== null && ES(r, c.deps)) { i.memoizedState = zp(t, n, s, r); return } } ei.flags |= e, i.memoizedState = zp(1 | t, n, s, r) } function JP(e, t) { return Og(8390656, 8, e, t) } function kS(e, t) { return g0(2048, 8, e, t) } function yA(e, t) { return g0(4, 2, e, t) } function xA(e, t) { return g0(4, 4, e, t) } function _A(e, t) { if (typeof t == "function") return e = e(), t(e), function () { t(null) }; if (t != null) return e = e(), t.current = e, function () { t.current = null } } function bA(e, t, n) { return n = n != null ? n.concat([e]) : null, g0(4, 4, _A.bind(null, t, e), n) } function IS() { } function wA(e, t) { var n = Ca(); t = t === void 0 ? null : t; var r = n.memoizedState; return r !== null && t !== null && ES(t, r[1]) ? r[0] : (n.memoizedState = [e, t], e) } function CA(e, t) { var n = Ca(); t = t === void 0 ? null : t; var r = n.memoizedState; return r !== null && t !== null && ES(t, r[1]) ? r[0] : (e = e(), n.memoizedState = [e, t], e) } function SA(e, t, n) { return (yc & 21) === 0 ? (e.baseState && (e.baseState = !1, No = !0), e.memoizedState = n) : (Wa(n, t) || (n = TM(), ei.lanes |= n, xc |= n, e.baseState = !0), t) } function NB(e, t) { var n = Er; Er = n !== 0 && 4 > n ? n : 4, e(!0); var r = Q_.transition; Q_.transition = {}; try { e(!1), t() } finally { Er = n, Q_.transition = r } } function EA() { return Ca().memoizedState } function OB(e, t, n) { var r = iu(e); if (n = { lane: r, action: n, hasEagerState: !1, eagerState: null, next: null }, PA(e)) TA(t, n); else if (n = rA(e, t, n, r), n !== null) { var i = _o(); Ka(n, e, r, i), kA(n, t, r) } } function DB(e, t, n) { var r = iu(e), i = { lane: r, action: n, hasEagerState: !1, eagerState: null, next: null }; if (PA(e)) TA(t, i); else { var s = e.alternate; if (e.lanes === 0 && (s === null || s.lanes === 0) && (s = t.lastRenderedReducer, s !== null)) try { var c = t.lastRenderedState, o = s(c, n); if (i.hasEagerState = !0, i.eagerState = o, Wa(o, c)) { var f = t.interleaved; f === null ? (i.next = i, _S(t)) : (i.next = f.next, f.next = i), t.interleaved = i; return } } catch { } finally { } n = rA(e, t, i, r), n !== null && (i = _o(), Ka(n, e, r, i), kA(n, t, r)) } } function PA(e) { var t = e.alternate; return e === ei || t !== null && t === ei } function TA(e, t) { ap = _y = !0; var n = e.pending; n === null ? t.next = t : (t.next = n.next, n.next = t), e.pending = t } function kA(e, t, n) { if ((n & 4194240) !== 0) { var r = t.lanes; r &= e.pendingLanes, n |= r, t.lanes = n, aS(e, n) } } var by = { readContext: wa, useCallback: to, useContext: to, useEffect: to, useImperativeHandle: to, useInsertionEffect: to, useLayoutEffect: to, useMemo: to, useReducer: to, useRef: to, useState: to, useDebugValue: to, useDeferredValue: to, useTransition: to, useMutableSource: to, useSyncExternalStore: to, useId: to, unstable_isNewReconciler: !1 }, LB = { readContext: wa, useCallback: function (e, t) { return ls().memoizedState = [e, t === void 0 ? null : t], e }, useContext: wa, useEffect: JP, useImperativeHandle: function (e, t, n) { return n = n != null ? n.concat([e]) : null, Og(4194308, 4, _A.bind(null, t, e), n) }, useLayoutEffect: function (e, t) { return Og(4194308, 4, e, t) }, useInsertionEffect: function (e, t) { return Og(4, 2, e, t) }, useMemo: function (e, t) { var n = ls(); return t = t === void 0 ? null : t, e = e(), n.memoizedState = [e, t], e }, useReducer: function (e, t, n) { var r = ls(); return t = n !== void 0 ? n(t) : t, r.memoizedState = r.baseState = t, e = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: e, lastRenderedState: t }, r.queue = e, e = e.dispatch = OB.bind(null, ei, e), [r.memoizedState, e] }, useRef: function (e) { var t = ls(); return e = { current: e }, t.memoizedState = e }, useState: QP, useDebugValue: IS, useDeferredValue: function (e) { return ls().memoizedState = e }, useTransition: function () { var e = QP(!1), t = e[0]; return e = NB.bind(null, e[1]), ls().memoizedState = e, [t, e] }, useMutableSource: function () { }, useSyncExternalStore: function (e, t, n) { var r = ei, i = ls(); if (Yr) { if (n === void 0) throw Error(Ht(407)); n = n() } else { if (n = t(), $i === null) throw Error(Ht(349)); (yc & 30) !== 0 || fA(r, t, n) } i.memoizedState = n; var s = { value: n, getSnapshot: t }; return i.queue = s, JP(pA.bind(null, r, s, e), [e]), r.flags |= 2048, zp(9, hA.bind(null, r, s, n, t), void 0, null), n }, useId: function () { var e = ls(), t = $i.identifierPrefix; if (Yr) { var n = Zs, r = qs; n = (r & ~(1 << 32 - ja(r) - 1)).toString(32) + n, t = ":" + t + "R" + n, n = Dp++, 0 < n && (t += "H" + n.toString(32)), t += ":" } else n = AB++, t = ":" + t + "r" + n.toString(32) + ":"; return e.memoizedState = t }, unstable_isNewReconciler: !1 }, zB = { readContext: wa, useCallback: wA, useContext: wa, useEffect: kS, useImperativeHandle: bA, useInsertionEffect: yA, useLayoutEffect: xA, useMemo: CA, useReducer: J_, useRef: gA, useState: function () { return J_(Lp) }, useDebugValue: IS, useDeferredValue: function (e) { var t = Ca(); return SA(t, ki.memoizedState, e) }, useTransition: function () { var e = J_(Lp)[0], t = Ca().memoizedState; return [e, t] }, useMutableSource: cA, useSyncExternalStore: dA, useId: EA, unstable_isNewReconciler: !1 }, FB = { readContext: wa, useCallback: wA, useContext: wa, useEffect: kS, useImperativeHandle: bA, useInsertionEffect: yA, useLayoutEffect: xA, useMemo: CA, useReducer: e1, useRef: gA, useState: function () { return e1(Lp) }, useDebugValue: IS, useDeferredValue: function (e) { var t = Ca(); return ki === null ? t.memoizedState = e : SA(t, ki.memoizedState, e) }, useTransition: function () { var e = e1(Lp)[0], t = Ca().memoizedState; return [e, t] }, useMutableSource: cA, useSyncExternalStore: dA, useId: EA, unstable_isNewReconciler: !1 }; function ef(e, t) {
|
|
|
try { var n = "", r = t; do n += f8(r), r = r.return; while (r); var i = n } catch (s) {
|
|
|
i = `
|
|
|
Error generating stack: `+ s.message + `
|
|
|
`+ s.stack
|
|
|
} return { value: e, source: t, stack: i, digest: null }
|
|
|
} function t1(e, t, n) { return { value: e, source: null, stack: n != null ? n : null, digest: t != null ? t : null } } function qb(e, t) { try { console.error(t.value) } catch (n) { setTimeout(function () { throw n }) } } var $B = typeof WeakMap == "function" ? WeakMap : Map; function IA(e, t, n) { n = Ys(-1, n), n.tag = 3, n.payload = { element: null }; var r = t.value; return n.callback = function () { Cy || (Cy = !0, iw = r), qb(e, t) }, n } function RA(e, t, n) { n = Ys(-1, n), n.tag = 3; var r = e.type.getDerivedStateFromError; if (typeof r == "function") { var i = t.value; n.payload = function () { return r(i) }, n.callback = function () { qb(e, t) } } var s = e.stateNode; return s !== null && typeof s.componentDidCatch == "function" && (n.callback = function () { qb(e, t), typeof r != "function" && (ru === null ? ru = new Set([this]) : ru.add(this)); var c = t.stack; this.componentDidCatch(t.value, { componentStack: c !== null ? c : "" }) }), n } function eT(e, t, n) { var r = e.pingCache; if (r === null) { r = e.pingCache = new $B; var i = new Set; r.set(t, i) } else i = r.get(t), i === void 0 && (i = new Set, r.set(t, i)); i.has(n) || (i.add(n), e = JB.bind(null, e, t, n), t.then(e, e)) } function tT(e) { do { var t; if ((t = e.tag === 13) && (t = e.memoizedState, t = t !== null ? t.dehydrated !== null : !0), t) return e; e = e.return } while (e !== null); return null } function nT(e, t, n, r, i) { return (e.mode & 1) === 0 ? (e === t ? e.flags |= 65536 : (e.flags |= 128, n.flags |= 131072, n.flags &= -52805, n.tag === 1 && (n.alternate === null ? n.tag = 17 : (t = Ys(-1, 1), t.tag = 2, nu(n, t, 1))), n.lanes |= 1), e) : (e.flags |= 65536, e.lanes = i, e) } var BB = ul.ReactCurrentOwner, No = !1; function yo(e, t, n, r) { t.child = e === null ? lA(t, null, n, r) : Qd(t, e.child, n, r) } function rT(e, t, n, r, i) { n = n.render; var s = t.ref; return jd(t, i), r = PS(e, t, n, r, s, i), n = TS(), e !== null && !No ? (t.updateQueue = e.updateQueue, t.flags &= -2053, e.lanes &= ~i, il(e, t, i)) : (Yr && n && pS(t), t.flags |= 1, yo(e, t, r, i), t.child) } function iT(e, t, n, r, i) { if (e === null) { var s = n.type; return typeof s == "function" && !zS(s) && s.defaultProps === void 0 && n.compare === null && n.defaultProps === void 0 ? (t.tag = 15, t.type = s, MA(e, t, s, r, i)) : (e = Fg(n.type, null, r, t, t.mode, i), e.ref = t.ref, e.return = t, t.child = e) } if (s = e.child, (e.lanes & i) === 0) { var c = s.memoizedProps; if (n = n.compare, n = n !== null ? n : Ip, n(c, r) && e.ref === t.ref) return il(e, t, i) } return t.flags |= 1, e = ou(s, r), e.ref = t.ref, e.return = t, t.child = e } function MA(e, t, n, r, i) { if (e !== null) { var s = e.memoizedProps; if (Ip(s, r) && e.ref === t.ref) if (No = !1, t.pendingProps = r = s, (e.lanes & i) !== 0) (e.flags & 131072) !== 0 && (No = !0); else return t.lanes = e.lanes, il(e, t, i) } return Zb(e, t, n, r, i) } function AA(e, t, n) { var r = t.pendingProps, i = r.children, s = e !== null ? e.memoizedState : null; if (r.mode === "hidden") if ((t.mode & 1) === 0) t.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, jr(Nd, Zo), Zo |= n; else { if ((n & 1073741824) === 0) return e = s !== null ? s.baseLanes | n : n, t.lanes = t.childLanes = 1073741824, t.memoizedState = { baseLanes: e, cachePool: null, transitions: null }, t.updateQueue = null, jr(Nd, Zo), Zo |= e, null; t.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, r = s !== null ? s.baseLanes : n, jr(Nd, Zo), Zo |= r } else s !== null ? (r = s.baseLanes | n, t.memoizedState = null) : r = n, jr(Nd, Zo), Zo |= r; return yo(e, t, i, n), t.child } function NA(e, t) { var n = t.ref; (e === null && n !== null || e !== null && e.ref !== n) && (t.flags |= 512, t.flags |= 2097152) } function Zb(e, t, n, r, i) { var s = Do(n) ? vc : oo.current; return s = Xd(t, s), jd(t, i), n = PS(e, t, n, r, s, i), r = TS(), e !== null && !No ? (t.updateQueue = e.updateQueue, t.flags &= -2053, e.lanes &= ~i, il(e, t, i)) : (Yr && r && pS(t), t.flags |= 1, yo(e, t, n, i), t.child) } function oT(e, t, n, r, i) { if (Do(n)) { var s = !0; hy(t) } else s = !1; if (jd(t, i), t.stateNode === null) Dg(e, t), aA(t, n, r), Gb(t, n, r, i), r = !0; else if (e === null) { var c = t.stateNode, o = t.memoizedProps; c.props = o; var f = c.context, p = n.contextType; typeof p == "object" && p !== null ? p = wa(p) : (p = Do(n) ? vc : oo.current, p = Xd(t, p)); var v = n.getDerivedStateFromProps, y = typeof v == "function" || typeof c.getSnapshotBeforeUpdate == "function"; y || typeof c.UNSAFE_componentWillReceiveProps != "function" && typeof c.componentWillReceiveProps != "function" || (o !== r || f !== p) && XP(t, c, r, p), Vl = !1; var w = t.memoizedState; c.state = w, yy(t, r, c, i), f = t.memoizedState, o !== r || w !== f || Oo.current || Vl ? (typeof v == "function" && (Wb(t, n, v, r), f = t.memoizedState), (o = Vl || ZP(t, n, o, r, w, f, p)) ? (y || typeof c.UNSAFE_componentWillMount != "function" && typeof c.componentWillMount != "function" || (typeof c.componentWillMount == "function" && c.componentWillMount(), typeof c.UNSAFE_componentWillMount == "function" && c.UNSAFE_componentWillMount()), typeof c.componentDidMount == "function" && (t.flags |= 4194308)) : (typeof c.componentDidMount == "function" && (t.flags |= 4194308), t.memoizedProps = r, t.memoizedState = f), c.props = r, c.state = f, c.context = p, r = o) : (typeof c.componentDidMount == "function" && (t.flags |= 4194308), r = !1) } else { c = t.stateNode, iA(e, t), o = t.memoizedProps, p = t.type === t.elementType ? o : $a(t.type, o), c.props = p, y = t.pendingProps, w = c.context, f = n.contextType, typeof f == "object" && f !== null ? f = wa(f) : (f = Do(n) ? vc : oo.current, f = Xd(t, f)); var P = n.getDerivedStateFromProps; (v = typeof P == "function" || typeof c.getSnapshotBeforeUpdate == "function") || typeof c.UNSAFE_componentWillReceiveProps != "function" && typeof c.componentWillReceiveProps != "function" || (o !== y || w !== f) && XP(t, c, r, f), Vl = !1, w = t.memoizedState, c.state = w, yy(t, r, c, i); var k = t.memoizedState; o !== y || w !== k || Oo.current || Vl ? (typeof P == "function" && (Wb(t, n, P, r), k = t.memoizedState), (p = Vl || ZP(t, n, p, r, w, k, f) || !1) ? (v || typeof c.UNSAFE_componentWillUpdate != "function" && typeof c.componentWillUpdate != "function" || (typeof c.componentWillUpdate == "function" && c.componentWillUpdate(r, k, f), typeof c.UNSAFE_componentWillUpdate == "function" && c.UNSAFE_componentWillUpdate(r, k, f)), typeof c.componentDidUpdate == "function" && (t.flags |= 4), typeof c.getSnapshotBeforeUpdate == "function" && (t.flags |= 1024)) : (typeof c.componentDidUpdate != "function" || o === e.memoizedProps && w === e.memoizedState || (t.flags |= 4), typeof c.getSnapshotBeforeUpdate != "function" || o === e.memoizedProps && w === e.memoizedState || (t.flags |= 1024), t.memoizedProps = r, t.memoizedState = k), c.props = r, c.state = k, c.context = f, r = p) : (typeof c.componentDidUpdate != "function" || o === e.memoizedProps && w === e.memoizedState || (t.flags |= 4), typeof c.getSnapshotBeforeUpdate != "function" || o === e.memoizedProps && w === e.memoizedState || (t.flags |= 1024), r = !1) } return Xb(e, t, n, r, s, i) } function Xb(e, t, n, r, i, s) { NA(e, t); var c = (t.flags & 128) !== 0; if (!r && !c) return i && KP(t, n, !1), il(e, t, s); r = t.stateNode, BB.current = t; var o = c && typeof n.getDerivedStateFromError != "function" ? null : r.render(); return t.flags |= 1, e !== null && c ? (t.child = Qd(t, e.child, null, s), t.child = Qd(t, null, o, s)) : yo(e, t, o, s), t.memoizedState = r.state, i && KP(t, n, !0), t.child } function OA(e) { var t = e.stateNode; t.pendingContext ? jP(e, t.pendingContext, t.pendingContext !== t.context) : t.context && jP(e, t.context, !1), wS(e, t.containerInfo) } function aT(e, t, n, r, i) { return Yd(), vS(i), t.flags |= 256, yo(e, t, n, r), t.child } var Yb = { dehydrated: null, treeContext: null, retryLane: 0 }; function Qb(e) { return { baseLanes: e, cachePool: null, transitions: null } } function DA(e, t, n) { var r = t.pendingProps, i = Jr.current, s = !1, c = (t.flags & 128) !== 0, o; if ((o = c) || (o = e !== null && e.memoizedState === null ? !1 : (i & 2) !== 0), o ? (s = !0, t.flags &= -129) : (e === null || e.memoizedState !== null) && (i |= 1), jr(Jr, i & 1), e === null) return Kb(t), e = t.memoizedState, e !== null && (e = e.dehydrated, e !== null) ? ((t.mode & 1) === 0 ? t.lanes = 1 : e.data === "$!" ? t.lanes = 8 : t.lanes = 1073741824, null) : (c = r.children, e = r.fallback, s ? (r = t.mode, s = t.child, c = { mode: "hidden", children: c }, (r & 1) === 0 && s !== null ? (s.childLanes = 0, s.pendingProps = c) : s = _0(c, r, 0, null), e = dc(e, r, n, null), s.return = t, e.return = t, s.sibling = e, t.child = s, t.child.memoizedState = Qb(n), t.memoizedState = Yb, e) : RS(t, c)); if (i = e.memoizedState, i !== null && (o = i.dehydrated, o !== null)) return VB(e, t, c, r, o, i, n); if (s) { s = r.fallback, c = t.mode, i = e.child, o = i.sibling; var f = { mode: "hidden", children: r.children }; return (c & 1) === 0 && t.child !== i ? (r = t.child, r.childLanes = 0, r.pendingProps = f, t.deletions = null) : (r = ou(i, f), r.subtreeFlags = i.subtreeFlags & 14680064), o !== null ? s = ou(o, s) : (s = dc(s, c, n, null), s.flags |= 2), s.return = t, r.return = t, r.sibling = s, t.child = r, r = s, s = t.child, c = e.child.memoizedState, c = c === null ? Qb(n) : { baseLanes: c.baseLanes | n, cachePool: null, transitions: c.transitions }, s.memoizedState = c, s.childLanes = e.childLanes & ~n, t.memoizedState = Yb, r } return s = e.child, e = s.sibling, r = ou(s, { mode: "visible", children: r.children }), (t.mode & 1) === 0 && (r.lanes = n), r.return = t, r.sibling = null, e !== null && (n = t.deletions, n === null ? (t.deletions = [e], t.flags |= 16) : n.push(e)), t.child = r, t.memoizedState = null, r } function RS(e, t) { return t = _0({ mode: "visible", children: t }, e.mode, 0, null), t.return = e, e.child = t } function Yv(e, t, n, r) { return r !== null && vS(r), Qd(t, e.child, null, n), e = RS(t, t.pendingProps.children), e.flags |= 2, t.memoizedState = null, e } function VB(e, t, n, r, i, s, c) { if (n) return t.flags & 256 ? (t.flags &= -257, r = t1(Error(Ht(422))), Yv(e, t, c, r)) : t.memoizedState !== null ? (t.child = e.child, t.flags |= 128, null) : (s = r.fallback, i = t.mode, r = _0({ mode: "visible", children: r.children }, i, 0, null), s = dc(s, i, c, null), s.flags |= 2, r.return = t, s.return = t, r.sibling = s, t.child = r, (t.mode & 1) !== 0 && Qd(t, e.child, null, c), t.child.memoizedState = Qb(c), t.memoizedState = Yb, s); if ((t.mode & 1) === 0) return Yv(e, t, c, null); if (i.data === "$!") { if (r = i.nextSibling && i.nextSibling.dataset, r) var o = r.dgst; return r = o, s = Error(Ht(419)), r = t1(s, r, void 0), Yv(e, t, c, r) } if (o = (c & e.childLanes) !== 0, No || o) { if (r = $i, r !== null) { switch (c & -c) { case 4: i = 2; break; case 16: i = 8; break; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: i = 32; break; case 536870912: i = 268435456; break; default: i = 0 }i = (i & (r.suspendedLanes | c)) !== 0 ? 0 : i, i !== 0 && i !== s.retryLane && (s.retryLane = i, rl(e, i), Ka(r, e, i, -1)) } return LS(), r = t1(Error(Ht(421))), Yv(e, t, c, r) } return i.data === "$?" ? (t.flags |= 128, t.child = e.child, t = e9.bind(null, e), i._reactRetry = t, null) : (e = s.treeContext, Xo = tu(i.nextSibling), Qo = t, Yr = !0, Va = null, e !== null && (va[ga++] = qs, va[ga++] = Zs, va[ga++] = gc, qs = e.id, Zs = e.overflow, gc = t), t = RS(t, r.children), t.flags |= 4096, t) } function sT(e, t, n) { e.lanes |= t; var r = e.alternate; r !== null && (r.lanes |= t), Hb(e.return, t, n) } function n1(e, t, n, r, i) { var s = e.memoizedState; s === null ? e.memoizedState = { isBackwards: t, rendering: null, renderingStartTime: 0, last: r, tail: n, tailMode: i } : (s.isBackwards = t, s.rendering = null, s.renderingStartTime = 0, s.last = r, s.tail = n, s.tailMode = i) } function LA(e, t, n) { var r = t.pendingProps, i = r.revealOrder, s = r.tail; if (yo(e, t, r.children, n), r = Jr.current, (r & 2) !== 0) r = r & 1 | 2, t.flags |= 128; else { if (e !== null && (e.flags & 128) !== 0) e: for (e = t.child; e !== null;) { if (e.tag === 13) e.memoizedState !== null && sT(e, n, t); else if (e.tag === 19) sT(e, n, t); else if (e.child !== null) { e.child.return = e, e = e.child; continue } if (e === t) break e; for (; e.sibling === null;) { if (e.return === null || e.return === t) break e; e = e.return } e.sibling.return = e.return, e = e.sibling } r &= 1 } if (jr(Jr, r), (t.mode & 1) === 0) t.memoizedState = null; else switch (i) { case "forwards": for (n = t.child, i = null; n !== null;)e = n.alternate, e !== null && xy(e) === null && (i = n), n = n.sibling; n = i, n === null ? (i = t.child, t.child = null) : (i = n.sibling, n.sibling = null), n1(t, !1, i, n, s); break; case "backwards": for (n = null, i = t.child, t.child = null; i !== null;) { if (e = i.alternate, e !== null && xy(e) === null) { t.child = i; break } e = i.sibling, i.sibling = n, n = i, i = e } n1(t, !0, n, null, s); break; case "together": n1(t, !1, null, null, void 0); break; default: t.memoizedState = null }return t.child } function Dg(e, t) { (t.mode & 1) === 0 && e !== null && (e.alternate = null, t.alternate = null, t.flags |= 2) } function il(e, t, n) { if (e !== null && (t.dependencies = e.dependencies), xc |= t.lanes, (n & t.childLanes) === 0) return null; if (e !== null && t.child !== e.child) throw Error(Ht(153)); if (t.child !== null) { for (e = t.child, n = ou(e, e.pendingProps), t.child = n, n.return = t; e.sibling !== null;)e = e.sibling, n = n.sibling = ou(e, e.pendingProps), n.return = t; n.sibling = null } return t.child } function UB(e, t, n) { switch (t.tag) { case 3: OA(t), Yd(); break; case 5: uA(t); break; case 1: Do(t.type) && hy(t); break; case 4: wS(t, t.stateNode.containerInfo); break; case 10: var r = t.type._context, i = t.memoizedProps.value; jr(vy, r._currentValue), r._currentValue = i; break; case 13: if (r = t.memoizedState, r !== null) return r.dehydrated !== null ? (jr(Jr, Jr.current & 1), t.flags |= 128, null) : (n & t.child.childLanes) !== 0 ? DA(e, t, n) : (jr(Jr, Jr.current & 1), e = il(e, t, n), e !== null ? e.sibling : null); jr(Jr, Jr.current & 1); break; case 19: if (r = (n & t.childLanes) !== 0, (e.flags & 128) !== 0) { if (r) return LA(e, t, n); t.flags |= 128 } if (i = t.memoizedState, i !== null && (i.rendering = null, i.tail = null, i.lastEffect = null), jr(Jr, Jr.current), r) break; return null; case 22: case 23: return t.lanes = 0, AA(e, t, n) }return il(e, t, n) } var zA, Jb, FA, $A; zA = function (e, t) { for (var n = t.child; n !== null;) { if (n.tag === 5 || n.tag === 6) e.appendChild(n.stateNode); else if (n.tag !== 4 && n.child !== null) { n.child.return = n, n = n.child; continue } if (n === t) break; for (; n.sibling === null;) { if (n.return === null || n.return === t) return; n = n.return } n.sibling.return = n.return, n = n.sibling } }; Jb = function () { }; FA = function (e, t, n, r) { var i = e.memoizedProps; if (i !== r) { e = t.stateNode, rc(ps.current); var s = null; switch (n) { case "input": i = bb(e, i), r = bb(e, r), s = []; break; case "select": i = ti({}, i, { value: void 0 }), r = ti({}, r, { value: void 0 }), s = []; break; case "textarea": i = Sb(e, i), r = Sb(e, r), s = []; break; default: typeof i.onClick != "function" && typeof r.onClick == "function" && (e.onclick = dy) }Pb(n, r); var c; n = null; for (p in i) if (!r.hasOwnProperty(p) && i.hasOwnProperty(p) && i[p] != null) if (p === "style") { var o = i[p]; for (c in o) o.hasOwnProperty(c) && (n || (n = {}), n[c] = "") } else p !== "dangerouslySetInnerHTML" && p !== "children" && p !== "suppressContentEditableWarning" && p !== "suppressHydrationWarning" && p !== "autoFocus" && (wp.hasOwnProperty(p) ? s || (s = []) : (s = s || []).push(p, null)); for (p in r) { var f = r[p]; if (o = i != null ? i[p] : void 0, r.hasOwnProperty(p) && f !== o && (f != null || o != null)) if (p === "style") if (o) { for (c in o) !o.hasOwnProperty(c) || f && f.hasOwnProperty(c) || (n || (n = {}), n[c] = ""); for (c in f) f.hasOwnProperty(c) && o[c] !== f[c] && (n || (n = {}), n[c] = f[c]) } else n || (s || (s = []), s.push(p, n)), n = f; else p === "dangerouslySetInnerHTML" ? (f = f ? f.__html : void 0, o = o ? o.__html : void 0, f != null && o !== f && (s = s || []).push(p, f)) : p === "children" ? typeof f != "string" && typeof f != "number" || (s = s || []).push(p, "" + f) : p !== "suppressContentEditableWarning" && p !== "suppressHydrationWarning" && (wp.hasOwnProperty(p) ? (f != null && p === "onScroll" && Kr("scroll", e), s || o === f || (s = [])) : (s = s || []).push(p, f)) } n && (s = s || []).push("style", n); var p = s; (t.updateQueue = p) && (t.flags |= 4) } }; $A = function (e, t, n, r) { n !== r && (t.flags |= 4) }; function Lh(e, t) { if (!Yr) switch (e.tailMode) { case "hidden": t = e.tail; for (var n = null; t !== null;)t.alternate !== null && (n = t), t = t.sibling; n === null ? e.tail = null : n.sibling = null; break; case "collapsed": n = e.tail; for (var r = null; n !== null;)n.alternate !== null && (r = n), n = n.sibling; r === null ? t || e.tail === null ? e.tail = null : e.tail.sibling = null : r.sibling = null } } function no(e) { var t = e.alternate !== null && e.alternate.child === e.child, n = 0, r = 0; if (t) for (var i = e.child; i !== null;)n |= i.lanes | i.childLanes, r |= i.subtreeFlags & 14680064, r |= i.flags & 14680064, i.return = e, i = i.sibling; else for (i = e.child; i !== null;)n |= i.lanes | i.childLanes, r |= i.subtreeFlags, r |= i.flags, i.return = e, i = i.sibling; return e.subtreeFlags |= r, e.childLanes = n, t } function jB(e, t, n) { var r = t.pendingProps; switch (mS(t), t.tag) { case 2: case 16: case 15: case 0: case 11: case 7: case 8: case 12: case 9: case 14: return no(t), null; case 1: return Do(t.type) && fy(), no(t), null; case 3: return r = t.stateNode, Jd(), Wr(Oo), Wr(oo), SS(), r.pendingContext && (r.context = r.pendingContext, r.pendingContext = null), (e === null || e.child === null) && (Zv(t) ? t.flags |= 4 : e === null || e.memoizedState.isDehydrated && (t.flags & 256) === 0 || (t.flags |= 1024, Va !== null && (sw(Va), Va = null))), Jb(e, t), no(t), null; case 5: CS(t); var i = rc(Op.current); if (n = t.type, e !== null && t.stateNode != null) FA(e, t, n, r, i), e.ref !== t.ref && (t.flags |= 512, t.flags |= 2097152); else { if (!r) { if (t.stateNode === null) throw Error(Ht(166)); return no(t), null } if (e = rc(ps.current), Zv(t)) { r = t.stateNode, n = t.type; var s = t.memoizedProps; switch (r[us] = t, r[Ap] = s, e = (t.mode & 1) !== 0, n) { case "dialog": Kr("cancel", r), Kr("close", r); break; case "iframe": case "object": case "embed": Kr("load", r); break; case "video": case "audio": for (i = 0; i < Xh.length; i++)Kr(Xh[i], r); break; case "source": Kr("error", r); break; case "img": case "image": case "link": Kr("error", r), Kr("load", r); break; case "details": Kr("toggle", r); break; case "input": vP(r, s), Kr("invalid", r); break; case "select": r._wrapperState = { wasMultiple: !!s.multiple }, Kr("invalid", r); break; case "textarea": yP(r, s), Kr("invalid", r) }Pb(n, s), i = null; for (var c in s) if (s.hasOwnProperty(c)) { var o = s[c]; c === "children" ? typeof o == "string" ? r.textContent !== o && (s.suppressHydrationWarning !== !0 && qv(r.textContent, o, e), i = ["children", o]) : typeof o == "number" && r.textContent !== "" + o && (s.suppressHydrationWarning !== !0 && qv(r.textContent, o, e), i = ["children", "" + o]) : wp.hasOwnProperty(c) && o != null && c === "onScroll" && Kr("scroll", r) } switch (n) { case "input": Bv(r), gP(r, s, !0); break; case "textarea": Bv(r), xP(r); break; case "select": case "option": break; default: typeof s.onClick == "function" && (r.onclick = dy) }r = i, t.updateQueue = r, r !== null && (t.flags |= 4) } else { c = i.nodeType === 9 ? i : i.ownerDocument, e === "http://www.w3.org/1999/xhtml" && (e = fM(n)), e === "http://www.w3.org/1999/xhtml" ? n === "script" ? (e = c.createElement("div"), e.innerHTML = "<script><\/script>", e = e.removeChild(e.firstChild)) : typeof r.is == "string" ? e = c.createElement(n, { is: r.is }) : (e = c.createElement(n), n === "select" && (c = e, r.multiple ? c.multiple = !0 : r.size && (c.size = r.size))) : e = c.createElementNS(e, n), e[us] = t, e[Ap] = r, zA(e, t, !1, !1), t.stateNode = e; e: { switch (c = Tb(n, r), n) { case "dialog": Kr("cancel", e), Kr("close", e), i = r; break; case "iframe": case "object": case "embed": Kr("load", e), i = r; break; case "video": case "audio": for (i = 0; i < Xh.length; i++)Kr(Xh[i], e); i = r; break; case "source": Kr("error", e), i = r; break; case "img": case "image": case "link": Kr("error", e), Kr("load", e), i = r; break; case "details": Kr("toggle", e), i = r; break; case "input": vP(e, r), i = bb(e, r), Kr("invalid", e); break; case "option": i = r; break; case "select": e._wrapperState = { wasMultiple: !!r.multiple }, i = ti({}, r, { value: void 0 }), Kr("invalid", e); break; case "textarea": yP(e, r), i = Sb(e, r), Kr("invalid", e); break; default: i = r }Pb(n, i), o = i; for (s in o) if (o.hasOwnProperty(s)) { var f = o[s]; s === "style" ? mM(e, f) : s === "dangerouslySetInnerHTML" ? (f = f ? f.__html : void 0, f != null && hM(e, f)) : s === "children" ? typeof f == "string" ? (n !== "textarea" || f !== "") && Cp(e, f) : typeof f == "number" && Cp(e, "" + f) : s !== "suppressContentEditableWarning" && s !== "suppressHydrationWarning" && s !== "autoFocus" && (wp.hasOwnProperty(s) ? f != null && s === "onScroll" && Kr("scroll", e) : f != null && eS(e, s, f, c)) } switch (n) { case "input": Bv(e), gP(e, r, !1); break; case "textarea": Bv(e), xP(e); break; case "option": r.value != null && e.setAttribute("value", "" + su(r.value)); break; case "select": e.multiple = !!r.multiple, s = r.value, s != null ? $d(e, !!r.multiple, s, !1) : r.defaultValue != null && $d(e, !!r.multiple, r.defaultValue, !0); break; default: typeof i.onClick == "function" && (e.onclick = dy) }switch (n) { case "button": case "input": case "select": case "textarea": r = !!r.autoFocus; break e; case "img": r = !0; break e; default: r = !1 } } r && (t.flags |= 4) } t.ref !== null && (t.flags |= 512, t.flags |= 2097152) } return no(t), null; case 6: if (e && t.stateNode != null) $A(e, t, e.memoizedProps, r); else { if (typeof r != "string" && t.stateNode === null) throw Error(Ht(166)); if (n = rc(Op.current), rc(ps.current), Zv(t)) { if (r = t.stateNode, n = t.memoizedProps, r[us] = t, (s = r.nodeValue !== n) && (e = Qo, e !== null)) switch (e.tag) { case 3: qv(r.nodeValue, n, (e.mode & 1) !== 0); break; case 5: e.memoizedProps.suppressHydrationWarning !== !0 && qv(r.nodeValue, n, (e.mode & 1) !== 0) }s && (t.flags |= 4) } else r = (n.nodeType === 9 ? n : n.ownerDocument).createTextNode(r), r[us] = t, t.stateNode = r } return no(t), null; case 13: if (Wr(Jr), r = t.memoizedState, e === null || e.memoizedState !== null && e.memoizedState.dehydrated !== null) { if (Yr && Xo !== null && (t.mode & 1) !== 0 && (t.flags & 128) === 0) nA(), Yd(), t.flags |= 98560, s = !1; else if (s = Zv(t), r !== null && r.dehydrated !== null) { if (e === null) { if (!s) throw Error(Ht(318)); if (s = t.memoizedState, s = s !== null ? s.dehydrated : null, !s) throw Error(Ht(317)); s[us] = t } else Yd(), (t.flags & 128) === 0 && (t.memoizedState = null), t.flags |= 4; no(t), s = !1 } else Va !== null && (sw(Va), Va = null), s = !0; if (!s) return t.flags & 65536 ? t : null } return (t.flags & 128) !== 0 ? (t.lanes = n, t) : (r = r !== null, r !== (e !== null && e.memoizedState !== null) && r && (t.child.flags |= 8192, (t.mode & 1) !== 0 && (e === null || (Jr.current & 1) !== 0 ? Ii === 0 && (Ii = 3) : LS())), t.updateQueue !== null && (t.flags |= 4), no(t), null); case 4: return Jd(), Jb(e, t), e === null && Rp(t.stateNode.containerInfo), no(t), null; case 10: return xS(t.type._context), no(t), null; case 17: return Do(t.type) && fy(), no(t), null; case 19: if (Wr(Jr), s = t.memoizedState, s === null) return no(t), null; if (r = (t.flags & 128) !== 0, c = s.rendering, c === null) if (r) Lh(s, !1); else { if (Ii !== 0 || e !== null && (e.flags & 128) !== 0) for (e = t.child; e !== null;) { if (c = xy(e), c !== null) { for (t.flags |= 128, Lh(s, !1), r = c.updateQueue, r !== null && (t.updateQueue = r, t.flags |= 4), t.subtreeFlags = 0, r = n, n = t.child; n !== null;)s = n, e = r, s.flags &= 14680066, c = s.alternate, c === null ? (s.childLanes = 0, s.lanes = e, s.child = null, s.subtreeFlags = 0, s.memoizedProps = null, s.memoizedState = null, s.updateQueue = null, s.dependencies = null, s.stateNode = null) : (s.childLanes = c.childLanes, s.lanes = c.lanes, s.child = c.child, s.subtreeFlags = 0, s.deletions = null, s.memoizedProps = c.memoizedProps, s.memoizedState = c.memoizedState, s.updateQueue = c.updateQueue, s.type = c.type, e = c.dependencies, s.dependencies = e === null ? null : { lanes: e.lanes, firstContext: e.firstContext }), n = n.sibling; return jr(Jr, Jr.current & 1 | 2), t.child } e = e.sibling } s.tail !== null && mi() > tf && (t.flags |= 128, r = !0, Lh(s, !1), t.lanes = 4194304) } else { if (!r) if (e = xy(c), e !== null) { if (t.flags |= 128, r = !0, n = e.updateQueue, n !== null && (t.updateQueue = n, t.flags |= 4), Lh(s, !0), s.tail === null && s.tailMode === "hidden" && !c.alternate && !Yr) return no(t), null } else 2 * mi() - s.renderingStartTime > tf && n !== 1073741824 && (t.flags |= 128, r = !0, Lh(s, !1), t.lanes = 4194304); s.isBackwards ? (c.sibling = t.child, t.child = c) : (n = s.last, n !== null ? n.sibling = c : t.child = c, s.last = c) } return s.tail !== null ? (t = s.tail, s.rendering = t, s.tail = t.sibling, s.renderingStartTime = mi(), t.sibling = null, n = Jr.current, jr(Jr, r ? n & 1 | 2 : n & 1), t) : (no(t), null); case 22: case 23: return DS(), r = t.memoizedState !== null, e !== null && e.memoizedState !== null !== r && (t.flags |= 8192), r && (t.mode & 1) !== 0 ? (Zo & 1073741824) !== 0 && (no(t), t.subtreeFlags & 6 && (t.flags |= 8192)) : no(t), null; case 24: return null; case 25: return null }throw Error(Ht(156, t.tag)) } function KB(e, t) { switch (mS(t), t.tag) { case 1: return Do(t.type) && fy(), e = t.flags, e & 65536 ? (t.flags = e & -65537 | 128, t) : null; case 3: return Jd(), Wr(Oo), Wr(oo), SS(), e = t.flags, (e & 65536) !== 0 && (e & 128) === 0 ? (t.flags = e & -65537 | 128, t) : null; case 5: return CS(t), null; case 13: if (Wr(Jr), e = t.memoizedState, e !== null && e.dehydrated !== null) { if (t.alternate === null) throw Error(Ht(340)); Yd() } return e = t.flags, e & 65536 ? (t.flags = e & -65537 | 128, t) : null; case 19: return Wr(Jr), null; case 4: return Jd(), null; case 10: return xS(t.type._context), null; case 22: case 23: return DS(), null; case 24: return null; default: return null } } var Qv = !1, ro = !1, HB = typeof WeakSet == "function" ? WeakSet : Set, En = null; function Ad(e, t) { var n = e.ref; if (n !== null) if (typeof n == "function") try { n(null) } catch (r) { oi(e, t, r) } else n.current = null } function ew(e, t, n) { try { n() } catch (r) { oi(e, t, r) } } var lT = !1; function WB(e, t) { if (zb = ly, e = jM(), hS(e)) { if ("selectionStart" in e) var n = { start: e.selectionStart, end: e.selectionEnd }; else e: { n = (n = e.ownerDocument) && n.defaultView || window; var r = n.getSelection && n.getSelection(); if (r && r.rangeCount !== 0) { n = r.anchorNode; var i = r.anchorOffset, s = r.focusNode; r = r.focusOffset; try { n.nodeType, s.nodeType } catch { n = null; break e } var c = 0, o = -1, f = -1, p = 0, v = 0, y = e, w = null; t: for (; ;) { for (var P; y !== n || i !== 0 && y.nodeType !== 3 || (o = c + i), y !== s || r !== 0 && y.nodeType !== 3 || (f = c + r), y.nodeType === 3 && (c += y.nodeValue.length), (P = y.firstChild) !== null;)w = y, y = P; for (; ;) { if (y === e) break t; if (w === n && ++p === i && (o = c), w === s && ++v === r && (f = c), (P = y.nextSibling) !== null) break; y = w, w = y.parentNode } y = P } n = o === -1 || f === -1 ? null : { start: o, end: f } } else n = null } n = n || { start: 0, end: 0 } } else n = null; for (Fb = { focusedElem: e, selectionRange: n }, ly = !1, En = t; En !== null;)if (t = En, e = t.child, (t.subtreeFlags & 1028) !== 0 && e !== null) e.return = t, En = e; else for (; En !== null;) { t = En; try { var k = t.alternate; if ((t.flags & 1024) !== 0) switch (t.tag) { case 0: case 11: case 15: break; case 1: if (k !== null) { var A = k.memoizedProps, N = k.memoizedState, R = t.stateNode, M = R.getSnapshotBeforeUpdate(t.elementType === t.type ? A : $a(t.type, A), N); R.__reactInternalSnapshotBeforeUpdate = M } break; case 3: var O = t.stateNode.containerInfo; O.nodeType === 1 ? O.textContent = "" : O.nodeType === 9 && O.documentElement && O.removeChild(O.documentElement); break; case 5: case 6: case 4: case 17: break; default: throw Error(Ht(163)) } } catch (z) { oi(t, t.return, z) } if (e = t.sibling, e !== null) { e.return = t.return, En = e; break } En = t.return } return k = lT, lT = !1, k } function sp(e, t, n) { var r = t.updateQueue; if (r = r !== null ? r.lastEffect : null, r !== null) { var i = r = r.next; do { if ((i.tag & e) === e) { var s = i.destroy; i.destroy = void 0, s !== void 0 && ew(t, n, s) } i = i.next } while (i !== r) } } function y0(e, t) { if (t = t.updateQueue, t = t !== null ? t.lastEffect : null, t !== null) { var n = t = t.next; do { if ((n.tag & e) === e) { var r = n.create; n.destroy = r() } n = n.next } while (n !== t) } } function tw(e) { var t = e.ref; if (t !== null) { var n = e.stateNode; switch (e.tag) { case 5: e = n; break; default: e = n }typeof t == "function" ? t(e) : t.current = e } } function BA(e) { var t = e.alternate; t !== null && (e.alternate = null, BA(t)), e.child = null, e.deletions = null, e.sibling = null, e.tag === 5 && (t = e.stateNode, t !== null && (delete t[us], delete t[Ap], delete t[Vb], delete t[kB], delete t[IB])), e.stateNode = null, e.return = null, e.dependencies = null, e.memoizedProps = null, e.memoizedState = null, e.pendingProps = null, e.stateNode = null, e.updateQueue = null } function VA(e) { return e.tag === 5 || e.tag === 3 || e.tag === 4 } function uT(e) { e: for (; ;) { for (; e.sibling === null;) { if (e.return === null || VA(e.return)) return null; e = e.return } for (e.sibling.return = e.return, e = e.sibling; e.tag !== 5 && e.tag !== 6 && e.tag !== 18;) { if (e.flags & 2 || e.child === null || e.tag === 4) continue e; e.child.return = e, e = e.child } if (!(e.flags & 2)) return e.stateNode } } function nw(e, t, n) { var r = e.tag; if (r === 5 || r === 6) e = e.stateNode, t ? n.nodeType === 8 ? n.parentNode.insertBefore(e, t) : n.insertBefore(e, t) : (n.nodeType === 8 ? (t = n.parentNode, t.insertBefore(e, n)) : (t = n, t.appendChild(e)), n = n._reactRootContainer, n != null || t.onclick !== null || (t.onclick = dy)); else if (r !== 4 && (e = e.child, e !== null)) for (nw(e, t, n), e = e.sibling; e !== null;)nw(e, t, n), e = e.sibling } function rw(e, t, n) { var r = e.tag; if (r === 5 || r === 6) e = e.stateNode, t ? n.insertBefore(e, t) : n.appendChild(e); else if (r !== 4 && (e = e.child, e !== null)) for (rw(e, t, n), e = e.sibling; e !== null;)rw(e, t, n), e = e.sibling } var Hi = null, Ba = !1; function Nl(e, t, n) { for (n = n.child; n !== null;)UA(e, t, n), n = n.sibling } function UA(e, t, n) { if (hs && typeof hs.onCommitFiberUnmount == "function") try { hs.onCommitFiberUnmount(c0, n) } catch { } switch (n.tag) { case 5: ro || Ad(n, t); case 6: var r = Hi, i = Ba; Hi = null, Nl(e, t, n), Hi = r, Ba = i, Hi !== null && (Ba ? (e = Hi, n = n.stateNode, e.nodeType === 8 ? e.parentNode.removeChild(n) : e.removeChild(n)) : Hi.removeChild(n.stateNode)); break; case 18: Hi !== null && (Ba ? (e = Hi, n = n.stateNode, e.nodeType === 8 ? Z_(e.parentNode, n) : e.nodeType === 1 && Z_(e, n), Tp(e)) : Z_(Hi, n.stateNode)); break; case 4: r = Hi, i = Ba, Hi = n.stateNode.containerInfo, Ba = !0, Nl(e, t, n), Hi = r, Ba = i; break; case 0: case 11: case 14: case 15: if (!ro && (r = n.updateQueue, r !== null && (r = r.lastEffect, r !== null))) { i = r = r.next; do { var s = i, c = s.destroy; s = s.tag, c !== void 0 && ((s & 2) !== 0 || (s & 4) !== 0) && ew(n, t, c), i = i.next } while (i !== r) } Nl(e, t, n); break; case 1: if (!ro && (Ad(n, t), r = n.stateNode, typeof r.componentWillUnmount == "function")) try { r.props = n.memoizedProps, r.state = n.memoizedState, r.componentWillUnmount() } catch (o) { oi(n, t, o) } Nl(e, t, n); break; case 21: Nl(e, t, n); break; case 22: n.mode & 1 ? (ro = (r = ro) || n.memoizedState !== null, Nl(e, t, n), ro = r) : Nl(e, t, n); break; default: Nl(e, t, n) } } function cT(e) { var t = e.updateQueue; if (t !== null) { e.updateQueue = null; var n = e.stateNode; n === null && (n = e.stateNode = new HB), t.forEach(function (r) { var i = t9.bind(null, e, r); n.has(r) || (n.add(r), r.then(i, i)) }) } } function Da(e, t) { var n = t.deletions; if (n !== null) for (var r = 0; r < n.length; r++) { var i = n[r]; try { var s = e, c = t, o = c; e: for (; o !== null;) { switch (o.tag) { case 5: Hi = o.stateNode, Ba = !1; break e; case 3: Hi = o.stateNode.containerInfo, Ba = !0; break e; case 4: Hi = o.stateNode.containerInfo, Ba = !0; break e }o = o.return } if (Hi === null) throw Error(Ht(160)); UA(s, c, i), Hi = null, Ba = !1; var f = i.alternate; f !== null && (f.return = null), i.return = null } catch (p) { oi(i, t, p) } } if (t.subtreeFlags & 12854) for (t = t.child; t !== null;)jA(t, e), t = t.sibling } function jA(e, t) { var n = e.alternate, r = e.flags; switch (e.tag) { case 0: case 11: case 14: case 15: if (Da(t, e), as(e), r & 4) { try { sp(3, e, e.return), y0(3, e) } catch (A) { oi(e, e.return, A) } try { sp(5, e, e.return) } catch (A) { oi(e, e.return, A) } } break; case 1: Da(t, e), as(e), r & 512 && n !== null && Ad(n, n.return); break; case 5: if (Da(t, e), as(e), r & 512 && n !== null && Ad(n, n.return), e.flags & 32) { var i = e.stateNode; try { Cp(i, "") } catch (A) { oi(e, e.return, A) } } if (r & 4 && (i = e.stateNode, i != null)) { var s = e.memoizedProps, c = n !== null ? n.memoizedProps : s, o = e.type, f = e.updateQueue; if (e.updateQueue = null, f !== null) try { o === "input" && s.type === "radio" && s.name != null && cM(i, s), Tb(o, c); var p = Tb(o, s); for (c = 0; c < f.length; c += 2) { var v = f[c], y = f[c + 1]; v === "style" ? mM(i, y) : v === "dangerouslySetInnerHTML" ? hM(i, y) : v === "children" ? Cp(i, y) : eS(i, v, y, p) } switch (o) { case "input": wb(i, s); break; case "textarea": dM(i, s); break; case "select": var w = i._wrapperState.wasMultiple; i._wrapperState.wasMultiple = !!s.multiple; var P = s.value; P != null ? $d(i, !!s.multiple, P, !1) : w !== !!s.multiple && (s.defaultValue != null ? $d(i, !!s.multiple, s.defaultValue, !0) : $d(i, !!s.multiple, s.multiple ? [] : "", !1)) }i[Ap] = s } catch (A) { oi(e, e.return, A) } } break; case 6: if (Da(t, e), as(e), r & 4) { if (e.stateNode === null) throw Error(Ht(162)); i = e.stateNode, s = e.memoizedProps; try { i.nodeValue = s } catch (A) { oi(e, e.return, A) } } break; case 3: if (Da(t, e), as(e), r & 4 && n !== null && n.memoizedState.isDehydrated) try { Tp(t.containerInfo) } catch (A) { oi(e, e.return, A) } break; case 4: Da(t, e), as(e); break; case 13: Da(t, e), as(e), i = e.child, i.flags & 8192 && (s = i.memoizedState !== null, i.stateNode.isHidden = s, !s || i.alternate !== null && i.alternate.memoizedState !== null || (NS = mi())), r & 4 && cT(e); break; case 22: if (v = n !== null && n.memoizedState !== null, e.mode & 1 ? (ro = (p = ro) || v, Da(t, e), ro = p) : Da(t, e), as(e), r & 8192) { if (p = e.memoizedState !== null, (e.stateNode.isHidden = p) && !v && (e.mode & 1) !== 0) for (En = e, v = e.child; v !== null;) { for (y = En = v; En !== null;) { switch (w = En, P = w.child, w.tag) { case 0: case 11: case 14: case 15: sp(4, w, w.return); break; case 1: Ad(w, w.return); var k = w.stateNode; if (typeof k.componentWillUnmount == "function") { r = w, n = w.return; try { t = r, k.props = t.memoizedProps, k.state = t.memoizedState, k.componentWillUnmount() } catch (A) { oi(r, n, A) } } break; case 5: Ad(w, w.return); break; case 22: if (w.memoizedState !== null) { fT(y); continue } }P !== null ? (P.return = w, En = P) : fT(y) } v = v.sibling } e: for (v = null, y = e; ;) { if (y.tag === 5) { if (v === null) { v = y; try { i = y.stateNode, p ? (s = i.style, typeof s.setProperty == "function" ? s.setProperty("display", "none", "important") : s.display = "none") : (o = y.stateNode, f = y.memoizedProps.style, c = f != null && f.hasOwnProperty("display") ? f.display : null, o.style.display = pM("display", c)) } catch (A) { oi(e, e.return, A) } } } else if (y.tag === 6) { if (v === null) try { y.stateNode.nodeValue = p ? "" : y.memoizedProps } catch (A) { oi(e, e.return, A) } } else if ((y.tag !== 22 && y.tag !== 23 || y.memoizedState === null || y === e) && y.child !== null) { y.child.return = y, y = y.child; continue } if (y === e) break e; for (; y.sibling === null;) { if (y.return === null || y.return === e) break e; v === y && (v = null), y = y.return } v === y && (v = null), y.sibling.return = y.return, y = y.sibling } } break; case 19: Da(t, e), as(e), r & 4 && cT(e); break; case 21: break; default: Da(t, e), as(e) } } function as(e) { var t = e.flags; if (t & 2) { try { e: { for (var n = e.return; n !== null;) { if (VA(n)) { var r = n; break e } n = n.return } throw Error(Ht(160)) } switch (r.tag) { case 5: var i = r.stateNode; r.flags & 32 && (Cp(i, ""), r.flags &= -33); var s = uT(e); rw(e, s, i); break; case 3: case 4: var c = r.stateNode.containerInfo, o = uT(e); nw(e, o, c); break; default: throw Error(Ht(161)) } } catch (f) { oi(e, e.return, f) } e.flags &= -3 } t & 4096 && (e.flags &= -4097) } function GB(e, t, n) { En = e, KA(e) } function KA(e, t, n) { for (var r = (e.mode & 1) !== 0; En !== null;) { var i = En, s = i.child; if (i.tag === 22 && r) { var c = i.memoizedState !== null || Qv; if (!c) { var o = i.alternate, f = o !== null && o.memoizedState !== null || ro; o = Qv; var p = ro; if (Qv = c, (ro = f) && !p) for (En = i; En !== null;)c = En, f = c.child, c.tag === 22 && c.memoizedState !== null ? hT(i) : f !== null ? (f.return = c, En = f) : hT(i); for (; s !== null;)En = s, KA(s), s = s.sibling; En = i, Qv = o, ro = p } dT(e) } else (i.subtreeFlags & 8772) !== 0 && s !== null ? (s.return = i, En = s) : dT(e) } } function dT(e) { for (; En !== null;) { var t = En; if ((t.flags & 8772) !== 0) { var n = t.alternate; try { if ((t.flags & 8772) !== 0) switch (t.tag) { case 0: case 11: case 15: ro || y0(5, t); break; case 1: var r = t.stateNode; if (t.flags & 4 && !ro) if (n === null) r.componentDidMount(); else { var i = t.elementType === t.type ? n.memoizedProps : $a(t.type, n.memoizedProps); r.componentDidUpdate(i, n.memoizedState, r.__reactInternalSnapshotBeforeUpdate) } var s = t.updateQueue; s !== null && qP(t, s, r); break; case 3: var c = t.updateQueue; if (c !== null) { if (n = null, t.child !== null) switch (t.child.tag) { case 5: n = t.child.stateNode; break; case 1: n = t.child.stateNode }qP(t, c, n) } break; case 5: var o = t.stateNode; if (n === null && t.flags & 4) { n = o; var f = t.memoizedProps; switch (t.type) { case "button": case "input": case "select": case "textarea": f.autoFocus && n.focus(); break; case "img": f.src && (n.src = f.src) } } break; case 6: break; case 4: break; case 12: break; case 13: if (t.memoizedState === null) { var p = t.alternate; if (p !== null) { var v = p.memoizedState; if (v !== null) { var y = v.dehydrated; y !== null && Tp(y) } } } break; case 19: case 17: case 21: case 22: case 23: case 25: break; default: throw Error(Ht(163)) }ro || t.flags & 512 && tw(t) } catch (w) { oi(t, t.return, w) } } if (t === e) { En = null; break } if (n = t.sibling, n !== null) { n.return = t.return, En = n; break } En = t.return } } function fT(e) { for (; En !== null;) { var t = En; if (t === e) { En = null; break } var n = t.sibling; if (n !== null) { n.return = t.return, En = n; break } En = t.return } } function hT(e) { for (; En !== null;) { var t = En; try { switch (t.tag) { case 0: case 11: case 15: var n = t.return; try { y0(4, t) } catch (f) { oi(t, n, f) } break; case 1: var r = t.stateNode; if (typeof r.componentDidMount == "function") { var i = t.return; try { r.componentDidMount() } catch (f) { oi(t, i, f) } } var s = t.return; try { tw(t) } catch (f) { oi(t, s, f) } break; case 5: var c = t.return; try { tw(t) } catch (f) { oi(t, c, f) } } } catch (f) { oi(t, t.return, f) } if (t === e) { En = null; break } var o = t.sibling; if (o !== null) { o.return = t.return, En = o; break } En = t.return } } var qB = Math.ceil, wy = ul.ReactCurrentDispatcher, MS = ul.ReactCurrentOwner, ba = ul.ReactCurrentBatchConfig, mr = 0, $i = null, Si = null, Wi = 0, Zo = 0, Nd = vu(0), Ii = 0, Fp = null, xc = 0, x0 = 0, AS = 0, lp = null, Ao = null, NS = 0, tf = 1 / 0, Vs = null, Cy = !1, iw = null, ru = null, Jv = !1, Wl = null, Sy = 0, up = 0, ow = null, Lg = -1, zg = 0; function _o() { return (mr & 6) !== 0 ? mi() : Lg !== -1 ? Lg : Lg = mi() } function iu(e) { return (e.mode & 1) === 0 ? 1 : (mr & 2) !== 0 && Wi !== 0 ? Wi & -Wi : MB.transition !== null ? (zg === 0 && (zg = TM()), zg) : (e = Er, e !== 0 || (e = window.event, e = e === void 0 ? 16 : OM(e.type)), e) } function Ka(e, t, n, r) { if (50 < up) throw up = 0, ow = null, Error(Ht(185)); im(e, n, r), ((mr & 2) === 0 || e !== $i) && (e === $i && ((mr & 2) === 0 && (x0 |= n), Ii === 4 && Kl(e, Wi)), Lo(e, r), n === 1 && mr === 0 && (t.mode & 1) === 0 && (tf = mi() + 500, m0 && gu())) } function Lo(e, t) { var n = e.callbackNode; M8(e, t); var r = sy(e, e === $i ? Wi : 0); if (r === 0) n !== null && wP(n), e.callbackNode = null, e.callbackPriority = 0; else if (t = r & -r, e.callbackPriority !== t) { if (n != null && wP(n), t === 1) e.tag === 0 ? RB(pT.bind(null, e)) : JM(pT.bind(null, e)), PB(function () { (mr & 6) === 0 && gu() }), n = null; else { switch (kM(r)) { case 1: n = oS; break; case 4: n = EM; break; case 16: n = ay; break; case 536870912: n = PM; break; default: n = ay }n = QA(n, HA.bind(null, e)) } e.callbackPriority = t, e.callbackNode = n } } function HA(e, t) { if (Lg = -1, zg = 0, (mr & 6) !== 0) throw Error(Ht(327)); var n = e.callbackNode; if (Kd() && e.callbackNode !== n) return null; var r = sy(e, e === $i ? Wi : 0); if (r === 0) return null; if ((r & 30) !== 0 || (r & e.expiredLanes) !== 0 || t) t = Ey(e, r); else { t = r; var i = mr; mr |= 2; var s = GA(); ($i !== e || Wi !== t) && (Vs = null, tf = mi() + 500, cc(e, t)); do try { YB(); break } catch (o) { WA(e, o) } while (1); yS(), wy.current = s, mr = i, Si !== null ? t = 0 : ($i = null, Wi = 0, t = Ii) } if (t !== 0) { if (t === 2 && (i = Ab(e), i !== 0 && (r = i, t = aw(e, i))), t === 1) throw n = Fp, cc(e, 0), Kl(e, r), Lo(e, mi()), n; if (t === 6) Kl(e, r); else { if (i = e.current.alternate, (r & 30) === 0 && !ZB(i) && (t = Ey(e, r), t === 2 && (s = Ab(e), s !== 0 && (r = s, t = aw(e, s))), t === 1)) throw n = Fp, cc(e, 0), Kl(e, r), Lo(e, mi()), n; switch (e.finishedWork = i, e.finishedLanes = r, t) { case 0: case 1: throw Error(Ht(345)); case 2: Zu(e, Ao, Vs); break; case 3: if (Kl(e, r), (r & 130023424) === r && (t = NS + 500 - mi(), 10 < t)) { if (sy(e, 0) !== 0) break; if (i = e.suspendedLanes, (i & r) !== r) { _o(), e.pingedLanes |= e.suspendedLanes & i; break } e.timeoutHandle = Bb(Zu.bind(null, e, Ao, Vs), t); break } Zu(e, Ao, Vs); break; case 4: if (Kl(e, r), (r & 4194240) === r) break; for (t = e.eventTimes, i = -1; 0 < r;) { var c = 31 - ja(r); s = 1 << c, c = t[c], c > i && (i = c), r &= ~s } if (r = i, r = mi() - r, r = (120 > r ? 120 : 480 > r ? 480 : 1080 > r ? 1080 : 1920 > r ? 1920 : 3e3 > r ? 3e3 : 4320 > r ? 4320 : 1960 * qB(r / 1960)) - r, 10 < r) { e.timeoutHandle = Bb(Zu.bind(null, e, Ao, Vs), r); break } Zu(e, Ao, Vs); break; case 5: Zu(e, Ao, Vs); break; default: throw Error(Ht(329)) } } } return Lo(e, mi()), e.callbackNode === n ? HA.bind(null, e) : null } function aw(e, t) { var n = lp; return e.current.memoizedState.isDehydrated && (cc(e, t).flags |= 256), e = Ey(e, t), e !== 2 && (t = Ao, Ao = n, t !== null && sw(t)), e } function sw(e) { Ao === null ? Ao = e : Ao.push.apply(Ao, e) } function ZB(e) { for (var t = e; ;) { if (t.flags & 16384) { var n = t.updateQueue; if (n !== null && (n = n.stores, n !== null)) for (var r = 0; r < n.length; r++) { var i = n[r], s = i.getSnapshot; i = i.value; try { if (!Wa(s(), i)) return !1 } catch { return !1 } } } if (n = t.child, t.subtreeFlags & 16384 && n !== null) n.return = t, t = n; else { if (t === e) break; for (; t.sibling === null;) { if (t.return === null || t.return === e) return !0; t = t.return } t.sibling.return = t.return, t = t.sibling } } return !0 } function Kl(e, t) { for (t &= ~AS, t &= ~x0, e.suspendedLanes |= t, e.pingedLanes &= ~t, e = e.expirationTimes; 0 < t;) { var n = 31 - ja(t), r = 1 << n; e[n] = -1, t &= ~r } } function pT(e) { if ((mr & 6) !== 0) throw Error(Ht(327)); Kd(); var t = sy(e, 0); if ((t & 1) === 0) return Lo(e, mi()), null; var n = Ey(e, t); if (e.tag !== 0 && n === 2) { var r = Ab(e); r !== 0 && (t = r, n = aw(e, r)) } if (n === 1) throw n = Fp, cc(e, 0), Kl(e, t), Lo(e, mi()), n; if (n === 6) throw Error(Ht(345)); return e.finishedWork = e.current.alternate, e.finishedLanes = t, Zu(e, Ao, Vs), Lo(e, mi()), null } function OS(e, t) { var n = mr; mr |= 1; try { return e(t) } finally { mr = n, mr === 0 && (tf = mi() + 500, m0 && gu()) } } function _c(e) { Wl !== null && Wl.tag === 0 && (mr & 6) === 0 && Kd(); var t = mr; mr |= 1; var n = ba.transition, r = Er; try { if (ba.transition = null, Er = 1, e) return e() } finally { Er = r, ba.transition = n, mr = t, (mr & 6) === 0 && gu() } } function DS() { Zo = Nd.current, Wr(Nd) } function cc(e, t) { e.finishedWork = null, e.finishedLanes = 0; var n = e.timeoutHandle; if (n !== -1 && (e.timeoutHandle = -1, EB(n)), Si !== null) for (n = Si.return; n !== null;) { var r = n; switch (mS(r), r.tag) { case 1: r = r.type.childContextTypes, r != null && fy(); break; case 3: Jd(), Wr(Oo), Wr(oo), SS(); break; case 5: CS(r); break; case 4: Jd(); break; case 13: Wr(Jr); break; case 19: Wr(Jr); break; case 10: xS(r.type._context); break; case 22: case 23: DS() }n = n.return } if ($i = e, Si = e = ou(e.current, null), Wi = Zo = t, Ii = 0, Fp = null, AS = x0 = xc = 0, Ao = lp = null, nc !== null) { for (t = 0; t < nc.length; t++)if (n = nc[t], r = n.interleaved, r !== null) { n.interleaved = null; var i = r.next, s = n.pending; if (s !== null) { var c = s.next; s.next = i, r.next = c } n.pending = r } nc = null } return e } function WA(e, t) { do { var n = Si; try { if (yS(), Ng.current = by, _y) { for (var r = ei.memoizedState; r !== null;) { var i = r.queue; i !== null && (i.pending = null), r = r.next } _y = !1 } if (yc = 0, Fi = ki = ei = null, ap = !1, Dp = 0, MS.current = null, n === null || n.return === null) { Ii = 1, Fp = t, Si = null; break } e: { var s = e, c = n.return, o = n, f = t; if (t = Wi, o.flags |= 32768, f !== null && typeof f == "object" && typeof f.then == "function") { var p = f, v = o, y = v.tag; if ((v.mode & 1) === 0 && (y === 0 || y === 11 || y === 15)) { var w = v.alternate; w ? (v.updateQueue = w.updateQueue, v.memoizedState = w.memoizedState, v.lanes = w.lanes) : (v.updateQueue = null, v.memoizedState = null) } var P = tT(c); if (P !== null) { P.flags &= -257, nT(P, c, o, s, t), P.mode & 1 && eT(s, p, t), t = P, f = p; var k = t.updateQueue; if (k === null) { var A = new Set; A.add(f), t.updateQueue = A } else k.add(f); break e } else { if ((t & 1) === 0) { eT(s, p, t), LS(); break e } f = Error(Ht(426)) } } else if (Yr && o.mode & 1) { var N = tT(c); if (N !== null) { (N.flags & 65536) === 0 && (N.flags |= 256), nT(N, c, o, s, t), vS(ef(f, o)); break e } } s = f = ef(f, o), Ii !== 4 && (Ii = 2), lp === null ? lp = [s] : lp.push(s), s = c; do { switch (s.tag) { case 3: s.flags |= 65536, t &= -t, s.lanes |= t; var R = IA(s, f, t); GP(s, R); break e; case 1: o = f; var M = s.type, O = s.stateNode; if ((s.flags & 128) === 0 && (typeof M.getDerivedStateFromError == "function" || O !== null && typeof O.componentDidCatch == "function" && (ru === null || !ru.has(O)))) { s.flags |= 65536, t &= -t, s.lanes |= t; var z = RA(s, o, t); GP(s, z); break e } }s = s.return } while (s !== null) } ZA(n) } catch (B) { t = B, Si === n && n !== null && (Si = n = n.return); continue } break } while (1) } function GA() { var e = wy.current; return wy.current = by, e === null ? by : e } function LS() { (Ii === 0 || Ii === 3 || Ii === 2) && (Ii = 4), $i === null || (xc & 268435455) === 0 && (x0 & 268435455) === 0 || Kl($i, Wi) } function Ey(e, t) { var n = mr; mr |= 2; var r = GA(); ($i !== e || Wi !== t) && (Vs = null, cc(e, t)); do try { XB(); break } catch (i) { WA(e, i) } while (1); if (yS(), mr = n, wy.current = r, Si !== null) throw Error(Ht(261)); return $i = null, Wi = 0, Ii } function XB() { for (; Si !== null;)qA(Si) } function YB() { for (; Si !== null && !w8();)qA(Si) } function qA(e) { var t = YA(e.alternate, e, Zo); e.memoizedProps = e.pendingProps, t === null ? ZA(e) : Si = t, MS.current = null } function ZA(e) { var t = e; do { var n = t.alternate; if (e = t.return, (t.flags & 32768) === 0) { if (n = jB(n, t, Zo), n !== null) { Si = n; return } } else { if (n = KB(n, t), n !== null) { n.flags &= 32767, Si = n; return } if (e !== null) e.flags |= 32768, e.subtreeFlags = 0, e.deletions = null; else { Ii = 6, Si = null; return } } if (t = t.sibling, t !== null) { Si = t; return } Si = t = e } while (t !== null); Ii === 0 && (Ii = 5) } function Zu(e, t, n) { var r = Er, i = ba.transition; try { ba.transition = null, Er = 1, QB(e, t, n, r) } finally { ba.transition = i, Er = r } return null } function QB(e, t, n, r) { do Kd(); while (Wl !== null); if ((mr & 6) !== 0) throw Error(Ht(327)); n = e.finishedWork; var i = e.finishedLanes; if (n === null) return null; if (e.finishedWork = null, e.finishedLanes = 0, n === e.current) throw Error(Ht(177)); e.callbackNode = null, e.callbackPriority = 0; var s = n.lanes | n.childLanes; if (A8(e, s), e === $i && (Si = $i = null, Wi = 0), (n.subtreeFlags & 2064) === 0 && (n.flags & 2064) === 0 || Jv || (Jv = !0, QA(ay, function () { return Kd(), null })), s = (n.flags & 15990) !== 0, (n.subtreeFlags & 15990) !== 0 || s) { s = ba.transition, ba.transition = null; var c = Er; Er = 1; var o = mr; mr |= 4, MS.current = null, WB(e, n), jA(n, e), yB(Fb), ly = !!zb, Fb = zb = null, e.current = n, GB(n), C8(), mr = o, Er = c, ba.transition = s } else e.current = n; if (Jv && (Jv = !1, Wl = e, Sy = i), s = e.pendingLanes, s === 0 && (ru = null), P8(n.stateNode), Lo(e, mi()), t !== null) for (r = e.onRecoverableError, n = 0; n < t.length; n++)i = t[n], r(i.value, { componentStack: i.stack, digest: i.digest }); if (Cy) throw Cy = !1, e = iw, iw = null, e; return (Sy & 1) !== 0 && e.tag !== 0 && Kd(), s = e.pendingLanes, (s & 1) !== 0 ? e === ow ? up++ : (up = 0, ow = e) : up = 0, gu(), null } function Kd() { if (Wl !== null) { var e = kM(Sy), t = ba.transition, n = Er; try { if (ba.transition = null, Er = 16 > e ? 16 : e, Wl === null) var r = !1; else { if (e = Wl, Wl = null, Sy = 0, (mr & 6) !== 0) throw Error(Ht(331)); var i = mr; for (mr |= 4, En = e.current; En !== null;) { var s = En, c = s.child; if ((En.flags & 16) !== 0) { var o = s.deletions; if (o !== null) { for (var f = 0; f < o.length; f++) { var p = o[f]; for (En = p; En !== null;) { var v = En; switch (v.tag) { case 0: case 11: case 15: sp(8, v, s) }var y = v.child; if (y !== null) y.return = v, En = y; else for (; En !== null;) { v = En; var w = v.sibling, P = v.return; if (BA(v), v === p) { En = null; break } if (w !== null) { w.return = P, En = w; break } En = P } } } var k = s.alternate; if (k !== null) { var A = k.child; if (A !== null) { k.child = null; do { var N = A.sibling; A.sibling = null, A = N } while (A !== null) } } En = s } } if ((s.subtreeFlags & 2064) !== 0 && c !== null) c.return = s, En = c; else e: for (; En !== null;) { if (s = En, (s.flags & 2048) !== 0) switch (s.tag) { case 0: case 11: case 15: sp(9, s, s.return) }var R = s.sibling; if (R !== null) { R.return = s.return, En = R; break e } En = s.return } } var M = e.current; for (En = M; En !== null;) { c = En; var O = c.child; if ((c.subtreeFlags & 2064) !== 0 && O !== null) O.return = c, En = O; else e: for (c = M; En !== null;) { if (o = En, (o.flags & 2048) !== 0) try { switch (o.tag) { case 0: case 11: case 15: y0(9, o) } } catch (B) { oi(o, o.return, B) } if (o === c) { En = null; break e } var z = o.sibling; if (z !== null) { z.return = o.return, En = z; break e } En = o.return } } if (mr = i, gu(), hs && typeof hs.onPostCommitFiberRoot == "function") try { hs.onPostCommitFiberRoot(c0, e) } catch { } r = !0 } return r } finally { Er = n, ba.transition = t } } return !1 } function mT(e, t, n) { t = ef(n, t), t = IA(e, t, 1), e = nu(e, t, 1), t = _o(), e !== null && (im(e, 1, t), Lo(e, t)) } function oi(e, t, n) { if (e.tag === 3) mT(e, e, n); else for (; t !== null;) { if (t.tag === 3) { mT(t, e, n); break } else if (t.tag === 1) { var r = t.stateNode; if (typeof t.type.getDerivedStateFromError == "function" || typeof r.componentDidCatch == "function" && (ru === null || !ru.has(r))) { e = ef(n, e), e = RA(t, e, 1), t = nu(t, e, 1), e = _o(), t !== null && (im(t, 1, e), Lo(t, e)); break } } t = t.return } } function JB(e, t, n) { var r = e.pingCache; r !== null && r.delete(t), t = _o(), e.pingedLanes |= e.suspendedLanes & n, $i === e && (Wi & n) === n && (Ii === 4 || Ii === 3 && (Wi & 130023424) === Wi && 500 > mi() - NS ? cc(e, 0) : AS |= n), Lo(e, t) } function XA(e, t) { t === 0 && ((e.mode & 1) === 0 ? t = 1 : (t = jv, jv <<= 1, (jv & 130023424) === 0 && (jv = 4194304))); var n = _o(); e = rl(e, t), e !== null && (im(e, t, n), Lo(e, n)) } function e9(e) { var t = e.memoizedState, n = 0; t !== null && (n = t.retryLane), XA(e, n) } function t9(e, t) { var n = 0; switch (e.tag) { case 13: var r = e.stateNode, i = e.memoizedState; i !== null && (n = i.retryLane); break; case 19: r = e.stateNode; break; default: throw Error(Ht(314)) }r !== null && r.delete(t), XA(e, n) } var YA; YA = function (e, t, n) { if (e !== null) if (e.memoizedProps !== t.pendingProps || Oo.current) No = !0; else { if ((e.lanes & n) === 0 && (t.flags & 128) === 0) return No = !1, UB(e, t, n); No = (e.flags & 131072) !== 0 } else No = !1, Yr && (t.flags & 1048576) !== 0 && eA(t, my, t.index); switch (t.lanes = 0, t.tag) { case 2: var r = t.type; Dg(e, t), e = t.pendingProps; var i = Xd(t, oo.current); jd(t, n), i = PS(null, t, r, e, i, n); var s = TS(); return t.flags |= 1, typeof i == "object" && i !== null && typeof i.render == "function" && i.$$typeof === void 0 ? (t.tag = 1, t.memoizedState = null, t.updateQueue = null, Do(r) ? (s = !0, hy(t)) : s = !1, t.memoizedState = i.state !== null && i.state !== void 0 ? i.state : null, bS(t), i.updater = v0, t.stateNode = i, i._reactInternals = t, Gb(t, r, e, n), t = Xb(null, t, r, !0, s, n)) : (t.tag = 0, Yr && s && pS(t), yo(null, t, i, n), t = t.child), t; case 16: r = t.elementType; e: { switch (Dg(e, t), e = t.pendingProps, i = r._init, r = i(r._payload), t.type = r, i = t.tag = r9(r), e = $a(r, e), i) { case 0: t = Zb(null, t, r, e, n); break e; case 1: t = oT(null, t, r, e, n); break e; case 11: t = rT(null, t, r, e, n); break e; case 14: t = iT(null, t, r, $a(r.type, e), n); break e }throw Error(Ht(306, r, "")) } return t; case 0: return r = t.type, i = t.pendingProps, i = t.elementType === r ? i : $a(r, i), Zb(e, t, r, i, n); case 1: return r = t.type, i = t.pendingProps, i = t.elementType === r ? i : $a(r, i), oT(e, t, r, i, n); case 3: e: { if (OA(t), e === null) throw Error(Ht(387)); r = t.pendingProps, s = t.memoizedState, i = s.element, iA(e, t), yy(t, r, null, n); var c = t.memoizedState; if (r = c.element, s.isDehydrated) if (s = { element: r, isDehydrated: !1, cache: c.cache, pendingSuspenseBoundaries: c.pendingSuspenseBoundaries, transitions: c.transitions }, t.updateQueue.baseState = s, t.memoizedState = s, t.flags & 256) { i = ef(Error(Ht(423)), t), t = aT(e, t, r, n, i); break e } else if (r !== i) { i = ef(Error(Ht(424)), t), t = aT(e, t, r, n, i); break e } else for (Xo = tu(t.stateNode.containerInfo.firstChild), Qo = t, Yr = !0, Va = null, n = lA(t, null, r, n), t.child = n; n;)n.flags = n.flags & -3 | 4096, n = n.sibling; else { if (Yd(), r === i) { t = il(e, t, n); break e } yo(e, t, r, n) } t = t.child } return t; case 5: return uA(t), e === null && Kb(t), r = t.type, i = t.pendingProps, s = e !== null ? e.memoizedProps : null, c = i.children, $b(r, i) ? c = null : s !== null && $b(r, s) && (t.flags |= 32), NA(e, t), yo(e, t, c, n), t.child; case 6: return e === null && Kb(t), null; case 13: return DA(e, t, n); case 4: return wS(t, t.stateNode.containerInfo), r = t.pendingProps, e === null ? t.child = Qd(t, null, r, n) : yo(e, t, r, n), t.child; case 11: return r = t.type, i = t.pendingProps, i = t.elementType === r ? i : $a(r, i), rT(e, t, r, i, n); case 7: return yo(e, t, t.pendingProps, n), t.child; case 8: return yo(e, t, t.pendingProps.children, n), t.child; case 12: return yo(e, t, t.pendingProps.children, n), t.child; case 10: e: { if (r = t.type._context, i = t.pendingProps, s = t.memoizedProps, c = i.value, jr(vy, r._currentValue), r._currentValue = c, s !== null) if (Wa(s.value, c)) { if (s.children === i.children && !Oo.current) { t = il(e, t, n); break e } } else for (s = t.child, s !== null && (s.return = t); s !== null;) { var o = s.dependencies; if (o !== null) { c = s.child; for (var f = o.firstContext; f !== null;) { if (f.context === r) { if (s.tag === 1) { f = Ys(-1, n & -n), f.tag = 2; var p = s.updateQueue; if (p !== null) { p = p.shared; var v = p.pending; v === null ? f.next = f : (f.next = v.next, v.next = f), p.pending = f } } s.lanes |= n, f = s.alternate, f !== null && (f.lanes |= n), Hb(s.return, n, t), o.lanes |= n; break } f = f.next } } else if (s.tag === 10) c = s.type === t.type ? null : s.child; else if (s.tag === 18) { if (c = s.return, c === null) throw Error(Ht(341)); c.lanes |= n, o = c.alternate, o !== null && (o.lanes |= n), Hb(c, n, t), c = s.sibling } else c = s.child; if (c !== null) c.return = s; else for (c = s; c !== null;) { if (c === t) { c = null; break } if (s = c.sibling, s !== null) { s.return = c.return, c = s; break } c = c.return } s = c } yo(e, t, i.children, n), t = t.child } return t; case 9: return i = t.type, r = t.pendingProps.children, jd(t, n), i = wa(i), r = r(i), t.flags |= 1, yo(e, t, r, n), t.child; case 14: return r = t.type, i = $a(r, t.pendingProps), i = $a(r.type, i), iT(e, t, r, i, n); case 15: return MA(e, t, t.type, t.pendingProps, n); case 17: return r = t.type, i = t.pendingProps, i = t.elementType === r ? i : $a(r, i), Dg(e, t), t.tag = 1, Do(r) ? (e = !0, hy(t)) : e = !1, jd(t, n), aA(t, r, i), Gb(t, r, i, n), Xb(null, t, r, !0, e, n); case 19: return LA(e, t, n); case 22: return AA(e, t, n) }throw Error(Ht(156, t.tag)) }; function QA(e, t) { return SM(e, t) } function n9(e, t, n, r) { this.tag = e, this.key = n, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = t, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = r, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null } function _a(e, t, n, r) { return new n9(e, t, n, r) } function zS(e) { return e = e.prototype, !(!e || !e.isReactComponent) } function r9(e) { if (typeof e == "function") return zS(e) ? 1 : 0; if (e != null) { if (e = e.$$typeof, e === nS) return 11; if (e === rS) return 14 } return 2 } function ou(e, t) { var n = e.alternate; return n === null ? (n = _a(e.tag, t, e.key, e.mode), n.elementType = e.elementType, n.type = e.type, n.stateNode = e.stateNode, n.alternate = e, e.alternate = n) : (n.pendingProps = t, n.type = e.type, n.flags = 0, n.subtreeFlags = 0, n.deletions = null), n.flags = e.flags & 14680064, n.childLanes = e.childLanes, n.lanes = e.lanes, n.child = e.child, n.memoizedProps = e.memoizedProps, n.memoizedState = e.memoizedState, n.updateQueue = e.updateQueue, t = e.dependencies, n.dependencies = t === null ? null : { lanes: t.lanes, firstContext: t.firstContext }, n.sibling = e.sibling, n.index = e.index, n.ref = e.ref, n } function Fg(e, t, n, r, i, s) { var c = 2; if (r = e, typeof e == "function") zS(e) && (c = 1); else if (typeof e == "string") c = 5; else e: switch (e) { case Cd: return dc(n.children, i, s, t); case tS: c = 8, i |= 8; break; case gb: return e = _a(12, n, t, i | 2), e.elementType = gb, e.lanes = s, e; case yb: return e = _a(13, n, t, i), e.elementType = yb, e.lanes = s, e; case xb: return e = _a(19, n, t, i), e.elementType = xb, e.lanes = s, e; case sM: return _0(n, i, s, t); default: if (typeof e == "object" && e !== null) switch (e.$$typeof) { case oM: c = 10; break e; case aM: c = 9; break e; case nS: c = 11; break e; case rS: c = 14; break e; case Bl: c = 16, r = null; break e }throw Error(Ht(130, e == null ? e : typeof e, "")) }return t = _a(c, n, t, i), t.elementType = e, t.type = r, t.lanes = s, t } function dc(e, t, n, r) { return e = _a(7, e, r, t), e.lanes = n, e } function _0(e, t, n, r) { return e = _a(22, e, r, t), e.elementType = sM, e.lanes = n, e.stateNode = { isHidden: !1 }, e } function r1(e, t, n) { return e = _a(6, e, null, t), e.lanes = n, e } function i1(e, t, n) { return t = _a(4, e.children !== null ? e.children : [], e.key, t), t.lanes = n, t.stateNode = { containerInfo: e.containerInfo, pendingChildren: null, implementation: e.implementation }, t } function i9(e, t, n, r, i) { this.tag = t, this.containerInfo = e, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = F_(0), this.expirationTimes = F_(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = F_(0), this.identifierPrefix = r, this.onRecoverableError = i, this.mutableSourceEagerHydrationData = null } function FS(e, t, n, r, i, s, c, o, f) { return e = new i9(e, t, n, o, f), t === 1 ? (t = 1, s === !0 && (t |= 8)) : t = 0, s = _a(3, null, null, t), e.current = s, s.stateNode = e, s.memoizedState = { element: r, isDehydrated: n, cache: null, transitions: null, pendingSuspenseBoundaries: null }, bS(s), e } function o9(e, t, n) { var r = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null; return { $$typeof: wd, key: r == null ? null : "" + r, children: e, containerInfo: t, implementation: n } } function JA(e) { if (!e) return lu; e = e._reactInternals; e: { if (kc(e) !== e || e.tag !== 1) throw Error(Ht(170)); var t = e; do { switch (t.tag) { case 3: t = t.stateNode.context; break e; case 1: if (Do(t.type)) { t = t.stateNode.__reactInternalMemoizedMergedChildContext; break e } }t = t.return } while (t !== null); throw Error(Ht(171)) } if (e.tag === 1) { var n = e.type; if (Do(n)) return QM(e, n, t) } return t } function eN(e, t, n, r, i, s, c, o, f) { return e = FS(n, r, !0, e, i, s, c, o, f), e.context = JA(null), n = e.current, r = _o(), i = iu(n), s = Ys(r, i), s.callback = t != null ? t : null, nu(n, s, i), e.current.lanes = i, im(e, i, r), Lo(e, r), e } function b0(e, t, n, r) { var i = t.current, s = _o(), c = iu(i); return n = JA(n), t.context === null ? t.context = n : t.pendingContext = n, t = Ys(s, c), t.payload = { element: e }, r = r === void 0 ? null : r, r !== null && (t.callback = r), e = nu(i, t, c), e !== null && (Ka(e, i, c, s), Ag(e, i, c)), c } function Py(e) { if (e = e.current, !e.child) return null; switch (e.child.tag) { case 5: return e.child.stateNode; default: return e.child.stateNode } } function vT(e, t) { if (e = e.memoizedState, e !== null && e.dehydrated !== null) { var n = e.retryLane; e.retryLane = n !== 0 && n < t ? n : t } } function $S(e, t) { vT(e, t), (e = e.alternate) && vT(e, t) } function a9() { return null } var tN = typeof reportError == "function" ? reportError : function (e) { console.error(e) }; function BS(e) { this._internalRoot = e } w0.prototype.render = BS.prototype.render = function (e) { var t = this._internalRoot; if (t === null) throw Error(Ht(409)); b0(e, t, null, null) }; w0.prototype.unmount = BS.prototype.unmount = function () { var e = this._internalRoot; if (e !== null) { this._internalRoot = null; var t = e.containerInfo; _c(function () { b0(null, e, null, null) }), t[nl] = null } }; function w0(e) { this._internalRoot = e } w0.prototype.unstable_scheduleHydration = function (e) { if (e) { var t = MM(); e = { blockedOn: null, target: e, priority: t }; for (var n = 0; n < jl.length && t !== 0 && t < jl[n].priority; n++); jl.splice(n, 0, e), n === 0 && NM(e) } }; function VS(e) { return !(!e || e.nodeType !== 1 && e.nodeType !== 9 && e.nodeType !== 11) } function C0(e) { return !(!e || e.nodeType !== 1 && e.nodeType !== 9 && e.nodeType !== 11 && (e.nodeType !== 8 || e.nodeValue !== " react-mount-point-unstable ")) } function gT() { } function s9(e, t, n, r, i) { if (i) { if (typeof r == "function") { var s = r; r = function () { var p = Py(c); s.call(p) } } var c = eN(t, r, e, 0, null, !1, !1, "", gT); return e._reactRootContainer = c, e[nl] = c.current, Rp(e.nodeType === 8 ? e.parentNode : e), _c(), c } for (; i = e.lastChild;)e.removeChild(i); if (typeof r == "function") { var o = r; r = function () { var p = Py(f); o.call(p) } } var f = FS(e, 0, !1, null, null, !1, !1, "", gT); return e._reactRootContainer = f, e[nl] = f.current, Rp(e.nodeType === 8 ? e.parentNode : e), _c(function () { b0(t, f, n, r) }), f } function S0(e, t, n, r, i) { var s = n._reactRootContainer; if (s) { var c = s; if (typeof i == "function") { var o = i; i = function () { var f = Py(c); o.call(f) } } b0(t, c, e, i) } else c = s9(n, t, e, i, r); return Py(c) } IM = function (e) { switch (e.tag) { case 3: var t = e.stateNode; if (t.current.memoizedState.isDehydrated) { var n = Zh(t.pendingLanes); n !== 0 && (aS(t, n | 1), Lo(t, mi()), (mr & 6) === 0 && (tf = mi() + 500, gu())) } break; case 13: _c(function () { var r = rl(e, 1); if (r !== null) { var i = _o(); Ka(r, e, 1, i) } }), $S(e, 1) } }; sS = function (e) { if (e.tag === 13) { var t = rl(e, 134217728); if (t !== null) { var n = _o(); Ka(t, e, 134217728, n) } $S(e, 134217728) } }; RM = function (e) { if (e.tag === 13) { var t = iu(e), n = rl(e, t); if (n !== null) { var r = _o(); Ka(n, e, t, r) } $S(e, t) } }; MM = function () { return Er }; AM = function (e, t) { var n = Er; try { return Er = e, t() } finally { Er = n } }; Ib = function (e, t, n) { switch (t) { case "input": if (wb(e, n), t = n.name, n.type === "radio" && t != null) { for (n = e; n.parentNode;)n = n.parentNode; for (n = n.querySelectorAll("input[name=" + JSON.stringify("" + t) + '][type="radio"]'), t = 0; t < n.length; t++) { var r = n[t]; if (r !== e && r.form === e.form) { var i = p0(r); if (!i) throw Error(Ht(90)); uM(r), wb(r, i) } } } break; case "textarea": dM(e, n); break; case "select": t = n.value, t != null && $d(e, !!n.multiple, t, !1) } }; yM = OS; xM = _c; var l9 = { usingClientEntryPoint: !1, Events: [am, Td, p0, vM, gM, OS] }, zh = { findFiberByHostInstance: tc, bundleType: 0, version: "18.2.0", rendererPackageName: "react-dom" }, u9 = { bundleType: zh.bundleType, version: zh.version, rendererPackageName: zh.rendererPackageName, rendererConfig: zh.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: ul.ReactCurrentDispatcher, findHostInstanceByFiber: function (e) { return e = wM(e), e === null ? null : e.stateNode }, findFiberByHostInstance: zh.findFiberByHostInstance || a9, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.2.0-next-9e3b772b8-20220608" }; if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") { var eg = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (!eg.isDisabled && eg.supportsFiber) try { c0 = eg.inject(u9), hs = eg } catch { } } ta.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = l9; ta.createPortal = function (e, t) { var n = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null; if (!VS(t)) throw Error(Ht(200)); return o9(e, t, null, n) }; ta.createRoot = function (e, t) { if (!VS(e)) throw Error(Ht(299)); var n = !1, r = "", i = tN; return t != null && (t.unstable_strictMode === !0 && (n = !0), t.identifierPrefix !== void 0 && (r = t.identifierPrefix), t.onRecoverableError !== void 0 && (i = t.onRecoverableError)), t = FS(e, 1, !1, null, null, n, !1, r, i), e[nl] = t.current, Rp(e.nodeType === 8 ? e.parentNode : e), new BS(t) }; ta.findDOMNode = function (e) { if (e == null) return null; if (e.nodeType === 1) return e; var t = e._reactInternals; if (t === void 0) throw typeof e.render == "function" ? Error(Ht(188)) : (e = Object.keys(e).join(","), Error(Ht(268, e))); return e = wM(t), e = e === null ? null : e.stateNode, e }; ta.flushSync = function (e) { return _c(e) }; ta.hydrate = function (e, t, n) { if (!C0(t)) throw Error(Ht(200)); return S0(null, e, t, !0, n) }; ta.hydrateRoot = function (e, t, n) { if (!VS(e)) throw Error(Ht(405)); var r = n != null && n.hydratedSources || null, i = !1, s = "", c = tN; if (n != null && (n.unstable_strictMode === !0 && (i = !0), n.identifierPrefix !== void 0 && (s = n.identifierPrefix), n.onRecoverableError !== void 0 && (c = n.onRecoverableError)), t = eN(t, null, e, 1, n != null ? n : null, i, !1, s, c), e[nl] = t.current, Rp(e), r) for (e = 0; e < r.length; e++)n = r[e], i = n._getVersion, i = i(n._source), t.mutableSourceEagerHydrationData == null ? t.mutableSourceEagerHydrationData = [n, i] : t.mutableSourceEagerHydrationData.push(n, i); return new w0(t) }; ta.render = function (e, t, n) { if (!C0(t)) throw Error(Ht(200)); return S0(null, e, t, !1, n) }; ta.unmountComponentAtNode = function (e) { if (!C0(e)) throw Error(Ht(40)); return e._reactRootContainer ? (_c(function () { S0(null, null, e, !1, function () { e._reactRootContainer = null, e[nl] = null }) }), !0) : !1 }; ta.unstable_batchedUpdates = OS; ta.unstable_renderSubtreeIntoContainer = function (e, t, n, r) { if (!C0(n)) throw Error(Ht(200)); if (e == null || e._reactInternals === void 0) throw Error(Ht(38)); return S0(e, t, n, !1, r) }; ta.version = "18.2.0-next-9e3b772b8-20220608"; (function (e) { function t() { if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) try { __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t) } catch (n) { console.error(n) } } t(), e.exports = ta })(pu); const bc = GC(pu.exports), c9 = GR({ __proto__: null, default: bc }, [pu.exports]); var yT = pu.exports; mb.createRoot = yT.createRoot, mb.hydrateRoot = yT.hydrateRoot;/**
|
|
|
* @remix-run/router v1.3.2
|
|
|
*
|
|
|
* Copyright (c) Remix Software Inc.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE.md file in the root directory of this source tree.
|
|
|
*
|
|
|
* @license MIT
|
|
|
*/function $p() { return $p = Object.assign ? Object.assign.bind() : function (e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]) } return e }, $p.apply(this, arguments) } var Gl; (function (e) { e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE" })(Gl || (Gl = {})); const xT = "popstate"; function d9(e) { e === void 0 && (e = {}); function t(r, i) { let { pathname: s, search: c, hash: o } = r.location; return lw("", { pathname: s, search: c, hash: o }, i.state && i.state.usr || null, i.state && i.state.key || "default") } function n(r, i) { return typeof i == "string" ? i : nN(i) } return h9(t, n, null, e) } function Ri(e, t) { if (e === !1 || e === null || typeof e > "u") throw new Error(t) } function f9() { return Math.random().toString(36).substr(2, 8) } function _T(e, t) { return { usr: e.state, key: e.key, idx: t } } function lw(e, t, n, r) { return n === void 0 && (n = null), $p({ pathname: typeof e == "string" ? e : e.pathname, search: "", hash: "" }, typeof t == "string" ? xf(t) : t, { state: n, key: t && t.key || r || f9() }) } function nN(e) { let { pathname: t = "/", search: n = "", hash: r = "" } = e; return n && n !== "?" && (t += n.charAt(0) === "?" ? n : "?" + n), r && r !== "#" && (t += r.charAt(0) === "#" ? r : "#" + r), t } function xf(e) { let t = {}; if (e) { let n = e.indexOf("#"); n >= 0 && (t.hash = e.substr(n), e = e.substr(0, n)); let r = e.indexOf("?"); r >= 0 && (t.search = e.substr(r), e = e.substr(0, r)), e && (t.pathname = e) } return t } function h9(e, t, n, r) { r === void 0 && (r = {}); let { window: i = document.defaultView, v5Compat: s = !1 } = r, c = i.history, o = Gl.Pop, f = null, p = v(); p == null && (p = 0, c.replaceState($p({}, c.state, { idx: p }), "")); function v() { return (c.state || { idx: null }).idx } function y() { o = Gl.Pop; let N = v(), R = N == null ? null : N - p; p = N, f && f({ action: o, location: A.location, delta: R }) } function w(N, R) { o = Gl.Push; let M = lw(A.location, N, R); n && n(M, N), p = v() + 1; let O = _T(M, p), z = A.createHref(M); try { c.pushState(O, "", z) } catch { i.location.assign(z) } s && f && f({ action: o, location: A.location, delta: 1 }) } function P(N, R) { o = Gl.Replace; let M = lw(A.location, N, R); n && n(M, N), p = v(); let O = _T(M, p), z = A.createHref(M); c.replaceState(O, "", z), s && f && f({ action: o, location: A.location, delta: 0 }) } function k(N) { let R = i.location.origin !== "null" ? i.location.origin : i.location.href, M = typeof N == "string" ? N : nN(N); return Ri(R, "No window.location.(origin|href) available to create URL for href: " + M), new URL(M, R) } let A = { get action() { return o }, get location() { return e(i, c) }, listen(N) { if (f) throw new Error("A history only accepts one active listener"); return i.addEventListener(xT, y), f = N, () => { i.removeEventListener(xT, y), f = null } }, createHref(N) { return t(i, N) }, createURL: k, encodeLocation(N) { let R = k(N); return { pathname: R.pathname, search: R.search, hash: R.hash } }, push: w, replace: P, go(N) { return c.go(N) } }; return A } var bT; (function (e) { e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error" })(bT || (bT = {})); function p9(e, t, n) { n === void 0 && (n = "/"); let r = typeof t == "string" ? xf(t) : t, i = oN(r.pathname || "/", n); if (i == null) return null; let s = rN(e); m9(s); let c = null; for (let o = 0; c == null && o < s.length; ++o)c = S9(s[o], T9(i)); return c } function rN(e, t, n, r) { t === void 0 && (t = []), n === void 0 && (n = []), r === void 0 && (r = ""); let i = (s, c, o) => { let f = { relativePath: o === void 0 ? s.path || "" : o, caseSensitive: s.caseSensitive === !0, childrenIndex: c, route: s }; f.relativePath.startsWith("/") && (Ri(f.relativePath.startsWith(r), 'Absolute route path "' + f.relativePath + '" nested under path ' + ('"' + r + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."), f.relativePath = f.relativePath.slice(r.length)); let p = fc([r, f.relativePath]), v = n.concat(f); s.children && s.children.length > 0 && (Ri(s.index !== !0, "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + p + '".')), rN(s.children, t, v, p)), !(s.path == null && !s.index) && t.push({ path: p, score: w9(p, s.index), routesMeta: v }) }; return e.forEach((s, c) => { var o; if (s.path === "" || !((o = s.path) != null && o.includes("?"))) i(s, c); else for (let f of iN(s.path)) i(s, c, f) }), t } function iN(e) { let t = e.split("/"); if (t.length === 0) return []; let [n, ...r] = t, i = n.endsWith("?"), s = n.replace(/\?$/, ""); if (r.length === 0) return i ? [s, ""] : [s]; let c = iN(r.join("/")), o = []; return o.push(...c.map(f => f === "" ? s : [s, f].join("/"))), i && o.push(...c), o.map(f => e.startsWith("/") && f === "" ? "/" : f) } function m9(e) { e.sort((t, n) => t.score !== n.score ? n.score - t.score : C9(t.routesMeta.map(r => r.childrenIndex), n.routesMeta.map(r => r.childrenIndex))) } const v9 = /^:\w+$/, g9 = 3, y9 = 2, x9 = 1, _9 = 10, b9 = -2, wT = e => e === "*"; function w9(e, t) { let n = e.split("/"), r = n.length; return n.some(wT) && (r += b9), t && (r += y9), n.filter(i => !wT(i)).reduce((i, s) => i + (v9.test(s) ? g9 : s === "" ? x9 : _9), r) } function C9(e, t) { return e.length === t.length && e.slice(0, -1).every((r, i) => r === t[i]) ? e[e.length - 1] - t[t.length - 1] : 0 } function S9(e, t) { let { routesMeta: n } = e, r = {}, i = "/", s = []; for (let c = 0; c < n.length; ++c) { let o = n[c], f = c === n.length - 1, p = i === "/" ? t : t.slice(i.length) || "/", v = E9({ path: o.relativePath, caseSensitive: o.caseSensitive, end: f }, p); if (!v) return null; Object.assign(r, v.params); let y = o.route; s.push({ params: r, pathname: fc([i, v.pathname]), pathnameBase: N9(fc([i, v.pathnameBase])), route: y }), v.pathnameBase !== "/" && (i = fc([i, v.pathnameBase])) } return s } function E9(e, t) { typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 }); let [n, r] = P9(e.path, e.caseSensitive, e.end), i = t.match(n); if (!i) return null; let s = i[0], c = s.replace(/(.)\/+$/, "$1"), o = i.slice(1); return { params: r.reduce((p, v, y) => { if (v === "*") { let w = o[y] || ""; c = s.slice(0, s.length - w.length).replace(/(.)\/+$/, "$1") } return p[v] = k9(o[y] || "", v), p }, {}), pathname: s, pathnameBase: c, pattern: e } } function P9(e, t, n) { t === void 0 && (t = !1), n === void 0 && (n = !0), US(e === "*" || !e.endsWith("*") || e.endsWith("/*"), 'Route path "' + e + '" will be treated as if it were ' + ('"' + e.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + e.replace(/\*$/, "/*") + '".')); let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^$?{}|()[\]]/g, "\\$&").replace(/\/:(\w+)/g, (c, o) => (r.push(o), "/([^\\/]+)")); return e.endsWith("*") ? (r.push("*"), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r] } function T9(e) { try { return decodeURI(e) } catch (t) { return US(!1, 'The URL path "' + e + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + t + ").")), e } } function k9(e, t) { try { return decodeURIComponent(e) } catch (n) { return US(!1, 'The value for the URL param "' + t + '" will not be decoded because' + (' the string "' + e + '" is a malformed URL segment. This is probably') + (" due to a bad percent encoding (" + n + ").")), e } } function oN(e, t) { if (t === "/") return e; if (!e.toLowerCase().startsWith(t.toLowerCase())) return null; let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n); return r && r !== "/" ? null : e.slice(n) || "/" } function US(e, t) { if (!e) { typeof console < "u" && console.warn(t); try { throw new Error(t) } catch { } } } function I9(e, t) { t === void 0 && (t = "/"); let { pathname: n, search: r = "", hash: i = "" } = typeof e == "string" ? xf(e) : e; return { pathname: n ? n.startsWith("/") ? n : R9(n, t) : t, search: O9(r), hash: D9(i) } } function R9(e, t) { let n = t.replace(/\/+$/, "").split("/"); return e.split("/").forEach(i => { i === ".." ? n.length > 1 && n.pop() : i !== "." && n.push(i) }), n.length > 1 ? n.join("/") : "/" } function o1(e, t, n, r) { return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(r) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.' } function M9(e) { return e.filter((t, n) => n === 0 || t.route.path && t.route.path.length > 0) } function A9(e, t, n, r) { r === void 0 && (r = !1); let i; typeof e == "string" ? i = xf(e) : (i = $p({}, e), Ri(!i.pathname || !i.pathname.includes("?"), o1("?", "pathname", "search", i)), Ri(!i.pathname || !i.pathname.includes("#"), o1("#", "pathname", "hash", i)), Ri(!i.search || !i.search.includes("#"), o1("#", "search", "hash", i))); let s = e === "" || i.pathname === "", c = s ? "/" : i.pathname, o; if (r || c == null) o = n; else { let y = t.length - 1; if (c.startsWith("..")) { let w = c.split("/"); for (; w[0] === "..";)w.shift(), y -= 1; i.pathname = w.join("/") } o = y >= 0 ? t[y] : "/" } let f = I9(i, o), p = c && c !== "/" && c.endsWith("/"), v = (s || c === ".") && n.endsWith("/"); return !f.pathname.endsWith("/") && (p || v) && (f.pathname += "/"), f } const fc = e => e.join("/").replace(/\/\/+/g, "/"), N9 = e => e.replace(/\/+$/, "").replace(/^\/*/, "/"), O9 = e => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, D9 = e => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e; function L9(e) { return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e } const z9 = ["post", "put", "patch", "delete"];[...z9]; var E0 = { exports: {} }, P0 = {};/**
|
|
|
* @license React
|
|
|
* react-jsx-runtime.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var F9 = C.exports, $9 = Symbol.for("react.element"), B9 = Symbol.for("react.fragment"), V9 = Object.prototype.hasOwnProperty, U9 = F9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j9 = { key: !0, ref: !0, __self: !0, __source: !0 }; function aN(e, t, n) { var r, i = {}, s = null, c = null; n !== void 0 && (s = "" + n), t.key !== void 0 && (s = "" + t.key), t.ref !== void 0 && (c = t.ref); for (r in t) V9.call(t, r) && !j9.hasOwnProperty(r) && (i[r] = t[r]); if (e && e.defaultProps) for (r in t = e.defaultProps, t) i[r] === void 0 && (i[r] = t[r]); return { $$typeof: $9, type: e, key: s, ref: c, props: i, _owner: U9.current } } P0.Fragment = B9; P0.jsx = aN; P0.jsxs = aN; (function (e) { e.exports = P0 })(E0); const An = E0.exports.Fragment, I = E0.exports.jsx, Qe = E0.exports.jsxs;/**
|
|
|
* React Router v6.8.1
|
|
|
*
|
|
|
* Copyright (c) Remix Software Inc.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE.md file in the root directory of this source tree.
|
|
|
*
|
|
|
* @license MIT
|
|
|
*/function uw() { return uw = Object.assign ? Object.assign.bind() : function (e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]) } return e }, uw.apply(this, arguments) } function K9(e, t) { return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t } const H9 = typeof Object.is == "function" ? Object.is : K9, { useState: W9, useEffect: G9, useLayoutEffect: q9, useDebugValue: Z9 } = ny; function X9(e, t, n) { const r = t(), [{ inst: i }, s] = W9({ inst: { value: r, getSnapshot: t } }); return q9(() => { i.value = r, i.getSnapshot = t, a1(i) && s({ inst: i }) }, [e, r, t]), G9(() => (a1(i) && s({ inst: i }), e(() => { a1(i) && s({ inst: i }) })), [e]), Z9(r), r } function a1(e) { const t = e.getSnapshot, n = e.value; try { const r = t(); return !H9(n, r) } catch { return !0 } } function Y9(e, t, n) { return t() } const Q9 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", J9 = !Q9, eV = J9 ? Y9 : X9; "useSyncExternalStore" in ny && (e => e.useSyncExternalStore)(ny); const sN = C.exports.createContext(null), jS = C.exports.createContext(null), KS = C.exports.createContext(null), T0 = C.exports.createContext(null), lm = C.exports.createContext({ outlet: null, matches: [] }), lN = C.exports.createContext(null); function um() { return C.exports.useContext(T0) != null } function HS() { return um() || Ri(!1), C.exports.useContext(T0).location } function uN() { um() || Ri(!1); let { basename: e, navigator: t } = C.exports.useContext(KS), { matches: n } = C.exports.useContext(lm), { pathname: r } = HS(), i = JSON.stringify(M9(n).map(o => o.pathnameBase)), s = C.exports.useRef(!1); return C.exports.useEffect(() => { s.current = !0 }), C.exports.useCallback(function (o, f) { if (f === void 0 && (f = {}), !s.current) return; if (typeof o == "number") { t.go(o); return } let p = A9(o, JSON.parse(i), r, f.relative === "path"); e !== "/" && (p.pathname = p.pathname === "/" ? e : fc([e, p.pathname])), (f.replace ? t.replace : t.push)(p, f.state, f) }, [e, t, i, r]) } function tV(e, t) { um() || Ri(!1); let { navigator: n } = C.exports.useContext(KS), r = C.exports.useContext(jS), { matches: i } = C.exports.useContext(lm), s = i[i.length - 1], c = s ? s.params : {}; s && s.pathname; let o = s ? s.pathnameBase : "/"; s && s.route; let f = HS(), p; if (t) { var v; let A = typeof t == "string" ? xf(t) : t; o === "/" || ((v = A.pathname) == null ? void 0 : v.startsWith(o)) || Ri(!1), p = A } else p = f; let y = p.pathname || "/", w = o === "/" ? y : y.slice(o.length) || "/", P = p9(e, { pathname: w }), k = oV(P && P.map(A => Object.assign({}, A, { params: Object.assign({}, c, A.params), pathname: fc([o, n.encodeLocation ? n.encodeLocation(A.pathname).pathname : A.pathname]), pathnameBase: A.pathnameBase === "/" ? o : fc([o, n.encodeLocation ? n.encodeLocation(A.pathnameBase).pathname : A.pathnameBase]) })), i, r || void 0); return t && k ? I(T0.Provider, { value: { location: uw({ pathname: "/", search: "", hash: "", state: null, key: "default" }, p), navigationType: Gl.Pop }, children: k }) : k } function nV() { let e = uV(), t = L9(e) ? e.status + " " + e.statusText : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null; return Qe(An, { children: [I("h2", { children: "Unexpected Application Error!" }), I("h3", { style: { fontStyle: "italic" }, children: t }), n ? I("pre", { style: { padding: "0.5rem", backgroundColor: "rgba(200,200,200, 0.5)" }, children: n }) : null, null] }) } class rV extends C.exports.Component { constructor(t) { super(t), this.state = { location: t.location, error: t.error } } static getDerivedStateFromError(t) { return { error: t } } static getDerivedStateFromProps(t, n) { return n.location !== t.location ? { error: t.error, location: t.location } : { error: t.error || n.error, location: n.location } } componentDidCatch(t, n) { console.error("React Router caught the following error during render", t, n) } render() { return this.state.error ? I(lm.Provider, { value: this.props.routeContext, children: I(lN.Provider, { value: this.state.error, children: this.props.component }) }) : this.props.children } } function iV(e) { let { routeContext: t, match: n, children: r } = e, i = C.exports.useContext(sN); return i && i.static && i.staticContext && n.route.errorElement && (i.staticContext._deepestRenderedBoundaryId = n.route.id), I(lm.Provider, { value: t, children: r }) } function oV(e, t, n) { if (t === void 0 && (t = []), e == null) if (n != null && n.errors) e = n.matches; else return null; let r = e, i = n == null ? void 0 : n.errors; if (i != null) { let s = r.findIndex(c => c.route.id && (i == null ? void 0 : i[c.route.id])); s >= 0 || Ri(!1), r = r.slice(0, Math.min(r.length, s + 1)) } return r.reduceRight((s, c, o) => { let f = c.route.id ? i == null ? void 0 : i[c.route.id] : null, p = n ? c.route.errorElement || I(nV, {}) : null, v = t.concat(r.slice(0, o + 1)), y = () => I(iV, { match: c, routeContext: { outlet: s, matches: v }, children: f ? p : c.route.element !== void 0 ? c.route.element : s }); return n && (c.route.errorElement || o === 0) ? I(rV, { location: n.location, component: p, error: f, children: y(), routeContext: { outlet: null, matches: v } }) : y() }, null) } var CT; (function (e) { e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator" })(CT || (CT = {})); var Ty; (function (e) { e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator" })(Ty || (Ty = {})); function aV(e) { let t = C.exports.useContext(jS); return t || Ri(!1), t } function sV(e) { let t = C.exports.useContext(lm); return t || Ri(!1), t } function lV(e) { let t = sV(), n = t.matches[t.matches.length - 1]; return n.route.id || Ri(!1), n.route.id } function uV() { var e; let t = C.exports.useContext(lN), n = aV(Ty.UseRouteError), r = lV(Ty.UseRouteError); return t || ((e = n.errors) == null ? void 0 : e[r]) } function WS(e) { let { to: t, replace: n, state: r, relative: i } = e; um() || Ri(!1); let s = C.exports.useContext(jS), c = uN(); return C.exports.useEffect(() => { s && s.navigation.state !== "idle" || c(t, { replace: n, state: r, relative: i }) }), null } function $g(e) { Ri(!1) } function cV(e) { let { basename: t = "/", children: n = null, location: r, navigationType: i = Gl.Pop, navigator: s, static: c = !1 } = e; um() && Ri(!1); let o = t.replace(/^\/*/, "/"), f = C.exports.useMemo(() => ({ basename: o, navigator: s, static: c }), [o, s, c]); typeof r == "string" && (r = xf(r)); let { pathname: p = "/", search: v = "", hash: y = "", state: w = null, key: P = "default" } = r, k = C.exports.useMemo(() => { let A = oN(p, o); return A == null ? null : { pathname: A, search: v, hash: y, state: w, key: P } }, [o, p, v, y, w, P]); return k == null ? null : I(KS.Provider, { value: f, children: I(T0.Provider, { children: n, value: { location: k, navigationType: i } }) }) } function dV(e) { let { children: t, location: n } = e, r = C.exports.useContext(sN), i = r && !t ? r.router.routes : cw(t); return tV(i, n) } var ST; (function (e) { e[e.pending = 0] = "pending", e[e.success = 1] = "success", e[e.error = 2] = "error" })(ST || (ST = {})); new Promise(() => { }); function cw(e, t) { t === void 0 && (t = []); let n = []; return C.exports.Children.forEach(e, (r, i) => { if (!C.exports.isValidElement(r)) return; if (r.type === C.exports.Fragment) { n.push.apply(n, cw(r.props.children, t)); return } r.type !== $g && Ri(!1), !r.props.index || !r.props.children || Ri(!1); let s = [...t, i], c = { id: r.props.id || s.join("-"), caseSensitive: r.props.caseSensitive, element: r.props.element, index: r.props.index, path: r.props.path, loader: r.props.loader, action: r.props.action, errorElement: r.props.errorElement, hasErrorBoundary: r.props.errorElement != null, shouldRevalidate: r.props.shouldRevalidate, handle: r.props.handle }; r.props.children && (c.children = cw(r.props.children, s)), n.push(c) }), n }/**
|
|
|
* React Router DOM v6.8.1
|
|
|
*
|
|
|
* Copyright (c) Remix Software Inc.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE.md file in the root directory of this source tree.
|
|
|
*
|
|
|
* @license MIT
|
|
|
*/function dw(e) { return e === void 0 && (e = ""), new URLSearchParams(typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, n) => { let r = e[n]; return t.concat(Array.isArray(r) ? r.map(i => [n, i]) : [[n, r]]) }, [])) } function fV(e, t) { let n = dw(e); if (t) for (let r of t.keys()) n.has(r) || t.getAll(r).forEach(i => { n.append(r, i) }); return n } function hV(e) { let { basename: t, children: n, window: r } = e, i = C.exports.useRef(); i.current == null && (i.current = d9({ window: r, v5Compat: !0 })); let s = i.current, [c, o] = C.exports.useState({ action: s.action, location: s.location }); return C.exports.useLayoutEffect(() => s.listen(o), [s]), I(cV, { basename: t, children: n, location: c.location, navigationType: c.action, navigator: s }) } var ET; (function (e) { e.UseScrollRestoration = "useScrollRestoration", e.UseSubmitImpl = "useSubmitImpl", e.UseFetcher = "useFetcher" })(ET || (ET = {})); var PT; (function (e) { e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration" })(PT || (PT = {})); function pV(e) { let t = C.exports.useRef(dw(e)), n = C.exports.useRef(!1), r = HS(), i = C.exports.useMemo(() => fV(r.search, n.current ? null : t.current), [r.search]), s = uN(), c = C.exports.useCallback((o, f) => { const p = dw(typeof o == "function" ? o(i) : o); n.current = !0, s("?" + p, f) }, [s, i]); return [i, c] } let s1 = 0, TT = []; function mV() { return s1 += 1, () => { if (s1 -= 1, s1 === 0) { let e = TT; TT = []; for (let t of e) t() } } } let tg = Symbol(), vV = (e, t, n, r) => { let i = { ...e }; i.set = (...c) => { e[tg] = t, e.set(...c), delete e[tg] }, e.setKey && (i.setKey = (...c) => { e[tg] = t, e.setKey(...c), delete e[tg] }); let s = n(i, ...r); if (s instanceof Promise) { let c = mV(); return s.finally(c) } return s }, gV = (e, t, n) => (...r) => vV(e, t, n, r), go = [], _f = (e, t) => { let n, r = [], i = { lc: 0, l: t || 0, value: e, set(s) { i.value = s, i.notify() }, get() { return i.lc || i.listen(() => { })(), i.value }, notify(s) { n = r; let c = !go.length; for (let o = 0; o < n.length; o += 2)go.push(n[o], i.value, s, n[o + 1]); if (c) { for (let o = 0; o < go.length; o += 4) { let f = !1; for (let p = o + 7; p < go.length; p += 4)if (go[p] < go[o + 3]) { f = !0; break } f ? go.push(go[o], go[o + 1], go[o + 2], go[o + 3]) : go[o](go[o + 1], go[o + 2]) } go.length = 0 } }, listen(s, c) { return r === n && (r = r.slice()), i.lc = r.push(s, c || i.l) / 2, () => { r === n && (r = r.slice()); let o = r.indexOf(s); ~o && (r.splice(o, 2), i.lc--) } }, subscribe(s, c) { let o = i.listen(s, c); return s(i.value), o }, off() { } }; return i }; function yV(e, t, n) { let r = new Set([...t, void 0]); return e.listen((i, s) => { r.has(s) && n(i, s) }) } var k0 = { exports: {} }, cN = {};/**
|
|
|
* @license React
|
|
|
* use-sync-external-store-shim.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var nf = C.exports; function xV(e, t) { return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t } var _V = typeof Object.is == "function" ? Object.is : xV, bV = nf.useState, wV = nf.useEffect, CV = nf.useLayoutEffect, SV = nf.useDebugValue; function EV(e, t) { var n = t(), r = bV({ inst: { value: n, getSnapshot: t } }), i = r[0].inst, s = r[1]; return CV(function () { i.value = n, i.getSnapshot = t, l1(i) && s({ inst: i }) }, [e, n, t]), wV(function () { return l1(i) && s({ inst: i }), e(function () { l1(i) && s({ inst: i }) }) }, [e]), SV(n), n } function l1(e) { var t = e.getSnapshot; e = e.value; try { var n = t(); return !_V(e, n) } catch { return !0 } } function PV(e, t) { return t() } var TV = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? PV : EV; cN.useSyncExternalStore = nf.useSyncExternalStore !== void 0 ? nf.useSyncExternalStore : TV; (function (e) { e.exports = cN })(k0); function Bp(e, t = {}) { let n = C.exports.useCallback(i => t.keys ? yV(e, t.keys, i) : e.listen(i), [t.keys, e]), r = e.get.bind(e); return k0.exports.useSyncExternalStore(n, r, r) } function tt() { return tt = Object.assign ? Object.assign.bind() : function (e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]) } return e }, tt.apply(this, arguments) } function ln(e) { return ln = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function (t) { return typeof t } : function (t) { return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, ln(e) } function kV(e, t) { if (ln(e) !== "object" || e === null) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(e, t || "default"); if (ln(r) !== "object") return r; throw new TypeError("@@toPrimitive must return a primitive value.") } return (t === "string" ? String : Number)(e) } function dN(e) { var t = kV(e, "string"); return ln(t) === "symbol" ? t : String(t) } function re(e, t, n) { return t = dN(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e } function zr(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } function kT(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, dN(r.key), r) } } function Fr(e, t, n) { return t && kT(e.prototype, t), n && kT(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e } function fw(e, t) { return fw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (r, i) { return r.__proto__ = i, r }, fw(e, t) } function ui(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && fw(e, t) } function ky(e) { return ky = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (n) { return n.__proto__ || Object.getPrototypeOf(n) }, ky(e) } function IV() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () { })), !0 } catch { return !1 } } function Ln(e) { if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e } function RV(e, t) { if (t && (ln(t) === "object" || typeof t == "function")) return t; if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return Ln(e) } function ci(e) { var t = IV(); return function () { var r = ky(e), i; if (t) { var s = ky(this).constructor; i = Reflect.construct(r, arguments, s) } else i = r.apply(this, arguments); return RV(this, i) } } var fN = { exports: {} };/*!
|
|
|
Copyright (c) 2018 Jed Watson.
|
|
|
Licensed under the MIT License (MIT), see
|
|
|
http://jedwatson.github.io/classnames
|
|
|
*/(function (e) { (function () { var t = {}.hasOwnProperty; function n() { for (var r = [], i = 0; i < arguments.length; i++) { var s = arguments[i]; if (!!s) { var c = typeof s; if (c === "string" || c === "number") r.push(s); else if (Array.isArray(s)) { if (s.length) { var o = n.apply(null, s); o && r.push(o) } } else if (c === "object") { if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]")) { r.push(s.toString()); continue } for (var f in s) t.call(s, f) && s[f] && r.push(f) } } } return r.join(" ") } e.exports ? (n.default = n, e.exports = n) : window.classNames = n })() })(fN); const Xe = fN.exports; var GS = { exports: {} }, Pr = {};/** @license React v16.13.1
|
|
|
* react-is.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var Vi = typeof Symbol == "function" && Symbol.for, qS = Vi ? Symbol.for("react.element") : 60103, ZS = Vi ? Symbol.for("react.portal") : 60106, I0 = Vi ? Symbol.for("react.fragment") : 60107, R0 = Vi ? Symbol.for("react.strict_mode") : 60108, M0 = Vi ? Symbol.for("react.profiler") : 60114, A0 = Vi ? Symbol.for("react.provider") : 60109, N0 = Vi ? Symbol.for("react.context") : 60110, XS = Vi ? Symbol.for("react.async_mode") : 60111, O0 = Vi ? Symbol.for("react.concurrent_mode") : 60111, D0 = Vi ? Symbol.for("react.forward_ref") : 60112, L0 = Vi ? Symbol.for("react.suspense") : 60113, MV = Vi ? Symbol.for("react.suspense_list") : 60120, z0 = Vi ? Symbol.for("react.memo") : 60115, F0 = Vi ? Symbol.for("react.lazy") : 60116, AV = Vi ? Symbol.for("react.block") : 60121, NV = Vi ? Symbol.for("react.fundamental") : 60117, OV = Vi ? Symbol.for("react.responder") : 60118, DV = Vi ? Symbol.for("react.scope") : 60119; function ra(e) { if (typeof e == "object" && e !== null) { var t = e.$$typeof; switch (t) { case qS: switch (e = e.type, e) { case XS: case O0: case I0: case M0: case R0: case L0: return e; default: switch (e = e && e.$$typeof, e) { case N0: case D0: case F0: case z0: case A0: return e; default: return t } }case ZS: return t } } } function hN(e) { return ra(e) === O0 } Pr.AsyncMode = XS; Pr.ConcurrentMode = O0; Pr.ContextConsumer = N0; Pr.ContextProvider = A0; Pr.Element = qS; Pr.ForwardRef = D0; Pr.Fragment = I0; Pr.Lazy = F0; Pr.Memo = z0; Pr.Portal = ZS; Pr.Profiler = M0; Pr.StrictMode = R0; Pr.Suspense = L0; Pr.isAsyncMode = function (e) { return hN(e) || ra(e) === XS }; Pr.isConcurrentMode = hN; Pr.isContextConsumer = function (e) { return ra(e) === N0 }; Pr.isContextProvider = function (e) { return ra(e) === A0 }; Pr.isElement = function (e) { return typeof e == "object" && e !== null && e.$$typeof === qS }; Pr.isForwardRef = function (e) { return ra(e) === D0 }; Pr.isFragment = function (e) { return ra(e) === I0 }; Pr.isLazy = function (e) { return ra(e) === F0 }; Pr.isMemo = function (e) { return ra(e) === z0 }; Pr.isPortal = function (e) { return ra(e) === ZS }; Pr.isProfiler = function (e) { return ra(e) === M0 }; Pr.isStrictMode = function (e) { return ra(e) === R0 }; Pr.isSuspense = function (e) { return ra(e) === L0 }; Pr.isValidElementType = function (e) { return typeof e == "string" || typeof e == "function" || e === I0 || e === O0 || e === M0 || e === R0 || e === L0 || e === MV || typeof e == "object" && e !== null && (e.$$typeof === F0 || e.$$typeof === z0 || e.$$typeof === A0 || e.$$typeof === N0 || e.$$typeof === D0 || e.$$typeof === NV || e.$$typeof === OV || e.$$typeof === DV || e.$$typeof === AV) }; Pr.typeOf = ra; (function (e) { e.exports = Pr })(GS); function Zi(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = []; return tr.Children.forEach(e, function (r) { r == null && !t.keepEmpty || (Array.isArray(r) ? n = n.concat(Zi(r)) : GS.exports.isFragment(r) && r.props ? n = n.concat(Zi(r.props.children, t)) : n.push(r)) }), n } var IT = {}; function LV(e, t) { } function zV(e, t, n) { !t && !IT[n] && (e(!1, n), IT[n] = !0) } function Rr(e, t) { zV(LV, e, t) } function RT(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter(function (i) { return Object.getOwnPropertyDescriptor(e, i).enumerable })), n.push.apply(n, r) } return n } function ge(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? RT(Object(n), !0).forEach(function (r) { re(e, r, n[r]) }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : RT(Object(n)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r)) }) } return e } function cm(e, t, n) { var r = C.exports.useRef({}); return (!("value" in r.current) || n(r.current.condition, t)) && (r.current.value = e(), r.current.condition = t), r.current.value } function Iy(e, t) { typeof e == "function" ? e(t) : ln(e) === "object" && e && "current" in e && (e.current = t) } function Po() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; var r = t.filter(function (i) { return i }); return r.length <= 1 ? r[0] : function (i) { t.forEach(function (s) { Iy(s, i) }) } } function pN() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; return cm(function () { return Po.apply(void 0, t) }, t, function (r, i) { return r.length === i.length && r.every(function (s, c) { return s === i[c] }) }) } function Ic(e) { var t, n, r = GS.exports.isMemo(e) ? e.type.type : e.type; return !(typeof r == "function" && !((t = r.prototype) !== null && t !== void 0 && t.render) || typeof e == "function" && !((n = e.prototype) !== null && n !== void 0 && n.render)) } function Vp(e) { return e instanceof HTMLElement ? e : e instanceof tr.Component ? bc.findDOMNode(e) : null } var mN = function () { if (typeof Map < "u") return Map; function e(t, n) { var r = -1; return t.some(function (i, s) { return i[0] === n ? (r = s, !0) : !1 }), r } return function () { function t() { this.__entries__ = [] } return Object.defineProperty(t.prototype, "size", { get: function () { return this.__entries__.length }, enumerable: !0, configurable: !0 }), t.prototype.get = function (n) { var r = e(this.__entries__, n), i = this.__entries__[r]; return i && i[1] }, t.prototype.set = function (n, r) { var i = e(this.__entries__, n); ~i ? this.__entries__[i][1] = r : this.__entries__.push([n, r]) }, t.prototype.delete = function (n) { var r = this.__entries__, i = e(r, n); ~i && r.splice(i, 1) }, t.prototype.has = function (n) { return !!~e(this.__entries__, n) }, t.prototype.clear = function () { this.__entries__.splice(0) }, t.prototype.forEach = function (n, r) { r === void 0 && (r = null); for (var i = 0, s = this.__entries__; i < s.length; i++) { var c = s[i]; n.call(r, c[1], c[0]) } }, t }() }(), hw = typeof window < "u" && typeof document < "u" && window.document === document, Ry = function () { return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")() }(), FV = function () { return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(Ry) : function (e) { return setTimeout(function () { return e(Date.now()) }, 1e3 / 60) } }(), $V = 2; function BV(e, t) { var n = !1, r = !1, i = 0; function s() { n && (n = !1, e()), r && o() } function c() { FV(s) } function o() { var f = Date.now(); if (n) { if (f - i < $V) return; r = !0 } else n = !0, r = !1, setTimeout(c, t); i = f } return o } var VV = 20, UV = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], jV = typeof MutationObserver < "u", KV = function () { function e() { this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = BV(this.refresh.bind(this), VV) } return e.prototype.addObserver = function (t) { ~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_() }, e.prototype.removeObserver = function (t) { var n = this.observers_, r = n.indexOf(t); ~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_() }, e.prototype.refresh = function () { var t = this.updateObservers_(); t && this.refresh() }, e.prototype.updateObservers_ = function () { var t = this.observers_.filter(function (n) { return n.gatherActive(), n.hasActive() }); return t.forEach(function (n) { return n.broadcastActive() }), t.length > 0 }, e.prototype.connect_ = function () { !hw || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), jV ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, { attributes: !0, childList: !0, characterData: !0, subtree: !0 })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0) }, e.prototype.disconnect_ = function () { !hw || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1) }, e.prototype.onTransitionEnd_ = function (t) { var n = t.propertyName, r = n === void 0 ? "" : n, i = UV.some(function (s) { return !!~r.indexOf(s) }); i && this.refresh() }, e.getInstance = function () { return this.instance_ || (this.instance_ = new e), this.instance_ }, e.instance_ = null, e }(), vN = function (e, t) { for (var n = 0, r = Object.keys(t); n < r.length; n++) { var i = r[n]; Object.defineProperty(e, i, { value: t[i], enumerable: !1, writable: !1, configurable: !0 }) } return e }, rf = function (e) { var t = e && e.ownerDocument && e.ownerDocument.defaultView; return t || Ry }, gN = $0(0, 0, 0, 0); function My(e) { return parseFloat(e) || 0 } function MT(e) { for (var t = [], n = 1; n < arguments.length; n++)t[n - 1] = arguments[n]; return t.reduce(function (r, i) { var s = e["border-" + i + "-width"]; return r + My(s) }, 0) } function HV(e) { for (var t = ["top", "right", "bottom", "left"], n = {}, r = 0, i = t; r < i.length; r++) { var s = i[r], c = e["padding-" + s]; n[s] = My(c) } return n } function WV(e) { var t = e.getBBox(); return $0(0, 0, t.width, t.height) } function GV(e) { var t = e.clientWidth, n = e.clientHeight; if (!t && !n) return gN; var r = rf(e).getComputedStyle(e), i = HV(r), s = i.left + i.right, c = i.top + i.bottom, o = My(r.width), f = My(r.height); if (r.boxSizing === "border-box" && (Math.round(o + s) !== t && (o -= MT(r, "left", "right") + s), Math.round(f + c) !== n && (f -= MT(r, "top", "bottom") + c)), !ZV(e)) { var p = Math.round(o + s) - t, v = Math.round(f + c) - n; Math.abs(p) !== 1 && (o -= p), Math.abs(v) !== 1 && (f -= v) } return $0(i.left, i.top, o, f) } var qV = function () { return typeof SVGGraphicsElement < "u" ? function (e) { return e instanceof rf(e).SVGGraphicsElement } : function (e) { return e instanceof rf(e).SVGElement && typeof e.getBBox == "function" } }(); function ZV(e) { return e === rf(e).document.documentElement } function XV(e) { return hw ? qV(e) ? WV(e) : GV(e) : gN } function YV(e) { var t = e.x, n = e.y, r = e.width, i = e.height, s = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, c = Object.create(s.prototype); return vN(c, { x: t, y: n, width: r, height: i, top: n, right: t + r, bottom: i + n, left: t }), c } function $0(e, t, n, r) { return { x: e, y: t, width: n, height: r } } var QV = function () { function e(t) { this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = $0(0, 0, 0, 0), this.target = t } return e.prototype.isActive = function () { var t = XV(this.target); return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight }, e.prototype.broadcastRect = function () { var t = this.contentRect_; return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t }, e }(), JV = function () { function e(t, n) { var r = YV(n); vN(this, { target: t, contentRect: r }) } return e }(), e7 = function () { function e(t, n, r) { if (this.activeObservations_ = [], this.observations_ = new mN, typeof t != "function") throw new TypeError("The callback provided as parameter 1 is not a function."); this.callback_ = t, this.controller_ = n, this.callbackCtx_ = r } return e.prototype.observe = function (t) { if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); if (!(typeof Element > "u" || !(Element instanceof Object))) { if (!(t instanceof rf(t).Element)) throw new TypeError('parameter 1 is not of type "Element".'); var n = this.observations_; n.has(t) || (n.set(t, new QV(t)), this.controller_.addObserver(this), this.controller_.refresh()) } }, e.prototype.unobserve = function (t) { if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); if (!(typeof Element > "u" || !(Element instanceof Object))) { if (!(t instanceof rf(t).Element)) throw new TypeError('parameter 1 is not of type "Element".'); var n = this.observations_; !n.has(t) || (n.delete(t), n.size || this.controller_.removeObserver(this)) } }, e.prototype.disconnect = function () { this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this) }, e.prototype.gatherActive = function () { var t = this; this.clearActive(), this.observations_.forEach(function (n) { n.isActive() && t.activeObservations_.push(n) }) }, e.prototype.broadcastActive = function () { if (!!this.hasActive()) { var t = this.callbackCtx_, n = this.activeObservations_.map(function (r) { return new JV(r.target, r.broadcastRect()) }); this.callback_.call(t, n, t), this.clearActive() } }, e.prototype.clearActive = function () { this.activeObservations_.splice(0) }, e.prototype.hasActive = function () { return this.activeObservations_.length > 0 }, e }(), yN = typeof WeakMap < "u" ? new WeakMap : new mN, xN = function () { function e(t) { if (!(this instanceof e)) throw new TypeError("Cannot call a class as a function."); if (!arguments.length) throw new TypeError("1 argument required, but only 0 present."); var n = KV.getInstance(), r = new e7(t, n, this); yN.set(this, r) } return e }();["observe", "unobserve", "disconnect"].forEach(function (e) { xN.prototype[e] = function () { var t; return (t = yN.get(this))[e].apply(t, arguments) } }); var _N = function () { return typeof Ry.ResizeObserver < "u" ? Ry.ResizeObserver : xN }(), ql = new Map; function t7(e) { e.forEach(function (t) { var n, r = t.target; (n = ql.get(r)) === null || n === void 0 || n.forEach(function (i) { return i(r) }) }) } var bN = new _N(t7); function n7(e, t) { ql.has(e) || (ql.set(e, new Set), bN.observe(e)), ql.get(e).add(t) } function r7(e, t) { ql.has(e) && (ql.get(e).delete(t), ql.get(e).size || (bN.unobserve(e), ql.delete(e))) } var i7 = function (e) { ui(n, e); var t = ci(n); function n() { return zr(this, n), t.apply(this, arguments) } return Fr(n, [{ key: "render", value: function () { return this.props.children } }]), n }(C.exports.Component), pw = C.exports.createContext(null); function o7(e) { var t = e.children, n = e.onBatchResize, r = C.exports.useRef(0), i = C.exports.useRef([]), s = C.exports.useContext(pw), c = C.exports.useCallback(function (o, f, p) { r.current += 1; var v = r.current; i.current.push({ size: o, element: f, data: p }), Promise.resolve().then(function () { v === r.current && (n == null || n(i.current), i.current = []) }), s == null || s(o, f, p) }, [n, s]); return I(pw.Provider, { value: c, children: t }) } function a7(e, t) { var n = e.children, r = e.disabled, i = C.exports.useRef(null), s = C.exports.useRef(null), c = C.exports.useContext(pw), o = typeof n == "function", f = o ? n(i) : n, p = C.exports.useRef({ width: -1, height: -1, offsetWidth: -1, offsetHeight: -1 }), v = !o && C.exports.isValidElement(f) && Ic(f), y = v ? f.ref : null, w = C.exports.useMemo(function () { return Po(y, i) }, [y, i]), P = function () { return Vp(i.current) || Vp(s.current) }; C.exports.useImperativeHandle(t, function () { return P() }); var k = C.exports.useRef(e); k.current = e; var A = C.exports.useCallback(function (N) { var R = k.current, M = R.onResize, O = R.data, z = N.getBoundingClientRect(), B = z.width, V = z.height, G = N.offsetWidth, j = N.offsetHeight, X = Math.floor(B), Y = Math.floor(V); if (p.current.width !== X || p.current.height !== Y || p.current.offsetWidth !== G || p.current.offsetHeight !== j) { var se = { width: X, height: Y, offsetWidth: G, offsetHeight: j }; p.current = se; var ee = G === Math.round(B) ? B : G, Z = j === Math.round(V) ? V : j, J = ge(ge({}, se), {}, { offsetWidth: ee, offsetHeight: Z }); c == null || c(J, N, O), M && Promise.resolve().then(function () { M(J, N) }) } }, []); return C.exports.useEffect(function () { var N = P(); return N && !r && n7(N, A), function () { return r7(N, A) } }, [i.current, r]), I(i7, { ref: s, children: v ? C.exports.cloneElement(f, { ref: w }) : f }) } var s7 = C.exports.forwardRef(a7), l7 = "rc-observer-key"; function u7(e, t) { var n = e.children, r = typeof n == "function" ? [n] : Zi(n); return r.map(function (i, s) { var c = (i == null ? void 0 : i.key) || "".concat(l7, "-").concat(s); return C.exports.createElement(s7, { ...e, key: c, ref: s === 0 ? t : void 0 }, i) }) } var cl = C.exports.forwardRef(u7); cl.Collection = o7; function vi(e, t) { var n = ge({}, e); return Array.isArray(t) && t.forEach(function (r) { delete n[r] }), n } var c7 = C.exports.createContext({}); const YS = c7; function d7(e, t) { if (e == null) return {}; var n = {}, r = Object.keys(e), i, s; for (s = 0; s < r.length; s++)i = r[s], !(t.indexOf(i) >= 0) && (n[i] = e[i]); return n } function Rn(e, t) { if (e == null) return {}; var n = d7(e, t), r, i; if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (i = 0; i < s.length; i++)r = s[i], !(t.indexOf(r) >= 0) && (!Object.prototype.propertyIsEnumerable.call(e, r) || (n[r] = e[r])) } return n } function mw(e, t) { (t == null || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++)r[n] = e[n]; return r } function f7(e) { if (Array.isArray(e)) return mw(e) } function wN(e) { if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e) } function QS(e, t) { if (!!e) { if (typeof e == "string") return mw(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return mw(e, t) } } function h7() {
|
|
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)
|
|
|
} function Et(e) { return f7(e) || wN(e) || QS(e) || h7() } var ic = "RC_FORM_INTERNAL_HOOKS", Ir = function () { Rr(!1, "Can not find FormContext. Please make sure you wrap Field under Form.") }, wc = C.exports.createContext({ getFieldValue: Ir, getFieldsValue: Ir, getFieldError: Ir, getFieldWarning: Ir, getFieldsError: Ir, isFieldsTouched: Ir, isFieldTouched: Ir, isFieldValidating: Ir, isFieldsValidating: Ir, resetFields: Ir, setFields: Ir, setFieldValue: Ir, setFieldsValue: Ir, validateFields: Ir, submit: Ir, getInternalHooks: function () { return Ir(), { dispatch: Ir, initEntityValue: Ir, registerField: Ir, useSubscribe: Ir, setInitialValues: Ir, destroyForm: Ir, setCallbacks: Ir, registerWatch: Ir, getFields: Ir, setValidateMessages: Ir, setPreserve: Ir, getInitialValue: Ir } } }); function vw(e) { return e == null ? [] : Array.isArray(e) ? e : [e] } function bo() { bo = function () { return e }; var e = {}, t = Object.prototype, n = t.hasOwnProperty, r = Object.defineProperty || function (ee, Z, J) { ee[Z] = J.value }, i = typeof Symbol == "function" ? Symbol : {}, s = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", o = i.toStringTag || "@@toStringTag"; function f(ee, Z, J) { return Object.defineProperty(ee, Z, { value: J, enumerable: !0, configurable: !0, writable: !0 }), ee[Z] } try { f({}, "") } catch { f = function (J, ve, ie) { return J[ve] = ie } } function p(ee, Z, J, ve) { var ie = Z && Z.prototype instanceof w ? Z : w, ce = Object.create(ie.prototype), oe = new X(ve || []); return r(ce, "_invoke", { value: B(ee, J, oe) }), ce } function v(ee, Z, J) { try { return { type: "normal", arg: ee.call(Z, J) } } catch (ve) { return { type: "throw", arg: ve } } } e.wrap = p; var y = {}; function w() { } function P() { } function k() { } var A = {}; f(A, s, function () { return this }); var N = Object.getPrototypeOf, R = N && N(N(Y([]))); R && R !== t && n.call(R, s) && (A = R); var M = k.prototype = w.prototype = Object.create(A); function O(ee) { ["next", "throw", "return"].forEach(function (Z) { f(ee, Z, function (J) { return this._invoke(Z, J) }) }) } function z(ee, Z) { function J(ie, ce, oe, ye) { var Ie = v(ee[ie], ee, ce); if (Ie.type !== "throw") { var Te = Ie.arg, Pe = Te.value; return Pe && ln(Pe) == "object" && n.call(Pe, "__await") ? Z.resolve(Pe.__await).then(function (De) { J("next", De, oe, ye) }, function (De) { J("throw", De, oe, ye) }) : Z.resolve(Pe).then(function (De) { Te.value = De, oe(Te) }, function (De) { return J("throw", De, oe, ye) }) } ye(Ie.arg) } var ve; r(this, "_invoke", { value: function (ce, oe) { function ye() { return new Z(function (Ie, Te) { J(ce, oe, Ie, Te) }) } return ve = ve ? ve.then(ye, ye) : ye() } }) } function B(ee, Z, J) { var ve = "suspendedStart"; return function (ie, ce) { if (ve === "executing") throw new Error("Generator is already running"); if (ve === "completed") { if (ie === "throw") throw ce; return se() } for (J.method = ie, J.arg = ce; ;) { var oe = J.delegate; if (oe) { var ye = V(oe, J); if (ye) { if (ye === y) continue; return ye } } if (J.method === "next") J.sent = J._sent = J.arg; else if (J.method === "throw") { if (ve === "suspendedStart") throw ve = "completed", J.arg; J.dispatchException(J.arg) } else J.method === "return" && J.abrupt("return", J.arg); ve = "executing"; var Ie = v(ee, Z, J); if (Ie.type === "normal") { if (ve = J.done ? "completed" : "suspendedYield", Ie.arg === y) continue; return { value: Ie.arg, done: J.done } } Ie.type === "throw" && (ve = "completed", J.method = "throw", J.arg = Ie.arg) } } } function V(ee, Z) { var J = Z.method, ve = ee.iterator[J]; if (ve === void 0) return Z.delegate = null, J === "throw" && ee.iterator.return && (Z.method = "return", Z.arg = void 0, V(ee, Z), Z.method === "throw") || J !== "return" && (Z.method = "throw", Z.arg = new TypeError("The iterator does not provide a '" + J + "' method")), y; var ie = v(ve, ee.iterator, Z.arg); if (ie.type === "throw") return Z.method = "throw", Z.arg = ie.arg, Z.delegate = null, y; var ce = ie.arg; return ce ? ce.done ? (Z[ee.resultName] = ce.value, Z.next = ee.nextLoc, Z.method !== "return" && (Z.method = "next", Z.arg = void 0), Z.delegate = null, y) : ce : (Z.method = "throw", Z.arg = new TypeError("iterator result is not an object"), Z.delegate = null, y) } function G(ee) { var Z = { tryLoc: ee[0] }; 1 in ee && (Z.catchLoc = ee[1]), 2 in ee && (Z.finallyLoc = ee[2], Z.afterLoc = ee[3]), this.tryEntries.push(Z) } function j(ee) { var Z = ee.completion || {}; Z.type = "normal", delete Z.arg, ee.completion = Z } function X(ee) { this.tryEntries = [{ tryLoc: "root" }], ee.forEach(G, this), this.reset(!0) } function Y(ee) { if (ee) { var Z = ee[s]; if (Z) return Z.call(ee); if (typeof ee.next == "function") return ee; if (!isNaN(ee.length)) { var J = -1, ve = function ie() { for (; ++J < ee.length;)if (n.call(ee, J)) return ie.value = ee[J], ie.done = !1, ie; return ie.value = void 0, ie.done = !0, ie }; return ve.next = ve } } return { next: se } } function se() { return { value: void 0, done: !0 } } return P.prototype = k, r(M, "constructor", { value: k, configurable: !0 }), r(k, "constructor", { value: P, configurable: !0 }), P.displayName = f(k, o, "GeneratorFunction"), e.isGeneratorFunction = function (ee) { var Z = typeof ee == "function" && ee.constructor; return !!Z && (Z === P || (Z.displayName || Z.name) === "GeneratorFunction") }, e.mark = function (ee) { return Object.setPrototypeOf ? Object.setPrototypeOf(ee, k) : (ee.__proto__ = k, f(ee, o, "GeneratorFunction")), ee.prototype = Object.create(M), ee }, e.awrap = function (ee) { return { __await: ee } }, O(z.prototype), f(z.prototype, c, function () { return this }), e.AsyncIterator = z, e.async = function (ee, Z, J, ve, ie) { ie === void 0 && (ie = Promise); var ce = new z(p(ee, Z, J, ve), ie); return e.isGeneratorFunction(Z) ? ce : ce.next().then(function (oe) { return oe.done ? oe.value : ce.next() }) }, O(M), f(M, o, "Generator"), f(M, s, function () { return this }), f(M, "toString", function () { return "[object Generator]" }), e.keys = function (ee) { var Z = Object(ee), J = []; for (var ve in Z) J.push(ve); return J.reverse(), function ie() { for (; J.length;) { var ce = J.pop(); if (ce in Z) return ie.value = ce, ie.done = !1, ie } return ie.done = !0, ie } }, e.values = Y, X.prototype = { constructor: X, reset: function (Z) { if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(j), !Z) for (var J in this) J.charAt(0) === "t" && n.call(this, J) && !isNaN(+J.slice(1)) && (this[J] = void 0) }, stop: function () { this.done = !0; var Z = this.tryEntries[0].completion; if (Z.type === "throw") throw Z.arg; return this.rval }, dispatchException: function (Z) { if (this.done) throw Z; var J = this; function ve(Te, Pe) { return oe.type = "throw", oe.arg = Z, J.next = Te, Pe && (J.method = "next", J.arg = void 0), !!Pe } for (var ie = this.tryEntries.length - 1; ie >= 0; --ie) { var ce = this.tryEntries[ie], oe = ce.completion; if (ce.tryLoc === "root") return ve("end"); if (ce.tryLoc <= this.prev) { var ye = n.call(ce, "catchLoc"), Ie = n.call(ce, "finallyLoc"); if (ye && Ie) { if (this.prev < ce.catchLoc) return ve(ce.catchLoc, !0); if (this.prev < ce.finallyLoc) return ve(ce.finallyLoc) } else if (ye) { if (this.prev < ce.catchLoc) return ve(ce.catchLoc, !0) } else { if (!Ie) throw new Error("try statement without catch or finally"); if (this.prev < ce.finallyLoc) return ve(ce.finallyLoc) } } } }, abrupt: function (Z, J) { for (var ve = this.tryEntries.length - 1; ve >= 0; --ve) { var ie = this.tryEntries[ve]; if (ie.tryLoc <= this.prev && n.call(ie, "finallyLoc") && this.prev < ie.finallyLoc) { var ce = ie; break } } ce && (Z === "break" || Z === "continue") && ce.tryLoc <= J && J <= ce.finallyLoc && (ce = null); var oe = ce ? ce.completion : {}; return oe.type = Z, oe.arg = J, ce ? (this.method = "next", this.next = ce.finallyLoc, y) : this.complete(oe) }, complete: function (Z, J) { if (Z.type === "throw") throw Z.arg; return Z.type === "break" || Z.type === "continue" ? this.next = Z.arg : Z.type === "return" ? (this.rval = this.arg = Z.arg, this.method = "return", this.next = "end") : Z.type === "normal" && J && (this.next = J), y }, finish: function (Z) { for (var J = this.tryEntries.length - 1; J >= 0; --J) { var ve = this.tryEntries[J]; if (ve.finallyLoc === Z) return this.complete(ve.completion, ve.afterLoc), j(ve), y } }, catch: function (Z) { for (var J = this.tryEntries.length - 1; J >= 0; --J) { var ve = this.tryEntries[J]; if (ve.tryLoc === Z) { var ie = ve.completion; if (ie.type === "throw") { var ce = ie.arg; j(ve) } return ce } } throw new Error("illegal catch attempt") }, delegateYield: function (Z, J, ve) { return this.delegate = { iterator: Y(Z), resultName: J, nextLoc: ve }, this.method === "next" && (this.arg = void 0), y } }, e } function AT(e, t, n, r, i, s, c) { try { var o = e[s](c), f = o.value } catch (p) { n(p); return } o.done ? t(f) : Promise.resolve(f).then(r, i) } function Rc(e) { return function () { var t = this, n = arguments; return new Promise(function (r, i) { var s = e.apply(t, n); function c(f) { AT(s, r, i, c, o, "next", f) } function o(f) { AT(s, r, i, c, o, "throw", f) } c(void 0) }) } } function oc() { return oc = Object.assign ? Object.assign.bind() : function (e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]) } return e }, oc.apply(this, arguments) } function p7(e, t) { e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Up(e, t) } function gw(e) { return gw = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (n) { return n.__proto__ || Object.getPrototypeOf(n) }, gw(e) } function Up(e, t) { return Up = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (r, i) { return r.__proto__ = i, r }, Up(e, t) } function m7() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () { })), !0 } catch { return !1 } } function Bg(e, t, n) { return m7() ? Bg = Reflect.construct.bind() : Bg = function (i, s, c) { var o = [null]; o.push.apply(o, s); var f = Function.bind.apply(i, o), p = new f; return c && Up(p, c.prototype), p }, Bg.apply(null, arguments) } function v7(e) { return Function.toString.call(e).indexOf("[native code]") !== -1 } function yw(e) { var t = typeof Map == "function" ? new Map : void 0; return yw = function (r) { if (r === null || !v7(r)) return r; if (typeof r != "function") throw new TypeError("Super expression must either be null or a function"); if (typeof t < "u") { if (t.has(r)) return t.get(r); t.set(r, i) } function i() { return Bg(r, arguments, gw(this).constructor) } return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), Up(i, r) }, yw(e) } var g7 = /%[sdj%]/g, y7 = function () { }; typeof process < "u" && process.env; function xw(e) { if (!e || !e.length) return null; var t = {}; return e.forEach(function (n) { var r = n.field; t[r] = t[r] || [], t[r].push(n) }), t } function Yo(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)n[r - 1] = arguments[r]; var i = 0, s = n.length; if (typeof e == "function") return e.apply(null, n); if (typeof e == "string") { var c = e.replace(g7, function (o) { if (o === "%%") return "%"; if (i >= s) return o; switch (o) { case "%s": return String(n[i++]); case "%d": return Number(n[i++]); case "%j": try { return JSON.stringify(n[i++]) } catch { return "[Circular]" } break; default: return o } }); return c } return e } function x7(e) { return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern" } function Mi(e, t) { return !!(e == null || t === "array" && Array.isArray(e) && !e.length || x7(t) && typeof e == "string" && !e) } function _7(e, t, n) { var r = [], i = 0, s = e.length; function c(o) { r.push.apply(r, o || []), i++, i === s && n(r) } e.forEach(function (o) { t(o, c) }) } function NT(e, t, n) { var r = 0, i = e.length; function s(c) { if (c && c.length) { n(c); return } var o = r; r = r + 1, o < i ? t(e[o], s) : n([]) } s([]) } function b7(e) { var t = []; return Object.keys(e).forEach(function (n) { t.push.apply(t, e[n] || []) }), t } var OT = function (e) { p7(t, e); function t(n, r) { var i; return i = e.call(this, "Async Validation Error") || this, i.errors = n, i.fields = r, i } return t }(yw(Error)); function w7(e, t, n, r, i) { if (t.first) { var s = new Promise(function (w, P) { var k = function (R) { return r(R), R.length ? P(new OT(R, xw(R))) : w(i) }, A = b7(e); NT(A, n, k) }); return s.catch(function (w) { return w }), s } var c = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], o = Object.keys(e), f = o.length, p = 0, v = [], y = new Promise(function (w, P) { var k = function (N) { if (v.push.apply(v, N), p++, p === f) return r(v), v.length ? P(new OT(v, xw(v))) : w(i) }; o.length || (r(v), w(i)), o.forEach(function (A) { var N = e[A]; c.indexOf(A) !== -1 ? NT(N, n, k) : _7(N, n, k) }) }); return y.catch(function (w) { return w }), y } function C7(e) { return !!(e && e.message !== void 0) } function S7(e, t) { for (var n = e, r = 0; r < t.length; r++) { if (n == null) return n; n = n[t[r]] } return n } function DT(e, t) { return function (n) { var r; return e.fullFields ? r = S7(t, e.fullFields) : r = t[n.field || e.fullField], C7(n) ? (n.field = n.field || e.fullField, n.fieldValue = r, n) : { message: typeof n == "function" ? n() : n, fieldValue: r, field: n.field || e.fullField } } } function LT(e, t) { if (t) { for (var n in t) if (t.hasOwnProperty(n)) { var r = t[n]; typeof r == "object" && typeof e[n] == "object" ? e[n] = oc({}, e[n], r) : e[n] = r } } return e } var CN = function (t, n, r, i, s, c) { t.required && (!r.hasOwnProperty(t.field) || Mi(n, c || t.type)) && i.push(Yo(s.messages.required, t.fullField)) }, E7 = function (t, n, r, i, s) { (/^\s+$/.test(n) || n === "") && i.push(Yo(s.messages.whitespace, t.fullField)) }, ng, P7 = function () {
|
|
|
if (ng) return ng; var e = "[a-fA-F\\d:]", t = function (z) { return z && z.includeBoundaries ? "(?:(?<=\\s|^)(?=" + e + ")|(?<=" + e + ")(?=\\s|$))" : "" }, n = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", r = "[a-fA-F\\d]{1,4}", i = (`
|
|
|
(?:
|
|
|
(?:`+ r + ":){7}(?:" + r + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
|
(?:`+ r + ":){6}(?:" + n + "|:" + r + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
|
(?:`+ r + ":){5}(?::" + n + "|(?::" + r + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
|
(?:`+ r + ":){4}(?:(?::" + r + "){0,1}:" + n + "|(?::" + r + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
|
(?:`+ r + ":){3}(?:(?::" + r + "){0,2}:" + n + "|(?::" + r + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
|
(?:`+ r + ":){2}(?:(?::" + r + "){0,3}:" + n + "|(?::" + r + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
|
(?:`+ r + ":){1}(?:(?::" + r + "){0,4}:" + n + "|(?::" + r + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
|
(?::(?:(?::`+ r + "){0,5}:" + n + "|(?::" + r + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
|
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), s = new RegExp("(?:^" + n + "$)|(?:^" + i + "$)"), c = new RegExp("^" + n + "$"), o = new RegExp("^" + i + "$"), f = function (z) { return z && z.exact ? s : new RegExp("(?:" + t(z) + n + t(z) + ")|(?:" + t(z) + i + t(z) + ")", "g") }; f.v4 = function (O) { return O && O.exact ? c : new RegExp("" + t(O) + n + t(O), "g") }, f.v6 = function (O) { return O && O.exact ? o : new RegExp("" + t(O) + i + t(O), "g") }; var p = "(?:(?:[a-z]+:)?//)", v = "(?:\\S+(?::\\S*)?@)?", y = f.v4().source, w = f.v6().source, P = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", k = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", A = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", N = "(?::\\d{2,5})?", R = '(?:[/?#][^\\s"]*)?', M = "(?:" + p + "|www\\.)" + v + "(?:localhost|" + y + "|" + w + "|" + P + k + A + ")" + N + R; return ng = new RegExp("(?:^" + M + "$)", "i"), ng
|
|
|
}, zT = { email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/, hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i }, Yh = { integer: function (t) { return Yh.number(t) && parseInt(t, 10) === t }, float: function (t) { return Yh.number(t) && !Yh.integer(t) }, array: function (t) { return Array.isArray(t) }, regexp: function (t) { if (t instanceof RegExp) return !0; try { return !!new RegExp(t) } catch { return !1 } }, date: function (t) { return typeof t.getTime == "function" && typeof t.getMonth == "function" && typeof t.getYear == "function" && !isNaN(t.getTime()) }, number: function (t) { return isNaN(t) ? !1 : typeof t == "number" }, object: function (t) { return typeof t == "object" && !Yh.array(t) }, method: function (t) { return typeof t == "function" }, email: function (t) { return typeof t == "string" && t.length <= 320 && !!t.match(zT.email) }, url: function (t) { return typeof t == "string" && t.length <= 2048 && !!t.match(P7()) }, hex: function (t) { return typeof t == "string" && !!t.match(zT.hex) } }, T7 = function (t, n, r, i, s) { if (t.required && n === void 0) { CN(t, n, r, i, s); return } var c = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], o = t.type; c.indexOf(o) > -1 ? Yh[o](n) || i.push(Yo(s.messages.types[o], t.fullField, t.type)) : o && typeof n !== t.type && i.push(Yo(s.messages.types[o], t.fullField, t.type)) }, k7 = function (t, n, r, i, s) { var c = typeof t.len == "number", o = typeof t.min == "number", f = typeof t.max == "number", p = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, v = n, y = null, w = typeof n == "number", P = typeof n == "string", k = Array.isArray(n); if (w ? y = "number" : P ? y = "string" : k && (y = "array"), !y) return !1; k && (v = n.length), P && (v = n.replace(p, "_").length), c ? v !== t.len && i.push(Yo(s.messages[y].len, t.fullField, t.len)) : o && !f && v < t.min ? i.push(Yo(s.messages[y].min, t.fullField, t.min)) : f && !o && v > t.max ? i.push(Yo(s.messages[y].max, t.fullField, t.max)) : o && f && (v < t.min || v > t.max) && i.push(Yo(s.messages[y].range, t.fullField, t.min, t.max)) }, pd = "enum", I7 = function (t, n, r, i, s) { t[pd] = Array.isArray(t[pd]) ? t[pd] : [], t[pd].indexOf(n) === -1 && i.push(Yo(s.messages[pd], t.fullField, t[pd].join(", "))) }, R7 = function (t, n, r, i, s) { if (t.pattern) { if (t.pattern instanceof RegExp) t.pattern.lastIndex = 0, t.pattern.test(n) || i.push(Yo(s.messages.pattern.mismatch, t.fullField, n, t.pattern)); else if (typeof t.pattern == "string") { var c = new RegExp(t.pattern); c.test(n) || i.push(Yo(s.messages.pattern.mismatch, t.fullField, n, t.pattern)) } } }, or = { required: CN, whitespace: E7, type: T7, range: k7, enum: I7, pattern: R7 }, M7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n, "string") && !t.required) return r(); or.required(t, n, i, c, s, "string"), Mi(n, "string") || (or.type(t, n, i, c, s), or.range(t, n, i, c, s), or.pattern(t, n, i, c, s), t.whitespace === !0 && or.whitespace(t, n, i, c, s)) } r(c) }, A7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && or.type(t, n, i, c, s) } r(c) }, N7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (n === "" && (n = void 0), Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && (or.type(t, n, i, c, s), or.range(t, n, i, c, s)) } r(c) }, O7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && or.type(t, n, i, c, s) } r(c) }, D7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), Mi(n) || or.type(t, n, i, c, s) } r(c) }, L7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && (or.type(t, n, i, c, s), or.range(t, n, i, c, s)) } r(c) }, z7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && (or.type(t, n, i, c, s), or.range(t, n, i, c, s)) } r(c) }, F7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (n == null && !t.required) return r(); or.required(t, n, i, c, s, "array"), n != null && (or.type(t, n, i, c, s), or.range(t, n, i, c, s)) } r(c) }, $7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && or.type(t, n, i, c, s) } r(c) }, B7 = "enum", V7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s), n !== void 0 && or[B7](t, n, i, c, s) } r(c) }, U7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n, "string") && !t.required) return r(); or.required(t, n, i, c, s), Mi(n, "string") || or.pattern(t, n, i, c, s) } r(c) }, j7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n, "date") && !t.required) return r(); if (or.required(t, n, i, c, s), !Mi(n, "date")) { var f; n instanceof Date ? f = n : f = new Date(n), or.type(t, f, i, c, s), f && or.range(t, f.getTime(), i, c, s) } } r(c) }, K7 = function (t, n, r, i, s) { var c = [], o = Array.isArray(n) ? "array" : typeof n; or.required(t, n, i, c, s, o), r(c) }, u1 = function (t, n, r, i, s) { var c = t.type, o = [], f = t.required || !t.required && i.hasOwnProperty(t.field); if (f) { if (Mi(n, c) && !t.required) return r(); or.required(t, n, i, o, s, c), Mi(n, c) || or.type(t, n, i, o, s) } r(o) }, H7 = function (t, n, r, i, s) { var c = [], o = t.required || !t.required && i.hasOwnProperty(t.field); if (o) { if (Mi(n) && !t.required) return r(); or.required(t, n, i, c, s) } r(c) }, cp = { string: M7, method: A7, number: N7, boolean: O7, regexp: D7, integer: L7, float: z7, array: F7, object: $7, enum: V7, pattern: U7, date: j7, url: u1, hex: u1, email: u1, required: K7, any: H7 }; function _w() { return { default: "Validation error on field %s", required: "%s is required", enum: "%s must be one of %s", whitespace: "%s cannot be empty", date: { format: "%s date %s is invalid for format %s", parse: "%s date could not be parsed, %s is invalid ", invalid: "%s date %s is invalid" }, types: { string: "%s is not a %s", method: "%s is not a %s (function)", array: "%s is not an %s", object: "%s is not an %s", number: "%s is not a %s", date: "%s is not a %s", boolean: "%s is not a %s", integer: "%s is not an %s", float: "%s is not a %s", regexp: "%s is not a valid %s", email: "%s is not a valid %s", url: "%s is not a valid %s", hex: "%s is not a valid %s" }, string: { len: "%s must be exactly %s characters", min: "%s must be at least %s characters", max: "%s cannot be longer than %s characters", range: "%s must be between %s and %s characters" }, number: { len: "%s must equal %s", min: "%s cannot be less than %s", max: "%s cannot be greater than %s", range: "%s must be between %s and %s" }, array: { len: "%s must be exactly %s in length", min: "%s cannot be less than %s in length", max: "%s cannot be greater than %s in length", range: "%s must be between %s and %s in length" }, pattern: { mismatch: "%s value %s does not match pattern %s" }, clone: function () { var t = JSON.parse(JSON.stringify(this)); return t.clone = this.clone, t } } } var bw = _w(), dm = function () { function e(n) { this.rules = null, this._messages = bw, this.define(n) } var t = e.prototype; return t.define = function (r) { var i = this; if (!r) throw new Error("Cannot configure a schema with no rules"); if (typeof r != "object" || Array.isArray(r)) throw new Error("Rules must be an object"); this.rules = {}, Object.keys(r).forEach(function (s) { var c = r[s]; i.rules[s] = Array.isArray(c) ? c : [c] }) }, t.messages = function (r) { return r && (this._messages = LT(_w(), r)), this._messages }, t.validate = function (r, i, s) { var c = this; i === void 0 && (i = {}), s === void 0 && (s = function () { }); var o = r, f = i, p = s; if (typeof f == "function" && (p = f, f = {}), !this.rules || Object.keys(this.rules).length === 0) return p && p(null, o), Promise.resolve(o); function v(A) { var N = [], R = {}; function M(z) { if (Array.isArray(z)) { var B; N = (B = N).concat.apply(B, z) } else N.push(z) } for (var O = 0; O < A.length; O++)M(A[O]); N.length ? (R = xw(N), p(N, R)) : p(null, o) } if (f.messages) { var y = this.messages(); y === bw && (y = _w()), LT(y, f.messages), f.messages = y } else f.messages = this.messages(); var w = {}, P = f.keys || Object.keys(this.rules); P.forEach(function (A) { var N = c.rules[A], R = o[A]; N.forEach(function (M) { var O = M; typeof O.transform == "function" && (o === r && (o = oc({}, o)), R = o[A] = O.transform(R)), typeof O == "function" ? O = { validator: O } : O = oc({}, O), O.validator = c.getValidationMethod(O), O.validator && (O.field = A, O.fullField = O.fullField || A, O.type = c.getType(O), w[A] = w[A] || [], w[A].push({ rule: O, value: R, source: o, field: A })) }) }); var k = {}; return w7(w, f, function (A, N) { var R = A.rule, M = (R.type === "object" || R.type === "array") && (typeof R.fields == "object" || typeof R.defaultField == "object"); M = M && (R.required || !R.required && A.value), R.field = A.field; function O(V, G) { return oc({}, G, { fullField: R.fullField + "." + V, fullFields: R.fullFields ? [].concat(R.fullFields, [V]) : [V] }) } function z(V) { V === void 0 && (V = []); var G = Array.isArray(V) ? V : [V]; !f.suppressWarning && G.length && e.warning("async-validator:", G), G.length && R.message !== void 0 && (G = [].concat(R.message)); var j = G.map(DT(R, o)); if (f.first && j.length) return k[R.field] = 1, N(j); if (!M) N(j); else { if (R.required && !A.value) return R.message !== void 0 ? j = [].concat(R.message).map(DT(R, o)) : f.error && (j = [f.error(R, Yo(f.messages.required, R.field))]), N(j); var X = {}; R.defaultField && Object.keys(A.value).map(function (ee) { X[ee] = R.defaultField }), X = oc({}, X, A.rule.fields); var Y = {}; Object.keys(X).forEach(function (ee) { var Z = X[ee], J = Array.isArray(Z) ? Z : [Z]; Y[ee] = J.map(O.bind(null, ee)) }); var se = new e(Y); se.messages(f.messages), A.rule.options && (A.rule.options.messages = f.messages, A.rule.options.error = f.error), se.validate(A.value, A.rule.options || f, function (ee) { var Z = []; j && j.length && Z.push.apply(Z, j), ee && ee.length && Z.push.apply(Z, ee), N(Z.length ? Z : null) }) } } var B; if (R.asyncValidator) B = R.asyncValidator(R, A.value, z, A.source, f); else if (R.validator) { try { B = R.validator(R, A.value, z, A.source, f) } catch (V) { console.error == null || console.error(V), f.suppressValidatorError || setTimeout(function () { throw V }, 0), z(V.message) } B === !0 ? z() : B === !1 ? z(typeof R.message == "function" ? R.message(R.fullField || R.field) : R.message || (R.fullField || R.field) + " fails") : B instanceof Array ? z(B) : B instanceof Error && z(B.message) } B && B.then && B.then(function () { return z() }, function (V) { return z(V) }) }, function (A) { v(A) }, o) }, t.getType = function (r) { if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !cp.hasOwnProperty(r.type)) throw new Error(Yo("Unknown rule type %s", r.type)); return r.type || "string" }, t.getValidationMethod = function (r) { if (typeof r.validator == "function") return r.validator; var i = Object.keys(r), s = i.indexOf("message"); return s !== -1 && i.splice(s, 1), i.length === 1 && i[0] === "required" ? cp.required : cp[this.getType(r)] || void 0 }, e }(); dm.register = function (t, n) { if (typeof n != "function") throw new Error("Cannot register a validator by type, validator is not a function"); cp[t] = n }; dm.warning = y7; dm.messages = bw; dm.validators = cp; var Wo = "'${name}' is not a valid ${type}", SN = { default: "Validation error on field '${name}'", required: "'${name}' is required", enum: "'${name}' must be one of [${enum}]", whitespace: "'${name}' cannot be empty", date: { format: "'${name}' is invalid for format date", parse: "'${name}' could not be parsed as date", invalid: "'${name}' is invalid date" }, types: { string: Wo, method: Wo, array: Wo, object: Wo, number: Wo, date: Wo, boolean: Wo, integer: Wo, float: Wo, regexp: Wo, email: Wo, url: Wo, hex: Wo }, string: { len: "'${name}' must be exactly ${len} characters", min: "'${name}' must be at least ${min} characters", max: "'${name}' cannot be longer than ${max} characters", range: "'${name}' must be between ${min} and ${max} characters" }, number: { len: "'${name}' must equal ${len}", min: "'${name}' cannot be less than ${min}", max: "'${name}' cannot be greater than ${max}", range: "'${name}' must be between ${min} and ${max}" }, array: { len: "'${name}' must be exactly ${len} in length", min: "'${name}' cannot be less than ${min} in length", max: "'${name}' cannot be greater than ${max} in length", range: "'${name}' must be between ${min} and ${max} in length" }, pattern: { mismatch: "'${name}' does not match pattern ${pattern}" } }; function EN(e, t) { for (var n = e, r = 0; r < t.length; r += 1) { if (n == null) return; n = n[t[r]] } return n } function PN(e) { if (Array.isArray(e)) return e } function TN() {
|
|
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)
|
|
|
} function JS(e) { return PN(e) || wN(e) || QS(e) || TN() } function kN(e, t, n, r) { if (!t.length) return n; var i = JS(t), s = i[0], c = i.slice(1), o; return !e && typeof s == "number" ? o = [] : Array.isArray(e) ? o = Et(e) : o = ge({}, e), r && n === void 0 && c.length === 1 ? delete o[s][c[0]] : o[s] = kN(o[s], c, n, r), o } function W7(e, t, n) { var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; return t.length && r && n === void 0 && !EN(e, t.slice(0, -1)) ? e : kN(e, t, n, r) } function B0(e) { return Array.isArray(e) ? q7(e) : ln(e) === "object" && e !== null ? G7(e) : e } function G7(e) { if (Object.getPrototypeOf(e) === Object.prototype) { var t = {}; for (var n in e) t[n] = B0(e[n]); return t } return e } function q7(e) { return e.map(function (t) { return B0(t) }) } function pi(e) { return vw(e) } function Zl(e, t) { var n = EN(e, t); return n } function Fl(e, t, n) { var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, i = W7(e, t, n, r); return i } function FT(e, t) { var n = {}; return t.forEach(function (r) { var i = Zl(e, r); n = Fl(n, r, i) }), n } function dp(e, t) { return e && e.some(function (n) { return RN(n, t) }) } function $T(e) { return ln(e) === "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype } function IN(e, t) { var n = Array.isArray(e) ? Et(e) : ge({}, e); return t && Object.keys(t).forEach(function (r) { var i = n[r], s = t[r], c = $T(i) && $T(s); n[r] = c ? IN(i, s || {}) : B0(s) }), n } function Vg(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)n[r - 1] = arguments[r]; return n.reduce(function (i, s) { return IN(i, s) }, e) } function RN(e, t) { return !e || !t || e.length !== t.length ? !1 : e.every(function (n, r) { return t[r] === n }) } function Z7(e, t) { if (e === t) return !0; if (!e && t || e && !t || !e || !t || ln(e) !== "object" || ln(t) !== "object") return !1; var n = Object.keys(e), r = Object.keys(t), i = new Set([].concat(n, r)); return Et(i).every(function (s) { var c = e[s], o = t[s]; return typeof c == "function" && typeof o == "function" ? !0 : c === o }) } function X7(e) { var t = arguments.length <= 1 ? void 0 : arguments[1]; return t && t.target && ln(t.target) === "object" && e in t.target ? t.target[e] : t } function BT(e, t, n) { var r = e.length; if (t < 0 || t >= r || n < 0 || n >= r) return e; var i = e[t], s = t - n; return s > 0 ? [].concat(Et(e.slice(0, n)), [i], Et(e.slice(n, t)), Et(e.slice(t + 1, r))) : s < 0 ? [].concat(Et(e.slice(0, t)), Et(e.slice(t + 1, n + 1)), [i], Et(e.slice(n + 1, r))) : e } var Y7 = dm; function Q7(e, t) { return e.replace(/\$\{\w+\}/g, function (n) { var r = n.slice(2, -1); return t[r] }) } var VT = "CODE_LOGIC_ERROR"; function ww(e, t, n, r, i) { return Cw.apply(this, arguments) } function Cw() { return Cw = Rc(bo().mark(function e(t, n, r, i, s) { var c, o, f, p, v, y, w, P, k; return bo().wrap(function (N) { for (; ;)switch (N.prev = N.next) { case 0: return c = ge({}, r), delete c.ruleIndex, c.validator && (o = c.validator, c.validator = function () { try { return o.apply(void 0, arguments) } catch (R) { return console.error(R), Promise.reject(VT) } }), f = null, c && c.type === "array" && c.defaultField && (f = c.defaultField, delete c.defaultField), p = new Y7(re({}, t, [c])), v = Vg({}, SN, i.validateMessages), p.messages(v), y = [], N.prev = 9, N.next = 12, Promise.resolve(p.validate(re({}, t, n), ge({}, i))); case 12: N.next = 17; break; case 14: N.prev = 14, N.t0 = N.catch(9), N.t0.errors && (y = N.t0.errors.map(function (R, M) { var O = R.message, z = O === VT ? v.default : O; return C.exports.isValidElement(z) ? C.exports.cloneElement(z, { key: "error_".concat(M) }) : z })); case 17: if (!(!y.length && f)) { N.next = 22; break } return N.next = 20, Promise.all(n.map(function (R, M) { return ww("".concat(t, ".").concat(M), R, f, i, s) })); case 20: return w = N.sent, N.abrupt("return", w.reduce(function (R, M) { return [].concat(Et(R), Et(M)) }, [])); case 22: return P = ge(ge({}, r), {}, { name: t, enum: (r.enum || []).join(", ") }, s), k = y.map(function (R) { return typeof R == "string" ? Q7(R, P) : R }), N.abrupt("return", k); case 25: case "end": return N.stop() } }, e, null, [[9, 14]]) })), Cw.apply(this, arguments) } function J7(e, t, n, r, i, s) { var c = e.join("."), o = n.map(function (v, y) { var w = v.validator, P = ge(ge({}, v), {}, { ruleIndex: y }); return w && (P.validator = function (k, A, N) { var R = !1, M = function () { for (var B = arguments.length, V = new Array(B), G = 0; G < B; G++)V[G] = arguments[G]; Promise.resolve().then(function () { Rr(!R, "Your validator function has already return a promise. `callback` will be ignored."), R || N.apply(void 0, V) }) }, O = w(k, A, M); R = O && typeof O.then == "function" && typeof O.catch == "function", Rr(R, "`callback` is deprecated. Please return a promise instead."), R && O.then(function () { N() }).catch(function (z) { N(z || " ") }) }), P }).sort(function (v, y) { var w = v.warningOnly, P = v.ruleIndex, k = y.warningOnly, A = y.ruleIndex; return !!w == !!k ? P - A : w ? 1 : -1 }), f; if (i === !0) f = new Promise(function () { var v = Rc(bo().mark(function y(w, P) { var k, A, N; return bo().wrap(function (M) { for (; ;)switch (M.prev = M.next) { case 0: k = 0; case 1: if (!(k < o.length)) { M.next = 12; break } return A = o[k], M.next = 5, ww(c, t, A, r, s); case 5: if (N = M.sent, !N.length) { M.next = 9; break } return P([{ errors: N, rule: A }]), M.abrupt("return"); case 9: k += 1, M.next = 1; break; case 12: w([]); case 13: case "end": return M.stop() } }, y) })); return function (y, w) { return v.apply(this, arguments) } }()); else { var p = o.map(function (v) { return ww(c, t, v, r, s).then(function (y) { return { errors: y, rule: v } }) }); f = (i ? tU(p) : eU(p)).then(function (v) { return Promise.reject(v) }) } return f.catch(function (v) { return v }), f } function eU(e) { return Sw.apply(this, arguments) } function Sw() { return Sw = Rc(bo().mark(function e(t) { return bo().wrap(function (r) { for (; ;)switch (r.prev = r.next) { case 0: return r.abrupt("return", Promise.all(t).then(function (i) { var s, c = (s = []).concat.apply(s, Et(i)); return c })); case 1: case "end": return r.stop() } }, e) })), Sw.apply(this, arguments) } function tU(e) { return Ew.apply(this, arguments) } function Ew() { return Ew = Rc(bo().mark(function e(t) { var n; return bo().wrap(function (i) { for (; ;)switch (i.prev = i.next) { case 0: return n = 0, i.abrupt("return", new Promise(function (s) { t.forEach(function (c) { c.then(function (o) { o.errors.length && s([o]), n += 1, n === t.length && s([]) }) }) })); case 2: case "end": return i.stop() } }, e) })), Ew.apply(this, arguments) } var nU = ["name"], da = []; function UT(e, t, n, r, i, s) { return typeof e == "function" ? e(t, n, "source" in s ? { source: s.source } : {}) : r !== i } var e2 = function (e) { ui(n, e); var t = ci(n); function n(r) { var i; if (zr(this, n), i = t.call(this, r), i.state = { resetCount: 0 }, i.cancelRegisterFunc = null, i.mounted = !1, i.touched = !1, i.dirty = !1, i.validatePromise = null, i.prevValidating = void 0, i.errors = da, i.warnings = da, i.cancelRegister = function () { var f = i.props, p = f.preserve, v = f.isListField, y = f.name; i.cancelRegisterFunc && i.cancelRegisterFunc(v, p, pi(y)), i.cancelRegisterFunc = null }, i.getNamePath = function () { var f = i.props, p = f.name, v = f.fieldContext, y = v.prefixName, w = y === void 0 ? [] : y; return p !== void 0 ? [].concat(Et(w), Et(p)) : [] }, i.getRules = function () { var f = i.props, p = f.rules, v = p === void 0 ? [] : p, y = f.fieldContext; return v.map(function (w) { return typeof w == "function" ? w(y) : w }) }, i.refresh = function () { !i.mounted || i.setState(function (f) { var p = f.resetCount; return { resetCount: p + 1 } }) }, i.triggerMetaEvent = function (f) { var p = i.props.onMetaChange; p == null || p(ge(ge({}, i.getMeta()), {}, { destroy: f })) }, i.onStoreChange = function (f, p, v) { var y = i.props, w = y.shouldUpdate, P = y.dependencies, k = P === void 0 ? [] : P, A = y.onReset, N = v.store, R = i.getNamePath(), M = i.getValue(f), O = i.getValue(N), z = p && dp(p, R); switch (v.type === "valueUpdate" && v.source === "external" && M !== O && (i.touched = !0, i.dirty = !0, i.validatePromise = null, i.errors = da, i.warnings = da, i.triggerMetaEvent()), v.type) { case "reset": if (!p || z) { i.touched = !1, i.dirty = !1, i.validatePromise = null, i.errors = da, i.warnings = da, i.triggerMetaEvent(), A == null || A(), i.refresh(); return } break; case "remove": { if (w) { i.reRender(); return } break } case "setField": { if (z) { var B = v.data; "touched" in B && (i.touched = B.touched), "validating" in B && !("originRCField" in B) && (i.validatePromise = B.validating ? Promise.resolve([]) : null), "errors" in B && (i.errors = B.errors || da), "warnings" in B && (i.warnings = B.warnings || da), i.dirty = !0, i.triggerMetaEvent(), i.reRender(); return } if (w && !R.length && UT(w, f, N, M, O, v)) { i.reRender(); return } break } case "dependenciesUpdate": { var V = k.map(pi); if (V.some(function (G) { return dp(v.relatedFields, G) })) { i.reRender(); return } break } default: if (z || (!k.length || R.length || w) && UT(w, f, N, M, O, v)) { i.reRender(); return } break }w === !0 && i.reRender() }, i.validateRules = function (f) { var p = i.getNamePath(), v = i.getValue(), y = Promise.resolve().then(function () { if (!i.mounted) return []; var w = i.props, P = w.validateFirst, k = P === void 0 ? !1 : P, A = w.messageVariables, N = f || {}, R = N.triggerName, M = i.getRules(); R && (M = M.filter(function (z) { return z }).filter(function (z) { var B = z.validateTrigger; if (!B) return !0; var V = vw(B); return V.includes(R) })); var O = J7(p, v, M, f, k, A); return O.catch(function (z) { return z }).then(function () { var z = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : da; if (i.validatePromise === y) { var B; i.validatePromise = null; var V = [], G = []; (B = z.forEach) === null || B === void 0 || B.call(z, function (j) { var X = j.rule.warningOnly, Y = j.errors, se = Y === void 0 ? da : Y; X ? G.push.apply(G, Et(se)) : V.push.apply(V, Et(se)) }), i.errors = V, i.warnings = G, i.triggerMetaEvent(), i.reRender() } }), O }); return i.validatePromise = y, i.dirty = !0, i.errors = da, i.warnings = da, i.triggerMetaEvent(), i.reRender(), y }, i.isFieldValidating = function () { return !!i.validatePromise }, i.isFieldTouched = function () { return i.touched }, i.isFieldDirty = function () { if (i.dirty || i.props.initialValue !== void 0) return !0; var f = i.props.fieldContext, p = f.getInternalHooks(ic), v = p.getInitialValue; return v(i.getNamePath()) !== void 0 }, i.getErrors = function () { return i.errors }, i.getWarnings = function () { return i.warnings }, i.isListField = function () { return i.props.isListField }, i.isList = function () { return i.props.isList }, i.isPreserve = function () { return i.props.preserve }, i.getMeta = function () { i.prevValidating = i.isFieldValidating(); var f = { touched: i.isFieldTouched(), validating: i.prevValidating, errors: i.errors, warnings: i.warnings, name: i.getNamePath() }; return f }, i.getOnlyChild = function (f) { if (typeof f == "function") { var p = i.getMeta(); return ge(ge({}, i.getOnlyChild(f(i.getControlled(), p, i.props.fieldContext))), {}, { isFunction: !0 }) } var v = Zi(f); return v.length !== 1 || !C.exports.isValidElement(v[0]) ? { child: v, isFunction: !1 } : { child: v[0], isFunction: !1 } }, i.getValue = function (f) { var p = i.props.fieldContext.getFieldsValue, v = i.getNamePath(); return Zl(f || p(!0), v) }, i.getControlled = function () { var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, p = i.props, v = p.trigger, y = p.validateTrigger, w = p.getValueFromEvent, P = p.normalize, k = p.valuePropName, A = p.getValueProps, N = p.fieldContext, R = y !== void 0 ? y : N.validateTrigger, M = i.getNamePath(), O = N.getInternalHooks, z = N.getFieldsValue, B = O(ic), V = B.dispatch, G = i.getValue(), j = A || function (ee) { return re({}, k, ee) }, X = f[v], Y = ge(ge({}, f), j(G)); Y[v] = function () { i.touched = !0, i.dirty = !0, i.triggerMetaEvent(); for (var ee, Z = arguments.length, J = new Array(Z), ve = 0; ve < Z; ve++)J[ve] = arguments[ve]; w ? ee = w.apply(void 0, J) : ee = X7.apply(void 0, [k].concat(J)), P && (ee = P(ee, G, z(!0))), V({ type: "updateValue", namePath: M, value: ee }), X && X.apply(void 0, J) }; var se = vw(R || []); return se.forEach(function (ee) { var Z = Y[ee]; Y[ee] = function () { Z && Z.apply(void 0, arguments); var J = i.props.rules; J && J.length && V({ type: "validateField", namePath: M, triggerName: ee }) } }), Y }, r.fieldContext) { var s = r.fieldContext.getInternalHooks, c = s(ic), o = c.initEntityValue; o(Ln(i)) } return i } return Fr(n, [{ key: "componentDidMount", value: function () { var i = this.props, s = i.shouldUpdate, c = i.fieldContext; if (this.mounted = !0, c) { var o = c.getInternalHooks, f = o(ic), p = f.registerField; this.cancelRegisterFunc = p(this) } s === !0 && this.reRender() } }, { key: "componentWillUnmount", value: function () { this.cancelRegister(), this.triggerMetaEvent(!0), this.mounted = !1 } }, { key: "reRender", value: function () { !this.mounted || this.forceUpdate() } }, { key: "render", value: function () { this.state.resetCount; var i = this.props.children, s = this.getOnlyChild(i), c = s.child, o = s.isFunction, f; return o ? f = c : C.exports.isValidElement(c) ? f = C.exports.cloneElement(c, this.getControlled(c.props)) : (Rr(!c, "`children` of Field is not validate ReactElement."), f = c), I(An, { children: f }) } }]), n }(C.exports.Component); e2.contextType = wc; e2.defaultProps = { trigger: "onChange", valuePropName: "value" }; function t2(e) { var t = e.name, n = Rn(e, nU), r = C.exports.useContext(wc), i = t !== void 0 ? pi(t) : void 0, s = "keep"; return n.isListField || (s = "_".concat((i || []).join("_"))), I(e2, { name: i, ...n, fieldContext: r }, s) } var MN = C.exports.createContext(null), AN = function (t) { var n = t.name, r = t.initialValue, i = t.children, s = t.rules, c = t.validateTrigger, o = C.exports.useContext(wc), f = C.exports.useRef({ keys: [], id: 0 }), p = f.current, v = C.exports.useMemo(function () { var k = pi(o.prefixName) || []; return [].concat(Et(k), Et(pi(n))) }, [o.prefixName, n]), y = C.exports.useMemo(function () { return ge(ge({}, o), {}, { prefixName: v }) }, [o, v]), w = C.exports.useMemo(function () { return { getKey: function (A) { var N = v.length, R = A[N]; return [p.keys[R], A.slice(N + 1)] } } }, [v]); if (typeof i != "function") return Rr(!1, "Form.List only accepts function as children."), null; var P = function (A, N, R) { var M = R.source; return M === "internal" ? !1 : A !== N }; return I(MN.Provider, { value: w, children: I(wc.Provider, { value: y, children: I(t2, { name: [], shouldUpdate: P, rules: s, validateTrigger: c, initialValue: r, isList: !0, children: function (k, A) { var N = k.value, R = N === void 0 ? [] : N, M = k.onChange, O = o.getFieldValue, z = function () { var j = O(v || []); return j || [] }, B = { add: function (j, X) { var Y = z(); X >= 0 && X <= Y.length ? (p.keys = [].concat(Et(p.keys.slice(0, X)), [p.id], Et(p.keys.slice(X))), M([].concat(Et(Y.slice(0, X)), [j], Et(Y.slice(X))))) : (p.keys = [].concat(Et(p.keys), [p.id]), M([].concat(Et(Y), [j]))), p.id += 1 }, remove: function (j) { var X = z(), Y = new Set(Array.isArray(j) ? j : [j]); Y.size <= 0 || (p.keys = p.keys.filter(function (se, ee) { return !Y.has(ee) }), M(X.filter(function (se, ee) { return !Y.has(ee) }))) }, move: function (j, X) { if (j !== X) { var Y = z(); j < 0 || j >= Y.length || X < 0 || X >= Y.length || (p.keys = BT(p.keys, j, X), M(BT(Y, j, X))) } } }, V = R || []; return Array.isArray(V) || (V = []), i(V.map(function (G, j) { var X = p.keys[j]; return X === void 0 && (p.keys[j] = p.id, X = p.keys[j], p.id += 1), { name: j, key: X, isListField: !0 } }), B, A) } }) }) }) }; function rU(e, t) { var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]; if (n != null) { var r, i, s, c, o = [], f = !0, p = !1; try { if (s = (n = n.call(e)).next, t === 0) { if (Object(n) !== n) return; f = !1 } else for (; !(f = (r = s.call(n)).done) && (o.push(r.value), o.length !== t); f = !0); } catch (v) { p = !0, i = v } finally { try { if (!f && n.return != null && (c = n.return(), Object(c) !== c)) return } finally { if (p) throw i } } return o } } function ze(e, t) { return PN(e) || rU(e, t) || QS(e, t) || TN() } function iU(e) { var t = !1, n = e.length, r = []; return e.length ? new Promise(function (i, s) { e.forEach(function (c, o) { c.catch(function (f) { return t = !0, f }).then(function (f) { n -= 1, r[o] = f, !(n > 0) && (t && s(r), i(r)) }) }) }) : Promise.resolve([]) } var NN = "__@field_split__"; function c1(e) { return e.map(function (t) { return "".concat(ln(t), ":").concat(t) }).join(NN) } var md = function () { function e() { zr(this, e), this.kvs = new Map } return Fr(e, [{ key: "set", value: function (n, r) { this.kvs.set(c1(n), r) } }, { key: "get", value: function (n) { return this.kvs.get(c1(n)) } }, { key: "update", value: function (n, r) { var i = this.get(n), s = r(i); s ? this.set(n, s) : this.delete(n) } }, { key: "delete", value: function (n) { this.kvs.delete(c1(n)) } }, { key: "map", value: function (n) { return Et(this.kvs.entries()).map(function (r) { var i = ze(r, 2), s = i[0], c = i[1], o = s.split(NN); return n({ key: o.map(function (f) { var p = f.match(/^([^:]*):(.*)$/), v = ze(p, 3), y = v[1], w = v[2]; return y === "number" ? Number(w) : w }), value: c }) }) } }, { key: "toJSON", value: function () { var n = {}; return this.map(function (r) { var i = r.key, s = r.value; return n[i.join(".")] = s, null }), n } }]), e }(), oU = ["name", "errors"], aU = Fr(function e(t) { var n = this; zr(this, e), this.formHooked = !1, this.forceRootUpdate = void 0, this.subscribable = !0, this.store = {}, this.fieldEntities = [], this.initialValues = {}, this.callbacks = {}, this.validateMessages = null, this.preserve = null, this.lastValidatePromise = null, this.getForm = function () { return { getFieldValue: n.getFieldValue, getFieldsValue: n.getFieldsValue, getFieldError: n.getFieldError, getFieldWarning: n.getFieldWarning, getFieldsError: n.getFieldsError, isFieldsTouched: n.isFieldsTouched, isFieldTouched: n.isFieldTouched, isFieldValidating: n.isFieldValidating, isFieldsValidating: n.isFieldsValidating, resetFields: n.resetFields, setFields: n.setFields, setFieldValue: n.setFieldValue, setFieldsValue: n.setFieldsValue, validateFields: n.validateFields, submit: n.submit, _init: !0, getInternalHooks: n.getInternalHooks } }, this.getInternalHooks = function (r) { return r === ic ? (n.formHooked = !0, { dispatch: n.dispatch, initEntityValue: n.initEntityValue, registerField: n.registerField, useSubscribe: n.useSubscribe, setInitialValues: n.setInitialValues, destroyForm: n.destroyForm, setCallbacks: n.setCallbacks, setValidateMessages: n.setValidateMessages, getFields: n.getFields, setPreserve: n.setPreserve, getInitialValue: n.getInitialValue, registerWatch: n.registerWatch }) : (Rr(!1, "`getInternalHooks` is internal usage. Should not call directly."), null) }, this.useSubscribe = function (r) { n.subscribable = r }, this.prevWithoutPreserves = null, this.setInitialValues = function (r, i) { if (n.initialValues = r || {}, i) { var s, c = Vg({}, r, n.store); (s = n.prevWithoutPreserves) === null || s === void 0 || s.map(function (o) { var f = o.key; c = Fl(c, f, Zl(r, f)) }), n.prevWithoutPreserves = null, n.updateStore(c) } }, this.destroyForm = function () { var r = new md; n.getFieldEntities(!0).forEach(function (i) { n.isMergedPreserve(i.isPreserve()) || r.set(i.getNamePath(), !0) }), n.prevWithoutPreserves = r }, this.getInitialValue = function (r) { var i = Zl(n.initialValues, r); return r.length ? B0(i) : i }, this.setCallbacks = function (r) { n.callbacks = r }, this.setValidateMessages = function (r) { n.validateMessages = r }, this.setPreserve = function (r) { n.preserve = r }, this.watchList = [], this.registerWatch = function (r) { return n.watchList.push(r), function () { n.watchList = n.watchList.filter(function (i) { return i !== r }) } }, this.notifyWatch = function () { var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; if (n.watchList.length) { var i = n.getFieldsValue(); n.watchList.forEach(function (s) { s(i, r) }) } }, this.timeoutId = null, this.warningUnhooked = function () { }, this.updateStore = function (r) { n.store = r }, this.getFieldEntities = function () { var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1; return r ? n.fieldEntities.filter(function (i) { return i.getNamePath().length }) : n.fieldEntities }, this.getFieldsMap = function () { var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = new md; return n.getFieldEntities(r).forEach(function (s) { var c = s.getNamePath(); i.set(c, s) }), i }, this.getFieldEntitiesForNamePathList = function (r) { if (!r) return n.getFieldEntities(!0); var i = n.getFieldsMap(!0); return r.map(function (s) { var c = pi(s); return i.get(c) || { INVALIDATE_NAME_PATH: pi(s) } }) }, this.getFieldsValue = function (r, i) { if (n.warningUnhooked(), r === !0 && !i) return n.store; var s = n.getFieldEntitiesForNamePathList(Array.isArray(r) ? r : null), c = []; return s.forEach(function (o) { var f, p = "INVALIDATE_NAME_PATH" in o ? o.INVALIDATE_NAME_PATH : o.getNamePath(); if (!(!r && ((f = o.isListField) === null || f === void 0 ? void 0 : f.call(o)))) if (!i) c.push(p); else { var v = "getMeta" in o ? o.getMeta() : null; i(v) && c.push(p) } }), FT(n.store, c.map(pi)) }, this.getFieldValue = function (r) { n.warningUnhooked(); var i = pi(r); return Zl(n.store, i) }, this.getFieldsError = function (r) { n.warningUnhooked(); var i = n.getFieldEntitiesForNamePathList(r); return i.map(function (s, c) { return s && !("INVALIDATE_NAME_PATH" in s) ? { name: s.getNamePath(), errors: s.getErrors(), warnings: s.getWarnings() } : { name: pi(r[c]), errors: [], warnings: [] } }) }, this.getFieldError = function (r) { n.warningUnhooked(); var i = pi(r), s = n.getFieldsError([i])[0]; return s.errors }, this.getFieldWarning = function (r) { n.warningUnhooked(); var i = pi(r), s = n.getFieldsError([i])[0]; return s.warnings }, this.isFieldsTouched = function () { n.warningUnhooked(); for (var r = arguments.length, i = new Array(r), s = 0; s < r; s++)i[s] = arguments[s]; var c = i[0], o = i[1], f, p = !1; i.length === 0 ? f = null : i.length === 1 ? Array.isArray(c) ? (f = c.map(pi), p = !1) : (f = null, p = c) : (f = c.map(pi), p = o); var v = n.getFieldEntities(!0), y = function (N) { return N.isFieldTouched() }; if (!f) return p ? v.every(y) : v.some(y); var w = new md; f.forEach(function (A) { w.set(A, []) }), v.forEach(function (A) { var N = A.getNamePath(); f.forEach(function (R) { R.every(function (M, O) { return N[O] === M }) && w.update(R, function (M) { return [].concat(Et(M), [A]) }) }) }); var P = function (N) { return N.some(y) }, k = w.map(function (A) { var N = A.value; return N }); return p ? k.every(P) : k.some(P) }, this.isFieldTouched = function (r) { return n.warningUnhooked(), n.isFieldsTouched([r]) }, this.isFieldsValidating = function (r) { n.warningUnhooked(); var i = n.getFieldEntities(); if (!r) return i.some(function (c) { return c.isFieldValidating() }); var s = r.map(pi); return i.some(function (c) { var o = c.getNamePath(); return dp(s, o) && c.isFieldValidating() }) }, this.isFieldValidating = function (r) { return n.warningUnhooked(), n.isFieldsValidating([r]) }, this.resetWithFieldInitialValue = function () { var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = new md, s = n.getFieldEntities(!0); s.forEach(function (f) { var p = f.props.initialValue, v = f.getNamePath(); if (p !== void 0) { var y = i.get(v) || new Set; y.add({ entity: f, value: p }), i.set(v, y) } }); var c = function (p) { p.forEach(function (v) { var y = v.props.initialValue; if (y !== void 0) { var w = v.getNamePath(), P = n.getInitialValue(w); if (P !== void 0) Rr(!1, "Form already set 'initialValues' with path '".concat(w.join("."), "'. Field can not overwrite it.")); else { var k = i.get(w); if (k && k.size > 1) Rr(!1, "Multiple Field with path '".concat(w.join("."), "' set 'initialValue'. Can not decide which one to pick.")); else if (k) { var A = n.getFieldValue(w); (!r.skipExist || A === void 0) && n.updateStore(Fl(n.store, w, Et(k)[0].value)) } } } }) }, o; r.entities ? o = r.entities : r.namePathList ? (o = [], r.namePathList.forEach(function (f) { var p = i.get(f); if (p) { var v; (v = o).push.apply(v, Et(Et(p).map(function (y) { return y.entity }))) } })) : o = s, c(o) }, this.resetFields = function (r) { n.warningUnhooked(); var i = n.store; if (!r) { n.updateStore(Vg({}, n.initialValues)), n.resetWithFieldInitialValue(), n.notifyObservers(i, null, { type: "reset" }), n.notifyWatch(); return } var s = r.map(pi); s.forEach(function (c) { var o = n.getInitialValue(c); n.updateStore(Fl(n.store, c, o)) }), n.resetWithFieldInitialValue({ namePathList: s }), n.notifyObservers(i, s, { type: "reset" }), n.notifyWatch(s) }, this.setFields = function (r) { n.warningUnhooked(); var i = n.store, s = []; r.forEach(function (c) { var o = c.name; c.errors; var f = Rn(c, oU), p = pi(o); s.push(p), "value" in f && n.updateStore(Fl(n.store, p, f.value)), n.notifyObservers(i, [p], { type: "setField", data: c }) }), n.notifyWatch(s) }, this.getFields = function () { var r = n.getFieldEntities(!0), i = r.map(function (s) { var c = s.getNamePath(), o = s.getMeta(), f = ge(ge({}, o), {}, { name: c, value: n.getFieldValue(c) }); return Object.defineProperty(f, "originRCField", { value: !0 }), f }); return i }, this.initEntityValue = function (r) { var i = r.props.initialValue; if (i !== void 0) { var s = r.getNamePath(), c = Zl(n.store, s); c === void 0 && n.updateStore(Fl(n.store, s, i)) } }, this.isMergedPreserve = function (r) { var i = r !== void 0 ? r : n.preserve; return i != null ? i : !0 }, this.registerField = function (r) { n.fieldEntities.push(r); var i = r.getNamePath(); if (n.notifyWatch([i]), r.props.initialValue !== void 0) { var s = n.store; n.resetWithFieldInitialValue({ entities: [r], skipExist: !0 }), n.notifyObservers(s, [r.getNamePath()], { type: "valueUpdate", source: "internal" }) } return function (c, o) { var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; if (n.fieldEntities = n.fieldEntities.filter(function (y) { return y !== r }), !n.isMergedPreserve(o) && (!c || f.length > 1)) { var p = c ? void 0 : n.getInitialValue(i); if (i.length && n.getFieldValue(i) !== p && n.fieldEntities.every(function (y) { return !RN(y.getNamePath(), i) })) { var v = n.store; n.updateStore(Fl(v, i, p, !0)), n.notifyObservers(v, [i], { type: "remove" }), n.triggerDependenciesUpdate(v, i) } } n.notifyWatch([i]) } }, this.dispatch = function (r) { switch (r.type) { case "updateValue": { var i = r.namePath, s = r.value; n.updateValue(i, s); break } case "validateField": { var c = r.namePath, o = r.triggerName; n.validateFields([c], { triggerName: o }); break } } }, this.notifyObservers = function (r, i, s) { if (n.subscribable) { var c = ge(ge({}, s), {}, { store: n.getFieldsValue(!0) }); n.getFieldEntities().forEach(function (o) { var f = o.onStoreChange; f(r, i, c) }) } else n.forceRootUpdate() }, this.triggerDependenciesUpdate = function (r, i) { var s = n.getDependencyChildrenFields(i); return s.length && n.validateFields(s), n.notifyObservers(r, s, { type: "dependenciesUpdate", relatedFields: [i].concat(Et(s)) }), s }, this.updateValue = function (r, i) { var s = pi(r), c = n.store; n.updateStore(Fl(n.store, s, i)), n.notifyObservers(c, [s], { type: "valueUpdate", source: "internal" }), n.notifyWatch([s]); var o = n.triggerDependenciesUpdate(c, s), f = n.callbacks.onValuesChange; if (f) { var p = FT(n.store, [s]); f(p, n.getFieldsValue()) } n.triggerOnFieldsChange([s].concat(Et(o))) }, this.setFieldsValue = function (r) { n.warningUnhooked(); var i = n.store; if (r) { var s = Vg(n.store, r); n.updateStore(s) } n.notifyObservers(i, null, { type: "valueUpdate", source: "external" }), n.notifyWatch() }, this.setFieldValue = function (r, i) { n.setFields([{ name: r, value: i }]) }, this.getDependencyChildrenFields = function (r) { var i = new Set, s = [], c = new md; n.getFieldEntities().forEach(function (f) { var p = f.props.dependencies; (p || []).forEach(function (v) { var y = pi(v); c.update(y, function () { var w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Set; return w.add(f), w }) }) }); var o = function f(p) { var v = c.get(p) || new Set; v.forEach(function (y) { if (!i.has(y)) { i.add(y); var w = y.getNamePath(); y.isFieldDirty() && w.length && (s.push(w), f(w)) } }) }; return o(r), s }, this.triggerOnFieldsChange = function (r, i) { var s = n.callbacks.onFieldsChange; if (s) { var c = n.getFields(); if (i) { var o = new md; i.forEach(function (p) { var v = p.name, y = p.errors; o.set(v, y) }), c.forEach(function (p) { p.errors = o.get(p.name) || p.errors }) } var f = c.filter(function (p) { var v = p.name; return dp(r, v) }); s(f, c) } }, this.validateFields = function (r, i) { n.warningUnhooked(); var s = !!r, c = s ? r.map(pi) : [], o = []; n.getFieldEntities(!0).forEach(function (v) { if (s || c.push(v.getNamePath()), (i == null ? void 0 : i.recursive) && s) { var y = v.getNamePath(); y.every(function (k, A) { return r[A] === k || r[A] === void 0 }) && c.push(y) } if (!(!v.props.rules || !v.props.rules.length)) { var w = v.getNamePath(); if (!s || dp(c, w)) { var P = v.validateRules(ge({ validateMessages: ge(ge({}, SN), n.validateMessages) }, i)); o.push(P.then(function () { return { name: w, errors: [], warnings: [] } }).catch(function (k) { var A, N = [], R = []; return (A = k.forEach) === null || A === void 0 || A.call(k, function (M) { var O = M.rule.warningOnly, z = M.errors; O ? R.push.apply(R, Et(z)) : N.push.apply(N, Et(z)) }), N.length ? Promise.reject({ name: w, errors: N, warnings: R }) : { name: w, errors: N, warnings: R } })) } } }); var f = iU(o); n.lastValidatePromise = f, f.catch(function (v) { return v }).then(function (v) { var y = v.map(function (w) { var P = w.name; return P }); n.notifyObservers(n.store, y, { type: "validateFinish" }), n.triggerOnFieldsChange(y, v) }); var p = f.then(function () { return n.lastValidatePromise === f ? Promise.resolve(n.getFieldsValue(c)) : Promise.reject([]) }).catch(function (v) { var y = v.filter(function (w) { return w && w.errors.length }); return Promise.reject({ values: n.getFieldsValue(c), errorFields: y, outOfDate: n.lastValidatePromise !== f }) }); return p.catch(function (v) { return v }), p }, this.submit = function () { n.warningUnhooked(), n.validateFields().then(function (r) { var i = n.callbacks.onFinish; if (i) try { i(r) } catch (s) { console.error(s) } }).catch(function (r) { var i = n.callbacks.onFinishFailed; i && i(r) }) }, this.forceRootUpdate = t }); function n2(e) { var t = C.exports.useRef(), n = C.exports.useState({}), r = ze(n, 2), i = r[1]; if (!t.current) if (e) t.current = e; else { var s = function () { i({}) }, c = new aU(s); t.current = c.getForm() } return [t.current] } var Pw = C.exports.createContext({ triggerFormChange: function () { }, triggerFormFinish: function () { }, registerForm: function () { }, unregisterForm: function () { } }), r2 = function (t) { var n = t.validateMessages, r = t.onFormChange, i = t.onFormFinish, s = t.children, c = C.exports.useContext(Pw), o = C.exports.useRef({}); return I(Pw.Provider, { value: ge(ge({}, c), {}, { validateMessages: ge(ge({}, c.validateMessages), n), triggerFormChange: function (p, v) { r && r(p, { changedFields: v, forms: o.current }), c.triggerFormChange(p, v) }, triggerFormFinish: function (p, v) { i && i(p, { values: v, forms: o.current }), c.triggerFormFinish(p, v) }, registerForm: function (p, v) { p && (o.current = ge(ge({}, o.current), {}, re({}, p, v))), c.registerForm(p, v) }, unregisterForm: function (p) { var v = ge({}, o.current); delete v[p], o.current = v, c.unregisterForm(p) } }), children: s }) }, sU = ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed"], lU = function (t, n) { var r = t.name, i = t.initialValues, s = t.fields, c = t.form, o = t.preserve, f = t.children, p = t.component, v = p === void 0 ? "form" : p, y = t.validateMessages, w = t.validateTrigger, P = w === void 0 ? "onChange" : w, k = t.onValuesChange, A = t.onFieldsChange, N = t.onFinish, R = t.onFinishFailed, M = Rn(t, sU), O = C.exports.useContext(Pw), z = n2(c), B = ze(z, 1), V = B[0], G = V.getInternalHooks(ic), j = G.useSubscribe, X = G.setInitialValues, Y = G.setCallbacks, se = G.setValidateMessages, ee = G.setPreserve, Z = G.destroyForm; C.exports.useImperativeHandle(n, function () { return V }), C.exports.useEffect(function () { return O.registerForm(r, V), function () { O.unregisterForm(r) } }, [O, V, r]), se(ge(ge({}, O.validateMessages), y)), Y({ onValuesChange: k, onFieldsChange: function (Pe) { if (O.triggerFormChange(r, Pe), A) { for (var De = arguments.length, Re = new Array(De > 1 ? De - 1 : 0), ke = 1; ke < De; ke++)Re[ke - 1] = arguments[ke]; A.apply(void 0, [Pe].concat(Re)) } }, onFinish: function (Pe) { O.triggerFormFinish(r, Pe), N && N(Pe) }, onFinishFailed: R }), ee(o); var J = C.exports.useRef(null); X(i, !J.current), J.current || (J.current = !0), C.exports.useEffect(function () { return Z }, []); var ve, ie = typeof f == "function"; if (ie) { var ce = V.getFieldsValue(!0); ve = f(ce, V) } else ve = f; j(!ie); var oe = C.exports.useRef(); C.exports.useEffect(function () { Z7(oe.current || [], s || []) || V.setFields(s || []), oe.current = s }, [s, V]); var ye = C.exports.useMemo(function () { return ge(ge({}, V), {}, { validateTrigger: P }) }, [V, P]), Ie = I(wc.Provider, { value: ye, children: ve }); return v === !1 ? Ie : I(v, { ...M, onSubmit: function (Pe) { Pe.preventDefault(), Pe.stopPropagation(), V.submit() }, onReset: function (Pe) { var De; Pe.preventDefault(), V.resetFields(), (De = M.onReset) === null || De === void 0 || De.call(M, Pe) }, children: Ie }) }; function jT(e) { try { return JSON.stringify(e) } catch { return Math.random() } } function ON() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; var r = t[0], i = r === void 0 ? [] : r, s = t[1], c = C.exports.useState(), o = ze(c, 2), f = o[0], p = o[1], v = C.exports.useMemo(function () { return jT(f) }, [f]), y = C.exports.useRef(v); y.current = v; var w = C.exports.useContext(wc), P = s || w, k = P && P._init, A = pi(i), N = C.exports.useRef(A); return N.current = A, C.exports.useEffect(function () { if (!!k) { var R = P.getFieldsValue, M = P.getInternalHooks, O = M(ic), z = O.registerWatch, B = z(function (G) { var j = Zl(G, N.current), X = jT(j); y.current !== X && (y.current = X, p(j)) }), V = Zl(R(), N.current); return p(V), B } }, [k]), f } var uU = C.exports.forwardRef(lU), bf = uU; bf.FormProvider = r2; bf.Field = t2; bf.List = AN; bf.useForm = n2; bf.useWatch = ON; const DN = { items_per_page: "/ page", jump_to: "Go to", jump_to_confirm: "confirm", page: "Page", prev_page: "Previous Page", next_page: "Next Page", prev_5: "Previous 5 Pages", next_5: "Next 5 Pages", prev_3: "Previous 3 Pages", next_3: "Next 3 Pages", page_size: "Page Size" }; var cU = { locale: "en_US", today: "Today", now: "Now", backToToday: "Back to today", ok: "OK", clear: "Clear", month: "Month", year: "Year", timeSelect: "select time", dateSelect: "select date", weekSelect: "Choose a week", monthSelect: "Choose a month", yearSelect: "Choose a year", decadeSelect: "Choose a decade", yearFormat: "YYYY", dateFormat: "M/D/YYYY", dayFormat: "D", dateTimeFormat: "M/D/YYYY HH:mm:ss", monthBeforeYear: !0, previousMonth: "Previous month (PageUp)", nextMonth: "Next month (PageDown)", previousYear: "Last year (Control + left)", nextYear: "Next year (Control + right)", previousDecade: "Last decade", nextDecade: "Next decade", previousCentury: "Last century", nextCentury: "Next century" }, dU = { placeholder: "Select time", rangePlaceholder: ["Start time", "End time"] }; const LN = dU; var fU = { lang: tt({ placeholder: "Select date", yearPlaceholder: "Select year", quarterPlaceholder: "Select quarter", monthPlaceholder: "Select month", weekPlaceholder: "Select week", rangePlaceholder: ["Start date", "End date"], rangeYearPlaceholder: ["Start year", "End year"], rangeQuarterPlaceholder: ["Start quarter", "End quarter"], rangeMonthPlaceholder: ["Start month", "End month"], rangeWeekPlaceholder: ["Start week", "End week"] }, cU), timePickerLocale: tt({}, LN) }; const KT = fU; var Go = "${label} is not a valid ${type}", hU = { locale: "en", Pagination: DN, DatePicker: KT, TimePicker: LN, Calendar: KT, global: { placeholder: "Please select" }, Table: { filterTitle: "Filter menu", filterConfirm: "OK", filterReset: "Reset", filterEmptyText: "No filters", filterCheckall: "Select all items", filterSearchPlaceholder: "Search in filters", emptyText: "No data", selectAll: "Select current page", selectInvert: "Invert current page", selectNone: "Clear all data", selectionAll: "Select all data", sortTitle: "Sort", expand: "Expand row", collapse: "Collapse row", triggerDesc: "Click to sort descending", triggerAsc: "Click to sort ascending", cancelSort: "Click to cancel sorting" }, Modal: { okText: "OK", cancelText: "Cancel", justOkText: "OK" }, Popconfirm: { okText: "OK", cancelText: "Cancel" }, Transfer: { titles: ["", ""], searchPlaceholder: "Search here", itemUnit: "item", itemsUnit: "items", remove: "Remove", selectCurrent: "Select current page", removeCurrent: "Remove current page", selectAll: "Select all data", removeAll: "Remove all data", selectInvert: "Invert current page" }, Upload: { uploading: "Uploading...", removeFile: "Remove file", uploadError: "Upload error", previewFile: "Preview file", downloadFile: "Download file" }, Empty: { description: "No data" }, Icon: { icon: "icon" }, Text: { edit: "Edit", copy: "Copy", copied: "Copied", expand: "Expand" }, PageHeader: { back: "Back" }, Form: { optional: "(optional)", defaultValidateMessages: { default: "Field validation error for ${label}", required: "Please enter ${label}", enum: "${label} must be one of [${enum}]", whitespace: "${label} cannot be a blank character", date: { format: "${label} date format is invalid", parse: "${label} cannot be converted to a date", invalid: "${label} is an invalid date" }, types: { string: Go, method: Go, array: Go, object: Go, number: Go, date: Go, boolean: Go, integer: Go, float: Go, regexp: Go, email: Go, url: Go, hex: Go }, string: { len: "${label} must be ${len} characters", min: "${label} must be at least ${min} characters", max: "${label} must be up to ${max} characters", range: "${label} must be between ${min}-${max} characters" }, number: { len: "${label} must be equal to ${len}", min: "${label} must be minimum ${min}", max: "${label} must be maximum ${max}", range: "${label} must be between ${min}-${max}" }, array: { len: "Must be ${len} ${label}", min: "At least ${min} ${label}", max: "At most ${max} ${label}", range: "The amount of ${label} must be between ${min}-${max}" }, pattern: { mismatch: "${label} does not match the pattern ${pattern}" } } }, Image: { preview: "Preview" } }; const ol = hU; var Ug = tt({}, ol.Modal); function HT(e) { e ? Ug = tt(tt({}, Ug), e) : Ug = tt({}, ol.Modal) } function zN() { return Ug } var pU = C.exports.createContext(void 0); const i2 = pU; var mU = "internalMark", vU = function (t) { var n = t.locale, r = n === void 0 ? {} : n, i = t.children; t._ANT_MARK__, C.exports.useEffect(function () { return HT(r && r.Modal), function () { HT() } }, [r]); var s = C.exports.useMemo(function () { return tt(tt({}, r), { exist: !0 }) }, [r]); return I(i2.Provider, { value: s, children: i }) }; const gU = vU; var yU = function (t) { var n = t.componentName, r = n === void 0 ? "global" : n, i = t.defaultLocale, s = t.children, c = C.exports.useContext(i2), o = C.exports.useMemo(function () { var p, v = i || ol[r], y = (p = c == null ? void 0 : c[r]) !== null && p !== void 0 ? p : {}; return tt(tt({}, v instanceof Function ? v() : v), y || {}) }, [r, i, c]), f = C.exports.useMemo(function () { var p = c && c.locale; return c && c.exist && !p ? ol.locale : p }, [c]); return s(o, f, c) }; const fm = yU; var FN = function (t, n) { var r = C.exports.useContext(i2), i = C.exports.useMemo(function () { var s, c = n || ol[t], o = (s = r == null ? void 0 : r[t]) !== null && s !== void 0 ? s : {}; return tt(tt({}, typeof c == "function" ? c() : c), o || {}) }, [t, n, r]); return [i] }, xU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, name: "check-circle", theme: "filled" }; const _U = xU; function Gi(e, t) { bU(e) && (e = "100%"); var n = wU(e); return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e) } function rg(e) { return Math.min(1, Math.max(0, e)) } function bU(e) { return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1 } function wU(e) { return typeof e == "string" && e.indexOf("%") !== -1 } function $N(e) { return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e } function ig(e) { return e <= 1 ? "".concat(Number(e) * 100, "%") : e } function ac(e) { return e.length === 1 ? "0" + e : String(e) } function CU(e, t, n) { return { r: Gi(e, 255) * 255, g: Gi(t, 255) * 255, b: Gi(n, 255) * 255 } } function WT(e, t, n) { e = Gi(e, 255), t = Gi(t, 255), n = Gi(n, 255); var r = Math.max(e, t, n), i = Math.min(e, t, n), s = 0, c = 0, o = (r + i) / 2; if (r === i) c = 0, s = 0; else { var f = r - i; switch (c = o > .5 ? f / (2 - r - i) : f / (r + i), r) { case e: s = (t - n) / f + (t < n ? 6 : 0); break; case t: s = (n - e) / f + 2; break; case n: s = (e - t) / f + 4; break }s /= 6 } return { h: s, s: c, l: o } } function d1(e, t, n) { return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e } function SU(e, t, n) { var r, i, s; if (e = Gi(e, 360), t = Gi(t, 100), n = Gi(n, 100), t === 0) i = n, s = n, r = n; else { var c = n < .5 ? n * (1 + t) : n + t - n * t, o = 2 * n - c; r = d1(o, c, e + 1 / 3), i = d1(o, c, e), s = d1(o, c, e - 1 / 3) } return { r: r * 255, g: i * 255, b: s * 255 } } function Ay(e, t, n) { e = Gi(e, 255), t = Gi(t, 255), n = Gi(n, 255); var r = Math.max(e, t, n), i = Math.min(e, t, n), s = 0, c = r, o = r - i, f = r === 0 ? 0 : o / r; if (r === i) s = 0; else { switch (r) { case e: s = (t - n) / o + (t < n ? 6 : 0); break; case t: s = (n - e) / o + 2; break; case n: s = (e - t) / o + 4; break }s /= 6 } return { h: s, s: f, v: c } } function EU(e, t, n) { e = Gi(e, 360) * 6, t = Gi(t, 100), n = Gi(n, 100); var r = Math.floor(e), i = e - r, s = n * (1 - t), c = n * (1 - i * t), o = n * (1 - (1 - i) * t), f = r % 6, p = [n, c, s, s, o, n][f], v = [o, n, n, c, s, s][f], y = [s, s, o, n, n, c][f]; return { r: p * 255, g: v * 255, b: y * 255 } } function Ny(e, t, n, r) { var i = [ac(Math.round(e).toString(16)), ac(Math.round(t).toString(16)), ac(Math.round(n).toString(16))]; return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("") } function PU(e, t, n, r, i) { var s = [ac(Math.round(e).toString(16)), ac(Math.round(t).toString(16)), ac(Math.round(n).toString(16)), ac(TU(r))]; return i && 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 TU(e) { return Math.round(parseFloat(e) * 255).toString(16) } function GT(e) { return qo(e) / 255 } function qo(e) { return parseInt(e, 16) } function kU(e) { return { r: e >> 16, g: (e & 65280) >> 8, b: e & 255 } } var Tw = { 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 Ua(e) { var t = { r: 0, g: 0, b: 0 }, n = 1, r = null, i = null, s = null, c = !1, o = !1; return typeof e == "string" && (e = MU(e)), typeof e == "object" && ($s(e.r) && $s(e.g) && $s(e.b) ? (t = CU(e.r, e.g, e.b), c = !0, o = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : $s(e.h) && $s(e.s) && $s(e.v) ? (r = ig(e.s), i = ig(e.v), t = EU(e.h, r, i), c = !0, o = "hsv") : $s(e.h) && $s(e.s) && $s(e.l) && (r = ig(e.s), s = ig(e.l), t = SU(e.h, r, s), c = !0, o = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = $N(n), { ok: c, format: e.format || o, r: Math.min(255, Math.max(t.r, 0)), g: Math.min(255, Math.max(t.g, 0)), b: Math.min(255, Math.max(t.b, 0)), a: n } } var IU = "[-\\+]?\\d+%?", RU = "[-\\+]?\\d*\\.\\d+%?", Xl = "(?:".concat(RU, ")|(?:").concat(IU, ")"), f1 = "[\\s|\\(]+(".concat(Xl, ")[,|\\s]+(").concat(Xl, ")[,|\\s]+(").concat(Xl, ")\\s*\\)?"), h1 = "[\\s|\\(]+(".concat(Xl, ")[,|\\s]+(").concat(Xl, ")[,|\\s]+(").concat(Xl, ")[,|\\s]+(").concat(Xl, ")\\s*\\)?"), za = { CSS_UNIT: new RegExp(Xl), rgb: new RegExp("rgb" + f1), rgba: new RegExp("rgba" + h1), hsl: new RegExp("hsl" + f1), hsla: new RegExp("hsla" + h1), hsv: new RegExp("hsv" + f1), hsva: new RegExp("hsva" + h1), 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 MU(e) { if (e = e.trim().toLowerCase(), e.length === 0) return !1; var t = !1; if (Tw[e]) e = Tw[e], t = !0; else if (e === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var n = za.rgb.exec(e); return n ? { r: n[1], g: n[2], b: n[3] } : (n = za.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = za.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = za.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = za.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = za.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = za.hex8.exec(e), n ? { r: qo(n[1]), g: qo(n[2]), b: qo(n[3]), a: GT(n[4]), format: t ? "name" : "hex8" } : (n = za.hex6.exec(e), n ? { r: qo(n[1]), g: qo(n[2]), b: qo(n[3]), format: t ? "name" : "hex" } : (n = za.hex4.exec(e), n ? { r: qo(n[1] + n[1]), g: qo(n[2] + n[2]), b: qo(n[3] + n[3]), a: GT(n[4] + n[4]), format: t ? "name" : "hex8" } : (n = za.hex3.exec(e), n ? { r: qo(n[1] + n[1]), g: qo(n[2] + n[2]), b: qo(n[3] + n[3]), format: t ? "name" : "hex" } : !1))))))))) } function $s(e) { return Boolean(za.CSS_UNIT.exec(String(e))) } var p1 = function () { function e(t, n) { t === void 0 && (t = ""), n === void 0 && (n = {}); var r; if (t instanceof e) return t; typeof t == "number" && (t = kU(t)), this.originalInput = t; var i = Ua(t); this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = n.format) !== null && r !== void 0 ? r : i.format, this.gradientType = n.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 = i.ok } return e.prototype.isDark = function () { return this.getBrightness() < 128 }, e.prototype.isLight = function () { return !this.isDark() }, e.prototype.getBrightness = function () { var t = this.toRgb(); return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3 }, e.prototype.getLuminance = function () { var t = this.toRgb(), n, r, i, s = t.r / 255, c = t.g / 255, o = t.b / 255; return s <= .03928 ? n = s / 12.92 : n = Math.pow((s + .055) / 1.055, 2.4), c <= .03928 ? r = c / 12.92 : r = Math.pow((c + .055) / 1.055, 2.4), o <= .03928 ? i = o / 12.92 : i = Math.pow((o + .055) / 1.055, 2.4), .2126 * n + .7152 * r + .0722 * i }, e.prototype.getAlpha = function () { return this.a }, e.prototype.setAlpha = function (t) { return this.a = $N(t), this.roundA = Math.round(100 * this.a) / 100, this }, e.prototype.isMonochrome = function () { var t = this.toHsl().s; return t === 0 }, e.prototype.toHsv = function () { var t = Ay(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, v: t.v, a: this.a } }, e.prototype.toHsvString = function () { var t = Ay(this.r, this.g, this.b), n = Math.round(t.h * 360), r = Math.round(t.s * 100), i = Math.round(t.v * 100); return this.a === 1 ? "hsv(".concat(n, ", ").concat(r, "%, ").concat(i, "%)") : "hsva(".concat(n, ", ").concat(r, "%, ").concat(i, "%, ").concat(this.roundA, ")") }, e.prototype.toHsl = function () { var t = WT(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, l: t.l, a: this.a } }, e.prototype.toHslString = function () { var t = WT(this.r, this.g, this.b), n = Math.round(t.h * 360), r = Math.round(t.s * 100), i = Math.round(t.l * 100); return this.a === 1 ? "hsl(".concat(n, ", ").concat(r, "%, ").concat(i, "%)") : "hsla(".concat(n, ", ").concat(r, "%, ").concat(i, "%, ").concat(this.roundA, ")") }, e.prototype.toHex = function (t) { return t === void 0 && (t = !1), Ny(this.r, this.g, this.b, t) }, e.prototype.toHexString = function (t) { return t === void 0 && (t = !1), "#" + this.toHex(t) }, e.prototype.toHex8 = function (t) { return t === void 0 && (t = !1), PU(this.r, this.g, this.b, this.a, t) }, e.prototype.toHex8String = function (t) { return t === void 0 && (t = !1), "#" + this.toHex8(t) }, e.prototype.toHexShortString = function (t) { return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t) }, e.prototype.toRgb = function () { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a } }, e.prototype.toRgbString = function () { var t = Math.round(this.r), n = Math.round(this.g), r = Math.round(this.b); return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(r, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(r, ", ").concat(this.roundA, ")") }, e.prototype.toPercentageRgb = function () { var t = function (n) { return "".concat(Math.round(Gi(n, 255) * 100), "%") }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a } }, e.prototype.toPercentageRgbString = function () { var t = function (n) { return Math.round(Gi(n, 255) * 100) }; return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")") }, e.prototype.toName = function () { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var t = "#" + Ny(this.r, this.g, this.b, !1), n = 0, r = Object.entries(Tw); n < r.length; n++) { var i = r[n], s = i[0], c = i[1]; if (t === c) return s } return !1 }, e.prototype.toString = function (t) { var n = Boolean(t); t = t != null ? t : this.format; var r = !1, i = this.a < 1 && this.a >= 0, s = !n && i && (t.startsWith("hex") || t === "name"); return s ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (r = this.toRgbString()), t === "prgb" && (r = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (r = this.toHexString()), t === "hex3" && (r = this.toHexString(!0)), t === "hex4" && (r = this.toHex8String(!0)), t === "hex8" && (r = this.toHex8String()), t === "name" && (r = this.toName()), t === "hsl" && (r = this.toHslString()), t === "hsv" && (r = this.toHsvString()), r || this.toHexString()) }, e.prototype.toNumber = function () { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b) }, e.prototype.clone = function () { return new e(this.toString()) }, e.prototype.lighten = function (t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.l += t / 100, n.l = rg(n.l), new e(n) }, e.prototype.brighten = function (t) { t === void 0 && (t = 10); var n = this.toRgb(); return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), new e(n) }, e.prototype.darken = function (t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.l -= t / 100, n.l = rg(n.l), new e(n) }, e.prototype.tint = function (t) { return t === void 0 && (t = 10), this.mix("white", t) }, e.prototype.shade = function (t) { return t === void 0 && (t = 10), this.mix("black", t) }, e.prototype.desaturate = function (t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.s -= t / 100, n.s = rg(n.s), new e(n) }, e.prototype.saturate = function (t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.s += t / 100, n.s = rg(n.s), new e(n) }, e.prototype.greyscale = function () { return this.desaturate(100) }, e.prototype.spin = function (t) { var n = this.toHsl(), r = (n.h + t) % 360; return n.h = r < 0 ? 360 + r : r, new e(n) }, e.prototype.mix = function (t, n) { n === void 0 && (n = 50); var r = this.toRgb(), i = new e(t).toRgb(), s = n / 100, c = { r: (i.r - r.r) * s + r.r, g: (i.g - r.g) * s + r.g, b: (i.b - r.b) * s + r.b, a: (i.a - r.a) * s + r.a }; return new e(c) }, e.prototype.analogous = function (t, n) { t === void 0 && (t = 6), n === void 0 && (n = 30); var r = this.toHsl(), i = 360 / n, s = [this]; for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;)r.h = (r.h + i) % 360, s.push(new e(r)); return s }, e.prototype.complement = function () { var t = this.toHsl(); return t.h = (t.h + 180) % 360, new e(t) }, e.prototype.monochromatic = function (t) { t === void 0 && (t = 6); for (var n = this.toHsv(), r = n.h, i = n.s, s = n.v, c = [], o = 1 / t; t--;)c.push(new e({ h: r, s: i, v: s })), s = (s + o) % 1; return c }, e.prototype.splitcomplement = function () { var t = this.toHsl(), n = t.h; return [this, new e({ h: (n + 72) % 360, s: t.s, l: t.l }), new e({ h: (n + 216) % 360, s: t.s, l: t.l })] }, e.prototype.onBackground = function (t) { var n = this.toRgb(), r = new e(t).toRgb(), i = n.a + r.a * (1 - n.a); return new e({ r: (n.r * n.a + r.r * r.a * (1 - n.a)) / i, g: (n.g * n.a + r.g * r.a * (1 - n.a)) / i, b: (n.b * n.a + r.b * r.a * (1 - n.a)) / i, a: i }) }, e.prototype.triad = function () { return this.polyad(3) }, e.prototype.tetrad = function () { return this.polyad(4) }, e.prototype.polyad = function (t) { for (var n = this.toHsl(), r = n.h, i = [this], s = 360 / t, c = 1; c < t; c++)i.push(new e({ h: (r + c * s) % 360, s: n.s, l: n.l })); return i }, e.prototype.equals = function (t) { return this.toRgbString() === new e(t).toRgbString() }, e }(), og = 2, qT = .16, AU = .05, NU = .05, OU = .15, BN = 5, VN = 4, DU = [{ index: 7, opacity: .15 }, { index: 6, opacity: .25 }, { index: 5, opacity: .3 }, { index: 5, opacity: .45 }, { index: 5, opacity: .65 }, { index: 5, opacity: .85 }, { index: 4, opacity: .9 }, { index: 3, opacity: .95 }, { index: 2, opacity: .97 }, { index: 1, opacity: .98 }]; function ZT(e) { var t = e.r, n = e.g, r = e.b, i = Ay(t, n, r); return { h: i.h * 360, s: i.s, v: i.v } } function ag(e) { var t = e.r, n = e.g, r = e.b; return "#".concat(Ny(t, n, r, !1)) } function LU(e, t, n) { var r = n / 100, i = { r: (t.r - e.r) * r + e.r, g: (t.g - e.g) * r + e.g, b: (t.b - e.b) * r + e.b }; return i } function XT(e, t, n) { var r; return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? r = n ? Math.round(e.h) - og * t : Math.round(e.h) + og * t : r = n ? Math.round(e.h) + og * t : Math.round(e.h) - og * t, r < 0 ? r += 360 : r >= 360 && (r -= 360), r } function YT(e, t, n) { if (e.h === 0 && e.s === 0) return e.s; var r; return n ? r = e.s - qT * t : t === VN ? r = e.s + qT : r = e.s + AU * t, r > 1 && (r = 1), n && t === BN && r > .1 && (r = .1), r < .06 && (r = .06), Number(r.toFixed(2)) } function QT(e, t, n) { var r; return n ? r = e.v + NU * t : r = e.v - OU * t, r > 1 && (r = 1), Number(r.toFixed(2)) } function jp(e) { for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = [], r = Ua(e), i = BN; i > 0; i -= 1) { var s = ZT(r), c = ag(Ua({ h: XT(s, i, !0), s: YT(s, i, !0), v: QT(s, i, !0) })); n.push(c) } n.push(ag(r)); for (var o = 1; o <= VN; o += 1) { var f = ZT(r), p = ag(Ua({ h: XT(f, o), s: YT(f, o), v: QT(f, o) })); n.push(p) } return t.theme === "dark" ? DU.map(function (v) { var y = v.index, w = v.opacity, P = ag(LU(Ua(t.backgroundColor || "#141414"), Ua(n[y]), w * 100)); return P }) : n } var m1 = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1890FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666" }, v1 = {}, g1 = {}; Object.keys(m1).forEach(function (e) { v1[e] = jp(m1[e]), v1[e].primary = v1[e][5], g1[e] = jp(m1[e], { theme: "dark", backgroundColor: "#141414" }), g1[e].primary = g1[e][5] }); function wo() { return !!(typeof window < "u" && window.document && window.document.createElement) } function hc(e, t) { if (!e) return !1; if (e.contains) return e.contains(t); for (var n = t; n;) { if (n === e) return !0; n = n.parentNode } return !1 } var JT = "data-rc-order", zU = "rc-util-key", kw = new Map; function UN() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mark; return t ? t.startsWith("data-") ? t : "data-".concat(t) : zU } function V0(e) { if (e.attachTo) return e.attachTo; var t = document.querySelector("head"); return t || document.body } function FU(e) { return e === "queue" ? "prependQueue" : e ? "prepend" : "append" } function jN(e) { return Array.from((kw.get(e) || e).children).filter(function (t) { return t.tagName === "STYLE" }) } function KN(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (!wo()) return null; var n = t.csp, r = t.prepend, i = document.createElement("style"); i.setAttribute(JT, FU(r)), n != null && n.nonce && (i.nonce = n == null ? void 0 : n.nonce), i.innerHTML = e; var s = V0(t), c = s.firstChild; if (r) { if (r === "queue") { var o = jN(s).filter(function (f) { return ["prepend", "prependQueue"].includes(f.getAttribute(JT)) }); if (o.length) return s.insertBefore(i, o[o.length - 1].nextSibling), i } s.insertBefore(i, c) } else s.appendChild(i); return i } function HN(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = V0(t); return jN(n).find(function (r) { return r.getAttribute(UN(t)) === e }) } function ek(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = HN(e, t); if (n) { var r = V0(t); r.removeChild(n) } } function $U(e, t) { var n = kw.get(e); if (!n || !hc(document, n)) { var r = KN("", t), i = r.parentNode; kw.set(e, i), e.removeChild(r) } } function hm(e, t) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = V0(n); $U(r, n); var i = HN(t, n); if (i) { var s, c; if ((s = n.csp) !== null && s !== void 0 && s.nonce && i.nonce !== ((c = n.csp) === null || c === void 0 ? void 0 : c.nonce)) { var o; i.nonce = (o = n.csp) === null || o === void 0 ? void 0 : o.nonce } return i.innerHTML !== e && (i.innerHTML = e), i } var f = KN(e, n); return f.setAttribute(UN(n), t), f } function BU(e, t) { Rr(e, "[@ant-design/icons] ".concat(t)) } function tk(e) { return ln(e) === "object" && typeof e.name == "string" && typeof e.theme == "string" && (ln(e.icon) === "object" || typeof e.icon == "function") } function nk() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return Object.keys(e).reduce(function (t, n) { var r = e[n]; switch (n) { case "class": t.className = r, delete t.class; break; default: t[n] = r }return t }, {}) } function Iw(e, t, n) { return n ? tr.createElement(e.tag, ge(ge({ key: t }, nk(e.attrs)), n), (e.children || []).map(function (r, i) { return Iw(r, "".concat(t, "-").concat(e.tag, "-").concat(i)) })) : tr.createElement(e.tag, ge({ key: t }, nk(e.attrs)), (e.children || []).map(function (r, i) { return Iw(r, "".concat(t, "-").concat(e.tag, "-").concat(i)) })) } function WN(e) { return jp(e)[0] } function GN(e) { return e ? Array.isArray(e) ? e : [e] : [] } var VU = `
|
|
|
.anticon {
|
|
|
display: inline-block;
|
|
|
color: inherit;
|
|
|
font-style: normal;
|
|
|
line-height: 0;
|
|
|
text-align: center;
|
|
|
text-transform: none;
|
|
|
vertical-align: -0.125em;
|
|
|
text-rendering: optimizeLegibility;
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
}
|
|
|
|
|
|
.anticon > * {
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.anticon svg {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|
|
|
.anticon::before {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
.anticon .anticon-icon {
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.anticon[tabindex] {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.anticon-spin::before,
|
|
|
.anticon-spin {
|
|
|
display: inline-block;
|
|
|
-webkit-animation: loadingCircle 1s infinite linear;
|
|
|
animation: loadingCircle 1s infinite linear;
|
|
|
}
|
|
|
|
|
|
@-webkit-keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
`, UU = function () { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : VU, n = C.exports.useContext(YS), r = n.csp; C.exports.useEffect(function () { hm(t, "@ant-design-icons", { prepend: !0, csp: r }) }, []) }, jU = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], fp = { primaryColor: "#333", secondaryColor: "#E6E6E6", calculated: !1 }; function KU(e) { var t = e.primaryColor, n = e.secondaryColor; fp.primaryColor = t, fp.secondaryColor = n || WN(t), fp.calculated = !!n } function HU() { return ge({}, fp) } var U0 = function (t) { var n = t.icon, r = t.className, i = t.onClick, s = t.style, c = t.primaryColor, o = t.secondaryColor, f = Rn(t, jU), p = fp; if (c && (p = { primaryColor: c, secondaryColor: o || WN(c) }), UU(), BU(tk(n), "icon should be icon definiton, but got ".concat(n)), !tk(n)) return null; var v = n; return v && typeof v.icon == "function" && (v = ge(ge({}, v), {}, { icon: v.icon(p.primaryColor, p.secondaryColor) })), Iw(v.icon, "svg-".concat(v.name), ge({ className: r, onClick: i, style: s, "data-icon": v.name, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" }, f)) }; U0.displayName = "IconReact"; U0.getTwoToneColors = HU; U0.setTwoToneColors = KU; const o2 = U0; function qN(e) { var t = GN(e), n = ze(t, 2), r = n[0], i = n[1]; return o2.setTwoToneColors({ primaryColor: r, secondaryColor: i }) } function WU() { var e = o2.getTwoToneColors(); return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor } var GU = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"]; qN("#1890ff"); var j0 = C.exports.forwardRef(function (e, t) { var n, r = e.className, i = e.icon, s = e.spin, c = e.rotate, o = e.tabIndex, f = e.onClick, p = e.twoToneColor, v = Rn(e, GU), y = C.exports.useContext(YS), w = y.prefixCls, P = w === void 0 ? "anticon" : w, k = y.rootClassName, A = Xe(k, P, (n = {}, re(n, "".concat(P, "-").concat(i.name), !!i.name), re(n, "".concat(P, "-spin"), !!s || i.name === "loading"), n), r), N = o; N === void 0 && f && (N = -1); var R = c ? { msTransform: "rotate(".concat(c, "deg)"), transform: "rotate(".concat(c, "deg)") } : void 0, M = GN(p), O = ze(M, 2), z = O[0], B = O[1]; return I("span", { ...ge(ge({ role: "img", "aria-label": i.name }, v), {}, { ref: t, tabIndex: N, onClick: f, className: A }), children: I(o2, { icon: i, primaryColor: z, secondaryColor: B, style: R }) }) }); j0.displayName = "AntdIcon"; j0.getTwoToneColor = WU; j0.setTwoToneColor = qN; const cr = j0; var ZN = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: _U }) }) }; ZN.displayName = "CheckCircleFilled"; const a2 = C.exports.forwardRef(ZN); var qU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, name: "close-circle", theme: "filled" }; const ZU = qU; var XN = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: ZU }) }) }; XN.displayName = "CloseCircleFilled"; const wf = C.exports.forwardRef(XN); var XU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "exclamation-circle", theme: "filled" }; const YU = XU; var YN = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: YU }) }) }; YN.displayName = "ExclamationCircleFilled"; const s2 = C.exports.forwardRef(YN); var QU = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "info-circle", theme: "filled" }; const JU = QU; var QN = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: JU }) }) }; QN.displayName = "InfoCircleFilled"; const JN = C.exports.forwardRef(QN); var ej = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, name: "loading", theme: "outlined" }; const tj = ej; var eO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: tj }) }) }; eO.displayName = "LoadingOutlined"; const of = C.exports.forwardRef(eO); var pm = ge({}, c9), nj = pm.version, rj = pm.render, ij = pm.unmountComponentAtNode, K0; try { var oj = Number((nj || "").split(".")[0]); oj >= 18 && (K0 = pm.createRoot) } catch { } function rk(e) { var t = pm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; t && ln(t) === "object" && (t.usingClientEntryPoint = e) } var Oy = "__rc_react_root__"; function aj(e, t) { rk(!0); var n = t[Oy] || K0(t); rk(!1), n.render(e), t[Oy] = n } function sj(e, t) { rj(e, t) } function tO(e, t) { if (K0) { aj(e, t); return } sj(e, t) } function lj(e) { return Rw.apply(this, arguments) } function Rw() { return Rw = Rc(bo().mark(function e(t) { return bo().wrap(function (r) { for (; ;)switch (r.prev = r.next) { case 0: return r.abrupt("return", Promise.resolve().then(function () { var i; (i = t[Oy]) === null || i === void 0 || i.unmount(), delete t[Oy] })); case 1: case "end": return r.stop() } }, e) })), Rw.apply(this, arguments) } function uj(e) { ij(e) } function nO(e) { return Mw.apply(this, arguments) } function Mw() { return Mw = Rc(bo().mark(function e(t) { return bo().wrap(function (r) { for (; ;)switch (r.prev = r.next) { case 0: if (K0 === void 0) { r.next = 2; break } return r.abrupt("return", lj(t)); case 2: uj(t); case 3: case "end": return r.stop() } }, e) })), Mw.apply(this, arguments) } function ik(e, t) { var n = {}; return n[e.toLowerCase()] = t.toLowerCase(), n["Webkit".concat(e)] = "webkit".concat(t), n["Moz".concat(e)] = "moz".concat(t), n["ms".concat(e)] = "MS".concat(t), n["O".concat(e)] = "o".concat(t.toLowerCase()), n } function cj(e, t) { var n = { animationend: ik("Animation", "AnimationEnd"), transitionend: ik("Transition", "TransitionEnd") }; return e && ("AnimationEvent" in t || delete n.animationend.animation, "TransitionEvent" in t || delete n.transitionend.transition), n } var dj = cj(wo(), typeof window < "u" ? window : {}), rO = {}; if (wo()) { var fj = document.createElement("div"); rO = fj.style } var sg = {}; function iO(e) { if (sg[e]) return sg[e]; var t = dj[e]; if (t) for (var n = Object.keys(t), r = n.length, i = 0; i < r; i += 1) { var s = n[i]; if (Object.prototype.hasOwnProperty.call(t, s) && s in rO) return sg[e] = t[s], sg[e] } return "" } var oO = iO("animationend"), aO = iO("transitionend"), sO = !!(oO && aO), ok = oO || "animationend", ak = aO || "transitionend"; function sk(e, t) { if (!e) return null; if (ln(e) === "object") { var n = t.replace(/-\w/g, function (r) { return r[1].toUpperCase() }); return e[n] } return "".concat(e, "-").concat(t) } var _d = "none", lg = "appear", ug = "enter", cg = "leave", lk = "none", Ks = "prepare", Od = "start", Dd = "active", l2 = "end"; function ms(e) { var t = C.exports.useRef(!1), n = C.exports.useState(e), r = ze(n, 2), i = r[0], s = r[1]; C.exports.useEffect(function () { return t.current = !1, function () { t.current = !0 } }, []); function c(o, f) { f && t.current || s(o) } return [i, c] } var lO = function (t) { return +setTimeout(t, 16) }, uO = function (t) { return clearTimeout(t) }; typeof window < "u" && "requestAnimationFrame" in window && (lO = function (t) { return window.requestAnimationFrame(t) }, uO = function (t) { return window.cancelAnimationFrame(t) }); var uk = 0, u2 = new Map; function cO(e) { u2.delete(e) } var nr = function (t) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; uk += 1; var r = uk; function i(s) { if (s === 0) cO(r), t(); else { var c = lO(function () { i(s - 1) }); u2.set(r, c) } } return i(n), r }; nr.cancel = function (e) { var t = u2.get(e); return cO(t), uO(t) }; const hj = function () { var e = C.exports.useRef(null); function t() { nr.cancel(e.current) } function n(r) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2; t(); var s = nr(function () { i <= 1 ? r({ isCanceled: function () { return s !== e.current } }) : n(r, i - 1) }); e.current = s } return C.exports.useEffect(function () { return function () { t() } }, []), [n, t] }; var dO = wo() ? C.exports.useLayoutEffect : C.exports.useEffect, ck = [Ks, Od, Dd, l2], fO = !1, pj = !0; function hO(e) { return e === Dd || e === l2 } const mj = function (e, t) { var n = ms(lk), r = ze(n, 2), i = r[0], s = r[1], c = hj(), o = ze(c, 2), f = o[0], p = o[1]; function v() { s(Ks, !0) } return dO(function () { if (i !== lk && i !== l2) { var y = ck.indexOf(i), w = ck[y + 1], P = t(i); P === fO ? s(w, !0) : f(function (k) { function A() { k.isCanceled() || s(w, !0) } P === !0 ? A() : Promise.resolve(P).then(A) }) } }, [e, i]), C.exports.useEffect(function () { return function () { p() } }, []), [v, i] }, vj = function (e) { var t = C.exports.useRef(), n = C.exports.useRef(e); n.current = e; var r = C.exports.useCallback(function (c) { n.current(c) }, []); function i(c) { c && (c.removeEventListener(ak, r), c.removeEventListener(ok, r)) } function s(c) { t.current && t.current !== c && i(t.current), c && c !== t.current && (c.addEventListener(ak, r), c.addEventListener(ok, r), t.current = c) } return C.exports.useEffect(function () { return function () { i(t.current) } }, []), [s, i] }; function gj(e, t, n, r) { var i = r.motionEnter, s = i === void 0 ? !0 : i, c = r.motionAppear, o = c === void 0 ? !0 : c, f = r.motionLeave, p = f === void 0 ? !0 : f, v = r.motionDeadline, y = r.motionLeaveImmediately, w = r.onAppearPrepare, P = r.onEnterPrepare, k = r.onLeavePrepare, A = r.onAppearStart, N = r.onEnterStart, R = r.onLeaveStart, M = r.onAppearActive, O = r.onEnterActive, z = r.onLeaveActive, B = r.onAppearEnd, V = r.onEnterEnd, G = r.onLeaveEnd, j = r.onVisibleChanged, X = ms(), Y = ze(X, 2), se = Y[0], ee = Y[1], Z = ms(_d), J = ze(Z, 2), ve = J[0], ie = J[1], ce = ms(null), oe = ze(ce, 2), ye = oe[0], Ie = oe[1], Te = C.exports.useRef(!1), Pe = C.exports.useRef(null); function De() { return n() } var Re = C.exports.useRef(!1); function ke(yt) { var Mt = De(); if (!(yt && !yt.deadline && yt.target !== Mt)) { var ut = Re.current, dt; ve === lg && ut ? dt = B == null ? void 0 : B(Mt, yt) : ve === ug && ut ? dt = V == null ? void 0 : V(Mt, yt) : ve === cg && ut && (dt = G == null ? void 0 : G(Mt, yt)), ve !== _d && ut && dt !== !1 && (ie(_d, !0), Ie(null, !0)) } } var Oe = vj(ke), $e = ze(Oe, 1), He = $e[0], Ue = C.exports.useMemo(function () { var yt, Mt, ut; switch (ve) { case lg: return yt = {}, re(yt, Ks, w), re(yt, Od, A), re(yt, Dd, M), yt; case ug: return Mt = {}, re(Mt, Ks, P), re(Mt, Od, N), re(Mt, Dd, O), Mt; case cg: return ut = {}, re(ut, Ks, k), re(ut, Od, R), re(ut, Dd, z), ut; default: return {} } }, [ve]), st = mj(ve, function (yt) { if (yt === Ks) { var Mt = Ue[Ks]; return Mt ? Mt(De()) : fO } if (We in Ue) { var ut; Ie(((ut = Ue[We]) === null || ut === void 0 ? void 0 : ut.call(Ue, De(), null)) || null) } return We === Dd && (He(De()), v > 0 && (clearTimeout(Pe.current), Pe.current = setTimeout(function () { ke({ deadline: !0 }) }, v))), pj }), ft = ze(st, 2), It = ft[0], We = ft[1], Pt = hO(We); Re.current = Pt, dO(function () { ee(t); var yt = Te.current; if (Te.current = !0, !!e) { var Mt; !yt && t && o && (Mt = lg), yt && t && s && (Mt = ug), (yt && !t && p || !yt && y && !t && p) && (Mt = cg), Mt && (ie(Mt), It()) } }, [t]), C.exports.useEffect(function () { (ve === lg && !o || ve === ug && !s || ve === cg && !p) && ie(_d) }, [o, s, p]), C.exports.useEffect(function () { return function () { Te.current = !1, clearTimeout(Pe.current) } }, []); var pt = C.exports.useRef(!1); C.exports.useEffect(function () { se && (pt.current = !0), se !== void 0 && ve === _d && ((pt.current || se) && (j == null || j(se)), pt.current = !0) }, [se, ve]); var Rt = ye; return Ue[Ks] && We === Od && (Rt = ge({ transition: "none" }, Rt)), [ve, We, Rt, se != null ? se : t] } var yj = function (e) { ui(n, e); var t = ci(n); function n() { return zr(this, n), t.apply(this, arguments) } return Fr(n, [{ key: "render", value: function () { return this.props.children } }]), n }(C.exports.Component); function xj(e) { var t = e; ln(e) === "object" && (t = e.transitionSupport); function n(i) { return !!(i.motionName && t) } var r = C.exports.forwardRef(function (i, s) { var c = i.visible, o = c === void 0 ? !0 : c, f = i.removeOnLeave, p = f === void 0 ? !0 : f, v = i.forceRender, y = i.children, w = i.motionName, P = i.leavedClassName, k = i.eventProps, A = n(i), N = C.exports.useRef(), R = C.exports.useRef(); function M() { try { return N.current instanceof HTMLElement ? N.current : Vp(R.current) } catch { return null } } var O = gj(A, o, M, i), z = ze(O, 4), B = z[0], V = z[1], G = z[2], j = z[3], X = C.exports.useRef(j); j && (X.current = !0); var Y = C.exports.useCallback(function (ce) { N.current = ce, Iy(s, ce) }, [s]), se, ee = ge(ge({}, k), {}, { visible: o }); if (!y) se = null; else if (B === _d || !n(i)) j ? se = y(ge({}, ee), Y) : !p && X.current && P ? se = y(ge(ge({}, ee), {}, { className: P }), Y) : v || !p && !P ? se = y(ge(ge({}, ee), {}, { style: { display: "none" } }), Y) : se = null; else { var Z, J; V === Ks ? J = "prepare" : hO(V) ? J = "active" : V === Od && (J = "start"), se = y(ge(ge({}, ee), {}, { className: Xe(sk(w, B), (Z = {}, re(Z, sk(w, "".concat(B, "-").concat(J)), J), re(Z, w, typeof w == "string"), Z)), style: G }), Y) } if (C.exports.isValidElement(se) && Ic(se)) { var ve = se, ie = ve.ref; ie || (se = C.exports.cloneElement(se, { ref: Y })) } return I(yj, { ref: R, children: se }) }); return r.displayName = "CSSMotion", r } const Sa = xj(sO); var Aw = "add", Nw = "keep", Ow = "remove", y1 = "removed"; function _j(e) { var t; return e && ln(e) === "object" && "key" in e ? t = e : t = { key: e }, ge(ge({}, t), {}, { key: String(t.key) }) } function Dw() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; return e.map(_j) } function bj() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = [], r = 0, i = t.length, s = Dw(e), c = Dw(t); s.forEach(function (p) { for (var v = !1, y = r; y < i; y += 1) { var w = c[y]; if (w.key === p.key) { r < y && (n = n.concat(c.slice(r, y).map(function (P) { return ge(ge({}, P), {}, { status: Aw }) })), r = y), n.push(ge(ge({}, w), {}, { status: Nw })), r += 1, v = !0; break } } v || n.push(ge(ge({}, p), {}, { status: Ow })) }), r < i && (n = n.concat(c.slice(r).map(function (p) { return ge(ge({}, p), {}, { status: Aw }) }))); var o = {}; n.forEach(function (p) { var v = p.key; o[v] = (o[v] || 0) + 1 }); var f = Object.keys(o).filter(function (p) { return o[p] > 1 }); return f.forEach(function (p) { n = n.filter(function (v) { var y = v.key, w = v.status; return y !== p || w !== Ow }), n.forEach(function (v) { v.key === p && (v.status = Nw) }) }), n } var wj = ["component", "children", "onVisibleChanged", "onAllRemoved"], Cj = ["status"], Sj = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"]; function Ej(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Sa, n = function (r) { ui(s, r); var i = ci(s); function s() { var c; zr(this, s); for (var o = arguments.length, f = new Array(o), p = 0; p < o; p++)f[p] = arguments[p]; return c = i.call.apply(i, [this].concat(f)), re(Ln(c), "state", { keyEntities: [] }), re(Ln(c), "removeKey", function (v) { var y = c.state.keyEntities, w = y.map(function (P) { return P.key !== v ? P : ge(ge({}, P), {}, { status: y1 }) }); return c.setState({ keyEntities: w }), w.filter(function (P) { var k = P.status; return k !== y1 }).length }), c } return Fr(s, [{ key: "render", value: function () { var o = this, f = this.state.keyEntities, p = this.props, v = p.component, y = p.children, w = p.onVisibleChanged, P = p.onAllRemoved, k = Rn(p, wj), A = v || C.exports.Fragment, N = {}; return Sj.forEach(function (R) { N[R] = k[R], delete k[R] }), delete k.keys, I(A, { ...k, children: f.map(function (R) { var M = R.status, O = Rn(R, Cj), z = M === Aw || M === Nw; return C.exports.createElement(t, { ...N, key: O.key, visible: z, eventProps: O, onVisibleChanged: function (V) { if (w == null || w(V, { key: O.key }), !V) { var G = o.removeKey(O.key); G === 0 && P && P() } } }, y) }) }) } }], [{ key: "getDerivedStateFromProps", value: function (o, f) { var p = o.keys, v = f.keyEntities, y = Dw(p), w = bj(v, y); return { keyEntities: w.filter(function (P) { var k = v.find(function (A) { var N = A.key; return P.key === N }); return !(k && k.status === y1 && P.status === Ow) }) } } }]), s }(C.exports.Component); return re(n, "defaultProps", { component: "div" }), n } const pO = Ej(sO); var c2 = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.closeTimer = null, r.close = function (o) { o && o.stopPropagation(), r.clearCloseTimer(); var f = r.props, p = f.onClose, v = f.noticeKey; p && p(v) }, r.startCloseTimer = function () { r.props.duration && (r.closeTimer = window.setTimeout(function () { r.close() }, r.props.duration * 1e3)) }, r.clearCloseTimer = function () { r.closeTimer && (clearTimeout(r.closeTimer), r.closeTimer = null) }, r } return Fr(n, [{ key: "componentDidMount", value: function () { this.startCloseTimer() } }, { key: "componentDidUpdate", value: function (i) { (this.props.duration !== i.duration || this.props.updateMark !== i.updateMark || this.props.visible !== i.visible && this.props.visible) && this.restartCloseTimer() } }, { key: "componentWillUnmount", value: function () { this.clearCloseTimer() } }, { key: "restartCloseTimer", value: function () { this.clearCloseTimer(), this.startCloseTimer() } }, { key: "render", value: function () { var i = this, s = this.props, c = s.prefixCls, o = s.className, f = s.closable, p = s.closeIcon, v = s.style, y = s.onClick, w = s.children, P = s.holder, k = "".concat(c, "-notice"), A = Object.keys(this.props).reduce(function (R, M) { return (M.substr(0, 5) === "data-" || M.substr(0, 5) === "aria-" || M === "role") && (R[M] = i.props[M]), R }, {}), N = Qe("div", { className: Xe(k, o, re({}, "".concat(k, "-closable"), f)), style: v, onMouseEnter: this.clearCloseTimer, onMouseLeave: this.startCloseTimer, onClick: y, ...A, children: [I("div", { className: "".concat(k, "-content"), children: w }), f ? I("a", { tabIndex: 0, onClick: this.close, className: "".concat(k, "-close"), children: p || I("span", { className: "".concat(k, "-close-x") }) }) : null] }); return P ? bc.createPortal(N, P) : N } }]), n }(C.exports.Component); c2.defaultProps = { onClose: function () { }, duration: 1.5 }; function d2(e) { var t = C.exports.useRef({}), n = C.exports.useState([]), r = ze(n, 2), i = r[0], s = r[1]; function c(o) { var f = !0; e.add(o, function (p, v) { var y = v.key; if (p && (!t.current[y] || f)) { var w = I(c2, { ...v, holder: p }); t.current[y] = w, s(function (P) { var k = P.findIndex(function (N) { return N.key === v.key }); if (k === -1) return [].concat(Et(P), [w]); var A = Et(P); return A[k] = w, A }) } f = !1 }) } return [c, I(An, { children: i })] } var Pj = ["getContainer"], dk = 0, Tj = Date.now(); function fk() { var e = dk; return dk += 1, "rcNotification_".concat(Tj, "_").concat(e) } var af = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.state = { notices: [] }, r.hookRefs = new Map, r.add = function (o, f) { var p, v = (p = o.key) !== null && p !== void 0 ? p : fk(), y = ge(ge({}, o), {}, { key: v }), w = r.props.maxCount; r.setState(function (P) { var k = P.notices, A = k.map(function (R) { return R.notice.key }).indexOf(v), N = k.concat(); return A !== -1 ? N.splice(A, 1, { notice: y, holderCallback: f }) : (w && k.length >= w && (y.key = N[0].notice.key, y.updateMark = fk(), y.userPassKey = v, N.shift()), N.push({ notice: y, holderCallback: f })), { notices: N } }) }, r.remove = function (o) { r.setState(function (f) { var p = f.notices; return { notices: p.filter(function (v) { var y = v.notice, w = y.key, P = y.userPassKey, k = P != null ? P : w; return k !== o }) } }) }, r.noticePropsMap = {}, r } return Fr(n, [{ key: "getTransitionName", value: function () { var i = this.props, s = i.prefixCls, c = i.animation, o = this.props.transitionName; return !o && c && (o = "".concat(s, "-").concat(c)), o } }, { key: "render", value: function () { var i = this, s = this.state.notices, c = this.props, o = c.prefixCls, f = c.className, p = c.closeIcon, v = c.style, y = []; return s.forEach(function (w, P) { var k = w.notice, A = w.holderCallback, N = P === s.length - 1 ? k.updateMark : void 0, R = k.key, M = k.userPassKey, O = ge(ge(ge({ prefixCls: o, closeIcon: p }, k), k.props), {}, { key: R, noticeKey: M || R, updateMark: N, onClose: function (B) { var V; i.remove(B), (V = k.onClose) === null || V === void 0 || V.call(k) }, onClick: k.onClick, children: k.content }); y.push(R), i.noticePropsMap[R] = { props: O, holderCallback: A } }), I("div", { className: Xe(o, f), style: v, children: I(pO, { keys: y, motionName: this.getTransitionName(), onVisibleChanged: function (P, k) { var A = k.key; P || delete i.noticePropsMap[A] }, children: function (w) { var P = w.key, k = w.className, A = w.style, N = w.visible, R = i.noticePropsMap[P], M = R.props, O = R.holderCallback; return O ? I("div", { className: Xe(k, "".concat(o, "-hook-holder")), style: ge({}, A), ref: function (B) { typeof P > "u" || (B ? (i.hookRefs.set(P, B), O(B, M)) : i.hookRefs.delete(P)) } }, P) : I(c2, { ...M, className: Xe(k, M == null ? void 0 : M.className), style: ge(ge({}, A), M == null ? void 0 : M.style), visible: N }) } }) }) } }]), n }(C.exports.Component); af.newInstance = void 0; af.defaultProps = { prefixCls: "rc-notification", animation: "fade", style: { top: 65, left: "50%" } }; af.newInstance = function (t, n) { var r = t || {}, i = r.getContainer, s = Rn(r, Pj), c = document.createElement("div"); if (i) { var o = i(); o.appendChild(c) } else document.body.appendChild(c); var f = !1; function p(v) { f || (f = !0, n({ notice: function (w) { v.add(w) }, removeNotice: function (w) { v.remove(w) }, component: v, destroy: function () { nO(c), c.parentNode && c.parentNode.removeChild(c) }, useNotification: function () { return d2(v) } })) } tO(I(af, { ...s, ref: p }), c) }; function kj(e, t) { var n = function () { var i, s, c = null, o = { add: function (A, N) { c == null || c.component.add(A, N) } }, f = d2(o), p = ze(f, 2), v = p[0], y = p[1]; function w(k) { var A = k.prefixCls, N = i("message", A), R = i(), M = k.key || wO(), O = new Promise(function (B) { var V = function () { return typeof k.onClose == "function" && k.onClose(), B(!0) }; e(tt(tt({}, k), { prefixCls: N, rootPrefixCls: R, getPopupContainer: s }), function (G) { var j = G.prefixCls, X = G.instance; c = X, v(t(tt(tt({}, k), { key: M, onClose: V }), j)) }) }), z = function () { c && c.removeNotice(M) }; return z.then = function (B, V) { return O.then(B, V) }, z.promise = O, z } var P = C.exports.useRef({}); return P.current.open = w, EO.forEach(function (k) { return TO(P.current, k) }), [P.current, I(yu, { children: function (k) { return i = k.getPrefixCls, s = k.getPopupContainer, y } }, "holder")] }; return n } var xo, mO = 3, vO, Ij = 1, gO = "", Lw = "move-up", yO = !1, xO, _O, bO = !1; function wO() { return Ij++ } function Rj(e) { e.top !== void 0 && (vO = e.top, xo = null), e.duration !== void 0 && (mO = e.duration), e.prefixCls !== void 0 && (gO = e.prefixCls), e.getContainer !== void 0 && (xO = e.getContainer, xo = null), e.transitionName !== void 0 && (Lw = e.transitionName, xo = null, yO = !0), e.maxCount !== void 0 && (_O = e.maxCount, xo = null), e.rtl !== void 0 && (bO = e.rtl) } function CO(e, t) { var n = e.prefixCls, r = e.getPopupContainer, i = m2(), s = i.getPrefixCls, c = i.getRootPrefixCls, o = i.getIconPrefixCls, f = s("message", n || gO), p = c(e.rootPrefixCls, f), v = o(); if (xo) { t({ prefixCls: f, rootPrefixCls: p, iconPrefixCls: v, instance: xo }); return } var y = { prefixCls: f, transitionName: yO ? Lw : "".concat(p, "-").concat(Lw), style: { top: vO }, getContainer: xO || r, maxCount: _O }; af.newInstance(y, function (w) { if (xo) { t({ prefixCls: f, rootPrefixCls: p, iconPrefixCls: v, instance: xo }); return } xo = w, t({ prefixCls: f, rootPrefixCls: p, iconPrefixCls: v, instance: w }) }) } var SO = { info: JN, success: a2, error: wf, warning: s2, loading: of }, EO = Object.keys(SO); function PO(e, t, n) { var r, i = e.duration !== void 0 ? e.duration : mO, s = SO[e.type], c = Xe("".concat(t, "-custom-content"), (r = {}, re(r, "".concat(t, "-").concat(e.type), e.type), re(r, "".concat(t, "-rtl"), bO === !0), r)); return { key: e.key, duration: i, style: e.style || {}, className: e.className, content: I(Cf, { iconPrefixCls: n, children: Qe("div", { className: c, children: [e.icon || s && I(s, {}), I("span", { children: e.content })] }) }), onClose: e.onClose, onClick: e.onClick } } function Mj(e) { var t = e.key || wO(), n = new Promise(function (i) { var s = function () { return typeof e.onClose == "function" && e.onClose(), i(!0) }; CO(e, function (c) { var o = c.prefixCls, f = c.iconPrefixCls, p = c.instance; p.notice(PO(tt(tt({}, e), { key: t, onClose: s }), o, f)) }) }), r = function () { var s; xo && (xo.removeNotice(t), (s = e.onClose) === null || s === void 0 || s.call(e)) }; return r.then = function (i, s) { return n.then(i, s) }, r.promise = n, r } function Aj(e) { return Object.prototype.toString.call(e) === "[object Object]" && !!e.content } var Kp = { open: Mj, config: Rj, destroy: function (t) { if (xo) if (t) { var n = xo, r = n.removeNotice; r(t) } else { var i = xo, s = i.destroy; s(), xo = null } } }; function TO(e, t) { e[t] = function (n, r, i) { return Aj(n) ? e.open(tt(tt({}, n), { type: t })) : (typeof r == "function" && (i = r, r = void 0), e.open({ content: n, duration: r, type: t, onClose: i })) } } EO.forEach(function (e) { return TO(Kp, e) }); Kp.warn = Kp.warning; Kp.useMessage = kj(CO, PO); const Nj = Kp; var Oj = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, name: "check-circle", theme: "outlined" }; const Dj = Oj; var kO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Dj }) }) }; kO.displayName = "CheckCircleOutlined"; const f2 = C.exports.forwardRef(kO); var Lj = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { tag: "path", attrs: { d: "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, name: "close-circle", theme: "outlined" }; const zj = Lj; var IO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: zj }) }) }; IO.displayName = "CloseCircleOutlined"; const h2 = C.exports.forwardRef(IO); var Fj = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, name: "close", theme: "outlined" }; const $j = Fj; var RO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: $j }) }) }; RO.displayName = "CloseOutlined"; const H0 = C.exports.forwardRef(RO); var Bj = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, name: "exclamation-circle", theme: "outlined" }; const Vj = Bj; var MO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Vj }) }) }; MO.displayName = "ExclamationCircleOutlined"; const W0 = C.exports.forwardRef(MO); var Uj = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, name: "info-circle", theme: "outlined" }; const jj = Uj; var AO = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: jj }) }) }; AO.displayName = "InfoCircleOutlined"; const p2 = C.exports.forwardRef(AO); function Kj(e, t) { var n = function () { var i, s = null, c = { add: function (k, A) { s == null || s.component.add(k, A) } }, o = d2(c), f = ze(o, 2), p = f[0], v = f[1]; function y(P) { var k = P.prefixCls, A = i("notification", k); e(tt(tt({}, P), { prefixCls: A }), function (N) { var R = N.prefixCls, M = N.instance; s = M, p(t(P, R)) }) } var w = C.exports.useRef({}); return w.current.open = y, ["success", "info", "warning", "error"].forEach(function (P) { w.current[P] = function (k) { return w.current.open(tt(tt({}, k), { type: P })) } }), [w.current, I(yu, { children: function (P) { return i = P.getPrefixCls, v } }, "holder")] }; return n } globalThis && globalThis.__awaiter; var ec = {}, NO = 4.5, OO = 24, DO = 24, LO = "", zw = "topRight", zO, FO, $O = !1, BO; function Hj(e) { var t = e.duration, n = e.placement, r = e.bottom, i = e.top, s = e.getContainer, c = e.closeIcon, o = e.prefixCls; o !== void 0 && (LO = o), t !== void 0 && (NO = t), n !== void 0 ? zw = n : e.rtl && (zw = "topLeft"), r !== void 0 && (DO = r), i !== void 0 && (OO = i), s !== void 0 && (zO = s), c !== void 0 && (FO = c), e.rtl !== void 0 && ($O = e.rtl), e.maxCount !== void 0 && (BO = e.maxCount) } function Wj(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : OO, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DO, r; switch (e) { case "top": r = { left: "50%", transform: "translateX(-50%)", right: "auto", top: t, bottom: "auto" }; break; case "topLeft": r = { left: 0, top: t, bottom: "auto" }; break; case "topRight": r = { right: 0, top: t, bottom: "auto" }; break; case "bottom": r = { left: "50%", transform: "translateX(-50%)", right: "auto", top: "auto", bottom: n }; break; case "bottomLeft": r = { left: 0, top: "auto", bottom: n }; break; default: r = { right: 0, top: "auto", bottom: n }; break }return r } function VO(e, t) { var n = e.placement, r = n === void 0 ? zw : n, i = e.top, s = e.bottom, c = e.getContainer, o = c === void 0 ? zO : c, f = e.prefixCls, p = m2(), v = p.getPrefixCls, y = p.getIconPrefixCls, w = v("notification", f || LO), P = y(), k = "".concat(w, "-").concat(r), A = ec[k]; if (A) { Promise.resolve(A).then(function (R) { t({ prefixCls: "".concat(w, "-notice"), iconPrefixCls: P, instance: R }) }); return } var N = Xe("".concat(w, "-").concat(r), re({}, "".concat(w, "-rtl"), $O === !0)); ec[k] = new Promise(function (R) { af.newInstance({ prefixCls: w, className: N, style: Wj(r, i, s), getContainer: o, maxCount: BO }, function (M) { R(M), t({ prefixCls: "".concat(w, "-notice"), iconPrefixCls: P, instance: M }) }) }) } var Gj = { success: f2, info: p2, error: h2, warning: W0 }; function UO(e, t, n) { var r = e.duration, i = e.icon, s = e.type, c = e.description, o = e.message, f = e.btn, p = e.onClose, v = e.onClick, y = e.key, w = e.style, P = e.className, k = e.closeIcon, A = k === void 0 ? FO : k, N = e.props, R = r === void 0 ? NO : r, M = null; i ? M = I("span", { className: "".concat(t, "-icon"), children: e.icon }) : s && (M = C.exports.createElement(Gj[s] || null, { className: "".concat(t, "-icon ").concat(t, "-icon-").concat(s) })); var O = I("span", { className: "".concat(t, "-close-x"), children: A || I(H0, { className: "".concat(t, "-close-icon") }) }), z = !c && M ? I("span", { className: "".concat(t, "-message-single-line-auto-margin") }) : null; return { content: I(Cf, { iconPrefixCls: n, children: Qe("div", { className: M ? "".concat(t, "-with-icon") : "", role: "alert", children: [M, Qe("div", { className: "".concat(t, "-message"), children: [z, o] }), I("div", { className: "".concat(t, "-description"), children: c }), f ? I("span", { className: "".concat(t, "-btn"), children: f }) : null] }) }), duration: R, closable: !0, closeIcon: O, onClose: p, onClick: v, key: y, style: w || {}, className: Xe(P, re({}, "".concat(t, "-").concat(s), !!s)), props: N } } function qj(e) { VO(e, function (t) { var n = t.prefixCls, r = t.iconPrefixCls, i = t.instance; i.notice(UO(e, n, r)) }) } var sf = { open: qj, close: function (t) { Object.keys(ec).forEach(function (n) { return Promise.resolve(ec[n]).then(function (r) { r.removeNotice(t) }) }) }, config: Hj, destroy: function () { Object.keys(ec).forEach(function (t) { Promise.resolve(ec[t]).then(function (n) { n.destroy() }), delete ec[t] }) } };["success", "info", "warning", "error"].forEach(function (e) { sf[e] = function (t) { return sf.open(tt(tt({}, t), { type: e })) } }); sf.warn = sf.warning; sf.useNotification = Kj(VO, UO); const Zj = sf; var Xj = function (t, n) { return n || (t ? "ant-".concat(t) : "ant") }, zn = C.exports.createContext({ getPrefixCls: Xj }), yu = zn.Consumer, Yj = "-ant-".concat(Date.now(), "-").concat(Math.random()); function Qj(e, t) {
|
|
|
var n = {}, r = function (v, y) { var w = v.clone(); return w = (y == null ? void 0 : y(w)) || w, w.toRgbString() }, i = function (v, y) { var w = new p1(v), P = jp(w.toRgbString()); n["".concat(y, "-color")] = r(w), n["".concat(y, "-color-disabled")] = P[1], n["".concat(y, "-color-hover")] = P[4], n["".concat(y, "-color-active")] = P[6], n["".concat(y, "-color-outline")] = w.clone().setAlpha(.2).toRgbString(), n["".concat(y, "-color-deprecated-bg")] = P[0], n["".concat(y, "-color-deprecated-border")] = P[2] }; if (t.primaryColor) { i(t.primaryColor, "primary"); var s = new p1(t.primaryColor), c = jp(s.toRgbString()); c.forEach(function (p, v) { n["primary-".concat(v + 1)] = p }), n["primary-color-deprecated-l-35"] = r(s, function (p) { return p.lighten(35) }), n["primary-color-deprecated-l-20"] = r(s, function (p) { return p.lighten(20) }), n["primary-color-deprecated-t-20"] = r(s, function (p) { return p.tint(20) }), n["primary-color-deprecated-t-50"] = r(s, function (p) { return p.tint(50) }), n["primary-color-deprecated-f-12"] = r(s, function (p) { return p.setAlpha(p.getAlpha() * .12) }); var o = new p1(c[0]); n["primary-color-active-deprecated-f-30"] = r(o, function (p) { return p.setAlpha(p.getAlpha() * .3) }), n["primary-color-active-deprecated-d-02"] = r(o, function (p) { return p.darken(2) }) } t.successColor && i(t.successColor, "success"), t.warningColor && i(t.warningColor, "warning"), t.errorColor && i(t.errorColor, "error"), t.infoColor && i(t.infoColor, "info"); var f = Object.keys(n).map(function (p) { return "--".concat(e, "-").concat(p, ": ").concat(n[p], ";") }); return `
|
|
|
:root {
|
|
|
`.concat(f.join(`
|
|
|
`), `
|
|
|
}
|
|
|
`).trim()
|
|
|
} function Jj(e, t) { var n = Qj(e, t); wo() && hm(n, "".concat(Yj, "-dynamic-theme")) } var Fw = C.exports.createContext(!1), jO = function (t) { var n = t.children, r = t.disabled, i = C.exports.useContext(Fw); return I(Fw.Provider, { value: r != null ? r : i, children: n }) }; const dl = Fw; var $w = C.exports.createContext(void 0), KO = function (t) { var n = t.children, r = t.size; return I($w.Consumer, { children: function (i) { return I($w.Provider, { value: r || i, children: n }) } }) }; const qa = $w; var eK = ["getTargetContainer", "getPopupContainer", "renderEmpty", "pageHeader", "input", "pagination", "form"], tK = "ant", nK = "anticon", Dy, HO; function jg() { return Dy || tK } function rK() { return HO || nK } var iK = function (t) { var n = t.prefixCls, r = t.iconPrefixCls, i = t.theme; n !== void 0 && (Dy = n), r !== void 0 && (HO = r), i && Jj(jg(), i) }, m2 = function () { return { getPrefixCls: function (n, r) { return r || (n ? "".concat(jg(), "-").concat(n) : jg()) }, getIconPrefixCls: rK, getRootPrefixCls: function (n, r) { return n || Dy || (r && r.includes("-") ? r.replace(/^(.*)-[^-]*$/, "$1") : jg()) } } }, oK = function (t) { var n, r, i = t.children, s = t.csp, c = t.autoInsertSpaceInButton, o = t.form, f = t.locale, p = t.componentSize, v = t.direction, y = t.space, w = t.virtual, P = t.dropdownMatchSelectWidth, k = t.legacyLocale, A = t.parentContext, N = t.iconPrefixCls, R = t.componentDisabled, M = C.exports.useCallback(function (j, X) { var Y = t.prefixCls; if (X) return X; var se = Y || A.getPrefixCls(""); return j ? "".concat(se, "-").concat(j) : se }, [A.getPrefixCls, t.prefixCls]), O = tt(tt({}, A), { csp: s, autoInsertSpaceInButton: c, locale: f || k, direction: v, space: y, virtual: w, dropdownMatchSelectWidth: P, getPrefixCls: M }); eK.forEach(function (j) { var X = t[j]; X && (O[j] = X) }); var z = cm(function () { return O }, O, function (j, X) { var Y = Object.keys(j), se = Object.keys(X); return Y.length !== se.length || Y.some(function (ee) { return j[ee] !== X[ee] }) }), B = C.exports.useMemo(function () { return { prefixCls: N, csp: s } }, [N, s]), V = i, G = {}; return f && (G = ((n = f.Form) === null || n === void 0 ? void 0 : n.defaultValidateMessages) || ((r = ol.Form) === null || r === void 0 ? void 0 : r.defaultValidateMessages) || {}), o && o.validateMessages && (G = tt(tt({}, G), o.validateMessages)), Object.keys(G).length > 0 && (V = I(r2, { validateMessages: G, children: i })), f && (V = I(gU, { locale: f, _ANT_MARK__: mU, children: V })), (N || s) && (V = I(YS.Provider, { value: B, children: V })), p && (V = I(KO, { size: p, children: V })), R !== void 0 && (V = I(jO, { disabled: R, children: V })), I(zn.Provider, { value: z, children: V }) }, Cf = function (t) { return C.exports.useEffect(function () { t.direction && (Nj.config({ rtl: t.direction === "rtl" }), Zj.config({ rtl: t.direction === "rtl" })) }, [t.direction]), I(fm, { children: function (n, r, i) { return I(yu, { children: function (s) { return I(oK, { parentContext: s, legacyLocale: i, ...t }) } }) } }) }; Cf.ConfigContext = zn; Cf.SizeContext = qa; Cf.config = iK; function Xs(e, t, n, r) { var i = bc.unstable_batchedUpdates ? function (c) { bc.unstable_batchedUpdates(n, c) } : n; return e.addEventListener && e.addEventListener(t, i, r), { remove: function () { e.removeEventListener && e.removeEventListener(t, i, r) } } } function WO(e) { return Object.keys(e).reduce(function (t, n) { return (n.startsWith("data-") || n.startsWith("aria-") || n === "role") && !n.startsWith("data-__") && (t[n] = e[n]), t }, {}) } var zo = C.exports.isValidElement; function GO(e) { return e && zo(e) && e.type === C.exports.Fragment } function qO(e, t, n) { return zo(e) ? C.exports.cloneElement(e, typeof n == "function" ? n(e.props || {}) : n) : t } function li(e, t) { return qO(e, e, t) } var aK = function (e) { ui(n, e); var t = ci(n); function n() { var r; return zr(this, n), r = t.apply(this, arguments), r.state = { error: void 0, info: { componentStack: "" } }, r } return Fr(n, [{ key: "componentDidCatch", value: function (i, s) { this.setState({ error: i, info: s }) } }, { key: "render", value: function () { var i = this.props, s = i.message, c = i.description, o = i.children, f = this.state, p = f.error, v = f.info, y = v && v.componentStack ? v.componentStack : null, w = typeof s > "u" ? (p || "").toString() : s, P = typeof c > "u" ? y : c; return p ? I(v2, { type: "error", message: w, description: I("pre", { children: P }) }) : o } }]), n }(C.exports.Component); const sK = aK; var lK = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, uK = { success: a2, info: JN, error: wf, warning: s2 }, cK = { success: f2, info: p2, error: h2, warning: W0 }, dK = function (t) { var n = t.description, r = t.icon, i = t.prefixCls, s = t.type, c = (n ? cK : uK)[s] || null; return r ? qO(r, I("span", { className: "".concat(i, "-icon"), children: r }), function () { return { className: Xe("".concat(i, "-icon"), re({}, r.props.className, r.props.className)) } }) : C.exports.createElement(c, { className: "".concat(i, "-icon") }) }, fK = function (t) { var n = t.isClosable, r = t.closeText, i = t.prefixCls, s = t.closeIcon, c = t.handleClose; return n ? I("button", { type: "button", onClick: c, className: "".concat(i, "-close-icon"), tabIndex: 0, children: r ? I("span", { className: "".concat(i, "-close-text"), children: r }) : s }) : null }, ZO = function (t) { var n, r = t.description, i = t.prefixCls, s = t.message, c = t.banner, o = t.className, f = o === void 0 ? "" : o, p = t.style, v = t.onMouseEnter, y = t.onMouseLeave, w = t.onClick, P = t.afterClose, k = t.showIcon, A = t.closable, N = t.closeText, R = t.closeIcon, M = R === void 0 ? I(H0, {}) : R, O = t.action, z = lK(t, ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action"]), B = C.exports.useState(!1), V = ze(B, 2), G = V[0], j = V[1], X = C.exports.useRef(), Y = C.exports.useContext(zn), se = Y.getPrefixCls, ee = Y.direction, Z = se("alert", i), J = function (Pe) { var De; j(!0), (De = z.onClose) === null || De === void 0 || De.call(z, Pe) }, ve = function () { var Pe = z.type; return Pe !== void 0 ? Pe : c ? "warning" : "info" }, ie = N ? !0 : A, ce = ve(), oe = c && k === void 0 ? !0 : k, ye = Xe(Z, "".concat(Z, "-").concat(ce), (n = {}, re(n, "".concat(Z, "-with-description"), !!r), re(n, "".concat(Z, "-no-icon"), !oe), re(n, "".concat(Z, "-banner"), !!c), re(n, "".concat(Z, "-rtl"), ee === "rtl"), n), f), Ie = WO(z); return I(Sa, { visible: !G, motionName: "".concat(Z, "-motion"), motionAppear: !1, motionEnter: !1, onLeaveStart: function (Pe) { return { maxHeight: Pe.offsetHeight } }, onLeaveEnd: P, children: function (Te) { var Pe = Te.className, De = Te.style; return Qe("div", { ref: X, "data-show": !G, className: Xe(ye, Pe), style: tt(tt({}, p), De), onMouseEnter: v, onMouseLeave: y, onClick: w, role: "alert", ...Ie, children: [oe ? I(dK, { description: r, icon: z.icon, prefixCls: Z, type: ce }) : null, Qe("div", { className: "".concat(Z, "-content"), children: [s ? I("div", { className: "".concat(Z, "-message"), children: s }) : null, r ? I("div", { className: "".concat(Z, "-description"), children: r }) : null] }), O ? I("div", { className: "".concat(Z, "-action"), children: O }) : null, I(fK, { isClosable: !!ie, closeText: N, prefixCls: Z, closeIcon: M, handleClose: J })] }) } }) }; ZO.ErrorBoundary = sK; const v2 = ZO; function Bw(e) { return e != null && e === e.window } function hK(e, t) { var n, r; if (typeof window > "u") return 0; var i = t ? "scrollTop" : "scrollLeft", s = 0; return Bw(e) ? s = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? s = e.documentElement[i] : (e instanceof HTMLElement || e) && (s = e[i]), e && !Bw(e) && typeof s != "number" && (s = (r = ((n = e.ownerDocument) !== null && n !== void 0 ? n : e).documentElement) === null || r === void 0 ? void 0 : r[i]), s } function pK(e, t, n, r) { var i = n - t; return e /= r / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t } function mK(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.getContainer, r = n === void 0 ? function () { return window } : n, i = t.callback, s = t.duration, c = s === void 0 ? 450 : s, o = r(), f = hK(o, !0), p = Date.now(), v = function y() { var w = Date.now(), P = w - p, k = pK(P > c ? c : P, f, e, c); Bw(o) ? o.scrollTo(window.pageXOffset, k) : o instanceof Document || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = k : o.scrollTop = k, P < c ? nr(y) : typeof i == "function" && i() }; nr(v) } function Hp(e) { var t = C.exports.useRef(); t.current = e; var n = C.exports.useCallback(function () { for (var r, i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return (r = t.current) === null || r === void 0 ? void 0 : r.call.apply(r, [t].concat(s)) }, []); return n } var si = wo() ? C.exports.useLayoutEffect : C.exports.useEffect, hp = function (t, n) { var r = C.exports.useRef(!0); si(function () { if (!r.current) return t() }, n), si(function () { return r.current = !1, function () { r.current = !0 } }, []) }; function x1(e) { return e !== void 0 } function Bi(e, t) { var n = t || {}, r = n.defaultValue, i = n.value, s = n.onChange, c = n.postState, o = ms(function () { return x1(i) ? i : x1(r) ? typeof r == "function" ? r() : r : typeof e == "function" ? e() : e }), f = ze(o, 2), p = f[0], v = f[1], y = i !== void 0 ? i : p, w = c ? c(y) : y, P = Hp(s), k = ms([y]), A = ze(k, 2), N = A[0], R = A[1]; hp(function () { var O = N[0]; p !== O && P(p, O) }, [N]), hp(function () { x1(i) || v(i) }, [i]); var M = Hp(function (O, z) { v(O, z), R([y], z) }); return [w, M] } const g2 = function () { if (typeof navigator > "u" || typeof window > "u") return !1; var e = navigator.userAgent || navigator.vendor || window.opera; return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e == null ? void 0 : e.substr(0, 4)) }; var St = { MAC_ENTER: 3, BACKSPACE: 8, TAB: 9, NUM_CENTER: 12, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, PAUSE: 19, CAPS_LOCK: 20, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, PRINT_SCREEN: 44, INSERT: 45, DELETE: 46, ZERO: 48, ONE: 49, TWO: 50, THREE: 51, FOUR: 52, FIVE: 53, SIX: 54, SEVEN: 55, EIGHT: 56, NINE: 57, QUESTION_MARK: 63, A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, META: 91, WIN_KEY_RIGHT: 92, CONTEXT_MENU: 93, NUM_ZERO: 96, NUM_ONE: 97, NUM_TWO: 98, NUM_THREE: 99, NUM_FOUR: 100, NUM_FIVE: 101, NUM_SIX: 102, NUM_SEVEN: 103, NUM_EIGHT: 104, NUM_NINE: 105, NUM_MULTIPLY: 106, NUM_PLUS: 107, NUM_MINUS: 109, NUM_PERIOD: 110, NUM_DIVISION: 111, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NUMLOCK: 144, SEMICOLON: 186, DASH: 189, EQUALS: 187, COMMA: 188, PERIOD: 190, SLASH: 191, APOSTROPHE: 192, SINGLE_QUOTE: 222, OPEN_SQUARE_BRACKET: 219, BACKSLASH: 220, CLOSE_SQUARE_BRACKET: 221, WIN_KEY: 224, MAC_FF_META: 224, WIN_IME: 229, isTextModifyingKeyEvent: function (t) { var n = t.keyCode; if (t.altKey && !t.ctrlKey || t.metaKey || n >= St.F1 && n <= St.F12) return !1; switch (n) { case St.ALT: case St.CAPS_LOCK: case St.CONTEXT_MENU: case St.CTRL: case St.DOWN: case St.END: case St.ESC: case St.HOME: case St.INSERT: case St.LEFT: case St.MAC_FF_META: case St.META: case St.NUMLOCK: case St.NUM_CENTER: case St.PAGE_DOWN: case St.PAGE_UP: case St.PAUSE: case St.PRINT_SCREEN: case St.RIGHT: case St.SHIFT: case St.UP: case St.WIN_KEY: case St.WIN_KEY_RIGHT: return !1; default: return !0 } }, isCharacterKey: function (t) { if (t >= St.ZERO && t <= St.NINE || t >= St.NUM_ZERO && t <= St.NUM_MULTIPLY || t >= St.A && t <= St.Z || window.navigator.userAgent.indexOf("WebKit") !== -1 && t === 0) return !0; switch (t) { case St.SPACE: case St.QUESTION_MARK: case St.NUM_PLUS: case St.NUM_MINUS: case St.NUM_PERIOD: case St.NUM_DIVISION: case St.SEMICOLON: case St.DASH: case St.EQUALS: case St.COMMA: case St.PERIOD: case St.SLASH: case St.APOSTROPHE: case St.SINGLE_QUOTE: case St.OPEN_SQUARE_BRACKET: case St.BACKSLASH: case St.CLOSE_SQUARE_BRACKET: return !0; default: return !1 } } }, XO = C.exports.createContext(null); function YO() { return C.exports.useContext(XO) } function vK() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10, t = C.exports.useState(!1), n = ze(t, 2), r = n[0], i = n[1], s = C.exports.useRef(null), c = function () { window.clearTimeout(s.current) }; C.exports.useEffect(function () { return c }, []); var o = function (p, v) { c(), s.current = window.setTimeout(function () { i(p), v && v() }, e) }; return [r, o, c] } function QO() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, t = C.exports.useRef(null), n = C.exports.useRef(null); C.exports.useEffect(function () { return function () { window.clearTimeout(n.current) } }, []); function r(i) { (i || t.current === null) && (t.current = i), window.clearTimeout(n.current), n.current = window.setTimeout(function () { t.current = null }, e) } return [function () { return t.current }, r] } function gK(e, t, n, r) { var i = C.exports.useRef(null); i.current = { open: t, triggerOpen: n, customizedTrigger: r }, C.exports.useEffect(function () { function s(c) { var o; if (!((o = i.current) !== null && o !== void 0 && o.customizedTrigger)) { var f = c.target; f.shadowRoot && c.composed && (f = c.composedPath()[0] || f), i.current.open && e().filter(function (p) { return p }).every(function (p) { return !p.contains(f) && p !== f }) && i.current.triggerOpen(!1) } } return window.addEventListener("mousedown", s), function () { return window.removeEventListener("mousedown", s) } }, []) } var yK = `accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`, xK = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, _K = "".concat(yK, " ").concat(xK).split(/[\s\n]+/), bK = "aria-", wK = "data-"; function hk(e, t) { return e.indexOf(t) === 0 } function uu(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n; t === !1 ? n = { aria: !0, data: !0, attr: !0 } : t === !0 ? n = { aria: !0 } : n = ge({}, t); var r = {}; return Object.keys(e).forEach(function (i) { (n.aria && (i === "role" || hk(i, bK)) || n.data && hk(i, wK) || n.attr && _K.includes(i)) && (r[i] = e[i]) }), r } var CK = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"], vd = void 0; function SK(e, t) { var n = e.prefixCls, r = e.invalidate, i = e.item, s = e.renderItem, c = e.responsive, o = e.responsiveDisabled, f = e.registerSize, p = e.itemKey, v = e.className, y = e.style, w = e.children, P = e.display, k = e.order, A = e.component, N = A === void 0 ? "div" : A, R = Rn(e, CK), M = c && !P; function O(j) { f(p, j) } C.exports.useEffect(function () { return function () { O(null) } }, []); var z = s && i !== vd ? s(i) : w, B; r || (B = { opacity: M ? 0 : 1, height: M ? 0 : vd, overflowY: M ? "hidden" : vd, order: c ? k : vd, pointerEvents: M ? "none" : vd, position: M ? "absolute" : vd }); var V = {}; M && (V["aria-hidden"] = !0); var G = I(N, { className: Xe(!r && n, v), style: ge(ge({}, B), y), ...V, ...R, ref: t, children: z }); return c && (G = I(cl, { onResize: function (X) { var Y = X.offsetWidth; O(Y) }, disabled: o, children: G })), G } var pp = C.exports.forwardRef(SK); pp.displayName = "Item"; function EK() { var e = ms({}), t = ze(e, 2), n = t[1], r = C.exports.useRef([]), i = 0, s = 0; function c(o) { var f = i; i += 1, r.current.length < f + 1 && (r.current[f] = o); var p = r.current[f]; function v(y) { r.current[f] = typeof y == "function" ? y(r.current[f]) : y, nr.cancel(s), s = nr(function () { n({}, !0) }) } return [p, v] } return c } var PK = ["component"], TK = ["className"], kK = ["className"], IK = function (t, n) { var r = C.exports.useContext(Ly); if (!r) { var i = t.component, s = i === void 0 ? "div" : i, c = Rn(t, PK); return I(s, { ...c, ref: n }) } var o = r.className, f = Rn(r, TK), p = t.className, v = Rn(t, kK); return I(Ly.Provider, { value: null, children: I(pp, { ref: n, className: Xe(o, p), ...f, ...v }) }) }, JO = C.exports.forwardRef(IK); JO.displayName = "RawItem"; var RK = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"], Ly = C.exports.createContext(null), eD = "responsive", tD = "invalidate"; function MK(e) { return "+ ".concat(e.length, " ...") } function AK(e, t) { var n = e.prefixCls, r = n === void 0 ? "rc-overflow" : n, i = e.data, s = i === void 0 ? [] : i, c = e.renderItem, o = e.renderRawItem, f = e.itemKey, p = e.itemWidth, v = p === void 0 ? 10 : p, y = e.ssr, w = e.style, P = e.className, k = e.maxCount, A = e.renderRest, N = e.renderRawRest, R = e.suffix, M = e.component, O = M === void 0 ? "div" : M, z = e.itemComponent, B = e.onVisibleChange, V = Rn(e, RK), G = EK(), j = y === "full", X = G(null), Y = ze(X, 2), se = Y[0], ee = Y[1], Z = se || 0, J = G(new Map), ve = ze(J, 2), ie = ve[0], ce = ve[1], oe = G(0), ye = ze(oe, 2), Ie = ye[0], Te = ye[1], Pe = G(0), De = ze(Pe, 2), Re = De[0], ke = De[1], Oe = G(0), $e = ze(Oe, 2), He = $e[0], Ue = $e[1], st = C.exports.useState(null), ft = ze(st, 2), It = ft[0], We = ft[1], Pt = C.exports.useState(null), pt = ze(Pt, 2), Rt = pt[0], yt = pt[1], Mt = C.exports.useMemo(function () { return Rt === null && j ? Number.MAX_SAFE_INTEGER : Rt || 0 }, [Rt, se]), ut = C.exports.useState(!1), dt = ze(ut, 2), ct = dt[0], rt = dt[1], ht = "".concat(r, "-item"), bt = Math.max(Ie, Re), Wt = k === eD, Ut = s.length && Wt, Jt = k === tD, Fe = Ut || typeof k == "number" && s.length > k, Ge = C.exports.useMemo(function () { var ot = s; return Ut ? se === null && j ? ot = s : ot = s.slice(0, Math.min(s.length, Z / v)) : typeof k == "number" && (ot = s.slice(0, k)), ot }, [s, v, se, k, Ut]), Zt = C.exports.useMemo(function () { return Ut ? s.slice(Mt + 1) : s.slice(Ge.length) }, [s, Ge, Ut, Mt]), cn = C.exports.useCallback(function (ot, mt) { var Dt; return typeof f == "function" ? f(ot) : (Dt = f && (ot == null ? void 0 : ot[f])) !== null && Dt !== void 0 ? Dt : mt }, [f]), jt = C.exports.useCallback(c || function (ot) { return ot }, [c]); function Kt(ot, mt, Dt) { Rt === ot && (mt === void 0 || mt === It) || (yt(ot), Dt || (rt(ot < s.length - 1), B == null || B(ot)), mt !== void 0 && We(mt)) } function nn(ot, mt) { ee(mt.clientWidth) } function Cn(ot, mt) { ce(function (Dt) { var Bt = new Map(Dt); return mt === null ? Bt.delete(ot) : Bt.set(ot, mt), Bt }) } function Nn(ot, mt) { ke(mt), Te(Re) } function wt(ot, mt) { Ue(mt) } function qt(ot) { return ie.get(cn(Ge[ot], ot)) } si(function () { if (Z && bt && Ge) { var ot = He, mt = Ge.length, Dt = mt - 1; if (!mt) { Kt(0, null); return } for (var Bt = 0; Bt < mt; Bt += 1) { var pn = qt(Bt); if (j && (pn = pn || 0), pn === void 0) { Kt(Bt - 1, void 0, !0); break } if (ot += pn, Dt === 0 && ot <= Z || Bt === Dt - 1 && ot + qt(Dt) <= Z) { Kt(Dt, null); break } else if (ot + bt > Z) { Kt(Bt - 1, ot - pn - He + Re); break } } R && qt(0) + He > Z && We(null) } }, [Z, ie, Re, He, cn, Ge]); var At = ct && !!Zt.length, Xt = {}; It !== null && Ut && (Xt = { position: "absolute", left: It, top: 0 }); var en = { prefixCls: ht, responsive: Ut, component: z, invalidate: Jt }, gt = o ? function (ot, mt) { var Dt = cn(ot, mt); return I(Ly.Provider, { value: ge(ge({}, en), {}, { order: mt, item: ot, itemKey: Dt, registerSize: Cn, display: mt <= Mt }), children: o(ot, mt) }, Dt) } : function (ot, mt) { var Dt = cn(ot, mt); return C.exports.createElement(pp, { ...en, order: mt, key: Dt, item: ot, renderItem: jt, itemKey: Dt, registerSize: Cn, display: mt <= Mt }) }, yn, Sn = { order: At ? Mt : Number.MAX_SAFE_INTEGER, className: "".concat(ht, "-rest"), registerSize: Nn, display: At }; if (N) N && (yn = I(Ly.Provider, { value: ge(ge({}, en), Sn), children: N(Zt) })); else { var dn = A || MK; yn = I(pp, { ...en, ...Sn, children: typeof dn == "function" ? dn(Zt) : dn }) } var zt = Qe(O, { className: Xe(!Jt && r, P), style: w, ref: t, ...V, children: [Ge.map(gt), Fe ? yn : null, R && I(pp, { ...en, responsive: Wt, responsiveDisabled: !Ut, order: Mt, className: "".concat(ht, "-suffix"), registerSize: wt, display: !0, style: Xt, children: R })] }); return Wt && (zt = I(cl, { onResize: nn, disabled: !Ut, children: zt })), zt } var vs = C.exports.forwardRef(AK); vs.displayName = "Overflow"; vs.Item = JO; vs.RESPONSIVE = eD; vs.INVALIDATE = tD; var zy = function (t) { var n = t.className, r = t.customizeIcon, i = t.customizeIconProps, s = t.onMouseDown, c = t.onClick, o = t.children, f; return typeof r == "function" ? f = r(i) : f = r, I("span", { className: n, onMouseDown: function (v) { v.preventDefault(), s && s(v) }, style: { userSelect: "none", WebkitUserSelect: "none" }, unselectable: "on", onClick: c, "aria-hidden": !0, children: f !== void 0 ? f : I("span", { className: Xe(n.split(/\s+/).map(function (p) { return "".concat(p, "-icon") })), children: o }) }) }, NK = function (t, n) { var r, i, s = t.prefixCls, c = t.id, o = t.inputElement, f = t.disabled, p = t.tabIndex, v = t.autoFocus, y = t.autoComplete, w = t.editable, P = t.activeDescendantId, k = t.value, A = t.maxLength, N = t.onKeyDown, R = t.onMouseDown, M = t.onChange, O = t.onPaste, z = t.onCompositionStart, B = t.onCompositionEnd, V = t.open, G = t.attrs, j = o || I("input", {}), X = j, Y = X.ref, se = X.props, ee = se.onKeyDown, Z = se.onChange, J = se.onMouseDown, ve = se.onCompositionStart, ie = se.onCompositionEnd, ce = se.style; return "maxLength" in j.props, j = C.exports.cloneElement(j, ge(ge(ge({ type: "search" }, se), {}, { id: c, ref: Po(n, Y), disabled: f, tabIndex: p, autoComplete: y || "off", autoFocus: v, className: Xe("".concat(s, "-selection-search-input"), (r = j) === null || r === void 0 || (i = r.props) === null || i === void 0 ? void 0 : i.className), role: "combobox", "aria-expanded": V, "aria-haspopup": "listbox", "aria-owns": "".concat(c, "_list"), "aria-autocomplete": "list", "aria-controls": "".concat(c, "_list"), "aria-activedescendant": P }, G), {}, { value: w ? k : "", maxLength: A, readOnly: !w, unselectable: w ? null : "on", style: ge(ge({}, ce), {}, { opacity: w ? null : 0 }), onKeyDown: function (ye) { N(ye), ee && ee(ye) }, onMouseDown: function (ye) { R(ye), J && J(ye) }, onChange: function (ye) { M(ye), Z && Z(ye) }, onCompositionStart: function (ye) { z(ye), ve && ve(ye) }, onCompositionEnd: function (ye) { B(ye), ie && ie(ye) }, onPaste: O })), j }, y2 = C.exports.forwardRef(NK); y2.displayName = "Input"; function nD(e) { return Array.isArray(e) ? e : e !== void 0 ? [e] : [] } var OK = typeof window < "u" && window.document && window.document.documentElement, DK = OK; function LK(e) { return e != null } function pk(e) { return ["string", "number"].includes(ln(e)) } function rD(e) { var t = void 0; return e && (pk(e.title) ? t = e.title.toString() : pk(e.label) && (t = e.label.toString())), t } function zK(e, t) { DK ? C.exports.useLayoutEffect(e, t) : C.exports.useEffect(e, t) } function FK(e) { var t; return (t = e.key) !== null && t !== void 0 ? t : e.value } var mk = function (t) { t.preventDefault(), t.stopPropagation() }, $K = function (t) { var n = t.id, r = t.prefixCls, i = t.values, s = t.open, c = t.searchValue, o = t.autoClearSearchValue, f = t.inputRef, p = t.placeholder, v = t.disabled, y = t.mode, w = t.showSearch, P = t.autoFocus, k = t.autoComplete, A = t.activeDescendantId, N = t.tabIndex, R = t.removeIcon, M = t.maxTagCount, O = t.maxTagTextLength, z = t.maxTagPlaceholder, B = z === void 0 ? function (We) { return "+ ".concat(We.length, " ...") } : z, V = t.tagRender, G = t.onToggleOpen, j = t.onRemove, X = t.onInputChange, Y = t.onInputPaste, se = t.onInputKeyDown, ee = t.onInputMouseDown, Z = t.onInputCompositionStart, J = t.onInputCompositionEnd, ve = C.exports.useRef(null), ie = C.exports.useState(0), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useState(!1), Te = ze(Ie, 2), Pe = Te[0], De = Te[1], Re = "".concat(r, "-selection"), ke = s || y === "multiple" && o === !1 || y === "tags" ? c : "", Oe = y === "tags" || y === "multiple" && o === !1 || w && (s || Pe); zK(function () { ye(ve.current.scrollWidth) }, [ke]); function $e(We, Pt, pt, Rt, yt) { return Qe("span", { className: Xe("".concat(Re, "-item"), re({}, "".concat(Re, "-item-disabled"), pt)), title: rD(We), children: [I("span", { className: "".concat(Re, "-item-content"), children: Pt }), Rt && I(zy, { className: "".concat(Re, "-item-remove"), onMouseDown: mk, onClick: yt, customizeIcon: R, children: "\xD7" })] }) } function He(We, Pt, pt, Rt, yt) { var Mt = function (dt) { mk(dt), G(!s) }; return I("span", { onMouseDown: Mt, children: V({ label: Pt, value: We, disabled: pt, closable: Rt, onClose: yt }) }) } function Ue(We) { var Pt = We.disabled, pt = We.label, Rt = We.value, yt = !v && !Pt, Mt = pt; if (typeof O == "number" && (typeof pt == "string" || typeof pt == "number")) { var ut = String(Mt); ut.length > O && (Mt = "".concat(ut.slice(0, O), "...")) } var dt = function (rt) { rt && rt.stopPropagation(), j(We) }; return typeof V == "function" ? He(Rt, Mt, Pt, yt, dt) : $e(We, Mt, Pt, yt, dt) } function st(We) { var Pt = typeof B == "function" ? B(We) : B; return $e({ title: Pt }, Pt, !1) } var ft = Qe("div", { className: "".concat(Re, "-search"), style: { width: oe }, onFocus: function () { De(!0) }, onBlur: function () { De(!1) }, children: [I(y2, { ref: f, open: s, prefixCls: r, id: n, inputElement: null, disabled: v, autoFocus: P, autoComplete: k, editable: Oe, activeDescendantId: A, value: ke, onKeyDown: se, onMouseDown: ee, onChange: X, onPaste: Y, onCompositionStart: Z, onCompositionEnd: J, tabIndex: N, attrs: uu(t, !0) }), Qe("span", { ref: ve, className: "".concat(Re, "-search-mirror"), "aria-hidden": !0, children: [ke, "\xA0"] })] }), It = I(vs, { prefixCls: "".concat(Re, "-overflow"), data: i, renderItem: Ue, renderRest: st, suffix: ft, itemKey: FK, maxCount: M }); return Qe(An, { children: [It, !i.length && !ke && I("span", { className: "".concat(Re, "-placeholder"), children: p })] }) }, BK = function (t) { var n = t.inputElement, r = t.prefixCls, i = t.id, s = t.inputRef, c = t.disabled, o = t.autoFocus, f = t.autoComplete, p = t.activeDescendantId, v = t.mode, y = t.open, w = t.values, P = t.placeholder, k = t.tabIndex, A = t.showSearch, N = t.searchValue, R = t.activeValue, M = t.maxLength, O = t.onInputKeyDown, z = t.onInputMouseDown, B = t.onInputChange, V = t.onInputPaste, G = t.onInputCompositionStart, j = t.onInputCompositionEnd, X = C.exports.useState(!1), Y = ze(X, 2), se = Y[0], ee = Y[1], Z = v === "combobox", J = Z || A, ve = w[0], ie = N || ""; Z && R && !se && (ie = R), C.exports.useEffect(function () { Z && ee(!1) }, [Z, R]); var ce = v !== "combobox" && !y && !A ? !1 : !!ie, oe = rD(ve), ye = function () { if (ve) return null; var Te = ce ? { visibility: "hidden" } : void 0; return I("span", { className: "".concat(r, "-selection-placeholder"), style: Te, children: P }) }; return Qe(An, { children: [I("span", { className: "".concat(r, "-selection-search"), children: I(y2, { ref: s, prefixCls: r, id: i, open: y, inputElement: n, disabled: c, autoFocus: o, autoComplete: f, editable: J, activeDescendantId: p, value: ie, onKeyDown: O, onMouseDown: z, onChange: function (Te) { ee(!0), B(Te) }, onPaste: V, onCompositionStart: G, onCompositionEnd: j, tabIndex: k, attrs: uu(t, !0), maxLength: Z ? M : void 0 }) }), !Z && ve && !ce && I("span", { className: "".concat(r, "-selection-item"), title: oe, children: ve.label }), ye()] }) }; function VK(e) { return ![St.ESC, St.SHIFT, St.BACKSPACE, St.TAB, St.WIN_KEY, St.ALT, St.META, St.WIN_KEY_RIGHT, St.CTRL, St.SEMICOLON, St.EQUALS, St.CAPS_LOCK, St.CONTEXT_MENU, St.F1, St.F2, St.F3, St.F4, St.F5, St.F6, St.F7, St.F8, St.F9, St.F10, St.F11, St.F12].includes(e) } var UK = function (t, n) { var r = C.exports.useRef(null), i = C.exports.useRef(!1), s = t.prefixCls, c = t.open, o = t.mode, f = t.showSearch, p = t.tokenWithEnter, v = t.autoClearSearchValue, y = t.onSearch, w = t.onSearchSubmit, P = t.onToggleOpen, k = t.onInputKeyDown, A = t.domRef; C.exports.useImperativeHandle(n, function () { return { focus: function () { r.current.focus() }, blur: function () { r.current.blur() } } }); var N = QO(0), R = ze(N, 2), M = R[0], O = R[1], z = function (ce) { var oe = ce.which; (oe === St.UP || oe === St.DOWN) && ce.preventDefault(), k && k(ce), oe === St.ENTER && o === "tags" && !i.current && !c && (w == null || w(ce.target.value)), VK(oe) && P(!0) }, B = function () { O(!0) }, V = C.exports.useRef(null), G = function (ce) { y(ce, !0, i.current) !== !1 && P(!0) }, j = function () { i.current = !0 }, X = function (ce) { i.current = !1, o !== "combobox" && G(ce.target.value) }, Y = function (ce) { var oe = ce.target.value; if (p && V.current && /[\r\n]/.test(V.current)) { var ye = V.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " "); oe = oe.replace(ye, V.current) } V.current = null, G(oe) }, se = function (ce) { var oe = ce.clipboardData, ye = oe.getData("text"); V.current = ye }, ee = function (ce) { var oe = ce.target; if (oe !== r.current) { var ye = document.body.style.msTouchAction !== void 0; ye ? setTimeout(function () { r.current.focus() }) : r.current.focus() } }, Z = function (ce) { var oe = M(); ce.target !== r.current && !oe && o !== "combobox" && ce.preventDefault(), (o !== "combobox" && (!f || !oe) || !c) && (c && v !== !1 && y("", !0, !1), P()) }, J = { inputRef: r, onInputKeyDown: z, onInputMouseDown: B, onInputChange: Y, onInputPaste: se, onInputCompositionStart: j, onInputCompositionEnd: X }, ve = o === "multiple" || o === "tags" ? I($K, { ...t, ...J }) : I(BK, { ...t, ...J }); return I("div", { ref: A, className: "".concat(s, "-selector"), onClick: ee, onMouseDown: Z, children: ve }) }, iD = C.exports.forwardRef(UK); iD.displayName = "Selector"; var jK = C.exports.forwardRef(function (e, t) { var n = e.didUpdate, r = e.getContainer, i = e.children, s = C.exports.useRef(), c = C.exports.useRef(); C.exports.useImperativeHandle(t, function () { return {} }); var o = C.exports.useRef(!1); return !o.current && wo() && (c.current = r(), s.current = c.current.parentNode, o.current = !0), C.exports.useEffect(function () { n == null || n(e) }), C.exports.useEffect(function () { return c.current.parentNode === null && s.current !== null && s.current.appendChild(c.current), function () { var f, p; (f = c.current) === null || f === void 0 || (p = f.parentNode) === null || p === void 0 || p.removeChild(c.current) } }, []), c.current ? bc.createPortal(i, c.current) : null }); function KK(e, t, n) { return n ? e[0] === t[0] : e[0] === t[0] && e[1] === t[1] } function HK(e, t, n) { var r = e[t] || {}; return ge(ge({}, r), n) } function WK(e, t, n, r) { for (var i = n.points, s = Object.keys(e), c = 0; c < s.length; c += 1) { var o = s[c]; if (KK(e[o].points, i, r)) return "".concat(t, "-placement-").concat(o) } return "" } function oD(e) { var t = e.prefixCls, n = e.motion, r = e.animation, i = e.transitionName; return n || (r ? { motionName: "".concat(t, "-").concat(r) } : i ? { motionName: i } : null) } function GK(e) { var t = e.prefixCls, n = e.visible, r = e.zIndex, i = e.mask, s = e.maskMotion, c = e.maskAnimation, o = e.maskTransitionName; if (!i) return null; var f = {}; return (s || o || c) && (f = ge({ motionAppear: !0 }, oD({ motion: s, prefixCls: t, transitionName: o, animation: c }))), I(Sa, { ...f, visible: n, removeOnLeave: !0, children: function (p) { var v = p.className; return I("div", { style: { zIndex: r }, className: Xe("".concat(t, "-mask"), v) }) } }) } function vk(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter(function (i) { return Object.getOwnPropertyDescriptor(e, i).enumerable })), n.push.apply(n, r) } return n } function gk(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? vk(Object(n), !0).forEach(function (r) { qK(e, r, n[r]) }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vk(Object(n)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r)) }) } return e } function Vw(e) { return Vw = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function (t) { return typeof t } : function (t) { return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, Vw(e) } function qK(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e } var Fh, ZK = { Webkit: "-webkit-", Moz: "-moz-", ms: "-ms-", O: "-o-" }; function Fy() { if (Fh !== void 0) return Fh; Fh = ""; var e = document.createElement("p").style, t = "Transform"; for (var n in ZK) n + t in e && (Fh = n); return Fh } function aD() { return Fy() ? "".concat(Fy(), "TransitionProperty") : "transitionProperty" } function G0() { return Fy() ? "".concat(Fy(), "Transform") : "transform" } function yk(e, t) { var n = aD(); n && (e.style[n] = t, n !== "transitionProperty" && (e.style.transitionProperty = t)) } function _1(e, t) { var n = G0(); n && (e.style[n] = t, n !== "transform" && (e.style.transform = t)) } function XK(e) { return e.style.transitionProperty || e.style[aD()] } function YK(e) { var t = window.getComputedStyle(e, null), n = t.getPropertyValue("transform") || t.getPropertyValue(G0()); if (n && n !== "none") { var r = n.replace(/[^0-9\-.,]/g, "").split(","); return { x: parseFloat(r[12] || r[4], 0), y: parseFloat(r[13] || r[5], 0) } } return { x: 0, y: 0 } } var QK = /matrix\((.*)\)/, JK = /matrix3d\((.*)\)/; function eH(e, t) { var n = window.getComputedStyle(e, null), r = n.getPropertyValue("transform") || n.getPropertyValue(G0()); if (r && r !== "none") { var i, s = r.match(QK); if (s) s = s[1], i = s.split(",").map(function (o) { return parseFloat(o, 10) }), i[4] = t.x, i[5] = t.y, _1(e, "matrix(".concat(i.join(","), ")")); else { var c = r.match(JK)[1]; i = c.split(",").map(function (o) { return parseFloat(o, 10) }), i[12] = t.x, i[13] = t.y, _1(e, "matrix3d(".concat(i.join(","), ")")) } } else _1(e, "translateX(".concat(t.x, "px) translateY(").concat(t.y, "px) translateZ(0)")) } var tH = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, mm; function xk(e) { var t = e.style.display; e.style.display = "none", e.offsetHeight, e.style.display = t } function Hd(e, t, n) { var r = n; if (Vw(t) === "object") { for (var i in t) t.hasOwnProperty(i) && Hd(e, i, t[i]); return } if (typeof r < "u") { typeof r == "number" && (r = "".concat(r, "px")), e.style[t] = r; return } return mm(e, t) } function nH(e) { var t, n, r, i = e.ownerDocument, s = i.body, c = i && i.documentElement; return t = e.getBoundingClientRect(), n = Math.floor(t.left), r = Math.floor(t.top), n -= c.clientLeft || s.clientLeft || 0, r -= c.clientTop || s.clientTop || 0, { left: n, top: r } } function sD(e, t) { var n = e["page".concat(t ? "Y" : "X", "Offset")], r = "scroll".concat(t ? "Top" : "Left"); if (typeof n != "number") { var i = e.document; n = i.documentElement[r], typeof n != "number" && (n = i.body[r]) } return n } function lD(e) { return sD(e) } function uD(e) { return sD(e, !0) } function Wp(e) { var t = nH(e), n = e.ownerDocument, r = n.defaultView || n.parentWindow; return t.left += lD(r), t.top += uD(r), t } function x2(e) { return e != null && e == e.window } function cD(e) { return x2(e) ? e.document : e.nodeType === 9 ? e : e.ownerDocument } function rH(e, t, n) { var r = n, i = "", s = cD(e); return r = r || s.defaultView.getComputedStyle(e, null), r && (i = r.getPropertyValue(t) || r[t]), i } var iH = new RegExp("^(".concat(tH, ")(?!px)[a-z%]+$"), "i"), oH = /^(top|right|bottom|left)$/, b1 = "currentStyle", w1 = "runtimeStyle", Wu = "left", aH = "px"; function sH(e, t) { var n = e[b1] && e[b1][t]; if (iH.test(n) && !oH.test(t)) { var r = e.style, i = r[Wu], s = e[w1][Wu]; e[w1][Wu] = e[b1][Wu], r[Wu] = t === "fontSize" ? "1em" : n || 0, n = r.pixelLeft + aH, r[Wu] = i, e[w1][Wu] = s } return n === "" ? "auto" : n } typeof window < "u" && (mm = window.getComputedStyle ? rH : sH); function dg(e, t) { return e === "left" ? t.useCssRight ? "right" : e : t.useCssBottom ? "bottom" : e } function _k(e) { if (e === "left") return "right"; if (e === "right") return "left"; if (e === "top") return "bottom"; if (e === "bottom") return "top" } function bk(e, t, n) { Hd(e, "position") === "static" && (e.style.position = "relative"); var r = -999, i = -999, s = dg("left", n), c = dg("top", n), o = _k(s), f = _k(c); s !== "left" && (r = 999), c !== "top" && (i = 999); var p = "", v = Wp(e); ("left" in t || "top" in t) && (p = XK(e) || "", yk(e, "none")), "left" in t && (e.style[o] = "", e.style[s] = "".concat(r, "px")), "top" in t && (e.style[f] = "", e.style[c] = "".concat(i, "px")), xk(e); var y = Wp(e), w = {}; for (var P in t) if (t.hasOwnProperty(P)) { var k = dg(P, n), A = P === "left" ? r : i, N = v[P] - y[P]; k === P ? w[k] = A + N : w[k] = A - N } Hd(e, w), xk(e), ("left" in t || "top" in t) && yk(e, p); var R = {}; for (var M in t) if (t.hasOwnProperty(M)) { var O = dg(M, n), z = t[M] - v[M]; M === O ? R[O] = w[O] + z : R[O] = w[O] - z } Hd(e, R) } function lH(e, t) { var n = Wp(e), r = YK(e), i = { x: r.x, y: r.y }; "left" in t && (i.x = r.x + t.left - n.left), "top" in t && (i.y = r.y + t.top - n.top), eH(e, i) } function uH(e, t, n) { if (n.ignoreShake) { var r = Wp(e), i = r.left.toFixed(0), s = r.top.toFixed(0), c = t.left.toFixed(0), o = t.top.toFixed(0); if (i === c && s === o) return } n.useCssRight || n.useCssBottom ? bk(e, t, n) : n.useCssTransform && G0() in document.body.style ? lH(e, t) : bk(e, t, n) } function _2(e, t) { for (var n = 0; n < e.length; n++)t(e[n]) } function dD(e) { return mm(e, "boxSizing") === "border-box" } var cH = ["margin", "border", "padding"], Uw = -1, dH = 2, jw = 1, fH = 0; function hH(e, t, n) { var r = {}, i = e.style, s; for (s in t) t.hasOwnProperty(s) && (r[s] = i[s], i[s] = t[s]); n.call(e); for (s in t) t.hasOwnProperty(s) && (i[s] = r[s]) } function Qh(e, t, n) { var r = 0, i, s, c; for (s = 0; s < t.length; s++)if (i = t[s], i) for (c = 0; c < n.length; c++) { var o = void 0; i === "border" ? o = "".concat(i).concat(n[c], "Width") : o = i + n[c], r += parseFloat(mm(e, o)) || 0 } return r } var ds = { getParent: function (t) { var n = t; do n.nodeType === 11 && n.host ? n = n.host : n = n.parentNode; while (n && n.nodeType !== 1 && n.nodeType !== 9); return n } }; _2(["Width", "Height"], function (e) { ds["doc".concat(e)] = function (t) { var n = t.document; return Math.max(n.documentElement["scroll".concat(e)], n.body["scroll".concat(e)], ds["viewport".concat(e)](n)) }, ds["viewport".concat(e)] = function (t) { var n = "client".concat(e), r = t.document, i = r.body, s = r.documentElement, c = s[n]; return r.compatMode === "CSS1Compat" && c || i && i[n] || c } }); function wk(e, t, n) { var r = n; if (x2(e)) return t === "width" ? ds.viewportWidth(e) : ds.viewportHeight(e); if (e.nodeType === 9) return t === "width" ? ds.docWidth(e) : ds.docHeight(e); var i = t === "width" ? ["Left", "Right"] : ["Top", "Bottom"], s = Math.floor(t === "width" ? e.getBoundingClientRect().width : e.getBoundingClientRect().height), c = dD(e), o = 0; (s == null || s <= 0) && (s = void 0, o = mm(e, t), (o == null || Number(o) < 0) && (o = e.style[t] || 0), o = Math.floor(parseFloat(o)) || 0), r === void 0 && (r = c ? jw : Uw); var f = s !== void 0 || c, p = s || o; return r === Uw ? f ? p - Qh(e, ["border", "padding"], i) : o : f ? r === jw ? p : p + (r === dH ? -Qh(e, ["border"], i) : Qh(e, ["margin"], i)) : o + Qh(e, cH.slice(r), i) } var pH = { position: "absolute", visibility: "hidden", display: "block" }; function Ck() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; var r, i = t[0]; return i.offsetWidth !== 0 ? r = wk.apply(void 0, t) : hH(i, pH, function () { r = wk.apply(void 0, t) }), r } _2(["width", "height"], function (e) { var t = e.charAt(0).toUpperCase() + e.slice(1); ds["outer".concat(t)] = function (r, i) { return r && Ck(r, e, i ? fH : jw) }; var n = e === "width" ? ["Left", "Right"] : ["Top", "Bottom"]; ds[e] = function (r, i) { var s = i; if (s !== void 0) { if (r) { var c = dD(r); return c && (s += Qh(r, ["padding", "border"], n)), Hd(r, e, s) } return } return r && Ck(r, e, Uw) } }); function fD(e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); return e } var Hn = { getWindow: function (t) { if (t && t.document && t.setTimeout) return t; var n = t.ownerDocument || t; return n.defaultView || n.parentWindow }, getDocument: cD, offset: function (t, n, r) { if (typeof n < "u") uH(t, n, r || {}); else return Wp(t) }, isWindow: x2, each: _2, css: Hd, clone: function (t) { var n, r = {}; for (n in t) t.hasOwnProperty(n) && (r[n] = t[n]); var i = t.overflow; if (i) for (n in t) t.hasOwnProperty(n) && (r.overflow[n] = t.overflow[n]); return r }, mix: fD, getWindowScrollLeft: function (t) { return lD(t) }, getWindowScrollTop: function (t) { return uD(t) }, merge: function () { for (var t = {}, n = 0; n < arguments.length; n++)Hn.mix(t, n < 0 || arguments.length <= n ? void 0 : arguments[n]); return t }, viewportWidth: 0, viewportHeight: 0 }; fD(Hn, ds); var C1 = Hn.getParent; function Kw(e) { if (Hn.isWindow(e) || e.nodeType === 9) return null; var t = Hn.getDocument(e), n = t.body, r, i = Hn.css(e, "position"), s = i === "fixed" || i === "absolute"; if (!s) return e.nodeName.toLowerCase() === "html" ? null : C1(e); for (r = C1(e); r && r !== n && r.nodeType !== 9; r = C1(r))if (i = Hn.css(r, "position"), i !== "static") return r; return null } var Sk = Hn.getParent; function mH(e) { if (Hn.isWindow(e) || e.nodeType === 9) return !1; var t = Hn.getDocument(e), n = t.body, r = null; for (r = Sk(e); r && r !== n && r !== t; r = Sk(r)) { var i = Hn.css(r, "position"); if (i === "fixed") return !0 } return !1 } function b2(e, t) { for (var n = { left: 0, right: 1 / 0, top: 0, bottom: 1 / 0 }, r = Kw(e), i = Hn.getDocument(e), s = i.defaultView || i.parentWindow, c = i.body, o = i.documentElement; r;) { if ((navigator.userAgent.indexOf("MSIE") === -1 || r.clientWidth !== 0) && r !== c && r !== o && Hn.css(r, "overflow") !== "visible") { var f = Hn.offset(r); f.left += r.clientLeft, f.top += r.clientTop, n.top = Math.max(n.top, f.top), n.right = Math.min(n.right, f.left + r.clientWidth), n.bottom = Math.min(n.bottom, f.top + r.clientHeight), n.left = Math.max(n.left, f.left) } else if (r === c || r === o) break; r = Kw(r) } var p = null; if (!Hn.isWindow(e) && e.nodeType !== 9) { p = e.style.position; var v = Hn.css(e, "position"); v === "absolute" && (e.style.position = "fixed") } var y = Hn.getWindowScrollLeft(s), w = Hn.getWindowScrollTop(s), P = Hn.viewportWidth(s), k = Hn.viewportHeight(s), A = o.scrollWidth, N = o.scrollHeight, R = window.getComputedStyle(c); if (R.overflowX === "hidden" && (A = s.innerWidth), R.overflowY === "hidden" && (N = s.innerHeight), e.style && (e.style.position = p), t || mH(e)) n.left = Math.max(n.left, y), n.top = Math.max(n.top, w), n.right = Math.min(n.right, y + P), n.bottom = Math.min(n.bottom, w + k); else { var M = Math.max(A, y + P); n.right = Math.min(n.right, M); var O = Math.max(N, w + k); n.bottom = Math.min(n.bottom, O) } return n.top >= 0 && n.left >= 0 && n.bottom > n.top && n.right > n.left ? n : null } function vH(e, t, n, r) { var i = Hn.clone(e), s = { width: t.width, height: t.height }; return r.adjustX && i.left < n.left && (i.left = n.left), r.resizeWidth && i.left >= n.left && i.left + s.width > n.right && (s.width -= i.left + s.width - n.right), r.adjustX && i.left + s.width > n.right && (i.left = Math.max(n.right - s.width, n.left)), r.adjustY && i.top < n.top && (i.top = n.top), r.resizeHeight && i.top >= n.top && i.top + s.height > n.bottom && (s.height -= i.top + s.height - n.bottom), r.adjustY && i.top + s.height > n.bottom && (i.top = Math.max(n.bottom - s.height, n.top)), Hn.mix(i, s) } function w2(e) { var t, n, r; if (!Hn.isWindow(e) && e.nodeType !== 9) t = Hn.offset(e), n = Hn.outerWidth(e), r = Hn.outerHeight(e); else { var i = Hn.getWindow(e); t = { left: Hn.getWindowScrollLeft(i), top: Hn.getWindowScrollTop(i) }, n = Hn.viewportWidth(i), r = Hn.viewportHeight(i) } return t.width = n, t.height = r, t } function Ek(e, t) { var n = t.charAt(0), r = t.charAt(1), i = e.width, s = e.height, c = e.left, o = e.top; return n === "c" ? o += s / 2 : n === "b" && (o += s), r === "c" ? c += i / 2 : r === "r" && (c += i), { left: c, top: o } } function fg(e, t, n, r, i) { var s = Ek(t, n[1]), c = Ek(e, n[0]), o = [c.left - s.left, c.top - s.top]; return { left: Math.round(e.left - o[0] + r[0] - i[0]), top: Math.round(e.top - o[1] + r[1] - i[1]) } } function Pk(e, t, n) { return e.left < n.left || e.left + t.width > n.right } function Tk(e, t, n) { return e.top < n.top || e.top + t.height > n.bottom } function gH(e, t, n) { return e.left > n.right || e.left + t.width < n.left } function yH(e, t, n) { return e.top > n.bottom || e.top + t.height < n.top } function hg(e, t, n) { var r = []; return Hn.each(e, function (i) { r.push(i.replace(t, function (s) { return n[s] })) }), r } function pg(e, t) { return e[t] = -e[t], e } function kk(e, t) { var n; return /%$/.test(e) ? n = parseInt(e.substring(0, e.length - 1), 10) / 100 * t : n = parseInt(e, 10), n || 0 } function Ik(e, t) { e[0] = kk(e[0], t.width), e[1] = kk(e[1], t.height) } function hD(e, t, n, r) { var i = n.points, s = n.offset || [0, 0], c = n.targetOffset || [0, 0], o = n.overflow, f = n.source || e; s = [].concat(s), c = [].concat(c), o = o || {}; var p = {}, v = 0, y = !!(o && o.alwaysByViewport), w = b2(f, y), P = w2(f); Ik(s, P), Ik(c, t); var k = fg(P, t, i, s, c), A = Hn.merge(P, k); if (w && (o.adjustX || o.adjustY) && r) { if (o.adjustX && Pk(k, P, w)) { var N = hg(i, /[lr]/gi, { l: "r", r: "l" }), R = pg(s, 0), M = pg(c, 0), O = fg(P, t, N, R, M); gH(O, P, w) || (v = 1, i = N, s = R, c = M) } if (o.adjustY && Tk(k, P, w)) { var z = hg(i, /[tb]/gi, { t: "b", b: "t" }), B = pg(s, 1), V = pg(c, 1), G = fg(P, t, z, B, V); yH(G, P, w) || (v = 1, i = z, s = B, c = V) } v && (k = fg(P, t, i, s, c), Hn.mix(A, k)); var j = Pk(k, P, w), X = Tk(k, P, w); if (j || X) { var Y = i; j && (Y = hg(i, /[lr]/gi, { l: "r", r: "l" })), X && (Y = hg(i, /[tb]/gi, { t: "b", b: "t" })), i = Y, s = n.offset || [0, 0], c = n.targetOffset || [0, 0] } p.adjustX = o.adjustX && j, p.adjustY = o.adjustY && X, (p.adjustX || p.adjustY) && (A = vH(k, P, w, p)) } return A.width !== P.width && Hn.css(f, "width", Hn.width(f) + A.width - P.width), A.height !== P.height && Hn.css(f, "height", Hn.height(f) + A.height - P.height), Hn.offset(f, { left: A.left, top: A.top }, { useCssRight: n.useCssRight, useCssBottom: n.useCssBottom, useCssTransform: n.useCssTransform, ignoreShake: n.ignoreShake }), { points: i, offset: s, targetOffset: c, overflow: p } } function xH(e, t) { var n = b2(e, t), r = w2(e); return !n || r.left + r.width <= n.left || r.top + r.height <= n.top || r.left >= n.right || r.top >= n.bottom } function C2(e, t, n) { var r = n.target || t, i = w2(r), s = !xH(r, n.overflow && n.overflow.alwaysByViewport); return hD(e, i, n, s) } C2.__getOffsetParent = Kw; C2.__getVisibleRectForElement = b2; function _H(e, t, n) { var r, i, s = Hn.getDocument(e), c = s.defaultView || s.parentWindow, o = Hn.getWindowScrollLeft(c), f = Hn.getWindowScrollTop(c), p = Hn.viewportWidth(c), v = Hn.viewportHeight(c); "pageX" in t ? r = t.pageX : r = o + t.clientX, "pageY" in t ? i = t.pageY : i = f + t.clientY; var y = { left: r, top: i, width: 0, height: 0 }, w = r >= 0 && r <= o + p && i >= 0 && i <= f + v, P = [n.points[0], "cc"]; return hD(e, y, gk(gk({}, n), {}, { points: P }), w) } function S2(e, t) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, r = new Set; function i(s, c) { var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, f = r.has(s); if (Rr(!f, "Warning: There may be circular references"), f) return !1; if (s === c) return !0; if (n && o > 1) return !1; r.add(s); var p = o + 1; if (Array.isArray(s)) { if (!Array.isArray(c) || s.length !== c.length) return !1; for (var v = 0; v < s.length; v++)if (!i(s[v], c[v], p)) return !1; return !0 } if (s && c && ln(s) === "object" && ln(c) === "object") { var y = Object.keys(s); return y.length !== Object.keys(c).length ? !1 : y.every(function (w) { return i(s[w], c[w], p) }) } return !1 } return i(e, t) } const E2 = function (e) { if (!e) return !1; if (e instanceof HTMLElement && e.offsetParent) return !0; if (e instanceof SVGGraphicsElement && e.getBBox) { var t = e.getBBox(), n = t.width, r = t.height; if (n || r) return !0 } if (e instanceof HTMLElement && e.getBoundingClientRect) { var i = e.getBoundingClientRect(), s = i.width, c = i.height; if (s || c) return !0 } return !1 }, bH = function (e, t) { var n = tr.useRef(!1), r = tr.useRef(null); function i() { window.clearTimeout(r.current) } function s(c) { if (i(), !n.current || c === !0) { if (e(c) === !1) return; n.current = !0, r.current = window.setTimeout(function () { n.current = !1 }, t) } else r.current = window.setTimeout(function () { n.current = !1, s() }, t) } return [s, function () { n.current = !1, i() }] }; function wH(e, t) { return e === t ? !0 : !e || !t ? !1 : "pageX" in t && "pageY" in t ? e.pageX === t.pageX && e.pageY === t.pageY : "clientX" in t && "clientY" in t ? e.clientX === t.clientX && e.clientY === t.clientY : !1 } function CH(e, t) { e !== document.activeElement && hc(t, e) && typeof e.focus == "function" && e.focus() } function Rk(e, t) { var n = null, r = null; function i(c) { var o = ze(c, 1), f = o[0].target; if (!!document.documentElement.contains(f)) { var p = f.getBoundingClientRect(), v = p.width, y = p.height, w = Math.floor(v), P = Math.floor(y); (n !== w || r !== P) && Promise.resolve().then(function () { t({ width: w, height: P }) }), n = w, r = P } } var s = new _N(i); return e && s.observe(e), function () { s.disconnect() } } function Mk(e) { return typeof e != "function" ? null : e() } function Ak(e) { return ln(e) !== "object" || !e ? null : e } var SH = function (t, n) { var r = t.children, i = t.disabled, s = t.target, c = t.align, o = t.onAlign, f = t.monitorWindowResize, p = t.monitorBufferTime, v = p === void 0 ? 0 : p, y = tr.useRef({}), w = tr.useRef(), P = tr.Children.only(r), k = tr.useRef({}); k.current.disabled = i, k.current.target = s, k.current.align = c, k.current.onAlign = o; var A = bH(function () { var se = k.current, ee = se.disabled, Z = se.target, J = se.align, ve = se.onAlign, ie = w.current; if (!ee && Z && ie) { var ce, oe = Mk(Z), ye = Ak(Z); y.current.element = oe, y.current.point = ye, y.current.align = J; var Ie = document, Te = Ie.activeElement; return oe && E2(oe) ? ce = C2(ie, oe, J) : ye && (ce = _H(ie, ye, J)), CH(Te, ie), ve && ce && ve(ie, ce), !0 } return !1 }, v), N = ze(A, 2), R = N[0], M = N[1], O = tr.useState(), z = ze(O, 2), B = z[0], V = z[1], G = tr.useState(), j = ze(G, 2), X = j[0], Y = j[1]; return si(function () { V(Mk(s)), Y(Ak(s)) }), tr.useEffect(function () { (y.current.element !== B || !wH(y.current.point, X) || !S2(y.current.align, c)) && R() }), tr.useEffect(function () { var se = Rk(w.current, R); return se }, [w.current]), tr.useEffect(function () { var se = Rk(B, R); return se }, [B]), tr.useEffect(function () { i ? M() : R() }, [i]), tr.useEffect(function () { if (f) { var se = Xs(window, "resize", R); return se.remove } }, [f]), tr.useEffect(function () { return function () { M() } }, []), tr.useImperativeHandle(n, function () { return { forceAlign: function () { return R(!0) } } }), tr.isValidElement(P) && (P = tr.cloneElement(P, { ref: Po(P.ref, w) })), P }, pD = tr.forwardRef(SH); pD.displayName = "Align"; var Nk = ["measure", "alignPre", "align", null, "motion"]; const EH = function (e, t) { var n = ms(null), r = ze(n, 2), i = r[0], s = r[1], c = C.exports.useRef(); function o(v) { s(v, !0) } function f() { nr.cancel(c.current) } function p(v) { f(), c.current = nr(function () { o(function (y) { switch (i) { case "align": return "motion"; case "motion": return "stable" }return y }), v == null || v() }) } return C.exports.useEffect(function () { o("measure") }, [e]), C.exports.useEffect(function () { switch (i) { case "measure": t(); break }i && (c.current = nr(Rc(bo().mark(function v() { var y, w; return bo().wrap(function (k) { for (; ;)switch (k.prev = k.next) { case 0: y = Nk.indexOf(i), w = Nk[y + 1], w && y !== -1 && o(w); case 3: case "end": return k.stop() } }, v) })))) }, [i]), C.exports.useEffect(function () { return function () { f() } }, []), [i, p] }, PH = function (e) { var t = C.exports.useState({ width: 0, height: 0 }), n = ze(t, 2), r = n[0], i = n[1]; function s(o) { var f = o.offsetWidth, p = o.offsetHeight, v = o.getBoundingClientRect(), y = v.width, w = v.height; Math.abs(f - y) < 1 && Math.abs(p - w) < 1 && (f = y, p = w), i({ width: f, height: p }) } var c = C.exports.useMemo(function () { var o = {}; if (e) { var f = r.width, p = r.height; e.indexOf("height") !== -1 && p ? o.height = p : e.indexOf("minHeight") !== -1 && p && (o.minHeight = p), e.indexOf("width") !== -1 && f ? o.width = f : e.indexOf("minWidth") !== -1 && f && (o.minWidth = f) } return o }, [e, r]); return [c, s] }; var mD = C.exports.forwardRef(function (e, t) { var n = e.visible, r = e.prefixCls, i = e.className, s = e.style, c = e.children, o = e.zIndex, f = e.stretch, p = e.destroyPopupOnHide, v = e.forceRender, y = e.align, w = e.point, P = e.getRootDomNode, k = e.getClassNameFromAlign, A = e.onAlign, N = e.onMouseEnter, R = e.onMouseLeave, M = e.onMouseDown, O = e.onTouchStart, z = e.onClick, B = C.exports.useRef(), V = C.exports.useRef(), G = C.exports.useState(), j = ze(G, 2), X = j[0], Y = j[1], se = PH(f), ee = ze(se, 2), Z = ee[0], J = ee[1]; function ve() { f && J(P()) } var ie = EH(n, ve), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useState(0), Te = ze(Ie, 2), Pe = Te[0], De = Te[1], Re = C.exports.useRef(); si(function () { oe === "alignPre" && De(0) }, [oe]); function ke() { return w || P } function Oe() { var We; (We = B.current) === null || We === void 0 || We.forceAlign() } function $e(We, Pt) { var pt = k(Pt); X !== pt && Y(pt), De(function (Rt) { return Rt + 1 }), oe === "align" && (A == null || A(We, Pt)) } si(function () { oe === "align" && (Pe < 3 ? Oe() : ye(function () { var We; (We = Re.current) === null || We === void 0 || We.call(Re) })) }, [Pe]); var He = ge({}, oD(e));["onAppearEnd", "onEnterEnd", "onLeaveEnd"].forEach(function (We) { var Pt = He[We]; He[We] = function (pt, Rt) { return ye(), Pt == null ? void 0 : Pt(pt, Rt) } }); function Ue() { return new Promise(function (We) { Re.current = We }) } C.exports.useEffect(function () { !He.motionName && oe === "motion" && ye() }, [He.motionName, oe]), C.exports.useImperativeHandle(t, function () { return { forceAlign: Oe, getElement: function () { return V.current } } }); var st = ge(ge({}, Z), {}, { zIndex: o, opacity: oe === "motion" || oe === "stable" || !n ? void 0 : 0, pointerEvents: !n && oe !== "stable" ? "none" : void 0 }, s), ft = !0; y != null && y.points && (oe === "align" || oe === "stable") && (ft = !1); var It = c; return C.exports.Children.count(c) > 1 && (It = I("div", { className: "".concat(r, "-content"), children: c })), I(Sa, { visible: n, ref: V, leavedClassName: "".concat(r, "-hidden"), ...He, onAppearPrepare: Ue, onEnterPrepare: Ue, removeOnLeave: p, forceRender: v, children: function (We, Pt) { var pt = We.className, Rt = We.style, yt = Xe(r, i, X, pt); return I(pD, { target: ke(), ref: B, monitorWindowResize: !0, disabled: ft, align: y, onAlign: $e, children: I("div", { ref: Pt, className: yt, onMouseEnter: N, onMouseLeave: R, onMouseDownCapture: M, onTouchStartCapture: O, onClick: z, style: ge(ge({}, Rt), st), children: It }) }, "popup") } }) }); mD.displayName = "PopupInner"; var vD = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.visible, i = e.zIndex, s = e.children, c = e.mobile; c = c === void 0 ? {} : c; var o = c.popupClassName, f = c.popupStyle, p = c.popupMotion, v = p === void 0 ? {} : p, y = c.popupRender, w = e.onClick, P = C.exports.useRef(); C.exports.useImperativeHandle(t, function () { return { forceAlign: function () { }, getElement: function () { return P.current } } }); var k = ge({ zIndex: i }, f), A = s; return C.exports.Children.count(s) > 1 && (A = I("div", { className: "".concat(n, "-content"), children: s })), y && (A = y(A)), I(Sa, { visible: r, ref: P, removeOnLeave: !0, ...v, children: function (N, R) { var M = N.className, O = N.style, z = Xe(n, o, M); return I("div", { ref: R, className: z, onClick: w, style: ge(ge({}, O), k), children: A }) } }) }); vD.displayName = "MobilePopupInner"; var TH = ["visible", "mobile"], gD = C.exports.forwardRef(function (e, t) { var n = e.visible, r = e.mobile, i = Rn(e, TH), s = C.exports.useState(n), c = ze(s, 2), o = c[0], f = c[1], p = C.exports.useState(!1), v = ze(p, 2), y = v[0], w = v[1], P = ge(ge({}, i), {}, { visible: o }); C.exports.useEffect(function () { f(n), n && r && w(g2()) }, [n, r]); var k = y ? I(vD, { ...P, mobile: r, ref: t }) : I(mD, { ...P, ref: t }); return Qe("div", { children: [I(GK, { ...P }), k] }) }); gD.displayName = "Popup"; var Ok = C.exports.createContext(null); function S1() { } function kH() { return "" } function IH(e) { return e ? e.ownerDocument : window.document } var RH = ["onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onContextMenu"]; function MH(e) { var t = function (n) { ui(i, n); var r = ci(i); function i(s) { var c; zr(this, i), c = r.call(this, s), re(Ln(c), "popupRef", C.exports.createRef()), re(Ln(c), "triggerRef", C.exports.createRef()), re(Ln(c), "portalContainer", void 0), re(Ln(c), "attachId", void 0), re(Ln(c), "clickOutsideHandler", void 0), re(Ln(c), "touchOutsideHandler", void 0), re(Ln(c), "contextMenuOutsideHandler1", void 0), re(Ln(c), "contextMenuOutsideHandler2", void 0), re(Ln(c), "mouseDownTimeout", void 0), re(Ln(c), "focusTime", void 0), re(Ln(c), "preClickTime", void 0), re(Ln(c), "preTouchTime", void 0), re(Ln(c), "delayTimer", void 0), re(Ln(c), "hasPopupMouseDown", void 0), re(Ln(c), "onMouseEnter", function (f) { var p = c.props.mouseEnterDelay; c.fireEvents("onMouseEnter", f), c.delaySetPopupVisible(!0, p, p ? null : f) }), re(Ln(c), "onMouseMove", function (f) { c.fireEvents("onMouseMove", f), c.setPoint(f) }), re(Ln(c), "onMouseLeave", function (f) { c.fireEvents("onMouseLeave", f), c.delaySetPopupVisible(!1, c.props.mouseLeaveDelay) }), re(Ln(c), "onPopupMouseEnter", function () { c.clearDelayTimer() }), re(Ln(c), "onPopupMouseLeave", function (f) { var p; f.relatedTarget && !f.relatedTarget.setTimeout && hc((p = c.popupRef.current) === null || p === void 0 ? void 0 : p.getElement(), f.relatedTarget) || c.delaySetPopupVisible(!1, c.props.mouseLeaveDelay) }), re(Ln(c), "onFocus", function (f) { c.fireEvents("onFocus", f), c.clearDelayTimer(), c.isFocusToShow() && (c.focusTime = Date.now(), c.delaySetPopupVisible(!0, c.props.focusDelay)) }), re(Ln(c), "onMouseDown", function (f) { c.fireEvents("onMouseDown", f), c.preClickTime = Date.now() }), re(Ln(c), "onTouchStart", function (f) { c.fireEvents("onTouchStart", f), c.preTouchTime = Date.now() }), re(Ln(c), "onBlur", function (f) { c.fireEvents("onBlur", f), c.clearDelayTimer(), c.isBlurToHide() && c.delaySetPopupVisible(!1, c.props.blurDelay) }), re(Ln(c), "onContextMenu", function (f) { f.preventDefault(), c.fireEvents("onContextMenu", f), c.setPopupVisible(!0, f) }), re(Ln(c), "onContextMenuClose", function () { c.isContextMenuToShow() && c.close() }), re(Ln(c), "onClick", function (f) { if (c.fireEvents("onClick", f), c.focusTime) { var p; if (c.preClickTime && c.preTouchTime ? p = Math.min(c.preClickTime, c.preTouchTime) : c.preClickTime ? p = c.preClickTime : c.preTouchTime && (p = c.preTouchTime), Math.abs(p - c.focusTime) < 20) return; c.focusTime = 0 } c.preClickTime = 0, c.preTouchTime = 0, c.isClickToShow() && (c.isClickToHide() || c.isBlurToHide()) && f && f.preventDefault && f.preventDefault(); var v = !c.state.popupVisible; (c.isClickToHide() && !v || v && c.isClickToShow()) && c.setPopupVisible(!c.state.popupVisible, f) }), re(Ln(c), "onPopupMouseDown", function () { if (c.hasPopupMouseDown = !0, clearTimeout(c.mouseDownTimeout), c.mouseDownTimeout = window.setTimeout(function () { c.hasPopupMouseDown = !1 }, 0), c.context) { var f; (f = c.context).onPopupMouseDown.apply(f, arguments) } }), re(Ln(c), "onDocumentClick", function (f) { if (!(c.props.mask && !c.props.maskClosable)) { var p = f.target, v = c.getRootDomNode(), y = c.getPopupDomNode(); (!hc(v, p) || c.isContextMenuOnly()) && !hc(y, p) && !c.hasPopupMouseDown && c.close() } }), re(Ln(c), "getRootDomNode", function () { var f = c.props.getTriggerDOMNode; if (f) return f(c.triggerRef.current); try { var p = Vp(c.triggerRef.current); if (p) return p } catch { } return bc.findDOMNode(Ln(c)) }), re(Ln(c), "getPopupClassNameFromAlign", function (f) { var p = [], v = c.props, y = v.popupPlacement, w = v.builtinPlacements, P = v.prefixCls, k = v.alignPoint, A = v.getPopupClassNameFromAlign; return y && w && p.push(WK(w, P, f, k)), A && p.push(A(f)), p.join(" ") }), re(Ln(c), "getComponent", function () { var f = c.props, p = f.prefixCls, v = f.destroyPopupOnHide, y = f.popupClassName, w = f.onPopupAlign, P = f.popupMotion, k = f.popupAnimation, A = f.popupTransitionName, N = f.popupStyle, R = f.mask, M = f.maskAnimation, O = f.maskTransitionName, z = f.maskMotion, B = f.zIndex, V = f.popup, G = f.stretch, j = f.alignPoint, X = f.mobile, Y = f.forceRender, se = f.onPopupClick, ee = c.state, Z = ee.popupVisible, J = ee.point, ve = c.getPopupAlign(), ie = {}; return c.isMouseEnterToShow() && (ie.onMouseEnter = c.onPopupMouseEnter), c.isMouseLeaveToHide() && (ie.onMouseLeave = c.onPopupMouseLeave), ie.onMouseDown = c.onPopupMouseDown, ie.onTouchStart = c.onPopupMouseDown, I(gD, { prefixCls: p, destroyPopupOnHide: v, visible: Z, point: j && J, className: y, align: ve, onAlign: w, animation: k, getClassNameFromAlign: c.getPopupClassNameFromAlign, ...ie, stretch: G, getRootDomNode: c.getRootDomNode, style: N, mask: R, zIndex: B, transitionName: A, maskAnimation: M, maskTransitionName: O, maskMotion: z, ref: c.popupRef, motion: P, mobile: X, forceRender: Y, onClick: se, children: typeof V == "function" ? V() : V }) }), re(Ln(c), "attachParent", function (f) { nr.cancel(c.attachId); var p = c.props, v = p.getPopupContainer, y = p.getDocument, w = c.getRootDomNode(), P; v ? (w || v.length === 0) && (P = v(w)) : P = y(c.getRootDomNode()).body, P ? P.appendChild(f) : c.attachId = nr(function () { c.attachParent(f) }) }), re(Ln(c), "getContainer", function () { if (!c.portalContainer) { var f = c.props.getDocument, p = f(c.getRootDomNode()).createElement("div"); p.style.position = "absolute", p.style.top = "0", p.style.left = "0", p.style.width = "100%", c.portalContainer = p } return c.attachParent(c.portalContainer), c.portalContainer }), re(Ln(c), "setPoint", function (f) { var p = c.props.alignPoint; !p || !f || c.setState({ point: { pageX: f.pageX, pageY: f.pageY } }) }), re(Ln(c), "handlePortalUpdate", function () { c.state.prevPopupVisible !== c.state.popupVisible && c.props.afterPopupVisibleChange(c.state.popupVisible) }), re(Ln(c), "triggerContextValue", { onPopupMouseDown: c.onPopupMouseDown }); var o; return "popupVisible" in s ? o = !!s.popupVisible : o = !!s.defaultPopupVisible, c.state = { prevPopupVisible: o, popupVisible: o }, RH.forEach(function (f) { c["fire".concat(f)] = function (p) { c.fireEvents(f, p) } }), c } return Fr(i, [{ key: "componentDidMount", value: function () { this.componentDidUpdate() } }, { key: "componentDidUpdate", value: function () { var c = this.props, o = this.state; if (o.popupVisible) { var f; !this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow()) && (f = c.getDocument(this.getRootDomNode()), this.clickOutsideHandler = Xs(f, "mousedown", this.onDocumentClick)), this.touchOutsideHandler || (f = f || c.getDocument(this.getRootDomNode()), this.touchOutsideHandler = Xs(f, "touchstart", this.onDocumentClick)), !this.contextMenuOutsideHandler1 && this.isContextMenuToShow() && (f = f || c.getDocument(this.getRootDomNode()), this.contextMenuOutsideHandler1 = Xs(f, "scroll", this.onContextMenuClose)), !this.contextMenuOutsideHandler2 && this.isContextMenuToShow() && (this.contextMenuOutsideHandler2 = Xs(window, "blur", this.onContextMenuClose)); return } this.clearOutsideHandler() } }, { key: "componentWillUnmount", value: function () { this.clearDelayTimer(), this.clearOutsideHandler(), clearTimeout(this.mouseDownTimeout), nr.cancel(this.attachId) } }, { key: "getPopupDomNode", value: function () { var c; return ((c = this.popupRef.current) === null || c === void 0 ? void 0 : c.getElement()) || null } }, { key: "getPopupAlign", value: function () { var c = this.props, o = c.popupPlacement, f = c.popupAlign, p = c.builtinPlacements; return o && p ? HK(p, o, f) : f } }, { key: "setPopupVisible", value: function (c, o) { var f = this.props.alignPoint, p = this.state.popupVisible; this.clearDelayTimer(), p !== c && ("popupVisible" in this.props || this.setState({ popupVisible: c, prevPopupVisible: p }), this.props.onPopupVisibleChange(c)), f && o && c && this.setPoint(o) } }, { key: "delaySetPopupVisible", value: function (c, o, f) { var p = this, v = o * 1e3; if (this.clearDelayTimer(), v) { var y = f ? { pageX: f.pageX, pageY: f.pageY } : null; this.delayTimer = window.setTimeout(function () { p.setPopupVisible(c, y), p.clearDelayTimer() }, v) } else this.setPopupVisible(c, f) } }, { key: "clearDelayTimer", value: function () { this.delayTimer && (clearTimeout(this.delayTimer), this.delayTimer = null) } }, { key: "clearOutsideHandler", value: function () { this.clickOutsideHandler && (this.clickOutsideHandler.remove(), this.clickOutsideHandler = null), this.contextMenuOutsideHandler1 && (this.contextMenuOutsideHandler1.remove(), this.contextMenuOutsideHandler1 = null), this.contextMenuOutsideHandler2 && (this.contextMenuOutsideHandler2.remove(), this.contextMenuOutsideHandler2 = null), this.touchOutsideHandler && (this.touchOutsideHandler.remove(), this.touchOutsideHandler = null) } }, { key: "createTwoChains", value: function (c) { var o = this.props.children.props, f = this.props; return o[c] && f[c] ? this["fire".concat(c)] : o[c] || f[c] } }, { key: "isClickToShow", value: function () { var c = this.props, o = c.action, f = c.showAction; return o.indexOf("click") !== -1 || f.indexOf("click") !== -1 } }, { key: "isContextMenuOnly", value: function () { var c = this.props.action; return c === "contextMenu" || c.length === 1 && c[0] === "contextMenu" } }, { key: "isContextMenuToShow", value: function () { var c = this.props, o = c.action, f = c.showAction; return o.indexOf("contextMenu") !== -1 || f.indexOf("contextMenu") !== -1 } }, { key: "isClickToHide", value: function () { var c = this.props, o = c.action, f = c.hideAction; return o.indexOf("click") !== -1 || f.indexOf("click") !== -1 } }, { key: "isMouseEnterToShow", value: function () { var c = this.props, o = c.action, f = c.showAction; return o.indexOf("hover") !== -1 || f.indexOf("mouseEnter") !== -1 } }, { key: "isMouseLeaveToHide", value: function () { var c = this.props, o = c.action, f = c.hideAction; return o.indexOf("hover") !== -1 || f.indexOf("mouseLeave") !== -1 } }, { key: "isFocusToShow", value: function () { var c = this.props, o = c.action, f = c.showAction; return o.indexOf("focus") !== -1 || f.indexOf("focus") !== -1 } }, { key: "isBlurToHide", value: function () { var c = this.props, o = c.action, f = c.hideAction; return o.indexOf("focus") !== -1 || f.indexOf("blur") !== -1 } }, { key: "forcePopupAlign", value: function () { if (this.state.popupVisible) { var c; (c = this.popupRef.current) === null || c === void 0 || c.forceAlign() } } }, { key: "fireEvents", value: function (c, o) { var f = this.props.children.props[c]; f && f(o); var p = this.props[c]; p && p(o) } }, { key: "close", value: function () { this.setPopupVisible(!1) } }, { key: "render", value: function () { var c = this.state.popupVisible, o = this.props, f = o.children, p = o.forceRender, v = o.alignPoint, y = o.className, w = o.autoDestroy, P = C.exports.Children.only(f), k = { key: "trigger" }; this.isContextMenuToShow() ? k.onContextMenu = this.onContextMenu : k.onContextMenu = this.createTwoChains("onContextMenu"), this.isClickToHide() || this.isClickToShow() ? (k.onClick = this.onClick, k.onMouseDown = this.onMouseDown, k.onTouchStart = this.onTouchStart) : (k.onClick = this.createTwoChains("onClick"), k.onMouseDown = this.createTwoChains("onMouseDown"), k.onTouchStart = this.createTwoChains("onTouchStart")), this.isMouseEnterToShow() ? (k.onMouseEnter = this.onMouseEnter, v && (k.onMouseMove = this.onMouseMove)) : k.onMouseEnter = this.createTwoChains("onMouseEnter"), this.isMouseLeaveToHide() ? k.onMouseLeave = this.onMouseLeave : k.onMouseLeave = this.createTwoChains("onMouseLeave"), this.isFocusToShow() || this.isBlurToHide() ? (k.onFocus = this.onFocus, k.onBlur = this.onBlur) : (k.onFocus = this.createTwoChains("onFocus"), k.onBlur = this.createTwoChains("onBlur")); var A = Xe(P && P.props && P.props.className, y); A && (k.className = A); var N = ge({}, k); Ic(P) && (N.ref = Po(this.triggerRef, P.ref)); var R = C.exports.cloneElement(P, N), M; return (c || this.popupRef.current || p) && (M = I(e, { getContainer: this.getContainer, didUpdate: this.handlePortalUpdate, children: this.getComponent() }, "portal")), !c && w && (M = null), Qe(Ok.Provider, { value: this.triggerContextValue, children: [R, M] }) } }], [{ key: "getDerivedStateFromProps", value: function (c, o) { var f = c.popupVisible, p = {}; return f !== void 0 && o.popupVisible !== f && (p.popupVisible = f, p.prevPopupVisible = o.popupVisible), p } }]), i }(C.exports.Component); return re(t, "contextType", Ok), re(t, "defaultProps", { prefixCls: "rc-trigger-popup", getPopupClassNameFromAlign: kH, getDocument: IH, onPopupVisibleChange: S1, afterPopupVisibleChange: S1, onPopupAlign: S1, popupClassName: "", mouseEnterDelay: 0, mouseLeaveDelay: .1, focusDelay: 0, blurDelay: .15, popupStyle: {}, destroyPopupOnHide: !1, popupAlign: {}, defaultPopupVisible: !1, mask: !1, maskClosable: !0, action: [], showAction: [], hideAction: [], autoDestroy: !1 }), t } const q0 = MH(jK); var AH = ["prefixCls", "disabled", "visible", "children", "popupElement", "containerWidth", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"], NH = function (t) { var n = t === !0 ? 0 : 1; return { bottomLeft: { points: ["tl", "bl"], offset: [0, 4], overflow: { adjustX: n, adjustY: 1 } }, bottomRight: { points: ["tr", "br"], offset: [0, 4], overflow: { adjustX: n, adjustY: 1 } }, topLeft: { points: ["bl", "tl"], offset: [0, -4], overflow: { adjustX: n, adjustY: 1 } }, topRight: { points: ["br", "tr"], offset: [0, -4], overflow: { adjustX: n, adjustY: 1 } } } }, OH = function (t, n) { var r = t.prefixCls; t.disabled; var i = t.visible, s = t.children, c = t.popupElement, o = t.containerWidth, f = t.animation, p = t.transitionName, v = t.dropdownStyle, y = t.dropdownClassName, w = t.direction, P = w === void 0 ? "ltr" : w, k = t.placement, A = t.dropdownMatchSelectWidth, N = t.dropdownRender, R = t.dropdownAlign, M = t.getPopupContainer, O = t.empty, z = t.getTriggerDOMNode, B = t.onPopupVisibleChange, V = t.onPopupMouseEnter, G = Rn(t, AH), j = "".concat(r, "-dropdown"), X = c; N && (X = N(c)); var Y = C.exports.useMemo(function () { return NH(A) }, [A]), se = f ? "".concat(j, "-").concat(f) : p, ee = C.exports.useRef(null); C.exports.useImperativeHandle(n, function () { return { getPopupElement: function () { return ee.current } } }); var Z = ge({ minWidth: o }, v); return typeof A == "number" ? Z.width = A : A && (Z.width = o), I(q0, { ...G, showAction: B ? ["click"] : [], hideAction: B ? ["click"] : [], popupPlacement: k || (P === "rtl" ? "bottomRight" : "bottomLeft"), builtinPlacements: Y, prefixCls: j, popupTransitionName: se, popup: I("div", { ref: ee, onMouseEnter: V, children: X }), popupAlign: R, popupVisible: i, getPopupContainer: M, popupClassName: Xe(y, re({}, "".concat(j, "-empty"), O)), popupStyle: Z, getTriggerDOMNode: z, onPopupVisibleChange: B, children: s }) }, yD = C.exports.forwardRef(OH); yD.displayName = "SelectTrigger"; function Dk(e, t) { var n = e.key, r; return "value" in e && (r = e.value), n != null ? n : r !== void 0 ? r : "rc-index-key-".concat(t) } function xD(e, t) { var n = e || {}, r = n.label, i = n.value, s = n.options; return { label: r || (t ? "children" : "label"), value: i || "value", options: s || "options" } } function DH(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.fieldNames, r = t.childrenAsData, i = [], s = xD(n, !1), c = s.label, o = s.value, f = s.options; function p(v, y) { v.forEach(function (w) { var P = w[c]; if (y || !(f in w)) { var k = w[o]; i.push({ key: Dk(w, i.length), groupOption: y, data: w, label: P, value: k }) } else { var A = P; A === void 0 && r && (A = w.label), i.push({ key: Dk(w, i.length), group: !0, data: w, label: A }), p(w[f], !0) } }) } return p(e, !1), i } function Hw(e) { var t = ge({}, e); return "props" in t || Object.defineProperty(t, "props", { get: function () { return Rr(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), t } }), t } function LH(e, t) { if (!t || !t.length) return null; var n = !1; function r(s, c) { var o = JS(c), f = o[0], p = o.slice(1); if (!f) return [s]; var v = s.split(f); return n = n || v.length > 1, v.reduce(function (y, w) { return [].concat(Et(y), Et(r(w, p))) }, []).filter(function (y) { return y }) } var i = r(e, t); return n ? i : null } var zH = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "showArrow", "inputIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"], FH = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"]; function Ww(e) { return e === "tags" || e === "multiple" } var _D = C.exports.forwardRef(function (e, t) {
|
|
|
var n, r, i = e.id, s = e.prefixCls, c = e.className, o = e.showSearch, f = e.tagRender, p = e.direction, v = e.omitDomProps, y = e.displayValues, w = e.onDisplayValuesChange, P = e.emptyOptions, k = e.notFoundContent, A = k === void 0 ? "Not Found" : k, N = e.onClear, R = e.mode, M = e.disabled, O = e.loading, z = e.getInputElement, B = e.getRawInputElement, V = e.open, G = e.defaultOpen, j = e.onDropdownVisibleChange, X = e.activeValue, Y = e.onActiveValueChange, se = e.activeDescendantId, ee = e.searchValue, Z = e.autoClearSearchValue, J = e.onSearch, ve = e.onSearchSplit, ie = e.tokenSeparators, ce = e.allowClear, oe = e.showArrow, ye = e.inputIcon, Ie = e.clearIcon, Te = e.OptionList, Pe = e.animation, De = e.transitionName, Re = e.dropdownStyle, ke = e.dropdownClassName, Oe = e.dropdownMatchSelectWidth, $e = e.dropdownRender, He = e.dropdownAlign, Ue = e.placement, st = e.getPopupContainer, ft = e.showAction, It = ft === void 0 ? [] : ft, We = e.onFocus, Pt = e.onBlur, pt = e.onKeyUp, Rt = e.onKeyDown, yt = e.onMouseDown, Mt = Rn(e, zH), ut = Ww(R), dt = (o !== void 0 ? o : ut) || R === "combobox", ct = ge({}, Mt); FH.forEach(function (Mn) { delete ct[Mn] }), v == null || v.forEach(function (Mn) { delete ct[Mn] }); var rt = C.exports.useState(!1), ht = ze(rt, 2), bt = ht[0], Wt = ht[1]; C.exports.useEffect(function () { Wt(g2()) }, []); var Ut = C.exports.useRef(null), Jt = C.exports.useRef(null), Fe = C.exports.useRef(null), Ge = C.exports.useRef(null), Zt = C.exports.useRef(null), cn = vK(), jt = ze(cn, 3), Kt = jt[0], nn = jt[1], Cn = jt[2]; C.exports.useImperativeHandle(t, function () { var Mn, kn; return { focus: (Mn = Ge.current) === null || Mn === void 0 ? void 0 : Mn.focus, blur: (kn = Ge.current) === null || kn === void 0 ? void 0 : kn.blur, scrollTo: function (Gr) { var yr; return (yr = Zt.current) === null || yr === void 0 ? void 0 : yr.scrollTo(Gr) } } }); var Nn = C.exports.useMemo(function () { var Mn; if (R !== "combobox") return ee; var kn = (Mn = y[0]) === null || Mn === void 0 ? void 0 : Mn.value; return typeof kn == "string" || typeof kn == "number" ? String(kn) : "" }, [ee, R, y]), wt = R === "combobox" && typeof z == "function" && z() || null, qt = typeof B == "function" && B(), At = pN(Jt, qt == null || (n = qt.props) === null || n === void 0 ? void 0 : n.ref), Xt = Bi(void 0, { defaultValue: G, value: V }), en = ze(Xt, 2), gt = en[0], yn = en[1], Sn = gt, dn = !A && P; (M || dn && Sn && R === "combobox") && (Sn = !1); var zt = dn ? !1 : Sn, ot = C.exports.useCallback(function (Mn) { var kn = Mn !== void 0 ? Mn : !Sn; M || (yn(kn), Sn !== kn && (j == null || j(kn))) }, [M, Sn, yn, j]), mt = C.exports.useMemo(function () {
|
|
|
return (ie || []).some(function (Mn) {
|
|
|
return [`
|
|
|
`, `\r
|
|
|
`].includes(Mn)
|
|
|
})
|
|
|
}, [ie]), Dt = function (kn, Dn, Gr) { var yr = !0, Kn = kn; Y == null || Y(null); var $n = Gr ? null : LH(kn, ie); return R !== "combobox" && $n && (Kn = "", ve == null || ve($n), ot(!1), yr = !1), J && Nn !== Kn && J(Kn, { source: Dn ? "typing" : "effect" }), yr }, Bt = function (kn) { !kn || !kn.trim() || J(kn, { source: "submit" }) }; C.exports.useEffect(function () { !Sn && !ut && R !== "combobox" && Dt("", !1, !1) }, [Sn]), C.exports.useEffect(function () { gt && M && yn(!1), M && nn(!1) }, [M]); var pn = QO(), On = ze(pn, 2), Zn = On[0], Xn = On[1], me = function (kn) { var Dn = Zn(), Gr = kn.which; if (Gr === St.ENTER && (R !== "combobox" && kn.preventDefault(), Sn || ot(!0)), Xn(!!Nn), Gr === St.BACKSPACE && !Dn && ut && !Nn && y.length) { for (var yr = Et(y), Kn = null, $n = yr.length - 1; $n >= 0; $n -= 1) { var Jn = yr[$n]; if (!Jn.disabled) { yr.splice($n, 1), Kn = Jn; break } } Kn && w(yr, { type: "remove", values: [Kn] }) } for (var br = arguments.length, Cr = new Array(br > 1 ? br - 1 : 0), Br = 1; Br < br; Br++)Cr[Br - 1] = arguments[Br]; if (Sn && Zt.current) { var so; (so = Zt.current).onKeyDown.apply(so, [kn].concat(Cr)) } Rt == null || Rt.apply(void 0, [kn].concat(Cr)) }, H = function (kn) { for (var Dn = arguments.length, Gr = new Array(Dn > 1 ? Dn - 1 : 0), yr = 1; yr < Dn; yr++)Gr[yr - 1] = arguments[yr]; if (Sn && Zt.current) { var Kn; (Kn = Zt.current).onKeyUp.apply(Kn, [kn].concat(Gr)) } pt == null || pt.apply(void 0, [kn].concat(Gr)) }, q = function (kn) { var Dn = y.filter(function (Gr) { return Gr !== kn }); w(Dn, { type: "remove", values: [kn] }) }, de = C.exports.useRef(!1), le = function () { nn(!0), M || (We && !de.current && We.apply(void 0, arguments), It.includes("focus") && ot(!0)), de.current = !0 }, xe = function () { nn(!1, function () { de.current = !1, ot(!1) }), !M && (Nn && (R === "tags" ? J(Nn, { source: "submit" }) : R === "multiple" && J("", { source: "blur" })), Pt && Pt.apply(void 0, arguments)) }, Ee = []; C.exports.useEffect(function () { return function () { Ee.forEach(function (Mn) { return clearTimeout(Mn) }), Ee.splice(0, Ee.length) } }, []); var be = function (kn) { var Dn, Gr = kn.target, yr = (Dn = Fe.current) === null || Dn === void 0 ? void 0 : Dn.getPopupElement(); if (yr && yr.contains(Gr)) { var Kn = setTimeout(function () { var Cr = Ee.indexOf(Kn); if (Cr !== -1 && Ee.splice(Cr, 1), Cn(), !bt && !yr.contains(document.activeElement)) { var Br; (Br = Ge.current) === null || Br === void 0 || Br.focus() } }); Ee.push(Kn) } for (var $n = arguments.length, Jn = new Array($n > 1 ? $n - 1 : 0), br = 1; br < $n; br++)Jn[br - 1] = arguments[br]; yt == null || yt.apply(void 0, [kn].concat(Jn)) }, Ce = C.exports.useState(null), Le = ze(Ce, 2), qe = Le[0], Ze = Le[1], Ve = C.exports.useState({}), Lt = ze(Ve, 2), Ct = Lt[1]; function Je() { Ct({}) } si(function () { if (zt) { var Mn, kn = Math.ceil((Mn = Ut.current) === null || Mn === void 0 ? void 0 : Mn.offsetWidth); qe !== kn && !Number.isNaN(kn) && Ze(kn) } }, [zt]); var Ot; qt && (Ot = function (kn) { ot(kn) }), gK(function () { var Mn; return [Ut.current, (Mn = Fe.current) === null || Mn === void 0 ? void 0 : Mn.getPopupElement()] }, zt, ot, !!qt); var Vt = C.exports.useMemo(function () { return ge(ge({}, e), {}, { notFoundContent: A, open: Sn, triggerOpen: zt, id: i, showSearch: dt, multiple: ut, toggleOpen: ot }) }, [e, A, zt, Sn, i, dt, ut, ot]), bn = oe !== void 0 ? oe : O || !ut && R !== "combobox", un; bn && (un = I(zy, { className: Xe("".concat(s, "-arrow"), re({}, "".concat(s, "-arrow-loading"), O)), customizeIcon: ye, customizeIconProps: { loading: O, searchValue: Nn, open: Sn, focused: Kt, showSearch: dt } })); var wn, Vn = function () { var kn; N == null || N(), (kn = Ge.current) === null || kn === void 0 || kn.focus(), w([], { type: "clear", values: y }), Dt("", !1, !1) }; !M && ce && (y.length || Nn) && !(R === "combobox" && Nn === "") && (wn = I(zy, { className: "".concat(s, "-clear"), onMouseDown: Vn, customizeIcon: Ie, children: "\xD7" })); var rr = I(Te, { ref: Zt }), $r = Xe(s, c, (r = {}, re(r, "".concat(s, "-focused"), Kt), re(r, "".concat(s, "-multiple"), ut), re(r, "".concat(s, "-single"), !ut), re(r, "".concat(s, "-allow-clear"), ce), re(r, "".concat(s, "-show-arrow"), bn), re(r, "".concat(s, "-disabled"), M), re(r, "".concat(s, "-loading"), O), re(r, "".concat(s, "-open"), Sn), re(r, "".concat(s, "-customize-input"), wt), re(r, "".concat(s, "-show-search"), dt), r)), sr = I(yD, { ref: Fe, disabled: M, prefixCls: s, visible: zt, popupElement: rr, containerWidth: qe, animation: Pe, transitionName: De, dropdownStyle: Re, dropdownClassName: ke, direction: p, dropdownMatchSelectWidth: Oe, dropdownRender: $e, dropdownAlign: He, placement: Ue, getPopupContainer: st, empty: P, getTriggerDOMNode: function () { return Jt.current }, onPopupVisibleChange: Ot, onPopupMouseEnter: Je, children: qt ? C.exports.cloneElement(qt, { ref: At }) : I(iD, { ...e, domRef: Jt, prefixCls: s, inputElement: wt, ref: Ge, id: i, showSearch: dt, autoClearSearchValue: Z, mode: R, activeDescendantId: se, tagRender: f, values: y, open: Sn, onToggleOpen: ot, activeValue: X, searchValue: Nn, onSearch: Dt, onSearchSubmit: Bt, onRemove: q, tokenWithEnter: mt }) }), Mr; return qt ? Mr = sr : Mr = Qe("div", { className: $r, ...ct, ref: Ut, onMouseDown: be, onKeyDown: me, onKeyUp: H, onFocus: le, onBlur: xe, children: [Kt && !Sn && I("span", { style: { width: 0, height: 0, position: "absolute", overflow: "hidden", opacity: 0 }, "aria-live": "polite", children: "".concat(y.map(function (Mn) { var kn = Mn.label, Dn = Mn.value; return ["number", "string"].includes(ln(kn)) ? kn : Dn }).join(", ")) }), sr, un, wn] }), I(XO.Provider, { value: Vt, children: Mr })
|
|
|
}); const $H = function (e, t) { var n = C.exports.useRef({ values: new Map, options: new Map }), r = C.exports.useMemo(function () { var s = n.current, c = s.values, o = s.options, f = e.map(function (y) { if (y.label === void 0) { var w; return ge(ge({}, y), {}, { label: (w = c.get(y.value)) === null || w === void 0 ? void 0 : w.label }) } return y }), p = new Map, v = new Map; return f.forEach(function (y) { p.set(y.value, y), v.set(y.value, t.get(y.value) || o.get(y.value)) }), n.current.values = p, n.current.options = v, f }, [e, t]), i = C.exports.useCallback(function (s) { return t.get(s) || n.current.options.get(s) }, [t]); return [r, i] }; function E1(e, t) { return nD(e).join("").toUpperCase().includes(t) } const BH = function (e, t, n, r, i) { return C.exports.useMemo(function () { if (!n || r === !1) return e; var s = t.options, c = t.label, o = t.value, f = [], p = typeof r == "function", v = n.toUpperCase(), y = p ? r : function (P, k) { return i ? E1(k[i], v) : k[s] ? E1(k[c !== "children" ? c : "label"], v) : E1(k[o], v) }, w = p ? function (P) { return Hw(P) } : function (P) { return P }; return e.forEach(function (P) { if (P[s]) { var k = y(n, w(P)); if (k) f.push(P); else { var A = P[s].filter(function (N) { return y(n, w(N)) }); A.length && f.push(ge(ge({}, P), {}, re({}, s, A))) } return } y(n, w(P)) && f.push(P) }), f }, [e, r, i, n, t]) }; var Lk = 0, VH = wo(); function UH() { var e; return VH ? (e = Lk, Lk += 1) : e = "TEST_OR_SSR", e } function bD(e) { var t = C.exports.useState(), n = ze(t, 2), r = n[0], i = n[1]; return C.exports.useEffect(function () { i("rc_select_".concat(UH())) }, []), e || r } var jH = ["children", "value"], KH = ["children"]; function HH(e) { var t = e, n = t.key, r = t.props, i = r.children, s = r.value, c = Rn(r, jH); return ge({ key: n, value: s !== void 0 ? s : n, children: i }, c) } function wD(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; return Zi(e).map(function (n, r) { if (!C.exports.isValidElement(n) || !n.type) return null; var i = n, s = i.type.isSelectOptGroup, c = i.key, o = i.props, f = o.children, p = Rn(o, KH); return t || !s ? HH(n) : ge(ge({ key: "__RC_SELECT_GRP__".concat(c === null ? r : c, "__"), label: c }, p), {}, { options: wD(f) }) }).filter(function (n) { return n }) } function WH(e, t, n, r, i) { return C.exports.useMemo(function () { var s = e, c = !e; c && (s = wD(t)); var o = new Map, f = new Map, p = function (w, P, k) { k && typeof k == "string" && w.set(P[k], P) }; function v(y) { for (var w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, P = 0; P < y.length; P += 1) { var k = y[P]; !k[n.options] || w ? (o.set(k[n.value], k), p(f, k, n.label), p(f, k, r), p(f, k, i)) : v(k[n.options], !0) } } return v(s), { options: s, valueOptions: o, labelOptions: f } }, [e, t, n, r, i]) } function zk(e) { var t = C.exports.useRef(); t.current = e; var n = C.exports.useCallback(function () { return t.current.apply(t, arguments) }, []); return n } var P2 = function () { return null }; P2.isSelectOptGroup = !0; var T2 = function () { return null }; T2.isSelectOption = !0; var CD = C.exports.forwardRef(function (e, t) { var n = e.height, r = e.offset, i = e.children, s = e.prefixCls, c = e.onInnerResize, o = e.innerProps, f = {}, p = { display: "flex", flexDirection: "column" }; return r !== void 0 && (f = { height: n, position: "relative", overflow: "hidden" }, p = ge(ge({}, p), {}, { transform: "translateY(".concat(r, "px)"), position: "absolute", left: 0, right: 0, top: 0 })), I("div", { style: f, children: I(cl, { onResize: function (y) { var w = y.offsetHeight; w && c && c() }, children: I("div", { style: p, className: Xe(re({}, "".concat(s, "-holder-inner"), s)), ref: t, ...o, children: i }) }) }) }); CD.displayName = "Filler"; var GH = 20; function Fk(e) { return "touches" in e ? e.touches[0].pageY : e.pageY } var qH = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.moveRaf = null, r.scrollbarRef = C.exports.createRef(), r.thumbRef = C.exports.createRef(), r.visibleTimeout = null, r.state = { dragging: !1, pageY: null, startTop: null, visible: !1 }, r.delayHidden = function () { clearTimeout(r.visibleTimeout), r.setState({ visible: !0 }), r.visibleTimeout = setTimeout(function () { r.setState({ visible: !1 }) }, 2e3) }, r.onScrollbarTouchStart = function (o) { o.preventDefault() }, r.onContainerMouseDown = function (o) { o.stopPropagation(), o.preventDefault() }, r.patchEvents = function () { window.addEventListener("mousemove", r.onMouseMove), window.addEventListener("mouseup", r.onMouseUp), r.thumbRef.current.addEventListener("touchmove", r.onMouseMove), r.thumbRef.current.addEventListener("touchend", r.onMouseUp) }, r.removeEvents = function () { var o; window.removeEventListener("mousemove", r.onMouseMove), window.removeEventListener("mouseup", r.onMouseUp), (o = r.scrollbarRef.current) === null || o === void 0 || o.removeEventListener("touchstart", r.onScrollbarTouchStart), r.thumbRef.current && (r.thumbRef.current.removeEventListener("touchstart", r.onMouseDown), r.thumbRef.current.removeEventListener("touchmove", r.onMouseMove), r.thumbRef.current.removeEventListener("touchend", r.onMouseUp)), nr.cancel(r.moveRaf) }, r.onMouseDown = function (o) { var f = r.props.onStartMove; r.setState({ dragging: !0, pageY: Fk(o), startTop: r.getTop() }), f(), r.patchEvents(), o.stopPropagation(), o.preventDefault() }, r.onMouseMove = function (o) { var f = r.state, p = f.dragging, v = f.pageY, y = f.startTop, w = r.props.onScroll; if (nr.cancel(r.moveRaf), p) { var P = Fk(o) - v, k = y + P, A = r.getEnableScrollRange(), N = r.getEnableHeightRange(), R = N ? k / N : 0, M = Math.ceil(R * A); r.moveRaf = nr(function () { w(M) }) } }, r.onMouseUp = function () { var o = r.props.onStopMove; r.setState({ dragging: !1 }), o(), r.removeEvents() }, r.getSpinHeight = function () { var o = r.props, f = o.height, p = o.count, v = f / p * 10; return v = Math.max(v, GH), v = Math.min(v, f / 2), Math.floor(v) }, r.getEnableScrollRange = function () { var o = r.props, f = o.scrollHeight, p = o.height; return f - p || 0 }, r.getEnableHeightRange = function () { var o = r.props.height, f = r.getSpinHeight(); return o - f || 0 }, r.getTop = function () { var o = r.props.scrollTop, f = r.getEnableScrollRange(), p = r.getEnableHeightRange(); if (o === 0 || f === 0) return 0; var v = o / f; return v * p }, r.showScroll = function () { var o = r.props, f = o.height, p = o.scrollHeight; return p > f }, r } return Fr(n, [{ key: "componentDidMount", value: function () { this.scrollbarRef.current.addEventListener("touchstart", this.onScrollbarTouchStart), this.thumbRef.current.addEventListener("touchstart", this.onMouseDown) } }, { key: "componentDidUpdate", value: function (i) { i.scrollTop !== this.props.scrollTop && this.delayHidden() } }, { key: "componentWillUnmount", value: function () { this.removeEvents(), clearTimeout(this.visibleTimeout) } }, { key: "render", value: function () { var i = this.state, s = i.dragging, c = i.visible, o = this.props.prefixCls, f = this.getSpinHeight(), p = this.getTop(), v = this.showScroll(), y = v && c; return I("div", { ref: this.scrollbarRef, className: Xe("".concat(o, "-scrollbar"), re({}, "".concat(o, "-scrollbar-show"), v)), style: { width: 8, top: 0, bottom: 0, right: 0, position: "absolute", display: y ? null : "none" }, onMouseDown: this.onContainerMouseDown, onMouseMove: this.delayHidden, children: I("div", { ref: this.thumbRef, className: Xe("".concat(o, "-scrollbar-thumb"), re({}, "".concat(o, "-scrollbar-thumb-moving"), s)), style: { width: "100%", height: f, top: p, left: 0, position: "absolute", background: "rgba(0, 0, 0, 0.5)", borderRadius: 99, cursor: "pointer", userSelect: "none" }, onMouseDown: this.onMouseDown }) }) } }]), n }(C.exports.Component); function ZH(e) { var t = e.children, n = e.setRef, r = C.exports.useCallback(function (i) { n(i) }, []); return C.exports.cloneElement(t, { ref: r }) } function XH(e, t, n, r, i, s) { var c = s.getKey; return e.slice(t, n + 1).map(function (o, f) { var p = t + f, v = i(o, p, {}), y = c(o); return I(ZH, { setRef: function (P) { return r(o, P) }, children: v }, y) }) } var YH = function () { function e() { zr(this, e), this.maps = void 0, this.maps = Object.create(null) } return Fr(e, [{ key: "set", value: function (n, r) { this.maps[n] = r } }, { key: "get", value: function (n) { return this.maps[n] } }]), e }(); function QH(e, t, n) { var r = C.exports.useState(0), i = ze(r, 2), s = i[0], c = i[1], o = C.exports.useRef(new Map), f = C.exports.useRef(new YH), p = C.exports.useRef(); function v() { nr.cancel(p.current) } function y() { v(), p.current = nr(function () { o.current.forEach(function (P, k) { if (P && P.offsetParent) { var A = Vp(P), N = A.offsetHeight; f.current.get(k) !== N && f.current.set(k, A.offsetHeight) } }), c(function (P) { return P + 1 }) }) } function w(P, k) { var A = e(P), N = o.current.get(A); k ? (o.current.set(A, k), y()) : o.current.delete(A), !N != !k && (k ? t == null || t(P) : n == null || n(P)) } return C.exports.useEffect(function () { return v }, []), [w, y, f.current, s] } function JH(e, t, n, r, i, s, c, o) { var f = C.exports.useRef(); return function (p) { if (p == null) { o(); return } if (nr.cancel(f.current), typeof p == "number") c(p); else if (p && ln(p) === "object") { var v, y = p.align; "index" in p ? v = p.index : v = t.findIndex(function (A) { return i(A) === p.key }); var w = p.offset, P = w === void 0 ? 0 : w, k = function A(N, R) { if (!(N < 0 || !e.current)) { var M = e.current.clientHeight, O = !1, z = R; if (M) { for (var B = R || y, V = 0, G = 0, j = 0, X = Math.min(t.length, v), Y = 0; Y <= X; Y += 1) { var se = i(t[Y]); G = V; var ee = n.get(se); j = G + (ee === void 0 ? r : ee), V = j, Y === v && ee === void 0 && (O = !0) } var Z = null; switch (B) { case "top": Z = G - P; break; case "bottom": Z = j - M + P; break; default: { var J = e.current.scrollTop, ve = J + M; G < J ? z = "top" : j > ve && (z = "bottom") } }Z !== null && Z !== e.current.scrollTop && c(Z) } f.current = nr(function () { O && s(), A(N - 1, z) }, 2) } }; k(3) } } } function eW(e, t, n) { var r = e.length, i = t.length, s, c; if (r === 0 && i === 0) return null; r < i ? (s = e, c = t) : (s = t, c = e); var o = { __EMPTY_ITEM__: !0 }; function f(k) { return k !== void 0 ? n(k) : o } for (var p = null, v = Math.abs(r - i) !== 1, y = 0; y < c.length; y += 1) { var w = f(s[y]), P = f(c[y]); if (w !== P) { p = y, v = v || w !== f(c[y + 1]); break } } return p === null ? null : { index: p, multiple: v } } function tW(e, t, n) { var r = C.exports.useState(e), i = ze(r, 2), s = i[0], c = i[1], o = C.exports.useState(null), f = ze(o, 2), p = f[0], v = f[1]; return C.exports.useEffect(function () { var y = eW(s || [], e || [], t); (y == null ? void 0 : y.index) !== void 0 && (n == null || n(y.index), v(e[y.index])), c(e) }, [e]), [p] } var nW = (typeof navigator > "u" ? "undefined" : ln(navigator)) === "object" && /Firefox/i.test(navigator.userAgent); const SD = function (e, t) { var n = C.exports.useRef(!1), r = C.exports.useRef(null); function i() { clearTimeout(r.current), n.current = !0, r.current = setTimeout(function () { n.current = !1 }, 50) } var s = C.exports.useRef({ top: e, bottom: t }); return s.current.top = e, s.current.bottom = t, function (c) { var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, f = c < 0 && s.current.top || c > 0 && s.current.bottom; return o && f ? (clearTimeout(r.current), n.current = !1) : (!f || n.current) && i(), !n.current && f } }; function rW(e, t, n, r) { var i = C.exports.useRef(0), s = C.exports.useRef(null), c = C.exports.useRef(null), o = C.exports.useRef(!1), f = SD(t, n); function p(y) { if (!!e) { nr.cancel(s.current); var w = y.deltaY; i.current += w, c.current = w, !f(w) && (nW || y.preventDefault(), s.current = nr(function () { var P = o.current ? 10 : 1; r(i.current * P), i.current = 0 })) } } function v(y) { !e || (o.current = y.detail === c.current) } return [p, v] } var iW = 14 / 15; function oW(e, t, n) { var r = C.exports.useRef(!1), i = C.exports.useRef(0), s = C.exports.useRef(null), c = C.exports.useRef(null), o, f = function (w) { if (r.current) { var P = Math.ceil(w.touches[0].pageY), k = i.current - P; i.current = P, n(k) && w.preventDefault(), clearInterval(c.current), c.current = setInterval(function () { k *= iW, (!n(k, !0) || Math.abs(k) <= .1) && clearInterval(c.current) }, 16) } }, p = function () { r.current = !1, o() }, v = function (w) { o(), w.touches.length === 1 && !r.current && (r.current = !0, i.current = Math.ceil(w.touches[0].pageY), s.current = w.target, s.current.addEventListener("touchmove", f), s.current.addEventListener("touchend", p)) }; o = function () { s.current && (s.current.removeEventListener("touchmove", f), s.current.removeEventListener("touchend", p)) }, si(function () { return e && t.current.addEventListener("touchstart", v), function () { var y; (y = t.current) === null || y === void 0 || y.removeEventListener("touchstart", v), o(), clearInterval(c.current) } }, [e]) } var aW = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "component", "onScroll", "onVisibleChange", "innerProps"], sW = [], lW = { overflowY: "auto", overflowAnchor: "none" }; function uW(e, t) { var n = e.prefixCls, r = n === void 0 ? "rc-virtual-list" : n, i = e.className, s = e.height, c = e.itemHeight, o = e.fullHeight, f = o === void 0 ? !0 : o, p = e.style, v = e.data, y = e.children, w = e.itemKey, P = e.virtual, k = e.component, A = k === void 0 ? "div" : k, N = e.onScroll, R = e.onVisibleChange, M = e.innerProps, O = Rn(e, aW), z = !!(P !== !1 && s && c), B = z && v && c * v.length > s, V = C.exports.useState(0), G = ze(V, 2), j = G[0], X = G[1], Y = C.exports.useState(!1), se = ze(Y, 2), ee = se[0], Z = se[1], J = Xe(r, i), ve = v || sW, ie = C.exports.useRef(), ce = C.exports.useRef(), oe = C.exports.useRef(), ye = C.exports.useCallback(function (Kt) { return typeof w == "function" ? w(Kt) : Kt == null ? void 0 : Kt[w] }, [w]), Ie = { getKey: ye }; function Te(Kt) { X(function (nn) { var Cn; typeof Kt == "function" ? Cn = Kt(nn) : Cn = Kt; var Nn = dt(Cn); return ie.current.scrollTop = Nn, Nn }) } var Pe = C.exports.useRef({ start: 0, end: ve.length }), De = C.exports.useRef(), Re = tW(ve, ye), ke = ze(Re, 1), Oe = ke[0]; De.current = Oe; var $e = QH(ye, null, null), He = ze($e, 4), Ue = He[0], st = He[1], ft = He[2], It = He[3], We = C.exports.useMemo(function () { if (!z) return { scrollHeight: void 0, start: 0, end: ve.length - 1, offset: void 0 }; if (!B) { var Kt; return { scrollHeight: ((Kt = ce.current) === null || Kt === void 0 ? void 0 : Kt.offsetHeight) || 0, start: 0, end: ve.length - 1, offset: void 0 } } for (var nn = 0, Cn, Nn, wt, qt = ve.length, At = 0; At < qt; At += 1) { var Xt = ve[At], en = ye(Xt), gt = ft.get(en), yn = nn + (gt === void 0 ? c : gt); yn >= j && Cn === void 0 && (Cn = At, Nn = nn), yn > j + s && wt === void 0 && (wt = At), nn = yn } return Cn === void 0 && (Cn = 0, Nn = 0, wt = Math.ceil(s / c)), wt === void 0 && (wt = ve.length - 1), wt = Math.min(wt + 1, ve.length), { scrollHeight: nn, start: Cn, end: wt, offset: Nn } }, [B, z, j, ve, It, s]), Pt = We.scrollHeight, pt = We.start, Rt = We.end, yt = We.offset; Pe.current.start = pt, Pe.current.end = Rt; var Mt = Pt - s, ut = C.exports.useRef(Mt); ut.current = Mt; function dt(Kt) { var nn = Kt; return Number.isNaN(ut.current) || (nn = Math.min(nn, ut.current)), nn = Math.max(nn, 0), nn } var ct = j <= 0, rt = j >= Mt, ht = SD(ct, rt); function bt(Kt) { var nn = Kt; Te(nn) } function Wt(Kt) { var nn = Kt.currentTarget.scrollTop; nn !== j && Te(nn), N == null || N(Kt) } var Ut = rW(z, ct, rt, function (Kt) { Te(function (nn) { var Cn = nn + Kt; return Cn }) }), Jt = ze(Ut, 2), Fe = Jt[0], Ge = Jt[1]; oW(z, ie, function (Kt, nn) { return ht(Kt, nn) ? !1 : (Fe({ preventDefault: function () { }, deltaY: Kt }), !0) }), si(function () { function Kt(nn) { z && nn.preventDefault() } return ie.current.addEventListener("wheel", Fe), ie.current.addEventListener("DOMMouseScroll", Ge), ie.current.addEventListener("MozMousePixelScroll", Kt), function () { ie.current && (ie.current.removeEventListener("wheel", Fe), ie.current.removeEventListener("DOMMouseScroll", Ge), ie.current.removeEventListener("MozMousePixelScroll", Kt)) } }, [z]); var Zt = JH(ie, ve, ft, c, ye, st, Te, function () { var Kt; (Kt = oe.current) === null || Kt === void 0 || Kt.delayHidden() }); C.exports.useImperativeHandle(t, function () { return { scrollTo: Zt } }), si(function () { if (R) { var Kt = ve.slice(pt, Rt + 1); R(Kt, ve) } }, [pt, Rt, ve]); var cn = XH(ve, pt, Rt, Ue, y, Ie), jt = null; return s && (jt = ge(re({}, f ? "height" : "maxHeight", s), lW), z && (jt.overflowY = "hidden", ee && (jt.pointerEvents = "none"))), Qe("div", { style: ge(ge({}, p), {}, { position: "relative" }), className: J, ...O, children: [I(A, { className: "".concat(r, "-holder"), style: jt, ref: ie, onScroll: Wt, children: I(CD, { prefixCls: r, height: Pt, offset: yt, onInnerResize: st, ref: ce, innerProps: M, children: cn }) }), z && I(qH, { ref: oe, prefixCls: r, scrollTop: j, height: s, scrollHeight: Pt, count: ve.length, onScroll: bt, onStartMove: function () { Z(!0) }, onStopMove: function () { Z(!1) } })] }) } var k2 = C.exports.forwardRef(uW); k2.displayName = "List"; function cW() { return /(mac\sos|macintosh)/i.test(navigator.appVersion) } var ED = C.exports.createContext(null), dW = ["disabled", "title", "children", "style", "className"]; function $k(e) { return typeof e == "string" || typeof e == "number" } var fW = function (t, n) { var r = YO(), i = r.prefixCls, s = r.id, c = r.open, o = r.multiple, f = r.mode, p = r.searchValue, v = r.toggleOpen, y = r.notFoundContent, w = r.onPopupScroll, P = C.exports.useContext(ED), k = P.flattenOptions, A = P.onActiveValue, N = P.defaultActiveFirstOption, R = P.onSelect, M = P.menuItemSelectedIcon, O = P.rawValues, z = P.fieldNames, B = P.virtual, V = P.listHeight, G = P.listItemHeight, j = "".concat(i, "-item"), X = cm(function () { return k }, [c, k], function (Re, ke) { return ke[0] && Re[1] !== ke[1] }), Y = C.exports.useRef(null), se = function (ke) { ke.preventDefault() }, ee = function (ke) { Y.current && Y.current.scrollTo(typeof ke == "number" ? { index: ke } : ke) }, Z = function (ke) { for (var Oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, $e = X.length, He = 0; He < $e; He += 1) { var Ue = (ke + He * Oe + $e) % $e, st = X[Ue], ft = st.group, It = st.data; if (!ft && !It.disabled) return Ue } return -1 }, J = C.exports.useState(function () { return Z(0) }), ve = ze(J, 2), ie = ve[0], ce = ve[1], oe = function (ke) { var Oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; ce(ke); var $e = { source: Oe ? "keyboard" : "mouse" }, He = X[ke]; if (!He) { A(null, -1, $e); return } A(He.value, ke, $e) }; C.exports.useEffect(function () { oe(N !== !1 ? Z(0) : -1) }, [X.length, p]); var ye = C.exports.useCallback(function (Re) { return O.has(Re) && f !== "combobox" }, [f, Et(O).toString(), O.size]); C.exports.useEffect(function () { var Re = setTimeout(function () { if (!o && c && O.size === 1) { var Oe = Array.from(O)[0], $e = X.findIndex(function (He) { var Ue = He.data; return Ue.value === Oe }); $e !== -1 && (oe($e), ee($e)) } }); if (c) { var ke; (ke = Y.current) === null || ke === void 0 || ke.scrollTo(void 0) } return function () { return clearTimeout(Re) } }, [c, p]); var Ie = function (ke) { ke !== void 0 && R(ke, { selected: !O.has(ke) }), o || v(!1) }; if (C.exports.useImperativeHandle(n, function () { return { onKeyDown: function (ke) { var Oe = ke.which, $e = ke.ctrlKey; switch (Oe) { case St.N: case St.P: case St.UP: case St.DOWN: { var He = 0; if (Oe === St.UP ? He = -1 : Oe === St.DOWN ? He = 1 : cW() && $e && (Oe === St.N ? He = 1 : Oe === St.P && (He = -1)), He !== 0) { var Ue = Z(ie + He, He); ee(Ue), oe(Ue, !0) } break } case St.ENTER: { var st = X[ie]; st && !st.data.disabled ? Ie(st.value) : Ie(void 0), c && ke.preventDefault(); break } case St.ESC: v(!1), c && ke.stopPropagation() } }, onKeyUp: function () { }, scrollTo: function (ke) { ee(ke) } } }), X.length === 0) return I("div", { role: "listbox", id: "".concat(s, "_list"), className: "".concat(j, "-empty"), onMouseDown: se, children: y }); var Te = Object.keys(z).map(function (Re) { return z[Re] }), Pe = function (ke) { return ke.label }, De = function (ke) { var Oe = X[ke]; if (!Oe) return null; var $e = Oe.data || {}, He = $e.value, Ue = Oe.group, st = uu($e, !0), ft = Pe(Oe); return Oe ? C.exports.createElement("div", { "aria-label": typeof ft == "string" && !Ue ? ft : null, ...st, key: ke, role: Ue ? "presentation" : "option", id: "".concat(s, "_list_").concat(ke), "aria-selected": ye(He) }, He) : null }; return Qe(An, { children: [Qe("div", { role: "listbox", id: "".concat(s, "_list"), style: { height: 0, width: 0, overflow: "hidden" }, children: [De(ie - 1), De(ie), De(ie + 1)] }), I(k2, { itemKey: "key", ref: Y, data: X, height: V, itemHeight: G, fullHeight: !1, onMouseDown: se, onScroll: w, virtual: B, children: function (Re, ke) { var Oe, $e = Re.group, He = Re.groupOption, Ue = Re.data, st = Re.label, ft = Re.value, It = Ue.key; if ($e) { var We, Pt = (We = Ue.title) !== null && We !== void 0 ? We : $k(st) ? st.toString() : void 0; return I("div", { className: Xe(j, "".concat(j, "-group")), title: Pt, children: st !== void 0 ? st : It }) } var pt = Ue.disabled, Rt = Ue.title; Ue.children; var yt = Ue.style, Mt = Ue.className, ut = Rn(Ue, dW), dt = vi(ut, Te), ct = ye(ft), rt = "".concat(j, "-option"), ht = Xe(j, rt, Mt, (Oe = {}, re(Oe, "".concat(rt, "-grouped"), He), re(Oe, "".concat(rt, "-active"), ie === ke && !pt), re(Oe, "".concat(rt, "-disabled"), pt), re(Oe, "".concat(rt, "-selected"), ct), Oe)), bt = Pe(Re), Wt = !M || typeof M == "function" || ct, Ut = typeof bt == "number" ? bt : bt || ft, Jt = $k(Ut) ? Ut.toString() : void 0; return Rt !== void 0 && (Jt = Rt), Qe("div", { ...uu(dt), "aria-selected": ct, className: ht, title: Jt, onMouseMove: function () { ie === ke || pt || oe(ke) }, onClick: function () { pt || Ie(ft) }, style: yt, children: [I("div", { className: "".concat(rt, "-content"), children: Ut }), C.exports.isValidElement(M) || ct, Wt && I(zy, { className: "".concat(j, "-option-state"), customizeIcon: M, customizeIconProps: { isSelected: ct }, children: ct ? "\u2713" : null })] }) } })] }) }, PD = C.exports.forwardRef(fW); PD.displayName = "OptionList"; var hW = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "listHeight", "listItemHeight", "value", "defaultValue", "labelInValue", "onChange"], pW = ["inputValue"]; function mW(e) { return !e || ln(e) !== "object" } var vW = C.exports.forwardRef(function (e, t) { var n = e.id, r = e.mode, i = e.prefixCls, s = i === void 0 ? "rc-select" : i, c = e.backfill, o = e.fieldNames, f = e.inputValue, p = e.searchValue, v = e.onSearch, y = e.autoClearSearchValue, w = y === void 0 ? !0 : y, P = e.onSelect, k = e.onDeselect, A = e.dropdownMatchSelectWidth, N = A === void 0 ? !0 : A, R = e.filterOption, M = e.filterSort, O = e.optionFilterProp, z = e.optionLabelProp, B = e.options, V = e.children, G = e.defaultActiveFirstOption, j = e.menuItemSelectedIcon, X = e.virtual, Y = e.listHeight, se = Y === void 0 ? 200 : Y, ee = e.listItemHeight, Z = ee === void 0 ? 20 : ee, J = e.value, ve = e.defaultValue, ie = e.labelInValue, ce = e.onChange, oe = Rn(e, hW), ye = bD(n), Ie = Ww(r), Te = !!(!B && V), Pe = C.exports.useMemo(function () { return R === void 0 && r === "combobox" ? !1 : R }, [R, r]), De = C.exports.useMemo(function () { return xD(o, Te) }, [JSON.stringify(o), Te]), Re = Bi("", { value: p !== void 0 ? p : f, postState: function (mt) { return mt || "" } }), ke = ze(Re, 2), Oe = ke[0], $e = ke[1], He = WH(B, V, De, O, z), Ue = He.valueOptions, st = He.labelOptions, ft = He.options, It = C.exports.useCallback(function (ot) { var mt = nD(ot); return mt.map(function (Dt) { var Bt, pn, On, Zn, Xn; if (mW(Dt)) Bt = Dt; else { var me; On = Dt.key, pn = Dt.label, Bt = (me = Dt.value) !== null && me !== void 0 ? me : On } var H = Ue.get(Bt); if (H) { var q; pn === void 0 && (pn = H == null ? void 0 : H[z || De.label]), On === void 0 && (On = (q = H == null ? void 0 : H.key) !== null && q !== void 0 ? q : Bt), Zn = H == null ? void 0 : H.disabled, Xn = H == null ? void 0 : H.title } return { label: pn, value: Bt, key: On, disabled: Zn, title: Xn } }) }, [De, z, Ue]), We = Bi(ve, { value: J }), Pt = ze(We, 2), pt = Pt[0], Rt = Pt[1], yt = C.exports.useMemo(function () { var ot, mt = It(pt); return r === "combobox" && !((ot = mt[0]) !== null && ot !== void 0 && ot.value) ? [] : mt }, [pt, It, r]), Mt = $H(yt, Ue), ut = ze(Mt, 2), dt = ut[0], ct = ut[1], rt = C.exports.useMemo(function () { if (!r && dt.length === 1) { var ot = dt[0]; if (ot.value === null && (ot.label === null || ot.label === void 0)) return [] } return dt.map(function (mt) { var Dt; return ge(ge({}, mt), {}, { label: (Dt = mt.label) !== null && Dt !== void 0 ? Dt : mt.value }) }) }, [r, dt]), ht = C.exports.useMemo(function () { return new Set(dt.map(function (ot) { return ot.value })) }, [dt]); C.exports.useEffect(function () { if (r === "combobox") { var ot, mt = (ot = dt[0]) === null || ot === void 0 ? void 0 : ot.value; $e(LK(mt) ? String(mt) : "") } }, [dt]); var bt = zk(function (ot, mt) { var Dt, Bt = mt != null ? mt : ot; return Dt = {}, re(Dt, De.value, ot), re(Dt, De.label, Bt), Dt }), Wt = C.exports.useMemo(function () { if (r !== "tags") return ft; var ot = Et(ft), mt = function (Bt) { return Ue.has(Bt) }; return Et(dt).sort(function (Dt, Bt) { return Dt.value < Bt.value ? -1 : 1 }).forEach(function (Dt) { var Bt = Dt.value; mt(Bt) || ot.push(bt(Bt, Dt.label)) }), ot }, [bt, ft, Ue, dt, r]), Ut = BH(Wt, De, Oe, Pe, O), Jt = C.exports.useMemo(function () { return r !== "tags" || !Oe || Ut.some(function (ot) { return ot[O || "value"] === Oe }) ? Ut : [bt(Oe)].concat(Et(Ut)) }, [bt, O, r, Ut, Oe]), Fe = C.exports.useMemo(function () { return M ? Et(Jt).sort(function (ot, mt) { return M(ot, mt) }) : Jt }, [Jt, M]), Ge = C.exports.useMemo(function () { return DH(Fe, { fieldNames: De, childrenAsData: Te }) }, [Fe, De, Te]), Zt = function (mt) { var Dt = It(mt); if (Rt(Dt), ce && (Dt.length !== dt.length || Dt.some(function (On, Zn) { var Xn; return ((Xn = dt[Zn]) === null || Xn === void 0 ? void 0 : Xn.value) !== (On == null ? void 0 : On.value) }))) { var Bt = ie ? Dt : Dt.map(function (On) { return On.value }), pn = Dt.map(function (On) { return Hw(ct(On.value)) }); ce(Ie ? Bt : Bt[0], Ie ? pn : pn[0]) } }, cn = C.exports.useState(null), jt = ze(cn, 2), Kt = jt[0], nn = jt[1], Cn = C.exports.useState(0), Nn = ze(Cn, 2), wt = Nn[0], qt = Nn[1], At = G !== void 0 ? G : r !== "combobox", Xt = C.exports.useCallback(function (ot, mt) { var Dt = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, Bt = Dt.source, pn = Bt === void 0 ? "keyboard" : Bt; qt(mt), c && r === "combobox" && ot !== null && pn === "keyboard" && nn(String(ot)) }, [c, r]), en = function (mt, Dt, Bt) { var pn = function () { var Ee, be = ct(mt); return [ie ? { label: be == null ? void 0 : be[De.label], value: mt, key: (Ee = be == null ? void 0 : be.key) !== null && Ee !== void 0 ? Ee : mt } : mt, Hw(be)] }; if (Dt && P) { var On = pn(), Zn = ze(On, 2), Xn = Zn[0], me = Zn[1]; P(Xn, me) } else if (!Dt && k && Bt !== "clear") { var H = pn(), q = ze(H, 2), de = q[0], le = q[1]; k(de, le) } }, gt = zk(function (ot, mt) { var Dt, Bt = Ie ? mt.selected : !0; Bt ? Dt = Ie ? [].concat(Et(dt), [ot]) : [ot] : Dt = dt.filter(function (pn) { return pn.value !== ot }), Zt(Dt), en(ot, Bt), r === "combobox" ? nn("") : (!Ww || w) && ($e(""), nn("")) }), yn = function (mt, Dt) { Zt(mt); var Bt = Dt.type, pn = Dt.values; (Bt === "remove" || Bt === "clear") && pn.forEach(function (On) { en(On.value, !1, Bt) }) }, Sn = function (mt, Dt) { if ($e(mt), nn(null), Dt.source === "submit") { var Bt = (mt || "").trim(); if (Bt) { var pn = Array.from(new Set([].concat(Et(ht), [Bt]))); Zt(pn), en(Bt, !0), $e("") } return } Dt.source !== "blur" && (r === "combobox" && Zt(mt), v == null || v(mt)) }, dn = function (mt) { var Dt = mt; r !== "tags" && (Dt = mt.map(function (pn) { var On = st.get(pn); return On == null ? void 0 : On.value }).filter(function (pn) { return pn !== void 0 })); var Bt = Array.from(new Set([].concat(Et(ht), Et(Dt)))); Zt(Bt), Bt.forEach(function (pn) { en(pn, !0) }) }, zt = C.exports.useMemo(function () { var ot = X !== !1 && N !== !1; return ge(ge({}, He), {}, { flattenOptions: Ge, onActiveValue: Xt, defaultActiveFirstOption: At, onSelect: gt, menuItemSelectedIcon: j, rawValues: ht, fieldNames: De, virtual: ot, listHeight: se, listItemHeight: Z, childrenAsData: Te }) }, [He, Ge, Xt, At, gt, j, ht, De, X, N, se, Z, Te]); return I(ED.Provider, { value: zt, children: I(_D, { ...oe, id: ye, prefixCls: s, ref: t, omitDomProps: pW, mode: r, displayValues: rt, onDisplayValuesChange: yn, searchValue: Oe, onSearch: Sn, autoClearSearchValue: w, onSearchSplit: dn, dropdownMatchSelectWidth: N, OptionList: PD, emptyOptions: !Ge.length, activeValue: Kt, activeDescendantId: "".concat(ye, "_list_").concat(wt) }) }) }), I2 = vW; I2.Option = T2; I2.OptGroup = P2; var gW = function () { var t = C.exports.useContext(zn), n = t.getPrefixCls, r = n("empty-img-default"); return I("svg", { className: r, width: "184", height: "152", viewBox: "0 0 184 152", xmlns: "http://www.w3.org/2000/svg", children: Qe("g", { fill: "none", fillRule: "evenodd", children: [Qe("g", { transform: "translate(24 31.67)", children: [I("ellipse", { className: "".concat(r, "-ellipse"), cx: "67.797", cy: "106.89", rx: "67.797", ry: "12.668" }), I("path", { className: "".concat(r, "-path-1"), d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z" }), I("path", { className: "".concat(r, "-path-2"), d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z", transform: "translate(13.56)" }), I("path", { className: "".concat(r, "-path-3"), d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z" }), I("path", { className: "".concat(r, "-path-4"), d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z" })] }), I("path", { className: "".concat(r, "-path-5"), d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z" }), Qe("g", { className: "".concat(r, "-g"), transform: "translate(149.65 15.383)", children: [I("ellipse", { cx: "20.654", cy: "3.167", rx: "2.849", ry: "2.815" }), I("path", { d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" })] })] }) }) }; const yW = gW; var xW = function () { var t = C.exports.useContext(zn), n = t.getPrefixCls, r = n("empty-img-simple"); return I("svg", { className: r, width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: Qe("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [I("ellipse", { className: "".concat(r, "-ellipse"), cx: "32", cy: "33", rx: "32", ry: "7" }), Qe("g", { className: "".concat(r, "-g"), fillRule: "nonzero", children: [I("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), I("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", className: "".concat(r, "-path") })] })] }) }) }; const _W = xW; var bW = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, TD = I(yW, {}), kD = I(_W, {}), R2 = function (t) { var n = t.className, r = t.prefixCls, i = t.image, s = i === void 0 ? TD : i, c = t.description, o = t.children, f = t.imageStyle, p = bW(t, ["className", "prefixCls", "image", "description", "children", "imageStyle"]), v = C.exports.useContext(zn), y = v.getPrefixCls, w = v.direction; return I(fm, { componentName: "Empty", children: function (P) { var k, A = y("empty", r), N = typeof c < "u" ? c : P.description, R = typeof N == "string" ? N : "empty", M = null; return typeof s == "string" ? M = I("img", { alt: R, src: s }) : M = s, Qe("div", { className: Xe(A, (k = {}, re(k, "".concat(A, "-normal"), s === kD), re(k, "".concat(A, "-rtl"), w === "rtl"), k), n), ...p, children: [I("div", { className: "".concat(A, "-image"), style: f, children: M }), N && I("div", { className: "".concat(A, "-description"), children: N }), o && I("div", { className: "".concat(A, "-footer"), children: o })] }) } }) }; R2.PRESENTED_IMAGE_DEFAULT = TD; R2.PRESENTED_IMAGE_SIMPLE = kD; const cs = R2; var wW = function (t) { return I(yu, { children: function (n) { var r = n.getPrefixCls, i = r("empty"); switch (t) { case "Table": case "List": return I(cs, { image: cs.PRESENTED_IMAGE_SIMPLE }); case "Select": case "TreeSelect": case "Cascader": case "Transfer": case "Mentions": return I(cs, { image: cs.PRESENTED_IMAGE_SIMPLE, className: "".concat(i, "-small") }); default: return I(cs, {}) } } }) }; const M2 = wW; var cu = C.exports.createContext({ labelAlign: "right", vertical: !1, itemRef: function () { } }), ID = C.exports.createContext(null), CW = function (t) { var n = vi(t, ["prefixCls"]); return I(r2, { ...n }) }, A2 = C.exports.createContext({ prefixCls: "" }), Fo = C.exports.createContext({}), Gp = function (t) { var n = t.children, r = t.status, i = t.override, s = C.exports.useContext(Fo), c = C.exports.useMemo(function () { var o = tt({}, s); return i && delete o.isFormItemInput, r && (delete o.status, delete o.hasFeedback, delete o.feedbackIcon), o }, [r, i, s]); return I(Fo.Provider, { value: c, children: n }) }, ia = function () { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)n[r] = arguments[r]; return n }, SW = function () { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)n[r] = arguments[r]; return n }, P1 = function () { return { height: 0, opacity: 0 } }, Bk = function (t) { var n = t.scrollHeight; return { height: n, opacity: 1 } }, EW = function (t) { return { height: t ? t.offsetHeight : 0 } }, T1 = function (t, n) { return (n == null ? void 0 : n.deadline) === !0 || n.propertyName === "height" }, PW = { motionName: "ant-motion-collapse", onAppearStart: P1, onEnterStart: P1, onAppearActive: Bk, onEnterActive: Bk, onLeaveStart: EW, onLeaveActive: P1, onAppearEnd: T1, onEnterEnd: T1, onLeaveEnd: T1, motionDeadline: 500 }; ia("bottomLeft", "bottomRight", "topLeft", "topRight"); var RD = function (t) { return t !== void 0 && (t === "topLeft" || t === "topRight") ? "slide-down" : "slide-up" }, al = function (t, n, r) { return r !== void 0 ? r : "".concat(t, "-").concat(n) }; const qp = PW; ia("warning", "error", ""); function Ha(e, t, n) { var r; return Xe((r = {}, re(r, "".concat(e, "-status-success"), t === "success"), re(r, "".concat(e, "-status-warning"), t === "warning"), re(r, "".concat(e, "-status-error"), t === "error"), re(r, "".concat(e, "-status-validating"), t === "validating"), re(r, "".concat(e, "-has-feedback"), n), r)) } var Sf = function (t, n) { return n || t }, TW = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, name: "check", theme: "outlined" }; const kW = TW; var MD = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: kW }) }) }; MD.displayName = "CheckOutlined"; const AD = C.exports.forwardRef(MD); var IW = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" }; const RW = IW; var ND = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: RW }) }) }; ND.displayName = "DownOutlined"; const N2 = C.exports.forwardRef(ND); var MW = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, name: "search", theme: "outlined" }; const OD = MW; var DD = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: OD }) }) }; DD.displayName = "SearchOutlined"; const O2 = C.exports.forwardRef(DD); function LD(e) { var t = e.suffixIcon, n = e.clearIcon, r = e.menuItemSelectedIcon, i = e.removeIcon, s = e.loading, c = e.multiple, o = e.hasFeedback, f = e.prefixCls, p = e.showArrow, v = e.feedbackIcon, y = n != null ? n : I(wf, {}), w = function (M) { return Qe(An, { children: [p !== !1 && M, o && v] }) }, P = null; if (t !== void 0) P = w(t); else if (s) P = w(I(of, { spin: !0 })); else { var k = "".concat(f, "-suffix"); P = function (M) { var O = M.open, z = M.showSearch; return w(O && z ? I(O2, { className: k }) : I(N2, { className: k })) } } var A = null; r !== void 0 ? A = r : c ? A = I(AD, {}) : A = null; var N = null; return i !== void 0 ? N = i : N = I(H0, {}), { clearIcon: y, suffixIcon: P, itemIcon: A, removeIcon: N } } var zD = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, Z0 = C.exports.createContext(null), Mc = function (t, n) { var r = C.exports.useContext(Z0), i = C.exports.useMemo(function () { var s; if (!r) return ""; var c = r.compactDirection, o = r.isFirstItem, f = r.isLastItem, p = c === "vertical" ? "-vertical-" : "-"; return Xe((s = {}, re(s, "".concat(t, "-compact").concat(p, "item"), !0), re(s, "".concat(t, "-compact").concat(p, "first-item"), o), re(s, "".concat(t, "-compact").concat(p, "last-item"), f), re(s, "".concat(t, "-compact").concat(p, "item-rtl"), n === "rtl"), s)) }, [t, n, r]); return { compactSize: r == null ? void 0 : r.compactSize, compactDirection: r == null ? void 0 : r.compactDirection, compactItemClassnames: i } }, lf = function (t) { var n = t.children; return I(Z0.Provider, { value: null, children: n }) }, AW = function (t) { var n = t.children, r = zD(t, ["children"]); return I(Z0.Provider, { value: r, children: n }) }, NW = function (t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = t.size, o = c === void 0 ? "middle" : c, f = t.direction, p = t.block, v = t.prefixCls, y = t.className, w = t.children, P = zD(t, ["size", "direction", "block", "prefixCls", "className", "children"]), k = i("space-compact", v), A = Xe(k, (n = {}, re(n, "".concat(k, "-rtl"), s === "rtl"), re(n, "".concat(k, "-block"), p), re(n, "".concat(k, "-vertical"), f === "vertical"), n), y), N = C.exports.useContext(Z0), R = Zi(w), M = C.exports.useMemo(function () { return R.map(function (O, z) { var B = O && O.key || "".concat(k, "-item-").concat(z); return I(AW, { compactSize: o, compactDirection: f, isFirstItem: z === 0 && (!N || (N == null ? void 0 : N.isFirstItem)), isLastItem: z === R.length - 1 && (!N || (N == null ? void 0 : N.isLastItem)), children: O }, B) }) }, [o, R, N]); return R.length === 0 ? null : I("div", { className: A, ...P, children: M }) }; const OW = NW; var DW = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, FD = "SECRET_COMBOBOX_MODE_DO_NOT_USE", LW = function (t, n) { var r, i = t.prefixCls, s = t.bordered, c = s === void 0 ? !0 : s, o = t.className, f = t.getPopupContainer, p = t.dropdownClassName, v = t.popupClassName, y = t.listHeight, w = y === void 0 ? 256 : y, P = t.placement, k = t.listItemHeight, A = k === void 0 ? 24 : k, N = t.size, R = t.disabled, M = t.notFoundContent, O = t.status, z = t.showArrow, B = DW(t, ["prefixCls", "bordered", "className", "getPopupContainer", "dropdownClassName", "popupClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "showArrow"]), V = C.exports.useContext(zn), G = V.getPopupContainer, j = V.getPrefixCls, X = V.renderEmpty, Y = V.direction, se = V.virtual, ee = V.dropdownMatchSelectWidth, Z = C.exports.useContext(qa), J = j("select", i), ve = j(), ie = Mc(J, Y), ce = ie.compactSize, oe = ie.compactItemClassnames, ye = C.exports.useMemo(function () { var ct = B.mode; if (ct !== "combobox") return ct === FD ? "combobox" : ct }, [B.mode]), Ie = ye === "multiple" || ye === "tags", Te = z !== void 0 ? z : B.loading || !(Ie || ye === "combobox"), Pe = C.exports.useContext(Fo), De = Pe.status, Re = Pe.hasFeedback, ke = Pe.isFormItemInput, Oe = Pe.feedbackIcon, $e = Sf(De, O), He; M !== void 0 ? He = M : ye === "combobox" ? He = null : He = (X || M2)("Select"); var Ue = LD(tt(tt({}, B), { multiple: Ie, hasFeedback: Re, feedbackIcon: Oe, showArrow: Te, prefixCls: J })), st = Ue.suffixIcon, ft = Ue.itemIcon, It = Ue.removeIcon, We = Ue.clearIcon, Pt = vi(B, ["suffixIcon", "itemIcon"]), pt = Xe(v || p, re({}, "".concat(J, "-dropdown-").concat(Y), Y === "rtl")), Rt = ce || N || Z, yt = C.exports.useContext(dl), Mt = R != null ? R : yt, ut = Xe((r = {}, re(r, "".concat(J, "-lg"), Rt === "large"), re(r, "".concat(J, "-sm"), Rt === "small"), re(r, "".concat(J, "-rtl"), Y === "rtl"), re(r, "".concat(J, "-borderless"), !c), re(r, "".concat(J, "-in-form-item"), ke), r), Ha(J, $e, Re), oe, o), dt = function () { return P !== void 0 ? P : Y === "rtl" ? "bottomRight" : "bottomLeft" }; return I(I2, { ref: n, virtual: se, dropdownMatchSelectWidth: ee, ...Pt, transitionName: al(ve, RD(P), B.transitionName), listHeight: w, listItemHeight: A, mode: ye, prefixCls: J, placement: dt(), direction: Y, inputIcon: st, menuItemSelectedIcon: ft, removeIcon: It, clearIcon: We, notFoundContent: He, className: ut, getPopupContainer: f || G, dropdownClassName: pt, showArrow: Re || z, disabled: Mt }) }, X0 = C.exports.forwardRef(LW); X0.SECRET_COMBOBOX_MODE_DO_NOT_USE = FD; X0.Option = T2; X0.OptGroup = P2; const sl = X0; var Gw = sl.Option; function Vk(e) { return e && e.type && (e.type.isSelectOption || e.type.isSelectOptGroup) } var zW = function (t, n) { var r = t.prefixCls, i = t.className, s = t.popupClassName, c = t.dropdownClassName, o = t.children, f = t.dataSource, p = Zi(o), v; if (p.length === 1 && zo(p[0]) && !Vk(p[0])) { var y = ze(p, 1); v = y[0] } var w = v ? function () { return v } : void 0, P; return p.length && Vk(p[0]) ? P = o : P = f ? f.map(function (k) { if (zo(k)) return k; switch (ln(k)) { case "string": return I(Gw, { value: k, children: k }, k); case "object": { var A = k.value; return I(Gw, { value: A, children: k.text }, A) } default: return } }) : [], I(yu, { children: function (k) { var A = k.getPrefixCls, N = A("select", r); return I(sl, { ref: n, ...vi(t, ["dataSource"]), prefixCls: N, popupClassName: s || c, className: Xe("".concat(N, "-auto-complete"), i), mode: sl.SECRET_COMBOBOX_MODE_DO_NOT_USE, getInputElement: w, children: P }) } }) }, $D = C.exports.forwardRef(zW); $D.Option = Gw; const FW = $D; function BD() { var e = C.exports.useReducer(function (r) { return r + 1 }, 0), t = ze(e, 2), n = t[1]; return n } var $y = ["xxl", "xl", "lg", "md", "sm", "xs"], mg = { xs: "(max-width: 575px)", sm: "(min-width: 576px)", md: "(min-width: 768px)", lg: "(min-width: 992px)", xl: "(min-width: 1200px)", xxl: "(min-width: 1600px)" }, Gu = new Map, k1 = -1, vg = {}, $W = { matchHandlers: {}, dispatch: function (t) { return vg = t, Gu.forEach(function (n) { return n(vg) }), Gu.size >= 1 }, subscribe: function (t) { return Gu.size || this.register(), k1 += 1, Gu.set(k1, t), t(vg), k1 }, unsubscribe: function (t) { Gu.delete(t), Gu.size || this.unregister() }, unregister: function () { var t = this; Object.keys(mg).forEach(function (n) { var r = mg[n], i = t.matchHandlers[r]; i == null || i.mql.removeListener(i == null ? void 0 : i.listener) }), Gu.clear() }, register: function () { var t = this; Object.keys(mg).forEach(function (n) { var r = mg[n], i = function (o) { var f = o.matches; t.dispatch(tt(tt({}, vg), re({}, n, f))) }, s = window.matchMedia(r); s.addListener(i), t.matchHandlers[r] = { mql: s, listener: i }, i(s) }) } }; const By = $W; function VD() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, t = C.exports.useRef({}), n = BD(); return C.exports.useEffect(function () { var r = By.subscribe(function (i) { t.current = i, e && n() }); return function () { return By.unsubscribe(r) } }, []), t.current } var fa = { adjustX: 1, adjustY: 1 }, ha = [0, 0], UD = { left: { points: ["cr", "cl"], overflow: fa, offset: [-4, 0], targetOffset: ha }, right: { points: ["cl", "cr"], overflow: fa, offset: [4, 0], targetOffset: ha }, top: { points: ["bc", "tc"], overflow: fa, offset: [0, -4], targetOffset: ha }, bottom: { points: ["tc", "bc"], overflow: fa, offset: [0, 4], targetOffset: ha }, topLeft: { points: ["bl", "tl"], overflow: fa, offset: [0, -4], targetOffset: ha }, leftTop: { points: ["tr", "tl"], overflow: fa, offset: [-4, 0], targetOffset: ha }, topRight: { points: ["br", "tr"], overflow: fa, offset: [0, -4], targetOffset: ha }, rightTop: { points: ["tl", "tr"], overflow: fa, offset: [4, 0], targetOffset: ha }, bottomRight: { points: ["tr", "br"], overflow: fa, offset: [0, 4], targetOffset: ha }, rightBottom: { points: ["bl", "br"], overflow: fa, offset: [4, 0], targetOffset: ha }, bottomLeft: { points: ["tl", "bl"], overflow: fa, offset: [0, 4], targetOffset: ha }, leftBottom: { points: ["br", "bl"], overflow: fa, offset: [-4, 0], targetOffset: ha } }; function BW(e) { var t = e.showArrow, n = e.arrowContent, r = e.children, i = e.prefixCls, s = e.id, c = e.overlayInnerStyle, o = e.className, f = e.style; return Qe("div", { className: Xe("".concat(i, "-content"), o), style: f, children: [t !== !1 && I("div", { className: "".concat(i, "-arrow"), children: n }, "arrow"), I("div", { className: "".concat(i, "-inner"), id: s, role: "tooltip", style: c, children: typeof r == "function" ? r() : r })] }) } var VW = function (t, n) { var r = t.overlayClassName, i = t.trigger, s = i === void 0 ? ["hover"] : i, c = t.mouseEnterDelay, o = c === void 0 ? 0 : c, f = t.mouseLeaveDelay, p = f === void 0 ? .1 : f, v = t.overlayStyle, y = t.prefixCls, w = y === void 0 ? "rc-tooltip" : y, P = t.children, k = t.onVisibleChange, A = t.afterVisibleChange, N = t.transitionName, R = t.animation, M = t.motion, O = t.placement, z = O === void 0 ? "right" : O, B = t.align, V = B === void 0 ? {} : B, G = t.destroyTooltipOnHide, j = G === void 0 ? !1 : G, X = t.defaultVisible, Y = t.getTooltipContainer, se = t.overlayInnerStyle, ee = t.arrowContent, Z = t.overlay, J = t.id, ve = t.showArrow, ie = Rn(t, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"]), ce = C.exports.useRef(null); C.exports.useImperativeHandle(n, function () { return ce.current }); var oe = ge({}, ie); "visible" in t && (oe.popupVisible = t.visible); var ye = function () { return I(BW, { showArrow: ve, arrowContent: ee, prefixCls: w, id: J, overlayInnerStyle: se, children: Z }, "content") }, Ie = !1, Te = !1; if (typeof j == "boolean") Ie = j; else if (j && ln(j) === "object") { var Pe = j.keepParent; Ie = Pe === !0, Te = Pe === !1 } return I(q0, { popupClassName: r, prefixCls: w, popup: ye, action: s, builtinPlacements: UD, popupPlacement: z, ref: ce, popupAlign: V, getPopupContainer: Y, onPopupVisibleChange: k, afterPopupVisibleChange: A, popupTransitionName: N, popupAnimation: R, popupMotion: M, defaultPopupVisible: X, destroyPopupOnHide: Ie, autoDestroy: Te, mouseLeaveDelay: p, popupStyle: v, mouseEnterDelay: o, ...oe, children: P }) }; const UW = C.exports.forwardRef(VW); ia("success", "processing", "error", "default", "warning"); var jW = ia("pink", "red", "yellow", "orange", "cyan", "green", "blue", "purple", "geekblue", "magenta", "volcano", "gold", "lime"), KW = { adjustX: 1, adjustY: 1 }, Uk = { adjustX: 0, adjustY: 0 }, HW = [0, 0]; function jk(e) { return typeof e == "boolean" ? e ? KW : Uk : tt(tt({}, Uk), e) } function jD(e) { var t = e.arrowWidth, n = t === void 0 ? 4 : t, r = e.horizontalArrowShift, i = r === void 0 ? 16 : r, s = e.verticalArrowShift, c = s === void 0 ? 8 : s, o = e.autoAdjustOverflow, f = e.arrowPointAtCenter, p = { left: { points: ["cr", "cl"], offset: [-4, 0] }, right: { points: ["cl", "cr"], offset: [4, 0] }, top: { points: ["bc", "tc"], offset: [0, -4] }, bottom: { points: ["tc", "bc"], offset: [0, 4] }, topLeft: { points: ["bl", "tc"], offset: [-(i + n), -4] }, leftTop: { points: ["tr", "cl"], offset: [-4, -(c + n)] }, topRight: { points: ["br", "tc"], offset: [i + n, -4] }, rightTop: { points: ["tl", "cr"], offset: [4, -(c + n)] }, bottomRight: { points: ["tr", "bc"], offset: [i + n, 4] }, rightBottom: { points: ["bl", "cr"], offset: [4, c + n] }, bottomLeft: { points: ["tl", "bc"], offset: [-(i + n), 4] }, leftBottom: { points: ["br", "cl"], offset: [-4, c + n] } }; return Object.keys(p).forEach(function (v) { p[v] = f ? tt(tt({}, p[v]), { overflow: jk(o), targetOffset: HW }) : tt(tt({}, UD[v]), { overflow: jk(o) }), p[v].ignoreShake = !0 }), p } var WW = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, GW = function (t, n) { var r = {}, i = tt({}, t); return n.forEach(function (s) { t && s in t && (r[s] = t[s], delete i[s]) }), { picked: r, omitted: i } }, Kk = new RegExp("^(".concat(jW.join("|"), ")(-inverse)?$")); function qW(e, t) { var n = e.type; if ((n.__ANT_BUTTON === !0 || e.type === "button") && e.props.disabled || n.__ANT_SWITCH === !0 && (e.props.disabled || e.props.loading) || n.__ANT_RADIO === !0 && e.props.disabled) { var r = GW(e.props.style, ["position", "left", "right", "top", "bottom", "float", "display", "zIndex"]), i = r.picked, s = r.omitted, c = tt(tt({ display: "inline-block" }, i), { cursor: "not-allowed", width: e.props.block ? "100%" : void 0 }), o = tt(tt({}, s), { pointerEvents: "none" }), f = li(e, { style: o, className: null }); return I("span", { style: c, className: Xe(e.props.className, "".concat(t, "-disabled-compatible-wrapper")), children: f }) } return e } var ZW = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(zn), i = r.getPopupContainer, s = r.getPrefixCls, c = r.direction, o = Bi(!1, { value: e.open !== void 0 ? e.open : e.visible, defaultValue: e.defaultOpen !== void 0 ? e.defaultOpen : e.defaultVisible }), f = ze(o, 2), p = f[0], v = f[1], y = function () { var ke = e.title, Oe = e.overlay; return !ke && !Oe && ke !== 0 }, w = function (ke) { var Oe, $e; v(y() ? !1 : ke), y() || ((Oe = e.onOpenChange) === null || Oe === void 0 || Oe.call(e, ke), ($e = e.onVisibleChange) === null || $e === void 0 || $e.call(e, ke)) }, P = function () { var ke = e.builtinPlacements, Oe = e.arrowPointAtCenter, $e = Oe === void 0 ? !1 : Oe, He = e.autoAdjustOverflow, Ue = He === void 0 ? !0 : He; return ke || jD({ arrowPointAtCenter: $e, autoAdjustOverflow: Ue }) }, k = function (ke, Oe) { var $e = P(), He = Object.keys($e).find(function (ft) { var It, We; return $e[ft].points[0] === ((It = Oe.points) === null || It === void 0 ? void 0 : It[0]) && $e[ft].points[1] === ((We = Oe.points) === null || We === void 0 ? void 0 : We[1]) }); if (!!He) { var Ue = ke.getBoundingClientRect(), st = { top: "50%", left: "50%" }; /top|Bottom/.test(He) ? st.top = "".concat(Ue.height - Oe.offset[1], "px") : /Top|bottom/.test(He) && (st.top = "".concat(-Oe.offset[1], "px")), /left|Right/.test(He) ? st.left = "".concat(Ue.width - Oe.offset[0], "px") : /right|Left/.test(He) && (st.left = "".concat(-Oe.offset[0], "px")), ke.style.transformOrigin = "".concat(st.left, " ").concat(st.top) } }, A = function () { var ke = e.title, Oe = e.overlay; return ke === 0 ? ke : Oe || ke || "" }, N = e.getPopupContainer, R = e.placement, M = R === void 0 ? "top" : R, O = e.mouseEnterDelay, z = O === void 0 ? .1 : O, B = e.mouseLeaveDelay, V = B === void 0 ? .1 : B, G = WW(e, ["getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay"]), j = e.prefixCls, X = e.openClassName, Y = e.getTooltipContainer, se = e.overlayClassName, ee = e.color, Z = e.overlayInnerStyle, J = e.children, ve = s("tooltip", j), ie = s(), ce = p; !("open" in e) && !("visible" in e) && y() && (ce = !1); var oe = qW(zo(J) && !GO(J) ? J : I("span", { children: J }), ve), ye = oe.props, Ie = !ye.className || typeof ye.className == "string" ? Xe(ye.className, re({}, X || "".concat(ve, "-open"), !0)) : ye.className, Te = Xe(se, (n = {}, re(n, "".concat(ve, "-rtl"), c === "rtl"), re(n, "".concat(ve, "-").concat(ee), ee && Kk.test(ee)), n)), Pe = Z, De = {}; return ee && !Kk.test(ee) && (Pe = tt(tt({}, Z), { background: ee }), De = { "--antd-arrow-background-color": ee }), I(UW, { ...G, placement: M, mouseEnterDelay: z, mouseLeaveDelay: V, prefixCls: ve, overlayClassName: Te, getTooltipContainer: N || Y || i, ref: t, builtinPlacements: P(), overlay: A(), visible: ce, onVisibleChange: w, onPopupAlign: k, overlayInnerStyle: Pe, arrowContent: I("span", { className: "".concat(ve, "-arrow-content"), style: De }), motion: { motionName: al(ie, "zoom-big-fast", e.transitionName), motionDeadline: 1e3 }, children: ce ? li(oe, { className: Ie }) : oe }) }); const io = ZW; var Hk = function (t) { return t ? typeof t == "function" ? t() : t : null }, XW = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, YW = function (t) { var n = t.title, r = t.content, i = t.prefixCls; return !n && !r ? null : Qe(An, { children: [n && I("div", { className: "".concat(i, "-title"), children: Hk(n) }), I("div", { className: "".concat(i, "-inner-content"), children: Hk(r) })] }) }, QW = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.title, i = e.content, s = e._overlay, c = e.placement, o = c === void 0 ? "top" : c, f = e.trigger, p = f === void 0 ? "hover" : f, v = e.mouseEnterDelay, y = v === void 0 ? .1 : v, w = e.mouseLeaveDelay, P = w === void 0 ? .1 : w, k = e.overlayStyle, A = k === void 0 ? {} : k, N = XW(e, ["prefixCls", "title", "content", "_overlay", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]), R = C.exports.useContext(zn), M = R.getPrefixCls, O = M("popover", n), z = M(); return I(io, { placement: o, trigger: p, mouseEnterDelay: y, mouseLeaveDelay: P, overlayStyle: A, ...N, prefixCls: O, ref: t, overlay: s || I(YW, { prefixCls: O, title: r, content: i }), transitionName: al(z, "zoom-big", N.transitionName) }) }); const Y0 = QW; var JW = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "ellipsis", theme: "outlined" }; const eG = JW; var KD = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: eG }) }) }; KD.displayName = "EllipsisOutlined"; const HD = C.exports.forwardRef(KD); var WD = C.exports.createContext(null); function D2(e, t) { return e === void 0 ? null : "".concat(e, "-").concat(t) } function GD(e) { var t = C.exports.useContext(WD); return D2(t, e) } var tG = ["children", "locked"], Ga = C.exports.createContext(null); function nG(e, t) { var n = ge({}, e); return Object.keys(t).forEach(function (r) { var i = t[r]; i !== void 0 && (n[r] = i) }), n } function Zp(e) { var t = e.children, n = e.locked, r = Rn(e, tG), i = C.exports.useContext(Ga), s = cm(function () { return nG(i, r) }, [i, r], function (c, o) { return !n && (c[0] !== o[0] || !S2(c[1], o[1], !0)) }); return I(Ga.Provider, { value: s, children: t }) } var rG = [], qD = C.exports.createContext(null); function Q0() { return C.exports.useContext(qD) } var ZD = C.exports.createContext(rG); function Ef(e) { var t = C.exports.useContext(ZD); return C.exports.useMemo(function () { return e !== void 0 ? [].concat(Et(t), [e]) : t }, [t, e]) } var XD = C.exports.createContext(null), L2 = C.exports.createContext({}); function Wk(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; if (E2(e)) { var n = e.nodeName.toLowerCase(), r = ["input", "select", "textarea", "button"].includes(n) || e.isContentEditable || n === "a" && !!e.getAttribute("href"), i = e.getAttribute("tabindex"), s = Number(i), c = null; return i && !Number.isNaN(s) ? c = s : r && c === null && (c = 0), r && e.disabled && (c = null), c !== null && (c >= 0 || t && c < 0) } return !1 } function YD(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = Et(e.querySelectorAll("*")).filter(function (r) { return Wk(r, t) }); return Wk(e, t) && n.unshift(e), n } var qw = St.LEFT, Zw = St.RIGHT, Xw = St.UP, Kg = St.DOWN, Hg = St.ENTER, QD = St.ESC, $h = St.HOME, Bh = St.END, Gk = [Xw, Kg, qw, Zw]; function iG(e, t, n, r) { var i, s, c, o, f = "prev", p = "next", v = "children", y = "parent"; if (e === "inline" && r === Hg) return { inlineTrigger: !0 }; var w = (i = {}, re(i, Xw, f), re(i, Kg, p), i), P = (s = {}, re(s, qw, n ? p : f), re(s, Zw, n ? f : p), re(s, Kg, v), re(s, Hg, v), s), k = (c = {}, re(c, Xw, f), re(c, Kg, p), re(c, Hg, v), re(c, QD, y), re(c, qw, n ? v : y), re(c, Zw, n ? y : v), c), A = { inline: w, horizontal: P, vertical: k, inlineSub: w, horizontalSub: k, verticalSub: k }, N = (o = A["".concat(e).concat(t ? "" : "Sub")]) === null || o === void 0 ? void 0 : o[r]; switch (N) { case f: return { offset: -1, sibling: !0 }; case p: return { offset: 1, sibling: !0 }; case y: return { offset: -1, sibling: !1 }; case v: return { offset: 1, sibling: !1 }; default: return null } } function oG(e) { for (var t = e; t;) { if (t.getAttribute("data-menu-list")) return t; t = t.parentElement } return null } function aG(e, t) { for (var n = e || document.activeElement; n;) { if (t.has(n)) return n; n = n.parentElement } return null } function JD(e, t) { var n = YD(e, !0); return n.filter(function (r) { return t.has(r) }) } function qk(e, t, n) { var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1; if (!e) return null; var i = JD(e, t), s = i.length, c = i.findIndex(function (o) { return n === o }); return r < 0 ? c === -1 ? c = s - 1 : c -= 1 : r > 0 && (c += 1), c = (c + s) % s, i[c] } function sG(e, t, n, r, i, s, c, o, f, p) { var v = C.exports.useRef(), y = C.exports.useRef(); y.current = t; var w = function () { nr.cancel(v.current) }; return C.exports.useEffect(function () { return function () { w() } }, []), function (P) { var k = P.which; if ([].concat(Gk, [Hg, QD, $h, Bh]).includes(k)) { var A, N, R, M = function () { A = new Set, N = new Map, R = new Map; var ve = s(); return ve.forEach(function (ie) { var ce = document.querySelector("[data-menu-id='".concat(D2(r, ie), "']")); ce && (A.add(ce), R.set(ce, ie), N.set(ie, ce)) }), A }; M(); var O = N.get(t), z = aG(O, A), B = R.get(z), V = iG(e, c(B, !0).length === 1, n, k); if (!V && k !== $h && k !== Bh) return; (Gk.includes(k) || [$h, Bh].includes(k)) && P.preventDefault(); var G = function (ve) { if (ve) { var ie = ve, ce = ve.querySelector("a"); ce != null && ce.getAttribute("href") && (ie = ce); var oe = R.get(ve); o(oe), w(), v.current = nr(function () { y.current === oe && ie.focus() }) } }; if ([$h, Bh].includes(k) || V.sibling || !z) { var j; !z || e === "inline" ? j = i.current : j = oG(z); var X, Y = JD(j, A); k === $h ? X = Y[0] : k === Bh ? X = Y[Y.length - 1] : X = qk(j, A, z, V.offset), G(X) } else if (V.inlineTrigger) f(B); else if (V.offset > 0) f(B, !0), w(), v.current = nr(function () { M(); var J = z.getAttribute("aria-controls"), ve = document.getElementById(J), ie = qk(ve, A); G(ie) }, 5); else if (V.offset < 0) { var se = c(B, !0), ee = se[se.length - 2], Z = N.get(ee); f(ee, !1), G(Z) } } p == null || p(P) } } function lG(e) { Promise.resolve().then(e) } var z2 = "__RC_UTIL_PATH_SPLIT__", Zk = function (t) { return t.join(z2) }, uG = function (t) { return t.split(z2) }, Yw = "rc-menu-more"; function cG() { var e = C.exports.useState({}), t = ze(e, 2), n = t[1], r = C.exports.useRef(new Map), i = C.exports.useRef(new Map), s = C.exports.useState([]), c = ze(s, 2), o = c[0], f = c[1], p = C.exports.useRef(0), v = C.exports.useRef(!1), y = function () { v.current || n({}) }, w = C.exports.useCallback(function (O, z) { var B = Zk(z); i.current.set(B, O), r.current.set(O, B), p.current += 1; var V = p.current; lG(function () { V === p.current && y() }) }, []), P = C.exports.useCallback(function (O, z) { var B = Zk(z); i.current.delete(B), r.current.delete(O) }, []), k = C.exports.useCallback(function (O) { f(O) }, []), A = C.exports.useCallback(function (O, z) { var B = r.current.get(O) || "", V = uG(B); return z && o.includes(V[0]) && V.unshift(Yw), V }, [o]), N = C.exports.useCallback(function (O, z) { return O.some(function (B) { var V = A(B, !0); return V.includes(z) }) }, [A]), R = function () { var z = Et(r.current.keys()); return o.length && z.push(Yw), z }, M = C.exports.useCallback(function (O) { var z = "".concat(r.current.get(O)).concat(z2), B = new Set; return Et(i.current.keys()).forEach(function (V) { V.startsWith(z) && B.add(i.current.get(V)) }), B }, []); return C.exports.useEffect(function () { return function () { v.current = !0 } }, []), { registerPath: w, unregisterPath: P, refreshOverflowKeys: k, isSubPathKey: N, getKeyPath: A, getKeys: R, getSubPathKeys: M } } function bd(e) { var t = C.exports.useRef(e); t.current = e; var n = C.exports.useCallback(function () { for (var r, i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return (r = t.current) === null || r === void 0 ? void 0 : r.call.apply(r, [t].concat(s)) }, []); return e ? n : void 0 } var dG = Math.random().toFixed(5).toString().slice(2), Xk = 0; function fG(e) { var t = Bi(e, { value: e }), n = ze(t, 2), r = n[0], i = n[1]; return C.exports.useEffect(function () { Xk += 1; var s = "".concat(dG, "-").concat(Xk); i("rc-menu-uuid-".concat(s)) }, []), r } function eL(e, t, n, r) { var i = C.exports.useContext(Ga), s = i.activeKey, c = i.onActive, o = i.onInactive, f = { active: s === e }; return t || (f.onMouseEnter = function (p) { n == null || n({ key: e, domEvent: p }), c(e) }, f.onMouseLeave = function (p) { r == null || r({ key: e, domEvent: p }), o(e) }), f } var hG = ["item"]; function Vy(e) { var t = e.item, n = Rn(e, hG); return Object.defineProperty(n, "item", { get: function () { return Rr(!1, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future."), t } }), n } function tL(e) { var t = e.icon, n = e.props, r = e.children, i; return typeof t == "function" ? i = C.exports.createElement(t, ge({}, n)) : i = t, i || r || null } function nL(e) { var t = C.exports.useContext(Ga), n = t.mode, r = t.rtl, i = t.inlineIndent; if (n !== "inline") return null; var s = e; return r ? { paddingRight: s * i } : { paddingLeft: s * i } } var pG = ["title", "attribute", "elementRef"], mG = ["style", "className", "eventKey", "warnKey", "disabled", "itemIcon", "children", "role", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "onFocus"], vG = ["active"], gG = function (e) { ui(n, e); var t = ci(n); function n() { return zr(this, n), t.apply(this, arguments) } return Fr(n, [{ key: "render", value: function () { var i = this.props, s = i.title, c = i.attribute, o = i.elementRef, f = Rn(i, pG), p = vi(f, ["eventKey"]); return Rr(!c, "`attribute` of Menu.Item is deprecated. Please pass attribute directly."), I(vs.Item, { ...c, title: typeof s == "string" ? s : void 0, ...p, ref: o }) } }]), n }(C.exports.Component), yG = function (t) { var n, r = t.style, i = t.className, s = t.eventKey; t.warnKey; var c = t.disabled, o = t.itemIcon, f = t.children, p = t.role, v = t.onMouseEnter, y = t.onMouseLeave, w = t.onClick, P = t.onKeyDown, k = t.onFocus, A = Rn(t, mG), N = GD(s), R = C.exports.useContext(Ga), M = R.prefixCls, O = R.onItemClick, z = R.disabled, B = R.overflowDisabled, V = R.itemIcon, G = R.selectedKeys, j = R.onActive, X = C.exports.useContext(L2), Y = X._internalRenderMenuItem, se = "".concat(M, "-item"), ee = C.exports.useRef(), Z = C.exports.useRef(), J = z || c, ve = Ef(s), ie = function (Ue) { return { key: s, keyPath: Et(ve).reverse(), item: ee.current, domEvent: Ue } }, ce = o || V, oe = eL(s, J, v, y), ye = oe.active, Ie = Rn(oe, vG), Te = G.includes(s), Pe = nL(ve.length), De = function (Ue) { if (!J) { var st = ie(Ue); w == null || w(Vy(st)), O(st) } }, Re = function (Ue) { if (P == null || P(Ue), Ue.which === St.ENTER) { var st = ie(Ue); w == null || w(Vy(st)), O(st) } }, ke = function (Ue) { j(s), k == null || k(Ue) }, Oe = {}; t.role === "option" && (Oe["aria-selected"] = Te); var $e = Qe(gG, { ref: ee, elementRef: Z, role: p === null ? "none" : p || "menuitem", tabIndex: c ? null : -1, "data-menu-id": B && N ? null : N, ...A, ...Ie, ...Oe, component: "li", "aria-disabled": c, style: ge(ge({}, Pe), r), className: Xe(se, (n = {}, re(n, "".concat(se, "-active"), ye), re(n, "".concat(se, "-selected"), Te), re(n, "".concat(se, "-disabled"), J), n), i), onClick: De, onKeyDown: Re, onFocus: ke, children: [f, I(tL, { props: ge(ge({}, t), {}, { isSelected: Te }), icon: ce })] }); return Y && ($e = Y($e, t, { selected: Te })), $e }; function J0(e) { var t = e.eventKey, n = Q0(), r = Ef(t); return C.exports.useEffect(function () { if (n) return n.registerPath(t, r), function () { n.unregisterPath(t, r) } }, [r]), n ? null : I(yG, { ...e }) } var xG = ["className", "children"], _G = function (t, n) { var r = t.className, i = t.children, s = Rn(t, xG), c = C.exports.useContext(Ga), o = c.prefixCls, f = c.mode, p = c.rtl; return I("ul", { className: Xe(o, p && "".concat(o, "-rtl"), "".concat(o, "-sub"), "".concat(o, "-").concat(f === "inline" ? "inline" : "vertical"), r), role: "menu", ...s, "data-menu-list": !0, ref: n, children: i }) }, F2 = C.exports.forwardRef(_G); F2.displayName = "SubMenuList"; var bG = ["label", "children", "key", "type"]; function $2(e, t) { return Zi(e).map(function (n, r) { if (C.exports.isValidElement(n)) { var i, s, c = n.key, o = (i = (s = n.props) === null || s === void 0 ? void 0 : s.eventKey) !== null && i !== void 0 ? i : c, f = o == null; f && (o = "tmp_key-".concat([].concat(Et(t), [r]).join("-"))); var p = { key: o, eventKey: o }; return C.exports.cloneElement(n, p) } return n }) } function Qw(e) { return (e || []).map(function (t, n) { if (t && ln(t) === "object") { var r = t, i = r.label, s = r.children, c = r.key, o = r.type, f = Rn(r, bG), p = c != null ? c : "tmp-".concat(n); return s || o === "group" ? o === "group" ? I(tx, { ...f, title: i, children: Qw(s) }, p) : I(ex, { ...f, title: i, children: Qw(s) }, p) : o === "divider" ? I(B2, { ...f }, p) : I(J0, { ...f, children: i }, p) } return null }).filter(function (t) { return t }) } function wG(e, t, n) { var r = e; return t && (r = Qw(t)), $2(r, n) } var Yl = { adjustX: 1, adjustY: 1 }, CG = { topLeft: { points: ["bl", "tl"], overflow: Yl, offset: [0, -7] }, bottomLeft: { points: ["tl", "bl"], overflow: Yl, offset: [0, 7] }, leftTop: { points: ["tr", "tl"], overflow: Yl, offset: [-4, 0] }, rightTop: { points: ["tl", "tr"], overflow: Yl, offset: [4, 0] } }, SG = { topLeft: { points: ["bl", "tl"], overflow: Yl, offset: [0, -7] }, bottomLeft: { points: ["tl", "bl"], overflow: Yl, offset: [0, 7] }, rightTop: { points: ["tr", "tl"], overflow: Yl, offset: [-4, 0] }, leftTop: { points: ["tl", "tr"], overflow: Yl, offset: [4, 0] } }; function rL(e, t, n) { if (t) return t; if (n) return n[e] || n.other } var EG = { horizontal: "bottomLeft", vertical: "rightTop", "vertical-left": "rightTop", "vertical-right": "leftTop" }; function PG(e) { var t = e.prefixCls, n = e.visible, r = e.children, i = e.popup, s = e.popupClassName, c = e.popupOffset, o = e.disabled, f = e.mode, p = e.onVisibleChange, v = C.exports.useContext(Ga), y = v.getPopupContainer, w = v.rtl, P = v.subMenuOpenDelay, k = v.subMenuCloseDelay, A = v.builtinPlacements, N = v.triggerSubMenuAction, R = v.forceSubMenuRender, M = v.rootClassName, O = v.motion, z = v.defaultMotions, B = C.exports.useState(!1), V = ze(B, 2), G = V[0], j = V[1], X = ge(w ? ge({}, SG) : ge({}, CG), A), Y = EG[f], se = rL(f, O, z), ee = C.exports.useRef(se); f !== "inline" && (ee.current = se); var Z = ge(ge({}, ee.current), {}, { leavedClassName: "".concat(t, "-hidden"), removeOnLeave: !1, motionAppear: !0 }), J = C.exports.useRef(); return C.exports.useEffect(function () { return J.current = nr(function () { j(n) }), function () { nr.cancel(J.current) } }, [n]), I(q0, { prefixCls: t, popupClassName: Xe("".concat(t, "-popup"), re({}, "".concat(t, "-rtl"), w), s, M), stretch: f === "horizontal" ? "minWidth" : null, getPopupContainer: y, builtinPlacements: X, popupPlacement: Y, popupVisible: G, popup: i, popupAlign: c && { offset: c }, action: o ? [] : [N], mouseEnterDelay: P, mouseLeaveDelay: k, onPopupVisibleChange: p, forceRender: R, popupMotion: Z, children: r }) } function TG(e) { var t = e.id, n = e.open, r = e.keyPath, i = e.children, s = "inline", c = C.exports.useContext(Ga), o = c.prefixCls, f = c.forceSubMenuRender, p = c.motion, v = c.defaultMotions, y = c.mode, w = C.exports.useRef(!1); w.current = y === s; var P = C.exports.useState(!w.current), k = ze(P, 2), A = k[0], N = k[1], R = w.current ? n : !1; C.exports.useEffect(function () { w.current && N(!1) }, [y]); var M = ge({}, rL(s, p, v)); r.length > 1 && (M.motionAppear = !1); var O = M.onVisibleChanged; return M.onVisibleChanged = function (z) { return !w.current && !z && N(!0), O == null ? void 0 : O(z) }, A ? null : I(Zp, { mode: s, locked: !w.current, children: I(Sa, { visible: R, ...M, forceRender: f, removeOnLeave: !1, leavedClassName: "".concat(o, "-hidden"), children: function (z) { var B = z.className, V = z.style; return I(F2, { id: t, className: B, style: V, children: i }) } }) }) } var kG = ["style", "className", "title", "eventKey", "warnKey", "disabled", "internalPopupClose", "children", "itemIcon", "expandIcon", "popupClassName", "popupOffset", "onClick", "onMouseEnter", "onMouseLeave", "onTitleClick", "onTitleMouseEnter", "onTitleMouseLeave"], IG = ["active"], RG = function (t) { var n, r = t.style, i = t.className, s = t.title, c = t.eventKey; t.warnKey; var o = t.disabled, f = t.internalPopupClose, p = t.children, v = t.itemIcon, y = t.expandIcon, w = t.popupClassName, P = t.popupOffset, k = t.onClick, A = t.onMouseEnter, N = t.onMouseLeave, R = t.onTitleClick, M = t.onTitleMouseEnter, O = t.onTitleMouseLeave, z = Rn(t, kG), B = GD(c), V = C.exports.useContext(Ga), G = V.prefixCls, j = V.mode, X = V.openKeys, Y = V.disabled, se = V.overflowDisabled, ee = V.activeKey, Z = V.selectedKeys, J = V.itemIcon, ve = V.expandIcon, ie = V.onItemClick, ce = V.onOpenChange, oe = V.onActive, ye = C.exports.useContext(L2), Ie = ye._internalRenderSubMenuItem, Te = C.exports.useContext(XD), Pe = Te.isSubPathKey, De = Ef(), Re = "".concat(G, "-submenu"), ke = Y || o, Oe = C.exports.useRef(), $e = C.exports.useRef(), He = v || J, Ue = y || ve, st = X.includes(c), ft = !se && st, It = Pe(Z, c), We = eL(c, ke, M, O), Pt = We.active, pt = Rn(We, IG), Rt = C.exports.useState(!1), yt = ze(Rt, 2), Mt = yt[0], ut = yt[1], dt = function (Cn) { ke || ut(Cn) }, ct = function (Cn) { dt(!0), A == null || A({ key: c, domEvent: Cn }) }, rt = function (Cn) { dt(!1), N == null || N({ key: c, domEvent: Cn }) }, ht = C.exports.useMemo(function () { return Pt || (j !== "inline" ? Mt || Pe([ee], c) : !1) }, [j, Pt, ee, Mt, c, Pe]), bt = nL(De.length), Wt = function (Cn) { ke || (R == null || R({ key: c, domEvent: Cn }), j === "inline" && ce(c, !st)) }, Ut = bd(function (nn) { k == null || k(Vy(nn)), ie(nn) }), Jt = function (Cn) { j !== "inline" && ce(c, Cn) }, Fe = function () { oe(c) }, Ge = B && "".concat(B, "-popup"), Zt = Qe("div", { role: "menuitem", style: bt, className: "".concat(Re, "-title"), tabIndex: ke ? null : -1, ref: Oe, title: typeof s == "string" ? s : null, "data-menu-id": se && B ? null : B, "aria-expanded": ft, "aria-haspopup": !0, "aria-controls": Ge, "aria-disabled": ke, onClick: Wt, onFocus: Fe, ...pt, children: [s, I(tL, { icon: j !== "horizontal" ? Ue : null, props: ge(ge({}, t), {}, { isOpen: ft, isSubMenu: !0 }), children: I("i", { className: "".concat(Re, "-arrow") }) })] }), cn = C.exports.useRef(j); if (j !== "inline" && De.length > 1 ? cn.current = "vertical" : cn.current = j, !se) { var jt = cn.current; Zt = I(PG, { mode: jt, prefixCls: Re, visible: !f && ft && j !== "inline", popupClassName: w, popupOffset: P, popup: I(Zp, { mode: jt === "horizontal" ? "vertical" : jt, children: I(F2, { id: Ge, ref: $e, children: p }) }), disabled: ke, onVisibleChange: Jt, children: Zt }) } var Kt = Qe(vs.Item, { role: "none", ...z, component: "li", style: r, className: Xe(Re, "".concat(Re, "-").concat(j), i, (n = {}, re(n, "".concat(Re, "-open"), ft), re(n, "".concat(Re, "-active"), ht), re(n, "".concat(Re, "-selected"), It), re(n, "".concat(Re, "-disabled"), ke), n)), onMouseEnter: ct, onMouseLeave: rt, children: [Zt, !se && I(TG, { id: Ge, open: ft, keyPath: De, children: p })] }); return Ie && (Kt = Ie(Kt, t, { selected: It, active: ht, open: ft, disabled: ke })), I(Zp, { onItemClick: Ut, mode: j === "horizontal" ? "vertical" : j, itemIcon: He, expandIcon: Ue, children: Kt }) }; function ex(e) { var t = e.eventKey, n = e.children, r = Ef(t), i = $2(n, r), s = Q0(); C.exports.useEffect(function () { if (s) return s.registerPath(t, r), function () { s.unregisterPath(t, r) } }, [r]); var c; return s ? c = i : c = I(RG, { ...e, children: i }), I(ZD.Provider, { value: r, children: c }) } var MG = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem"], gd = [], AG = C.exports.forwardRef(function (e, t) { var n, r, i = e, s = i.prefixCls, c = s === void 0 ? "rc-menu" : s, o = i.rootClassName, f = i.style, p = i.className, v = i.tabIndex, y = v === void 0 ? 0 : v, w = i.items, P = i.children, k = i.direction, A = i.id, N = i.mode, R = N === void 0 ? "vertical" : N, M = i.inlineCollapsed, O = i.disabled, z = i.disabledOverflow, B = i.subMenuOpenDelay, V = B === void 0 ? .1 : B, G = i.subMenuCloseDelay, j = G === void 0 ? .1 : G, X = i.forceSubMenuRender, Y = i.defaultOpenKeys, se = i.openKeys, ee = i.activeKey, Z = i.defaultActiveFirst, J = i.selectable, ve = J === void 0 ? !0 : J, ie = i.multiple, ce = ie === void 0 ? !1 : ie, oe = i.defaultSelectedKeys, ye = i.selectedKeys, Ie = i.onSelect, Te = i.onDeselect, Pe = i.inlineIndent, De = Pe === void 0 ? 24 : Pe, Re = i.motion, ke = i.defaultMotions, Oe = i.triggerSubMenuAction, $e = Oe === void 0 ? "hover" : Oe, He = i.builtinPlacements, Ue = i.itemIcon, st = i.expandIcon, ft = i.overflowedIndicator, It = ft === void 0 ? "..." : ft, We = i.overflowedIndicatorPopupClassName, Pt = i.getPopupContainer, pt = i.onClick, Rt = i.onOpenChange, yt = i.onKeyDown; i.openAnimation, i.openTransitionName; var Mt = i._internalRenderMenuItem, ut = i._internalRenderSubMenuItem, dt = Rn(i, MG), ct = C.exports.useMemo(function () { return wG(P, w, gd) }, [P, w]), rt = C.exports.useState(!1), ht = ze(rt, 2), bt = ht[0], Wt = ht[1], Ut = C.exports.useRef(), Jt = fG(A), Fe = k === "rtl", Ge = Bi(Y, { value: se, postState: function ($n) { return $n || gd } }), Zt = ze(Ge, 2), cn = Zt[0], jt = Zt[1], Kt = function ($n) { var Jn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; function br() { jt($n), Rt == null || Rt($n) } Jn ? pu.exports.flushSync(br) : br() }, nn = C.exports.useState(cn), Cn = ze(nn, 2), Nn = Cn[0], wt = Cn[1], qt = C.exports.useRef(!1), At = C.exports.useMemo(function () { return (R === "inline" || R === "vertical") && M ? ["vertical", M] : [R, !1] }, [R, M]), Xt = ze(At, 2), en = Xt[0], gt = Xt[1], yn = en === "inline", Sn = C.exports.useState(en), dn = ze(Sn, 2), zt = dn[0], ot = dn[1], mt = C.exports.useState(gt), Dt = ze(mt, 2), Bt = Dt[0], pn = Dt[1]; C.exports.useEffect(function () { ot(en), pn(gt), qt.current && (yn ? jt(Nn) : Kt(gd)) }, [en, gt]); var On = C.exports.useState(0), Zn = ze(On, 2), Xn = Zn[0], me = Zn[1], H = Xn >= ct.length - 1 || zt !== "horizontal" || z; C.exports.useEffect(function () { yn && wt(cn) }, [cn]), C.exports.useEffect(function () { return qt.current = !0, function () { qt.current = !1 } }, []); var q = cG(), de = q.registerPath, le = q.unregisterPath, xe = q.refreshOverflowKeys, Ee = q.isSubPathKey, be = q.getKeyPath, Ce = q.getKeys, Le = q.getSubPathKeys, qe = C.exports.useMemo(function () { return { registerPath: de, unregisterPath: le } }, [de, le]), Ze = C.exports.useMemo(function () { return { isSubPathKey: Ee } }, [Ee]); C.exports.useEffect(function () { xe(H ? gd : ct.slice(Xn + 1).map(function (Kn) { return Kn.key })) }, [Xn, H]); var Ve = Bi(ee || Z && ((n = ct[0]) === null || n === void 0 ? void 0 : n.key), { value: ee }), Lt = ze(Ve, 2), Ct = Lt[0], Je = Lt[1], Ot = bd(function (Kn) { Je(Kn) }), Vt = bd(function () { Je(void 0) }); C.exports.useImperativeHandle(t, function () { return { list: Ut.current, focus: function ($n) { var Jn, br = Ct != null ? Ct : (Jn = ct.find(function (gl) { return !gl.props.disabled })) === null || Jn === void 0 ? void 0 : Jn.key; if (br) { var Cr, Br, so; (Cr = Ut.current) === null || Cr === void 0 || (Br = Cr.querySelector("li[data-menu-id='".concat(D2(Jt, br), "']"))) === null || Br === void 0 || (so = Br.focus) === null || so === void 0 || so.call(Br, $n) } } } }); var bn = Bi(oe || [], { value: ye, postState: function ($n) { return Array.isArray($n) ? $n : $n == null ? gd : [$n] } }), un = ze(bn, 2), wn = un[0], Vn = un[1], rr = function ($n) { if (ve) { var Jn = $n.key, br = wn.includes(Jn), Cr; ce ? br ? Cr = wn.filter(function (so) { return so !== Jn }) : Cr = [].concat(Et(wn), [Jn]) : Cr = [Jn], Vn(Cr); var Br = ge(ge({}, $n), {}, { selectedKeys: Cr }); br ? Te == null || Te(Br) : Ie == null || Ie(Br) } !ce && cn.length && zt !== "inline" && Kt(gd) }, $r = bd(function (Kn) { pt == null || pt(Vy(Kn)), rr(Kn) }), sr = bd(function (Kn, $n) { var Jn = cn.filter(function (Cr) { return Cr !== Kn }); if ($n) Jn.push(Kn); else if (zt !== "inline") { var br = Le(Kn); Jn = Jn.filter(function (Cr) { return !br.has(Cr) }) } S2(cn, Jn, !0) || Kt(Jn, !0) }), Mr = bd(Pt), Mn = function ($n, Jn) { var br = Jn != null ? Jn : !cn.includes($n); sr($n, br) }, kn = sG(zt, Ct, Fe, Jt, Ut, Ce, be, Je, Mn, yt); C.exports.useEffect(function () { Wt(!0) }, []); var Dn = C.exports.useMemo(function () { return { _internalRenderMenuItem: Mt, _internalRenderSubMenuItem: ut } }, [Mt, ut]), Gr = zt !== "horizontal" || z ? ct : ct.map(function (Kn, $n) { return I(Zp, { overflowDisabled: $n > Xn, children: Kn }, Kn.key) }), yr = I(vs, { id: A, ref: Ut, prefixCls: "".concat(c, "-overflow"), component: "ul", itemComponent: J0, className: Xe(c, "".concat(c, "-root"), "".concat(c, "-").concat(zt), p, (r = {}, re(r, "".concat(c, "-inline-collapsed"), Bt), re(r, "".concat(c, "-rtl"), Fe), r), o), dir: k, style: f, role: "menu", tabIndex: y, data: Gr, renderRawItem: function ($n) { return $n }, renderRawRest: function ($n) { var Jn = $n.length, br = Jn ? ct.slice(-Jn) : null; return I(ex, { eventKey: Yw, title: It, disabled: H, internalPopupClose: Jn === 0, popupClassName: We, children: br }) }, maxCount: zt !== "horizontal" || z ? vs.INVALIDATE : vs.RESPONSIVE, ssr: "full", "data-menu-list": !0, onVisibleChange: function ($n) { me($n) }, onKeyDown: kn, ...dt }); return I(L2.Provider, { value: Dn, children: I(WD.Provider, { value: Jt, children: Qe(Zp, { prefixCls: c, rootClassName: o, mode: zt, openKeys: cn, rtl: Fe, disabled: O, motion: bt ? Re : null, defaultMotions: bt ? ke : null, activeKey: Ct, onActive: Ot, onInactive: Vt, selectedKeys: wn, inlineIndent: De, subMenuOpenDelay: V, subMenuCloseDelay: j, forceSubMenuRender: X, builtinPlacements: He, triggerSubMenuAction: $e, getPopupContainer: Mr, itemIcon: Ue, expandIcon: st, onItemClick: $r, onOpenChange: sr, children: [I(XD.Provider, { value: Ze, children: yr }), I("div", { style: { display: "none" }, "aria-hidden": !0, children: I(qD.Provider, { value: qe, children: ct }) })] }) }) }) }), NG = ["className", "title", "eventKey", "children"], OG = ["children"], DG = function (t) { var n = t.className, r = t.title; t.eventKey; var i = t.children, s = Rn(t, NG), c = C.exports.useContext(Ga), o = c.prefixCls, f = "".concat(o, "-item-group"); return Qe("li", { role: "presentation", ...s, onClick: function (v) { return v.stopPropagation() }, className: Xe(f, n), children: [I("div", { role: "presentation", className: "".concat(f, "-title"), title: typeof r == "string" ? r : void 0, children: r }), I("ul", { role: "group", className: "".concat(f, "-list"), children: i })] }) }; function tx(e) { var t = e.children, n = Rn(e, OG), r = Ef(n.eventKey), i = $2(t, r), s = Q0(); return s ? i : I(DG, { ...vi(n, ["warnKey"]), children: i }) } function B2(e) { var t = e.className, n = e.style, r = C.exports.useContext(Ga), i = r.prefixCls, s = Q0(); return s ? null : I("li", { className: Xe("".concat(i, "-item-divider"), t), style: n }) } var vm = AG; vm.Item = J0; vm.SubMenu = ex; vm.ItemGroup = tx; vm.Divider = B2; var LG = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, name: "left", theme: "outlined" }; const zG = LG; var iL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: zG }) }) }; iL.displayName = "LeftOutlined"; const FG = C.exports.forwardRef(iL); var $G = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }; const BG = $G; var oL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: BG }) }) }; oL.displayName = "RightOutlined"; const V2 = C.exports.forwardRef(oL); globalThis && globalThis.__rest; var aL = C.exports.createContext({}), VG = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, UG = function (t) { var n = t.prefixCls, r = t.className, i = t.dashed, s = VG(t, ["prefixCls", "className", "dashed"]), c = C.exports.useContext(zn), o = c.getPrefixCls, f = o("menu", n), p = Xe(re({}, "".concat(f, "-item-divider-dashed"), !!i), r); return I(B2, { className: p, ...s }) }; const sL = UG; var jG = C.exports.createContext({ prefixCls: "", firstLevel: !0, inlineCollapsed: !1 }); const Uy = jG; var KG = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, U2 = function (e) { ui(n, e); var t = ci(n); function n() { var r; return zr(this, n), r = t.apply(this, arguments), r.renderItem = function (i) { var s, c = i.siderCollapsed, o, f = r.context, p = f.prefixCls, v = f.firstLevel, y = f.inlineCollapsed, w = f.direction, P = f.disableMenuItemTitleTooltip, k = r.props, A = k.className, N = k.children, R = r.props, M = R.title, O = R.icon, z = R.danger, B = KG(R, ["title", "icon", "danger"]), V = M; typeof M > "u" ? V = v ? N : "" : M === !1 && (V = ""); var G = { title: V }; !c && !y && (G.title = null, G.open = !1); var j = Zi(N).length, X = Qe(J0, { ...B, className: Xe((s = {}, re(s, "".concat(p, "-item-danger"), z), re(s, "".concat(p, "-item-only-child"), (O ? j + 1 : j) === 1), s), A), title: typeof M == "string" ? M : void 0, children: [li(O, { className: Xe(zo(O) ? (o = O.props) === null || o === void 0 ? void 0 : o.className : "", "".concat(p, "-item-icon")) }), r.renderItemChildren(y)] }); return P || (X = I(io, { ...G, placement: w === "rtl" ? "left" : "right", overlayClassName: "".concat(p, "-inline-collapsed-tooltip"), children: X })), X }, r } return Fr(n, [{ key: "renderItemChildren", value: function (i) { var s = this.context, c = s.prefixCls, o = s.firstLevel, f = this.props, p = f.icon, v = f.children, y = I("span", { className: "".concat(c, "-title-content"), children: v }); return (!p || zo(v) && v.type === "span") && v && i && o && typeof v == "string" ? I("div", { className: "".concat(c, "-inline-collapsed-noicon"), children: v.charAt(0) }) : y } }, { key: "render", value: function () { return I(aL.Consumer, { children: this.renderItem }) } }]), n }(C.exports.Component); U2.contextType = Uy; function lL(e) { var t, n = e.popupClassName, r = e.icon, i = e.title, s = e.theme, c = C.exports.useContext(Uy), o = c.prefixCls, f = c.inlineCollapsed, p = c.antdMenuTheme, v = Ef(), y; if (!r) y = f && !v.length && i && typeof i == "string" ? I("div", { className: "".concat(o, "-inline-collapsed-noicon"), children: i.charAt(0) }) : I("span", { className: "".concat(o, "-title-content"), children: i }); else { var w = zo(i) && i.type === "span"; y = Qe(An, { children: [li(r, { className: Xe(zo(r) ? (t = r.props) === null || t === void 0 ? void 0 : t.className : "", "".concat(o, "-item-icon")) }), w ? i : I("span", { className: "".concat(o, "-title-content"), children: i })] }) } var P = C.exports.useMemo(function () { return tt(tt({}, c), { firstLevel: !1 }) }, [c]); return I(Uy.Provider, { value: P, children: I(ex, { ...vi(e, ["icon"]), title: y, popupClassName: Xe(o, "".concat(o, "-").concat(s || p), n) }) }) } var HG = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function Jw(e) { return (e || []).map(function (t, n) { if (t && ln(t) === "object") { var r = t, i = r.label, s = r.children, c = r.key, o = r.type, f = HG(r, ["label", "children", "key", "type"]), p = c != null ? c : "tmp-".concat(n); return s || o === "group" ? o === "group" ? I(tx, { ...f, title: i, children: Jw(s) }, p) : I(lL, { ...f, title: i, children: Jw(s) }, p) : o === "divider" ? I(sL, { ...f }, p) : I(U2, { ...f, children: i }, p) } return null }).filter(function (t) { return t }) } function WG(e) { return C.exports.useMemo(function () { return e && Jw(e) }, [e]) } var GG = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, jy = C.exports.createContext(null), uL = function (t) { var n = t.children, r = GG(t, ["children"]), i = C.exports.useContext(jy), s = C.exports.useMemo(function () { return tt(tt({}, i), r) }, [i, r.prefixCls, r.mode, r.selectable]); return I(jy.Provider, { value: s, children: n }) }, qG = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, ZG = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(jy) || {}, i = C.exports.useContext(zn), s = i.getPrefixCls, c = i.getPopupContainer, o = i.direction, f = s(), p = e.prefixCls, v = e.className, y = e.theme, w = y === void 0 ? "light" : y, P = e.expandIcon, k = e._internalDisableMenuItemTitleTooltip, A = e.inlineCollapsed, N = e.siderCollapsed, R = e.items, M = e.children, O = e.mode, z = e.selectable, B = e.onClick, V = qG(e, ["prefixCls", "className", "theme", "expandIcon", "_internalDisableMenuItemTitleTooltip", "inlineCollapsed", "siderCollapsed", "items", "children", "mode", "selectable", "onClick"]), G = vi(V, ["collapsedWidth"]), j = WG(R) || M; (n = r.validator) === null || n === void 0 || n.call(r, { mode: O }); var X = Hp(function () { var oe; B == null || B.apply(void 0, arguments), (oe = r == null ? void 0 : r.onClick) === null || oe === void 0 || oe.call(r) }), Y = r.mode || O, se = z != null ? z : r.selectable, ee = C.exports.useMemo(function () { return N !== void 0 ? N : A }, [A, N]), Z = { horizontal: { motionName: "".concat(f, "-slide-up") }, inline: qp, other: { motionName: "".concat(f, "-zoom-big") } }, J = s("menu", p || r.prefixCls), ve = Xe("".concat(J, "-").concat(w), v), ie; typeof P == "function" ? ie = P : ie = li(P || r.expandIcon, { className: "".concat(J, "-submenu-expand-icon") }); var ce = C.exports.useMemo(function () { return { prefixCls: J, inlineCollapsed: ee || !1, antdMenuTheme: w, direction: o, firstLevel: !0, disableMenuItemTitleTooltip: k } }, [J, ee, w, o, k]); return I(jy.Provider, { value: null, children: I(Uy.Provider, { value: ce, children: I(vm, { getPopupContainer: c, overflowedIndicator: I(HD, {}), overflowedIndicatorPopupClassName: "".concat(J, "-").concat(w), mode: Y, selectable: se, onClick: X, ...G, inlineCollapsed: ee, className: ve, prefixCls: J, direction: o, defaultMotions: Z, expandIcon: ie, ref: t, children: j }) }) }) }), gm = function (e) { ui(n, e); var t = ci(n); function n() { var r; return zr(this, n), r = t.apply(this, arguments), r.focus = function (i) { var s; (s = r.menu) === null || s === void 0 || s.focus(i) }, r } return Fr(n, [{ key: "render", value: function () { var i = this; return I(aL.Consumer, { children: function (s) { return I(ZG, { ref: function (o) { i.menu = o }, ...i.props, ...s }) } }) } }]), n }(C.exports.Component); gm.Divider = sL; gm.Item = U2; gm.SubMenu = lL; gm.ItemGroup = tx; const cL = gm; var yd = { adjustX: 1, adjustY: 1 }, xd = [0, 0], XG = { topLeft: { points: ["bl", "tl"], overflow: yd, offset: [0, -4], targetOffset: xd }, topCenter: { points: ["bc", "tc"], overflow: yd, offset: [0, -4], targetOffset: xd }, topRight: { points: ["br", "tr"], overflow: yd, offset: [0, -4], targetOffset: xd }, bottomLeft: { points: ["tl", "bl"], overflow: yd, offset: [0, 4], targetOffset: xd }, bottomCenter: { points: ["tc", "bc"], overflow: yd, offset: [0, 4], targetOffset: xd }, bottomRight: { points: ["tr", "br"], overflow: yd, offset: [0, 4], targetOffset: xd } }, YG = St.ESC, QG = St.TAB; function JG(e) { var t = e.visible, n = e.setTriggerVisible, r = e.triggerRef, i = e.onVisibleChange, s = e.autoFocus, c = C.exports.useRef(!1), o = function () { if (t && r.current) { var y, w, P, k; (y = r.current) === null || y === void 0 || (w = y.triggerRef) === null || w === void 0 || (P = w.current) === null || P === void 0 || (k = P.focus) === null || k === void 0 || k.call(P), n(!1), typeof i == "function" && i(!1) } }, f = function () { var y, w, P, k, A = YD((y = r.current) === null || y === void 0 || (w = y.popupRef) === null || w === void 0 || (P = w.current) === null || P === void 0 || (k = P.getElement) === null || k === void 0 ? void 0 : k.call(P)), N = A[0]; return N != null && N.focus ? (N.focus(), c.current = !0, !0) : !1 }, p = function (y) { switch (y.keyCode) { case YG: o(); break; case QG: { var w = !1; c.current || (w = f()), w ? y.preventDefault() : o(); break } } }; C.exports.useEffect(function () { return t ? (window.addEventListener("keydown", p), s && nr(f, 3), function () { window.removeEventListener("keydown", p), c.current = !1 }) : function () { c.current = !1 } }, [t]) } var eq = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus"]; function tq(e, t) { var n = e.arrow, r = n === void 0 ? !1 : n, i = e.prefixCls, s = i === void 0 ? "rc-dropdown" : i, c = e.transitionName, o = e.animation, f = e.align, p = e.placement, v = p === void 0 ? "bottomLeft" : p, y = e.placements, w = y === void 0 ? XG : y, P = e.getPopupContainer, k = e.showAction, A = e.hideAction, N = e.overlayClassName, R = e.overlayStyle, M = e.visible, O = e.trigger, z = O === void 0 ? ["hover"] : O, B = e.autoFocus, V = Rn(e, eq), G = C.exports.useState(), j = ze(G, 2), X = j[0], Y = j[1], se = "visible" in e ? M : X, ee = C.exports.useRef(null); C.exports.useImperativeHandle(t, function () { return ee.current }), JG({ visible: se, setTriggerVisible: Y, triggerRef: ee, onVisibleChange: e.onVisibleChange, autoFocus: B }); var Z = function () { var De = e.overlay, Re; return typeof De == "function" ? Re = De() : Re = De, Re }, J = function (De) { var Re = e.onOverlayClick; Y(!1), Re && Re(De) }, ve = function (De) { var Re = e.onVisibleChange; Y(De), typeof Re == "function" && Re(De) }, ie = function () { var De = Z(); return Qe(An, { children: [r && I("div", { className: "".concat(s, "-arrow") }), De] }) }, ce = function () { var De = e.overlay; return typeof De == "function" ? ie : ie() }, oe = function () { var De = e.minOverlayWidthMatchTrigger, Re = e.alignPoint; return "minOverlayWidthMatchTrigger" in e ? De : !Re }, ye = function () { var De = e.openClassName; return De !== void 0 ? De : "".concat(s, "-open") }, Ie = function () { var De = e.children, Re = De.props ? De.props : {}, ke = Xe(Re.className, ye()); return se && De ? C.exports.cloneElement(De, { className: ke }) : De }, Te = A; return !Te && z.indexOf("contextMenu") !== -1 && (Te = ["click"]), I(q0, { ...ge(ge({ builtinPlacements: w }, V), {}, { prefixCls: s, ref: ee, popupClassName: Xe(N, re({}, "".concat(s, "-show-arrow"), r)), popupStyle: R, action: z, showAction: k, hideAction: Te || [], popupPlacement: v, popupAlign: f, popupTransitionName: c, popupAnimation: o, popupVisible: se, stretch: oe() ? "minWidth" : "", popup: ce(), onPopupVisibleChange: ve, onPopupClick: J, getPopupContainer: P }), children: Ie() }) } const nq = C.exports.forwardRef(tq); var rq = 0, Wd = {}; function Ky(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, n = rq++, r = t; function i() { r -= 1, r <= 0 ? (e(), delete Wd[n]) : Wd[n] = nr(i) } return Wd[n] = nr(i), n } Ky.cancel = function (t) { t !== void 0 && (nr.cancel(Wd[t]), delete Wd[t]) }; Ky.ids = Wd; var I1; function Yk(e) { return !e || e.offsetParent === null || e.hidden } function iq(e) { return e instanceof Document ? e.body : Array.from(e.childNodes).find(function (t) { return (t == null ? void 0 : t.nodeType) === Node.ELEMENT_NODE }) } function oq(e) { var t = (e || "").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/); return t && t[1] && t[2] && t[3] ? !(t[1] === t[2] && t[2] === t[3]) : !0 } var dL = function (e) {
|
|
|
ui(n, e); var t = ci(n); function n() {
|
|
|
var r; return zr(this, n), r = t.apply(this, arguments), r.containerRef = C.exports.createRef(), r.animationStart = !1, r.destroyed = !1, r.onClick = function (i, s) {
|
|
|
var c, o, f = r.props, p = f.insertExtraNode, v = f.disabled; if (!(v || !i || Yk(i) || i.className.includes("-leave"))) {
|
|
|
r.extraNode = document.createElement("div"); var y = Ln(r), w = y.extraNode, P = r.context.getPrefixCls; w.className = "".concat(P(""), "-click-animating-node"); var k = r.getAttributeName(); if (i.setAttribute(k, "true"), s && s !== "#fff" && s !== "#ffffff" && s !== "rgb(255, 255, 255)" && s !== "rgba(255, 255, 255, 1)" && oq(s) && !/rgba\((?:\d*, ){3}0\)/.test(s) && s !== "transparent") {
|
|
|
w.style.borderColor = s; var A = ((c = i.getRootNode) === null || c === void 0 ? void 0 : c.call(i)) || i.ownerDocument, N = (o = iq(A)) !== null && o !== void 0 ? o : A; I1 = hm(`
|
|
|
[`.concat(P(""), "-click-animating-without-extra-node='true']::after, .").concat(P(""), `-click-animating-node {
|
|
|
--antd-wave-shadow-color: `).concat(s, `;
|
|
|
}`), "antd-wave", { csp: r.csp, attachTo: N })
|
|
|
} p && i.appendChild(w), ["transition", "animation"].forEach(function (R) { i.addEventListener("".concat(R, "start"), r.onTransitionStart), i.addEventListener("".concat(R, "end"), r.onTransitionEnd) })
|
|
|
}
|
|
|
}, r.onTransitionStart = function (i) { if (!r.destroyed) { var s = r.containerRef.current; !i || i.target !== s || r.animationStart || r.resetEffect(s) } }, r.onTransitionEnd = function (i) { !i || i.animationName !== "fadeEffect" || r.resetEffect(i.target) }, r.bindAnimationEvent = function (i) { if (!(!i || !i.getAttribute || i.getAttribute("disabled") || i.className.includes("disabled"))) { var s = function (o) { if (!(o.target.tagName === "INPUT" || Yk(o.target))) { r.resetEffect(i); var f = getComputedStyle(i).getPropertyValue("border-top-color") || getComputedStyle(i).getPropertyValue("border-color") || getComputedStyle(i).getPropertyValue("background-color"); r.clickWaveTimeoutId = window.setTimeout(function () { return r.onClick(i, f) }, 0), Ky.cancel(r.animationStartId), r.animationStart = !0, r.animationStartId = Ky(function () { r.animationStart = !1 }, 10) } }; return i.addEventListener("click", s, !0), { cancel: function () { i.removeEventListener("click", s, !0) } } } }, r.renderWave = function (i) { var s = i.csp, c = r.props.children; if (r.csp = s, !C.exports.isValidElement(c)) return c; var o = r.containerRef; return Ic(c) && (o = Po(c.ref, r.containerRef)), li(c, { ref: o }) }, r
|
|
|
} return Fr(n, [{ key: "componentDidMount", value: function () { this.destroyed = !1; var i = this.containerRef.current; !i || i.nodeType !== 1 || (this.instance = this.bindAnimationEvent(i)) } }, { key: "componentWillUnmount", value: function () { this.instance && this.instance.cancel(), this.clickWaveTimeoutId && clearTimeout(this.clickWaveTimeoutId), this.destroyed = !0 } }, { key: "getAttributeName", value: function () { var i = this.context.getPrefixCls, s = this.props.insertExtraNode; return s ? "".concat(i(""), "-click-animating") : "".concat(i(""), "-click-animating-without-extra-node") } }, { key: "resetEffect", value: function (i) { var s = this; if (!(!i || i === this.extraNode || !(i instanceof Element))) { var c = this.props.insertExtraNode, o = this.getAttributeName(); i.setAttribute(o, "false"), I1 && (I1.innerHTML = ""), c && this.extraNode && i.contains(this.extraNode) && i.removeChild(this.extraNode), ["transition", "animation"].forEach(function (f) { i.removeEventListener("".concat(f, "start"), s.onTransitionStart), i.removeEventListener("".concat(f, "end"), s.onTransitionEnd) }) } } }, { key: "render", value: function () { return I(yu, { children: this.renderWave }) } }]), n
|
|
|
}(C.exports.Component); dL.contextType = zn; const aq = dL; var sq = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, fL = C.exports.createContext(void 0), lq = function (t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = t.prefixCls, o = t.size, f = t.className, p = sq(t, ["prefixCls", "size", "className"]), v = i("btn-group", c), y = ""; switch (o) { case "large": y = "lg"; break; case "small": y = "sm"; break }var w = Xe(v, (n = {}, re(n, "".concat(v, "-").concat(y), y), re(n, "".concat(v, "-rtl"), s === "rtl"), n), f); return I(fL.Provider, { value: o, children: I("div", { ...p, className: w }) }) }; const uq = lq; var R1 = function () { return { width: 0, opacity: 0, transform: "scale(0)" } }, M1 = function (t) { return { width: t.scrollWidth, opacity: 1, transform: "scale(1)" } }, cq = function (t) { var n = t.prefixCls, r = t.loading, i = t.existIcon, s = !!r; return i ? I("span", { className: "".concat(n, "-loading-icon"), children: I(of, {}) }) : I(Sa, { visible: s, motionName: "".concat(n, "-loading-icon-motion"), removeOnLeave: !0, onAppearStart: R1, onAppearActive: M1, onEnterStart: R1, onEnterActive: M1, onLeaveStart: M1, onLeaveActive: R1, children: function (c, o) { var f = c.className, p = c.style; return I("span", { className: "".concat(n, "-loading-icon"), style: p, ref: o, children: I(of, { className: f }) }) } }) }; const dq = cq; var fq = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, Qk = /^[\u4e00-\u9fa5]{2}$/, eC = Qk.test.bind(Qk); function hq(e) { return typeof e == "string" } function A1(e) { return e === "text" || e === "link" } function pq(e, t) { if (e != null) { var n = t ? " " : ""; return typeof e != "string" && typeof e != "number" && hq(e.type) && eC(e.props.children) ? li(e, { children: e.props.children.split("").join(n) }) : typeof e == "string" ? eC(e) ? I("span", { children: e.split("").join(n) }) : I("span", { children: e }) : GO(e) ? I("span", { children: e }) : e } } function mq(e, t) { var n = !1, r = []; return C.exports.Children.forEach(e, function (i) { var s = ln(i), c = s === "string" || s === "number"; if (n && c) { var o = r.length - 1, f = r[o]; r[o] = "".concat(f).concat(i) } else r.push(i); n = c }), C.exports.Children.map(r, function (i) { return pq(i, t) }) } ia("default", "primary", "ghost", "dashed", "link", "text"); ia("default", "circle", "round"); ia("submit", "button", "reset"); function hL(e) { return e === "danger" ? { danger: !0 } : { type: e } } var vq = function (t, n) { var r, i = t.loading, s = i === void 0 ? !1 : i, c = t.prefixCls, o = t.type, f = o === void 0 ? "default" : o, p = t.danger, v = t.shape, y = v === void 0 ? "default" : v, w = t.size, P = t.disabled, k = t.className, A = t.children, N = t.icon, R = t.ghost, M = R === void 0 ? !1 : R, O = t.block, z = O === void 0 ? !1 : O, B = t.htmlType, V = B === void 0 ? "button" : B, G = fq(t, ["loading", "prefixCls", "type", "danger", "shape", "size", "disabled", "className", "children", "icon", "ghost", "block", "htmlType"]), j = C.exports.useContext(qa), X = C.exports.useContext(dl), Y = P != null ? P : X, se = C.exports.useContext(fL), ee = C.exports.useState(!!s), Z = ze(ee, 2), J = Z[0], ve = Z[1], ie = C.exports.useState(!1), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useContext(zn), Te = Ie.getPrefixCls, Pe = Ie.autoInsertSpaceInButton, De = Ie.direction, Re = n || C.exports.createRef(), ke = function () { return C.exports.Children.count(A) === 1 && !N && !A1(f) }, Oe = function () { if (!(!Re || !Re.current || Pe === !1)) { var bt = Re.current.textContent; ke() && eC(bt) ? oe || ye(!0) : oe && ye(!1) } }, $e = typeof s == "boolean" ? s : (s == null ? void 0 : s.delay) || !0; C.exports.useEffect(function () { var ht = null; return typeof $e == "number" ? ht = window.setTimeout(function () { ht = null, ve($e) }, $e) : ve($e), function () { ht && (window.clearTimeout(ht), ht = null) } }, [$e]), C.exports.useEffect(Oe, [Re]); var He = function (bt) { var Wt = t.onClick; if (J || Y) { bt.preventDefault(); return } Wt == null || Wt(bt) }, Ue = Te("btn", c), st = Pe !== !1, ft = Mc(Ue, De), It = ft.compactSize, We = ft.compactItemClassnames, Pt = { large: "lg", small: "sm", middle: void 0 }, pt = It || se || w || j, Rt = pt && Pt[pt] || "", yt = J ? "loading" : N, Mt = vi(G, ["navigate"]), ut = Xe(Ue, (r = {}, re(r, "".concat(Ue, "-").concat(y), y !== "default" && y), re(r, "".concat(Ue, "-").concat(f), f), re(r, "".concat(Ue, "-").concat(Rt), Rt), re(r, "".concat(Ue, "-icon-only"), !A && A !== 0 && !!yt), re(r, "".concat(Ue, "-background-ghost"), M && !A1(f)), re(r, "".concat(Ue, "-loading"), J), re(r, "".concat(Ue, "-two-chinese-chars"), oe && st && !J), re(r, "".concat(Ue, "-block"), z), re(r, "".concat(Ue, "-dangerous"), !!p), re(r, "".concat(Ue, "-rtl"), De === "rtl"), re(r, "".concat(Ue, "-disabled"), Mt.href !== void 0 && Y), r), We, k), dt = N && !J ? N : I(dq, { existIcon: !!N, prefixCls: Ue, loading: !!J }), ct = A || A === 0 ? mq(A, ke() && st) : null; if (Mt.href !== void 0) return Qe("a", { ...Mt, className: ut, onClick: He, ref: Re, children: [dt, ct] }); var rt = Qe("button", { ...G, type: V, className: ut, onClick: He, disabled: Y, ref: Re, children: [dt, ct] }); return A1(f) ? rt : I(aq, { disabled: !!J, children: rt }) }, j2 = C.exports.forwardRef(vq); j2.Group = uq; j2.__ANT_BUTTON = !0; const gr = j2; var pL = function (t) { if (wo() && window.document.documentElement) { var n = Array.isArray(t) ? t : [t], r = window.document.documentElement; return n.some(function (i) { return i in r.style }) } return !1 }, gq = function (t, n) { if (!pL(t)) return !1; var r = document.createElement("div"), i = r.style[t]; return r.style[t] = n, r.style[t] !== i }; function tC(e, t) { return !Array.isArray(e) && t !== void 0 ? gq(e, t) : pL(e) } var mL = function () { return wo() && window.document.documentElement }, gg, yq = function () { if (!mL()) return !1; if (gg !== void 0) return gg; var t = document.createElement("div"); return t.style.display = "flex", t.style.flexDirection = "column", t.style.rowGap = "1px", t.appendChild(document.createElement("div")), t.appendChild(document.createElement("div")), document.body.appendChild(t), gg = t.scrollHeight === 1, document.body.removeChild(t), gg }; const vL = function () { var e = C.exports.useState(!1), t = ze(e, 2), n = t[0], r = t[1]; return C.exports.useEffect(function () { r(yq()) }, []), n }; function xq(e) { var t = e.className, n = e.direction, r = e.index, i = e.marginDirection, s = e.children, c = e.split, o = e.wrap, f = C.exports.useContext(gL), p = f.horizontalSize, v = f.verticalSize, y = f.latestIndex, w = f.supportFlexGap, P = {}; return w || (n === "vertical" ? r < y && (P = { marginBottom: p / (c ? 2 : 1) }) : P = tt(tt({}, r < y && re({}, i, p / (c ? 2 : 1))), o && { paddingBottom: v })), s == null ? null : Qe(An, { children: [I("div", { className: t, style: P, children: s }), r < y && c && I("span", { className: "".concat(t, "-split"), style: P, children: c })] }) } var _q = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, gL = C.exports.createContext({ latestIndex: 0, horizontalSize: 0, verticalSize: 0, supportFlexGap: !1 }), bq = { small: 8, middle: 16, large: 24 }; function wq(e) { return typeof e == "string" ? bq[e] : e || 0 } var Cq = function (t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.space, c = r.direction, o = t.size, f = o === void 0 ? (s == null ? void 0 : s.size) || "small" : o, p = t.align, v = t.className, y = t.children, w = t.direction, P = w === void 0 ? "horizontal" : w, k = t.prefixCls, A = t.split, N = t.style, R = t.wrap, M = R === void 0 ? !1 : R, O = _q(t, ["size", "align", "className", "children", "direction", "prefixCls", "split", "style", "wrap"]), z = vL(), B = C.exports.useMemo(function () { return (Array.isArray(f) ? f : [f, f]).map(function (ye) { return wq(ye) }) }, [f]), V = ze(B, 2), G = V[0], j = V[1], X = Zi(y, { keepEmpty: !0 }), Y = p === void 0 && P === "horizontal" ? "center" : p, se = i("space", k), ee = Xe(se, "".concat(se, "-").concat(P), (n = {}, re(n, "".concat(se, "-rtl"), c === "rtl"), re(n, "".concat(se, "-align-").concat(Y), Y), n), v), Z = "".concat(se, "-item"), J = c === "rtl" ? "marginLeft" : "marginRight", ve = 0, ie = X.map(function (ye, Ie) { ye != null && (ve = Ie); var Te = ye && ye.key || "".concat(Z, "-").concat(Ie); return I(xq, { className: Z, direction: P, index: Ie, marginDirection: J, split: A, wrap: M, children: ye }, Te) }), ce = C.exports.useMemo(function () { return { horizontalSize: G, verticalSize: j, latestIndex: ve, supportFlexGap: z } }, [G, j, ve, z]); if (X.length === 0) return null; var oe = {}; return M && (oe.flexWrap = "wrap", z || (oe.marginBottom = -j)), z && (oe.columnGap = G, oe.rowGap = j), I("div", { className: ee, style: tt(tt({}, oe), N), ...O, children: I(gL.Provider, { value: ce, children: ie }) }) }, yL = Cq; yL.Compact = OW; const xL = yL; var Sq = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, _L = function (t) { var n = C.exports.useContext(zn), r = n.getPopupContainer, i = n.getPrefixCls, s = n.direction, c = t.prefixCls, o = t.type, f = o === void 0 ? "default" : o, p = t.danger, v = t.disabled, y = t.loading, w = t.onClick, P = t.htmlType, k = t.children, A = t.className, N = t.menu, R = t.arrow, M = t.autoFocus, O = t.overlay, z = t.trigger, B = t.align, V = t.visible, G = t.open, j = t.onVisibleChange, X = t.onOpenChange, Y = t.placement, se = t.getPopupContainer, ee = t.href, Z = t.icon, J = Z === void 0 ? I(HD, {}) : Z, ve = t.title, ie = t.buttonsRender, ce = ie === void 0 ? function (Rt) { return Rt } : ie, oe = t.mouseEnterDelay, ye = t.mouseLeaveDelay, Ie = t.overlayClassName, Te = t.overlayStyle, Pe = t.destroyPopupOnHide, De = Sq(t, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "visible", "open", "onVisibleChange", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide"]), Re = i("dropdown-button", c), ke = { menu: N, arrow: R, autoFocus: M, align: B, disabled: v, trigger: v ? [] : z, onOpenChange: X || j, getPopupContainer: se || r, mouseEnterDelay: oe, mouseLeaveDelay: ye, overlayClassName: Ie, overlayStyle: Te, destroyPopupOnHide: Pe }, Oe = Mc(Re, s), $e = Oe.compactSize, He = Oe.compactItemClassnames, Ue = Xe(Re, He, A); "overlay" in t && (ke.overlay = O), "open" in t ? ke.open = G : "visible" in t && (ke.open = V), "placement" in t ? ke.placement = Y : ke.placement = s === "rtl" ? "bottomLeft" : "bottomRight"; var st = I(gr, { type: f, danger: p, disabled: v, loading: y, onClick: w, htmlType: P, href: ee, title: ve, children: k }), ft = I(gr, { type: f, danger: p, icon: J }), It = ce([st, ft]), We = ze(It, 2), Pt = We[0], pt = We[1]; return Qe(xL.Compact, { className: Ue, size: $e, block: !0, ...De, children: [Pt, I(K2, { ...ke, children: pt })] }) }; _L.__ANT_BUTTON = !0; const Eq = _L; ia("topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight", "top", "bottom"); var bL = function (t) { var n = C.exports.useContext(zn), r = n.getPopupContainer, i = n.getPrefixCls, s = n.direction, c = function () { var Oe = i(), $e = t.placement, He = $e === void 0 ? "" : $e, Ue = t.transitionName; return Ue !== void 0 ? Ue : He.includes("top") ? "".concat(Oe, "-slide-down") : "".concat(Oe, "-slide-up") }, o = function () { var Oe = t.placement; if (!Oe) return s === "rtl" ? "bottomRight" : "bottomLeft"; if (Oe.includes("Center")) { var $e = Oe.slice(0, Oe.indexOf("Center")); return $e } return Oe }, f = t.menu, p = t.arrow, v = t.prefixCls, y = t.children, w = t.trigger, P = t.disabled, k = t.dropdownRender, A = t.getPopupContainer, N = t.overlayClassName, R = t.visible, M = t.open, O = t.onVisibleChange, z = t.onOpenChange, B = t.mouseEnterDelay, V = B === void 0 ? .15 : B, G = t.mouseLeaveDelay, j = G === void 0 ? .1 : G, X = t.autoAdjustOverflow, Y = X === void 0 ? !0 : X, se = i("dropdown", v), ee = C.exports.Children.only(y), Z = li(ee, { className: Xe("".concat(se, "-trigger"), re({}, "".concat(se, "-rtl"), s === "rtl"), ee.props.className), disabled: P }), J = P ? [] : w, ve; J && J.includes("contextMenu") && (ve = !0); var ie = Bi(!1, { value: M !== void 0 ? M : R }), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = Hp(function (ke) { O == null || O(ke), z == null || z(ke), ye(ke) }), Te = Xe(N, re({}, "".concat(se, "-rtl"), s === "rtl")), Pe = jD({ arrowPointAtCenter: ln(p) === "object" && p.pointAtCenter, autoAdjustOverflow: Y }), De = C.exports.useCallback(function () { ye(!1) }, []), Re = function () { var Oe = t.overlay, $e; return f != null && f.items ? $e = I(cL, { ...f }) : typeof Oe == "function" ? $e = Oe() : $e = Oe, k && ($e = k($e)), $e = C.exports.Children.only(typeof $e == "string" ? I("span", { children: $e }) : $e), I(uL, { prefixCls: "".concat(se, "-menu"), expandIcon: I("span", { className: "".concat(se, "-menu-submenu-arrow"), children: I(V2, { className: "".concat(se, "-menu-submenu-arrow-icon") }) }), mode: "vertical", selectable: !1, onClick: De, validator: function (Ue) { Ue.mode }, children: I(lf, { children: $e }) }) }; return I(nq, { alignPoint: ve, ...t, mouseEnterDelay: V, mouseLeaveDelay: j, visible: oe, builtinPlacements: Pe, arrow: !!p, overlayClassName: Te, prefixCls: se, getPopupContainer: A || r, transitionName: c(), trigger: J, overlay: Re, placement: o(), onVisibleChange: Ie, children: Z }) }; bL.Button = Eq; const K2 = bL; var Pq = typeof Gs == "object" && Gs && Gs.Object === Object && Gs, wL = Pq, Tq = wL, kq = typeof self == "object" && self && self.Object === Object && self, Iq = Tq || kq || Function("return this")(), ys = Iq, Rq = ys, Mq = Rq.Symbol, H2 = Mq, Aq = Array.isArray, W2 = Aq, Jk = H2, CL = Object.prototype, Nq = CL.hasOwnProperty, Oq = CL.toString, Vh = Jk ? Jk.toStringTag : void 0; function Dq(e) { var t = Nq.call(e, Vh), n = e[Vh]; try { e[Vh] = void 0; var r = !0 } catch { } var i = Oq.call(e); return r && (t ? e[Vh] = n : delete e[Vh]), i } var Lq = Dq, zq = Object.prototype, Fq = zq.toString; function $q(e) { return Fq.call(e) } var Bq = $q, eI = H2, Vq = Lq, Uq = Bq, jq = "[object Null]", Kq = "[object Undefined]", tI = eI ? eI.toStringTag : void 0; function Hq(e) { return e == null ? e === void 0 ? Kq : jq : tI && tI in Object(e) ? Vq(e) : Uq(e) } var ym = Hq; function Wq(e) { return e != null && typeof e == "object" } var xm = Wq, Gq = ym, qq = xm, Zq = "[object Symbol]"; function Xq(e) { return typeof e == "symbol" || qq(e) && Gq(e) == Zq } var Yq = Xq, Qq = /\s/; function Jq(e) { for (var t = e.length; t-- && Qq.test(e.charAt(t));); return t } var eZ = Jq, tZ = eZ, nZ = /^\s+/; function rZ(e) { return e && e.slice(0, tZ(e) + 1).replace(nZ, "") } var iZ = rZ; function oZ(e) { var t = typeof e; return e != null && (t == "object" || t == "function") } var nx = oZ, aZ = iZ, nI = nx, sZ = Yq, rI = 0 / 0, lZ = /^[-+]0x[0-9a-f]+$/i, uZ = /^0b[01]+$/i, cZ = /^0o[0-7]+$/i, dZ = parseInt; function fZ(e) { if (typeof e == "number") return e; if (sZ(e)) return rI; if (nI(e)) { var t = typeof e.valueOf == "function" ? e.valueOf() : e; e = nI(t) ? t + "" : t } if (typeof e != "string") return e === 0 ? e : +e; e = aZ(e); var n = uZ.test(e); return n || cZ.test(e) ? dZ(e.slice(2), n ? 2 : 8) : lZ.test(e) ? rI : +e } var hZ = fZ, Cc = function (t, n, r, i) { var s = r ? r.call(i, t, n) : void 0; if (s !== void 0) return !!s; if (t === n) return !0; if (typeof t != "object" || !t || typeof n != "object" || !n) return !1; var c = Object.keys(t), o = Object.keys(n); if (c.length !== o.length) return !1; for (var f = Object.prototype.hasOwnProperty.bind(n), p = 0; p < c.length; p++) { var v = c[p]; if (!f(v)) return !1; var y = t[v], w = n[v]; if (s = r ? r.call(i, y, w, v) : void 0, s === !1 || s === void 0 && y !== w) return !1 } return !0 }, SL = C.exports.createContext(null), pZ = SL.Provider, EL = C.exports.createContext(null), mZ = EL.Provider, G2 = function (e) { ui(n, e); var t = ci(n); function n(r) { var i; zr(this, n), i = t.call(this, r), i.handleChange = function (c) { var o = i.props, f = o.disabled, p = o.onChange; f || ("checked" in i.props || i.setState({ checked: c.target.checked }), p && p({ target: ge(ge({}, i.props), {}, { checked: c.target.checked }), stopPropagation: function () { c.stopPropagation() }, preventDefault: function () { c.preventDefault() }, nativeEvent: c.nativeEvent })) }, i.saveInput = function (c) { i.input = c }; var s = "checked" in r ? r.checked : r.defaultChecked; return i.state = { checked: s }, i } return Fr(n, [{ key: "focus", value: function () { this.input.focus() } }, { key: "blur", value: function () { this.input.blur() } }, { key: "render", value: function () { var i, s = this.props, c = s.prefixCls, o = s.className, f = s.style, p = s.name, v = s.id, y = s.type, w = s.disabled, P = s.readOnly, k = s.tabIndex, A = s.onClick, N = s.onFocus, R = s.onBlur, M = s.onKeyDown, O = s.onKeyPress, z = s.onKeyUp, B = s.autoFocus, V = s.value, G = s.required, j = Rn(s, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "onKeyDown", "onKeyPress", "onKeyUp", "autoFocus", "value", "required"]), X = Object.keys(j).reduce(function (ee, Z) { return (Z.substr(0, 5) === "aria-" || Z.substr(0, 5) === "data-" || Z === "role") && (ee[Z] = j[Z]), ee }, {}), Y = this.state.checked, se = Xe(c, o, (i = {}, re(i, "".concat(c, "-checked"), Y), re(i, "".concat(c, "-disabled"), w), i)); return Qe("span", { className: se, style: f, children: [I("input", { name: p, id: v, type: y, required: G, readOnly: P, disabled: w, tabIndex: k, className: "".concat(c, "-input"), checked: !!Y, onClick: A, onFocus: N, onBlur: R, onKeyUp: z, onKeyDown: M, onKeyPress: O, onChange: this.handleChange, autoFocus: B, ref: this.saveInput, value: V, ...X }), I("span", { className: "".concat(c, "-inner") })] }) } }], [{ key: "getDerivedStateFromProps", value: function (i, s) { return "checked" in i ? ge(ge({}, s), {}, { checked: i.checked }) : null } }]), n }(C.exports.Component); G2.defaultProps = { prefixCls: "rc-checkbox", className: "", style: {}, type: "checkbox", defaultChecked: !1, onFocus: function () { }, onBlur: function () { }, onChange: function () { }, onKeyDown: function () { }, onKeyPress: function () { }, onKeyUp: function () { } }; var vZ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, gZ = function (t, n) { var r, i = C.exports.useContext(SL), s = C.exports.useContext(EL), c = C.exports.useContext(zn), o = c.getPrefixCls, f = c.direction, p = C.exports.useRef(), v = Po(n, p), y = C.exports.useContext(Fo), w = y.isFormItemInput, P = function (Y) { var se, ee; (se = t.onChange) === null || se === void 0 || se.call(t, Y), (ee = i == null ? void 0 : i.onChange) === null || ee === void 0 || ee.call(i, Y) }, k = t.prefixCls, A = t.className, N = t.children, R = t.style, M = t.disabled, O = vZ(t, ["prefixCls", "className", "children", "style", "disabled"]), z = o("radio", k), B = ((i == null ? void 0 : i.optionType) || s) === "button" ? "".concat(z, "-button") : z, V = tt({}, O), G = C.exports.useContext(dl); V.disabled = M || G, i && (V.name = i.name, V.onChange = P, V.checked = t.value === i.value, V.disabled = V.disabled || i.disabled); var j = Xe("".concat(B, "-wrapper"), (r = {}, re(r, "".concat(B, "-wrapper-checked"), V.checked), re(r, "".concat(B, "-wrapper-disabled"), V.disabled), re(r, "".concat(B, "-wrapper-rtl"), f === "rtl"), re(r, "".concat(B, "-wrapper-in-form-item"), w), r), A); return Qe("label", { className: j, style: R, onMouseEnter: t.onMouseEnter, onMouseLeave: t.onMouseLeave, children: [I(G2, { ...V, type: "radio", prefixCls: B, ref: v }), N !== void 0 ? I("span", { children: N }) : null] }) }, yZ = C.exports.forwardRef(gZ); const Hy = yZ; var xZ = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = C.exports.useContext(qa), o = Bi(e.defaultValue, { value: e.value }), f = ze(o, 2), p = f[0], v = f[1], y = function (ce) { var oe = p, ye = ce.target.value; "value" in e || v(ye); var Ie = e.onChange; Ie && ye !== oe && Ie(ce) }, w = e.prefixCls, P = e.className, k = P === void 0 ? "" : P, A = e.options, N = e.buttonStyle, R = N === void 0 ? "outline" : N, M = e.disabled, O = e.children, z = e.size, B = e.style, V = e.id, G = e.onMouseEnter, j = e.onMouseLeave, X = e.onFocus, Y = e.onBlur, se = i("radio", w), ee = "".concat(se, "-group"), Z = O; A && A.length > 0 && (Z = A.map(function (ie) { return typeof ie == "string" || typeof ie == "number" ? I(Hy, { prefixCls: se, disabled: M, value: ie, checked: p === ie, children: ie }, ie.toString()) : I(Hy, { prefixCls: se, disabled: ie.disabled || M, value: ie.value, checked: p === ie.value, style: ie.style, children: ie.label }, "radio-group-value-options-".concat(ie.value)) })); var J = z || c, ve = Xe(ee, "".concat(ee, "-").concat(R), (n = {}, re(n, "".concat(ee, "-").concat(J), J), re(n, "".concat(ee, "-rtl"), s === "rtl"), n), k); return I("div", { ...WO(e), className: ve, style: B, onMouseEnter: G, onMouseLeave: j, onFocus: X, onBlur: Y, id: V, ref: t, children: I(pZ, { value: { onChange: y, value: p, disabled: e.disabled, name: e.name, optionType: e.optionType }, children: Z }) }) }); const _Z = C.exports.memo(xZ); var bZ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, wZ = function (t, n) { var r = C.exports.useContext(zn), i = r.getPrefixCls, s = t.prefixCls, c = bZ(t, ["prefixCls"]), o = i("radio", s); return I(mZ, { value: "button", children: I(Hy, { prefixCls: o, ...c, type: "radio", ref: n }) }) }; const CZ = C.exports.forwardRef(wZ); var rx = Hy; rx.Button = CZ; rx.Group = _Z; rx.__ANT_RADIO = !0; const PL = rx; var SZ = ys, EZ = function () { return SZ.Date.now() }, PZ = EZ, TZ = nx, N1 = PZ, iI = hZ, kZ = "Expected a function", IZ = Math.max, RZ = Math.min; function MZ(e, t, n) { var r, i, s, c, o, f, p = 0, v = !1, y = !1, w = !0; if (typeof e != "function") throw new TypeError(kZ); t = iI(t) || 0, TZ(n) && (v = !!n.leading, y = "maxWait" in n, s = y ? IZ(iI(n.maxWait) || 0, t) : s, w = "trailing" in n ? !!n.trailing : w); function P(V) { var G = r, j = i; return r = i = void 0, p = V, c = e.apply(j, G), c } function k(V) { return p = V, o = setTimeout(R, t), v ? P(V) : c } function A(V) { var G = V - f, j = V - p, X = t - G; return y ? RZ(X, s - j) : X } function N(V) { var G = V - f, j = V - p; return f === void 0 || G >= t || G < 0 || y && j >= s } function R() { var V = N1(); if (N(V)) return M(V); o = setTimeout(R, A(V)) } function M(V) { return o = void 0, w && r ? P(V) : (r = i = void 0, c) } function O() { o !== void 0 && clearTimeout(o), p = 0, r = f = i = o = void 0 } function z() { return o === void 0 ? c : M(N1()) } function B() { var V = N1(), G = N(V); if (r = arguments, i = this, f = V, G) { if (o === void 0) return k(f); if (y) return clearTimeout(o), o = setTimeout(R, t), P(f) } return o === void 0 && (o = setTimeout(R, t)), c } return B.cancel = O, B.flush = z, B } var AZ = MZ; function TL(e, t) { var n = new Set; return e.forEach(function (r) { t.has(r) || n.add(r) }), n } function NZ(e) { var t = e || {}, n = t.disabled, r = t.disableCheckbox, i = t.checkable; return !!(n || r) || i === !1 } function OZ(e, t, n, r) { for (var i = new Set(e), s = new Set, c = 0; c <= n; c += 1) { var o = t.get(c) || new Set; o.forEach(function (y) { var w = y.key, P = y.node, k = y.children, A = k === void 0 ? [] : k; i.has(w) && !r(P) && A.filter(function (N) { return !r(N.node) }).forEach(function (N) { i.add(N.key) }) }) } for (var f = new Set, p = n; p >= 0; p -= 1) { var v = t.get(p) || new Set; v.forEach(function (y) { var w = y.parent, P = y.node; if (!(r(P) || !y.parent || f.has(y.parent.key))) { if (r(y.parent.node)) { f.add(w.key); return } var k = !0, A = !1; (w.children || []).filter(function (N) { return !r(N.node) }).forEach(function (N) { var R = N.key, M = i.has(R); k && !M && (k = !1), !A && (M || s.has(R)) && (A = !0) }), k && i.add(w.key), A && s.add(w.key), f.add(w.key) } }) } return { checkedKeys: Array.from(i), halfCheckedKeys: Array.from(TL(s, i)) } } function DZ(e, t, n, r, i) { for (var s = new Set(e), c = new Set(t), o = 0; o <= r; o += 1) { var f = n.get(o) || new Set; f.forEach(function (w) { var P = w.key, k = w.node, A = w.children, N = A === void 0 ? [] : A; !s.has(P) && !c.has(P) && !i(k) && N.filter(function (R) { return !i(R.node) }).forEach(function (R) { s.delete(R.key) }) }) } c = new Set; for (var p = new Set, v = r; v >= 0; v -= 1) { var y = n.get(v) || new Set; y.forEach(function (w) { var P = w.parent, k = w.node; if (!(i(k) || !w.parent || p.has(w.parent.key))) { if (i(w.parent.node)) { p.add(P.key); return } var A = !0, N = !1; (P.children || []).filter(function (R) { return !i(R.node) }).forEach(function (R) { var M = R.key, O = s.has(M); A && !O && (A = !1), !N && (O || c.has(M)) && (N = !0) }), A || s.delete(P.key), N && c.add(P.key), p.add(P.key) } }) } return { checkedKeys: Array.from(s), halfCheckedKeys: Array.from(TL(c, s)) } } function Qs(e, t, n, r) { var i = [], s; r ? s = r : s = NZ; var c = new Set(e.filter(function (v) { var y = !!n[v]; return y || i.push(v), y })), o = new Map, f = 0; Object.keys(n).forEach(function (v) { var y = n[v], w = y.level, P = o.get(w); P || (P = new Set, o.set(w, P)), P.add(y), f = Math.max(f, w) }), Rr(!i.length, "Tree missing follow keys: ".concat(i.slice(0, 100).map(function (v) { return "'".concat(v, "'") }).join(", "))); var p; return t === !0 ? p = OZ(c, o, f, s) : p = DZ(c, t.halfCheckedKeys, o, f, s), p } var q2 = C.exports.createContext(null), LZ = function (t) { for (var n = t.prefixCls, r = t.level, i = t.isStart, s = t.isEnd, c = "".concat(n, "-indent-unit"), o = [], f = 0; f < r; f += 1) { var p; o.push(I("span", { className: Xe(c, (p = {}, re(p, "".concat(c, "-start"), i[f]), re(p, "".concat(c, "-end"), s[f]), p)) }, f)) } return I("span", { "aria-hidden": "true", className: "".concat(n, "-indent"), children: o }) }; const zZ = C.exports.memo(LZ); var FZ = ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove", "selectable"], oI = "open", aI = "close", $Z = "---", BZ = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.state = { dragNodeHighlight: !1 }, r.selectHandle = void 0, r.onSelectorClick = function (o) { var f = r.props.context.onNodeClick; f(o, Ci(r.props)), r.isSelectable() ? r.onSelect(o) : r.onCheck(o) }, r.onSelectorDoubleClick = function (o) { var f = r.props.context.onNodeDoubleClick; f(o, Ci(r.props)) }, r.onSelect = function (o) { if (!r.isDisabled()) { var f = r.props.context.onNodeSelect; o.preventDefault(), f(o, Ci(r.props)) } }, r.onCheck = function (o) { if (!r.isDisabled()) { var f = r.props, p = f.disableCheckbox, v = f.checked, y = r.props.context.onNodeCheck; if (!(!r.isCheckable() || p)) { o.preventDefault(); var w = !v; y(o, Ci(r.props), w) } } }, r.onMouseEnter = function (o) { var f = r.props.context.onNodeMouseEnter; f(o, Ci(r.props)) }, r.onMouseLeave = function (o) { var f = r.props.context.onNodeMouseLeave; f(o, Ci(r.props)) }, r.onContextMenu = function (o) { var f = r.props.context.onNodeContextMenu; f(o, Ci(r.props)) }, r.onDragStart = function (o) { var f = r.props.context.onNodeDragStart; o.stopPropagation(), r.setState({ dragNodeHighlight: !0 }), f(o, Ln(r)); try { o.dataTransfer.setData("text/plain", "") } catch { } }, r.onDragEnter = function (o) { var f = r.props.context.onNodeDragEnter; o.preventDefault(), o.stopPropagation(), f(o, Ln(r)) }, r.onDragOver = function (o) { var f = r.props.context.onNodeDragOver; o.preventDefault(), o.stopPropagation(), f(o, Ln(r)) }, r.onDragLeave = function (o) { var f = r.props.context.onNodeDragLeave; o.stopPropagation(), f(o, Ln(r)) }, r.onDragEnd = function (o) { var f = r.props.context.onNodeDragEnd; o.stopPropagation(), r.setState({ dragNodeHighlight: !1 }), f(o, Ln(r)) }, r.onDrop = function (o) { var f = r.props.context.onNodeDrop; o.preventDefault(), o.stopPropagation(), r.setState({ dragNodeHighlight: !1 }), f(o, Ln(r)) }, r.onExpand = function (o) { var f = r.props, p = f.loading, v = f.context.onNodeExpand; p || v(o, Ci(r.props)) }, r.setSelectHandle = function (o) { r.selectHandle = o }, r.getNodeState = function () { var o = r.props.expanded; return r.isLeaf() ? null : o ? oI : aI }, r.hasChildren = function () { var o = r.props.eventKey, f = r.props.context.keyEntities, p = f[o] || {}, v = p.children; return !!(v || []).length }, r.isLeaf = function () { var o = r.props, f = o.isLeaf, p = o.loaded, v = r.props.context.loadData, y = r.hasChildren(); return f === !1 ? !1 : f || !v && !y || v && p && !y }, r.isDisabled = function () { var o = r.props.disabled, f = r.props.context.disabled; return !!(f || o) }, r.isCheckable = function () { var o = r.props.checkable, f = r.props.context.checkable; return !f || o === !1 ? !1 : f }, r.syncLoadData = function (o) { var f = o.expanded, p = o.loading, v = o.loaded, y = r.props.context, w = y.loadData, P = y.onNodeLoad; p || w && f && !r.isLeaf() && !r.hasChildren() && !v && P(Ci(r.props)) }, r.isDraggable = function () { var o = r.props, f = o.data, p = o.context.draggable; return !!(p && (!p.nodeDraggable || p.nodeDraggable(f))) }, r.renderDragHandler = function () { var o = r.props.context, f = o.draggable, p = o.prefixCls; return f != null && f.icon ? I("span", { className: "".concat(p, "-draggable-icon"), children: f.icon }) : null }, r.renderSwitcherIconDom = function (o) { var f = r.props.switcherIcon, p = r.props.context.switcherIcon, v = f || p; return typeof v == "function" ? v(ge(ge({}, r.props), {}, { isLeaf: o })) : v }, r.renderSwitcher = function () { var o = r.props.expanded, f = r.props.context.prefixCls; if (r.isLeaf()) { var p = r.renderSwitcherIconDom(!0); return p !== !1 ? I("span", { className: Xe("".concat(f, "-switcher"), "".concat(f, "-switcher-noop")), children: p }) : null } var v = Xe("".concat(f, "-switcher"), "".concat(f, "-switcher_").concat(o ? oI : aI)), y = r.renderSwitcherIconDom(!1); return y !== !1 ? I("span", { onClick: r.onExpand, className: v, children: y }) : null }, r.renderCheckbox = function () { var o = r.props, f = o.checked, p = o.halfChecked, v = o.disableCheckbox, y = r.props.context.prefixCls, w = r.isDisabled(), P = r.isCheckable(); if (!P) return null; var k = typeof P != "boolean" ? P : null; return I("span", { className: Xe("".concat(y, "-checkbox"), f && "".concat(y, "-checkbox-checked"), !f && p && "".concat(y, "-checkbox-indeterminate"), (w || v) && "".concat(y, "-checkbox-disabled")), onClick: r.onCheck, children: k }) }, r.renderIcon = function () { var o = r.props.loading, f = r.props.context.prefixCls; return I("span", { className: Xe("".concat(f, "-iconEle"), "".concat(f, "-icon__").concat(r.getNodeState() || "docu"), o && "".concat(f, "-icon_loading")) }) }, r.renderSelector = function () { var o = r.state.dragNodeHighlight, f = r.props, p = f.title, v = f.selected, y = f.icon, w = f.loading, P = f.data, k = r.props.context, A = k.prefixCls, N = k.showIcon, R = k.icon, M = k.loadData, O = k.titleRender, z = r.isDisabled(), B = "".concat(A, "-node-content-wrapper"), V; if (N) { var G = y || R; V = G ? I("span", { className: Xe("".concat(A, "-iconEle"), "".concat(A, "-icon__customize")), children: typeof G == "function" ? G(r.props) : G }) : r.renderIcon() } else M && w && (V = r.renderIcon()); var j; typeof p == "function" ? j = p(P) : O ? j = O(P) : j = p; var X = I("span", { className: "".concat(A, "-title"), children: j }); return Qe("span", { ref: r.setSelectHandle, title: typeof p == "string" ? p : "", className: Xe("".concat(B), "".concat(B, "-").concat(r.getNodeState() || "normal"), !z && (v || o) && "".concat(A, "-node-selected")), onMouseEnter: r.onMouseEnter, onMouseLeave: r.onMouseLeave, onContextMenu: r.onContextMenu, onClick: r.onSelectorClick, onDoubleClick: r.onSelectorDoubleClick, children: [V, X, r.renderDropIndicator()] }) }, r.renderDropIndicator = function () { var o = r.props, f = o.disabled, p = o.eventKey, v = r.props.context, y = v.draggable, w = v.dropLevelOffset, P = v.dropPosition, k = v.prefixCls, A = v.indent, N = v.dropIndicatorRender, R = v.dragOverNodeKey, M = v.direction, O = !!y, z = !f && O && R === p; return z ? N({ dropPosition: P, dropLevelOffset: w, indent: A, prefixCls: k, direction: M }) : null }, r } return Fr(n, [{ key: "componentDidMount", value: function () { this.syncLoadData(this.props) } }, { key: "componentDidUpdate", value: function () { this.syncLoadData(this.props) } }, { key: "isSelectable", value: function () { var i = this.props.selectable, s = this.props.context.selectable; return typeof i == "boolean" ? i : s } }, { key: "render", value: function () { var i, s = this.props, c = s.eventKey, o = s.className, f = s.style, p = s.dragOver, v = s.dragOverGapTop, y = s.dragOverGapBottom, w = s.isLeaf, P = s.isStart, k = s.isEnd, A = s.expanded, N = s.selected, R = s.checked, M = s.halfChecked, O = s.loading, z = s.domRef, B = s.active; s.data; var V = s.onMouseMove, G = s.selectable, j = Rn(s, FZ), X = this.props.context, Y = X.prefixCls, se = X.filterTreeNode, ee = X.keyEntities, Z = X.dropContainerKey, J = X.dropTargetKey, ve = X.draggingNodeKey, ie = this.isDisabled(), ce = uu(j, { aria: !0, data: !0 }), oe = ee[c] || {}, ye = oe.level, Ie = k[k.length - 1], Te = this.isDraggable(), Pe = !ie && Te, De = ve === c, Re = G !== void 0 ? { "aria-selected": !!G } : void 0; return Qe("div", { ref: z, className: Xe(o, "".concat(Y, "-treenode"), (i = {}, re(i, "".concat(Y, "-treenode-disabled"), ie), re(i, "".concat(Y, "-treenode-switcher-").concat(A ? "open" : "close"), !w), re(i, "".concat(Y, "-treenode-checkbox-checked"), R), re(i, "".concat(Y, "-treenode-checkbox-indeterminate"), M), re(i, "".concat(Y, "-treenode-selected"), N), re(i, "".concat(Y, "-treenode-loading"), O), re(i, "".concat(Y, "-treenode-active"), B), re(i, "".concat(Y, "-treenode-leaf-last"), Ie), re(i, "".concat(Y, "-treenode-draggable"), Te), re(i, "dragging", De), re(i, "drop-target", J === c), re(i, "drop-container", Z === c), re(i, "drag-over", !ie && p), re(i, "drag-over-gap-top", !ie && v), re(i, "drag-over-gap-bottom", !ie && y), re(i, "filter-node", se && se(Ci(this.props))), i)), style: f, draggable: Pe, "aria-grabbed": De, onDragStart: Pe ? this.onDragStart : void 0, onDragEnter: Te ? this.onDragEnter : void 0, onDragOver: Te ? this.onDragOver : void 0, onDragLeave: Te ? this.onDragLeave : void 0, onDrop: Te ? this.onDrop : void 0, onDragEnd: Te ? this.onDragEnd : void 0, onMouseMove: V, ...Re, ...ce, children: [I(zZ, { prefixCls: Y, level: ye, isStart: P, isEnd: k }), this.renderDragHandler(), this.renderSwitcher(), this.renderCheckbox(), this.renderSelector()] }) } }]), n }(C.exports.Component), Sc = function (t) { return I(q2.Consumer, { children: function (n) { return I(BZ, { ...t, context: n }) } }) }; Sc.displayName = "TreeNode"; Sc.defaultProps = { title: $Z }; Sc.isTreeNode = 1; function ss(e, t) { if (!e) return []; var n = e.slice(), r = n.indexOf(t); return r >= 0 && n.splice(r, 1), n } function Bs(e, t) { var n = (e || []).slice(); return n.indexOf(t) === -1 && n.push(t), n } function Z2(e) { return e.split("-") } function kL(e, t) { return "".concat(e, "-").concat(t) } function VZ(e) { return e && e.type && e.type.isTreeNode } function UZ(e, t) { var n = [], r = t[e]; function i() { var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; s.forEach(function (c) { var o = c.key, f = c.children; n.push(o), i(f) }) } return i(r.children), n } function jZ(e) { if (e.parent) { var t = Z2(e.pos); return Number(t[t.length - 1]) === e.parent.children.length - 1 } return !1 } function KZ(e) { var t = Z2(e.pos); return Number(t[t.length - 1]) === 0 } function sI(e, t, n, r, i, s, c, o, f, p) { var v, y = e.clientX, w = e.clientY, P = e.target.getBoundingClientRect(), k = P.top, A = P.height, N = (p === "rtl" ? -1 : 1) * (((i == null ? void 0 : i.x) || 0) - y), R = (N - 12) / r, M = o[n.props.eventKey]; if (w < k + A / 2) { var O = c.findIndex(function (ve) { return ve.key === M.key }), z = O <= 0 ? 0 : O - 1, B = c[z].key; M = o[B] } var V = M.key, G = M, j = M.key, X = 0, Y = 0; if (!f.includes(V)) for (var se = 0; se < R && jZ(M); se += 1)M = M.parent, Y += 1; var ee = t.props.data, Z = M.node, J = !0; return KZ(M) && M.level === 0 && w < k + A / 2 && s({ dragNode: ee, dropNode: Z, dropPosition: -1 }) && M.key === n.props.eventKey ? X = -1 : (G.children || []).length && f.includes(j) ? s({ dragNode: ee, dropNode: Z, dropPosition: 0 }) ? X = 0 : J = !1 : Y === 0 ? R > -1.5 ? s({ dragNode: ee, dropNode: Z, dropPosition: 1 }) ? X = 1 : J = !1 : s({ dragNode: ee, dropNode: Z, dropPosition: 0 }) ? X = 0 : s({ dragNode: ee, dropNode: Z, dropPosition: 1 }) ? X = 1 : J = !1 : s({ dragNode: ee, dropNode: Z, dropPosition: 1 }) ? X = 1 : J = !1, { dropPosition: X, dropLevelOffset: Y, dropTargetKey: M.key, dropTargetPos: M.pos, dragOverNodeKey: j, dropContainerKey: X === 0 ? null : ((v = M.parent) === null || v === void 0 ? void 0 : v.key) || null, dropAllowed: J } } function lI(e, t) { if (!!e) { var n = t.multiple; return n ? e.slice() : e.length ? [e[0]] : e } } function O1(e) { if (!e) return null; var t; if (Array.isArray(e)) t = { checkedKeys: e, halfCheckedKeys: void 0 }; else if (ln(e) === "object") t = { checkedKeys: e.checked || void 0, halfCheckedKeys: e.halfChecked || void 0 }; else return Rr(!1, "`checkedKeys` is not an array or an object"), null; return t } function nC(e, t) { var n = new Set; function r(i) { if (!n.has(i)) { var s = t[i]; if (!!s) { n.add(i); var c = s.parent, o = s.node; o.disabled || c && r(c.key) } } } return (e || []).forEach(function (i) { r(i) }), Et(n) } var HZ = ["children"]; function _m(e, t) { return e != null ? e : t } function Wy(e) { var t = e || {}, n = t.title, r = t._title, i = t.key, s = t.children, c = n || "title"; return { title: c, _title: r || [c], key: i || "key", children: s || "children" } } function IL(e) { function t(n) { var r = Zi(n); return r.map(function (i) { if (!VZ(i)) return Rr(!i, "Tree/TreeNode can only accept TreeNode as children."), null; var s = i.key, c = i.props, o = c.children, f = Rn(c, HZ), p = ge({ key: s }, f), v = t(o); return v.length && (p.children = v), p }).filter(function (i) { return i }) } return t(e) } function D1(e, t, n) { var r = Wy(n), i = r._title, s = r.key, c = r.children, o = new Set(t === !0 ? [] : t), f = []; function p(v) { var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; return v.map(function (w, P) { for (var k = kL(y ? y.pos : "0", P), A = _m(w[s], k), N, R = 0; R < i.length; R += 1) { var M = i[R]; if (w[M] !== void 0) { N = w[M]; break } } var O = ge(ge({}, vi(w, [].concat(Et(i), [s, c]))), {}, { title: N, key: A, parent: y, pos: k, children: null, data: w, isStart: [].concat(Et(y ? y.isStart : []), [P === 0]), isEnd: [].concat(Et(y ? y.isEnd : []), [P === v.length - 1]) }); return f.push(O), t === !0 || o.has(A) ? O.children = p(w[c] || [], O) : O.children = [], O }) } return p(e), f } function WZ(e, t, n) { var r = {}; ln(n) === "object" ? r = n : r = { externalGetKey: n }, r = r || {}; var i = r, s = i.childrenPropName, c = i.externalGetKey, o = i.fieldNames, f = Wy(o), p = f.key, v = f.children, y = s || v, w; c ? typeof c == "string" ? w = function (A) { return A[c] } : typeof c == "function" && (w = function (A) { return c(A) }) : w = function (A, N) { return _m(A[p], N) }; function P(k, A, N, R) { var M = k ? k[y] : e, O = k ? kL(N.pos, A) : "0", z = k ? [].concat(Et(R), [k]) : []; if (k) { var B = w(k, O), V = { node: k, index: A, pos: O, key: B, parentPos: N.node ? N.pos : null, level: N.level + 1, nodes: z }; t(V) } M && M.forEach(function (G, j) { P(G, j, { node: k, pos: O, level: N ? N.level + 1 : -1 }, z) }) } P(null) } function ix(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.initWrapper, r = t.processEntity, i = t.onProcessFinished, s = t.externalGetKey, c = t.childrenPropName, o = t.fieldNames, f = arguments.length > 2 ? arguments[2] : void 0, p = s || f, v = {}, y = {}, w = { posEntities: v, keyEntities: y }; return n && (w = n(w) || w), WZ(e, function (P) { var k = P.node, A = P.index, N = P.pos, R = P.key, M = P.parentPos, O = P.level, z = P.nodes, B = { node: k, nodes: z, index: A, key: R, pos: N, level: O }, V = _m(R, N); v[N] = B, y[V] = B, B.parent = v[M], B.parent && (B.parent.children = B.parent.children || [], B.parent.children.push(B)), r && r(B, w) }, { externalGetKey: p, childrenPropName: c, fieldNames: o }), i && i(w), w } function mp(e, t) { var n = t.expandedKeys, r = t.selectedKeys, i = t.loadedKeys, s = t.loadingKeys, c = t.checkedKeys, o = t.halfCheckedKeys, f = t.dragOverNodeKey, p = t.dropPosition, v = t.keyEntities, y = v[e], w = { eventKey: e, expanded: n.indexOf(e) !== -1, selected: r.indexOf(e) !== -1, loaded: i.indexOf(e) !== -1, loading: s.indexOf(e) !== -1, checked: c.indexOf(e) !== -1, halfChecked: o.indexOf(e) !== -1, pos: String(y ? y.pos : ""), dragOver: f === e && p === 0, dragOverGapTop: f === e && p === -1, dragOverGapBottom: f === e && p === 1 }; return w } function Ci(e) { var t = e.data, n = e.expanded, r = e.selected, i = e.checked, s = e.loaded, c = e.loading, o = e.halfChecked, f = e.dragOver, p = e.dragOverGapTop, v = e.dragOverGapBottom, y = e.pos, w = e.active, P = e.eventKey, k = ge(ge({}, t), {}, { expanded: n, selected: r, checked: i, loaded: s, loading: c, halfChecked: o, dragOver: f, dragOverGapTop: p, dragOverGapBottom: v, pos: y, active: w, key: P }); return "props" in k || Object.defineProperty(k, "props", { get: function () { return Rr(!1, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."), e } }), k } var GZ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, RL = C.exports.createContext(null), qZ = function (t, n) { var r = t.defaultValue, i = t.children, s = t.options, c = s === void 0 ? [] : s, o = t.prefixCls, f = t.className, p = t.style, v = t.onChange, y = GZ(t, ["defaultValue", "children", "options", "prefixCls", "className", "style", "onChange"]), w = C.exports.useContext(zn), P = w.getPrefixCls, k = w.direction, A = C.exports.useState(y.value || r || []), N = ze(A, 2), R = N[0], M = N[1], O = C.exports.useState([]), z = ze(O, 2), B = z[0], V = z[1]; C.exports.useEffect(function () { "value" in y && M(y.value || []) }, [y.value]); var G = function () { return c.map(function (ce) { return typeof ce == "string" || typeof ce == "number" ? { label: ce, value: ce } : ce }) }, j = function (ce) { V(function (oe) { return oe.filter(function (ye) { return ye !== ce }) }) }, X = function (ce) { V(function (oe) { return [].concat(Et(oe), [ce]) }) }, Y = function (ce) { var oe = R.indexOf(ce.value), ye = Et(R); oe === -1 ? ye.push(ce.value) : ye.splice(oe, 1), "value" in y || M(ye); var Ie = G(); v == null || v(ye.filter(function (Te) { return B.includes(Te) }).sort(function (Te, Pe) { var De = Ie.findIndex(function (ke) { return ke.value === Te }), Re = Ie.findIndex(function (ke) { return ke.value === Pe }); return De - Re })) }, se = P("checkbox", o), ee = "".concat(se, "-group"), Z = vi(y, ["value", "disabled"]); c && c.length > 0 && (i = G().map(function (ie) { return I(Ld, { prefixCls: se, disabled: "disabled" in ie ? ie.disabled : y.disabled, value: ie.value, checked: R.includes(ie.value), onChange: ie.onChange, className: "".concat(ee, "-item"), style: ie.style, children: ie.label }, ie.value.toString()) })); var J = { toggleOption: Y, value: R, disabled: y.disabled, name: y.name, registerValue: X, cancelValue: j }, ve = Xe(ee, re({}, "".concat(ee, "-rtl"), k === "rtl"), f); return I("div", { className: ve, style: p, ...Z, ref: n, children: I(RL.Provider, { value: J, children: i }) }) }, ZZ = C.exports.forwardRef(qZ); const XZ = C.exports.memo(ZZ); var YZ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, QZ = function (t, n) { var r, i, s = t.prefixCls, c = t.className, o = t.children, f = t.indeterminate, p = f === void 0 ? !1 : f, v = t.style, y = t.onMouseEnter, w = t.onMouseLeave, P = t.skipGroup, k = P === void 0 ? !1 : P, A = t.disabled, N = YZ(t, ["prefixCls", "className", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]), R = C.exports.useContext(zn), M = R.getPrefixCls, O = R.direction, z = C.exports.useContext(RL), B = C.exports.useContext(Fo), V = B.isFormItemInput, G = C.exports.useContext(dl), j = (i = (z == null ? void 0 : z.disabled) || A) !== null && i !== void 0 ? i : G, X = C.exports.useRef(N.value); C.exports.useEffect(function () { z == null || z.registerValue(N.value) }, []), C.exports.useEffect(function () { if (!k) return N.value !== X.current && (z == null || z.cancelValue(X.current), z == null || z.registerValue(N.value), X.current = N.value), function () { return z == null ? void 0 : z.cancelValue(N.value) } }, [N.value]); var Y = M("checkbox", s), se = tt({}, N); z && !k && (se.onChange = function () { N.onChange && N.onChange.apply(N, arguments), z.toggleOption && z.toggleOption({ label: o, value: N.value }) }, se.name = z.name, se.checked = z.value.includes(N.value)); var ee = Xe((r = {}, re(r, "".concat(Y, "-wrapper"), !0), re(r, "".concat(Y, "-rtl"), O === "rtl"), re(r, "".concat(Y, "-wrapper-checked"), se.checked), re(r, "".concat(Y, "-wrapper-disabled"), j), re(r, "".concat(Y, "-wrapper-in-form-item"), V), r), c), Z = Xe(re({}, "".concat(Y, "-indeterminate"), p)), J = p ? "mixed" : void 0; return Qe("label", { className: ee, style: v, onMouseEnter: y, onMouseLeave: w, children: [I(G2, { "aria-checked": J, ...se, prefixCls: Y, className: Z, disabled: j, ref: n }), o !== void 0 && I("span", { children: o })] }) }, JZ = C.exports.forwardRef(QZ); const Ld = JZ; var X2 = Ld; X2.Group = XZ; X2.__ANT_CHECKBOX = !0; const pc = X2; var eX = C.exports.createContext({}); const ML = eX; var tX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function nX(e) { return typeof e == "number" ? "".concat(e, " ").concat(e, " auto") : /^\d+(\.\d+)?(px|em|rem|%)$/.test(e) ? "0 0 ".concat(e) : e } var rX = ["xs", "sm", "md", "lg", "xl", "xxl"], iX = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = C.exports.useContext(ML), o = c.gutter, f = c.wrap, p = c.supportFlexGap, v = e.prefixCls, y = e.span, w = e.order, P = e.offset, k = e.push, A = e.pull, N = e.className, R = e.children, M = e.flex, O = e.style, z = tX(e, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]), B = i("col", v), V = {}; rX.forEach(function (se) { var ee, Z = {}, J = e[se]; typeof J == "number" ? Z.span = J : ln(J) === "object" && (Z = J || {}), delete z[se], V = tt(tt({}, V), (ee = {}, re(ee, "".concat(B, "-").concat(se, "-").concat(Z.span), Z.span !== void 0), re(ee, "".concat(B, "-").concat(se, "-order-").concat(Z.order), Z.order || Z.order === 0), re(ee, "".concat(B, "-").concat(se, "-offset-").concat(Z.offset), Z.offset || Z.offset === 0), re(ee, "".concat(B, "-").concat(se, "-push-").concat(Z.push), Z.push || Z.push === 0), re(ee, "".concat(B, "-").concat(se, "-pull-").concat(Z.pull), Z.pull || Z.pull === 0), re(ee, "".concat(B, "-rtl"), s === "rtl"), ee)) }); var G = Xe(B, (n = {}, re(n, "".concat(B, "-").concat(y), y !== void 0), re(n, "".concat(B, "-order-").concat(w), w), re(n, "".concat(B, "-offset-").concat(P), P), re(n, "".concat(B, "-push-").concat(k), k), re(n, "".concat(B, "-pull-").concat(A), A), n), N, V), j = {}; if (o && o[0] > 0) { var X = o[0] / 2; j.paddingLeft = X, j.paddingRight = X } if (o && o[1] > 0 && !p) { var Y = o[1] / 2; j.paddingTop = Y, j.paddingBottom = Y } return M && (j.flex = nX(M), f === !1 && !j.minWidth && (j.minWidth = 0)), I("div", { ...z, style: tt(tt({}, j), O), className: G, ref: t, children: R }) }); const Gy = iX; var oX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; ia("top", "middle", "bottom", "stretch"); ia("start", "end", "center", "space-around", "space-between", "space-evenly"); function uI(e, t) { var n = C.exports.useState(typeof e == "string" ? e : ""), r = ze(n, 2), i = r[0], s = r[1], c = function () { if (typeof e == "string" && s(e), ln(e) === "object") for (var f = 0; f < $y.length; f++) { var p = $y[f]; if (!!t[p]) { var v = e[p]; if (v !== void 0) { s(v); return } } } }; return C.exports.useEffect(function () { c() }, [JSON.stringify(e), t]), i } var aX = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = e.justify, s = e.align, c = e.className, o = e.style, f = e.children, p = e.gutter, v = p === void 0 ? 0 : p, y = e.wrap, w = oX(e, ["prefixCls", "justify", "align", "className", "style", "children", "gutter", "wrap"]), P = C.exports.useContext(zn), k = P.getPrefixCls, A = P.direction, N = C.exports.useState({ xs: !0, sm: !0, md: !0, lg: !0, xl: !0, xxl: !0 }), R = ze(N, 2), M = R[0], O = R[1], z = C.exports.useState({ xs: !1, sm: !1, md: !1, lg: !1, xl: !1, xxl: !1 }), B = ze(z, 2), V = B[0], G = B[1], j = uI(s, V), X = uI(i, V), Y = vL(), se = C.exports.useRef(v); C.exports.useEffect(function () { var Re = By.subscribe(function (ke) { G(ke); var Oe = se.current || 0; (!Array.isArray(Oe) && ln(Oe) === "object" || Array.isArray(Oe) && (ln(Oe[0]) === "object" || ln(Oe[1]) === "object")) && O(ke) }); return function () { return By.unsubscribe(Re) } }, []); var ee = function () { var ke = [void 0, void 0], Oe = Array.isArray(v) ? v : [v, void 0]; return Oe.forEach(function ($e, He) { if (ln($e) === "object") for (var Ue = 0; Ue < $y.length; Ue++) { var st = $y[Ue]; if (M[st] && $e[st] !== void 0) { ke[He] = $e[st]; break } } else ke[He] = $e }), ke }, Z = k("row", r), J = ee(), ve = Xe(Z, (n = {}, re(n, "".concat(Z, "-no-wrap"), y === !1), re(n, "".concat(Z, "-").concat(X), X), re(n, "".concat(Z, "-").concat(j), j), re(n, "".concat(Z, "-rtl"), A === "rtl"), n), c), ie = {}, ce = J[0] != null && J[0] > 0 ? J[0] / -2 : void 0, oe = J[1] != null && J[1] > 0 ? J[1] / -2 : void 0; if (ce && (ie.marginLeft = ce, ie.marginRight = ce), Y) { var ye = ze(J, 2); ie.rowGap = ye[1] } else oe && (ie.marginTop = oe, ie.marginBottom = oe); var Ie = ze(J, 2), Te = Ie[0], Pe = Ie[1], De = C.exports.useMemo(function () { return { gutter: [Te, Pe], wrap: y, supportFlexGap: Y } }, [Te, Pe, y, Y]); return I(ML.Provider, { value: De, children: I("div", { ...w, className: ve, style: tt(tt({}, ie), o), ref: t, children: f }) }) }); const AL = aX; var NL = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = e.forceRender, s = e.className, c = e.style, o = e.children, f = e.isActive, p = e.role, v = C.exports.useState(f || i), y = ze(v, 2), w = y[0], P = y[1]; return C.exports.useEffect(function () { (i || f) && P(!0) }, [i, f]), w ? I("div", { ref: t, className: Xe("".concat(r, "-content"), (n = {}, re(n, "".concat(r, "-content-active"), f), re(n, "".concat(r, "-content-inactive"), !f), n), s), style: c, role: p, children: I("div", { className: "".concat(r, "-content-box"), children: o }) }) : null }); NL.displayName = "PanelContent"; var sX = ["className", "id", "style", "prefixCls", "headerClass", "children", "isActive", "destroyInactivePanel", "accordion", "forceRender", "openMotion", "extra", "collapsible"], OL = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.onItemClick = function () { var o = r.props, f = o.onItemClick, p = o.panelKey; typeof f == "function" && f(p) }, r.handleKeyPress = function (o) { (o.key === "Enter" || o.keyCode === 13 || o.which === 13) && r.onItemClick() }, r.renderIcon = function () { var o = r.props, f = o.showArrow, p = o.expandIcon, v = o.prefixCls, y = o.collapsible; if (!f) return null; var w = typeof p == "function" ? p(r.props) : I("i", { className: "arrow" }); return w && I("div", { className: "".concat(v, "-expand-icon"), onClick: y === "header" || y === "icon" ? r.onItemClick : null, children: w }) }, r.renderTitle = function () { var o = r.props, f = o.header, p = o.prefixCls, v = o.collapsible; return I("span", { className: "".concat(p, "-header-text"), onClick: v === "header" ? r.onItemClick : null, children: f }) }, r } return Fr(n, [{ key: "shouldComponentUpdate", value: function (i) { return !Cc(this.props, i) } }, { key: "render", value: function () { var i, s, c = this.props, o = c.className, f = c.id, p = c.style, v = c.prefixCls, y = c.headerClass, w = c.children, P = c.isActive, k = c.destroyInactivePanel, A = c.accordion, N = c.forceRender, R = c.openMotion, M = c.extra, O = c.collapsible, z = Rn(c, sX), B = O === "disabled", V = O === "header", G = O === "icon", j = Xe((i = {}, re(i, "".concat(v, "-item"), !0), re(i, "".concat(v, "-item-active"), P), re(i, "".concat(v, "-item-disabled"), B), i), o), X = Xe("".concat(v, "-header"), (s = {}, re(s, y, y), re(s, "".concat(v, "-header-collapsible-only"), V), re(s, "".concat(v, "-icon-collapsible-only"), G), s)), Y = { className: X, "aria-expanded": P, "aria-disabled": B, onKeyPress: this.handleKeyPress }; !V && !G && (Y.onClick = this.onItemClick, Y.role = A ? "tab" : "button", Y.tabIndex = B ? -1 : 0); var se = M != null && typeof M != "boolean"; return delete z.header, delete z.panelKey, delete z.onItemClick, delete z.showArrow, delete z.expandIcon, Qe("div", { ...z, className: j, style: p, id: f, children: [Qe("div", { ...Y, children: [this.renderIcon(), this.renderTitle(), se && I("div", { className: "".concat(v, "-extra"), children: M })] }), I(Sa, { visible: P, leavedClassName: "".concat(v, "-content-hidden"), ...R, forceRender: N, removeOnLeave: k, children: function (ee, Z) { var J = ee.className, ve = ee.style; return I(NL, { ref: Z, prefixCls: v, className: J, style: ve, isActive: P, forceRender: N, role: A ? "tabpanel" : null, children: w }) } })] }) } }]), n }(C.exports.Component); OL.defaultProps = { showArrow: !0, isActive: !1, onItemClick: function () { }, headerClass: "", forceRender: !1 }; function cI(e) { var t = e; if (!Array.isArray(t)) { var n = ln(t); t = n === "number" || n === "string" ? [t] : [] } return t.map(function (r) { return String(r) }) } var bm = function (e) { ui(n, e); var t = ci(n); function n(r) { var i; zr(this, n), i = t.call(this, r), i.onClickItem = function (f) { var p = i.state.activeKey; if (i.props.accordion) p = p[0] === f ? [] : [f]; else { p = Et(p); var v = p.indexOf(f), y = v > -1; y ? p.splice(v, 1) : p.push(f) } i.setActiveKey(p) }, i.getNewChild = function (f, p) { if (!f) return null; var v = i.state.activeKey, y = i.props, w = y.prefixCls, P = y.openMotion, k = y.accordion, A = y.destroyInactivePanel, N = y.expandIcon, R = y.collapsible, M = f.key || String(p), O = f.props, z = O.header, B = O.headerClass, V = O.destroyInactivePanel, G = O.collapsible, j = !1; k ? j = v[0] === M : j = v.indexOf(M) > -1; var X = G != null ? G : R, Y = { key: M, panelKey: M, header: z, headerClass: B, isActive: j, prefixCls: w, destroyInactivePanel: V != null ? V : A, openMotion: P, accordion: k, children: f.props.children, onItemClick: X === "disabled" ? null : i.onClickItem, expandIcon: N, collapsible: X }; return typeof f.type == "string" ? f : (Object.keys(Y).forEach(function (se) { typeof Y[se] > "u" && delete Y[se] }), C.exports.cloneElement(f, Y)) }, i.getItems = function () { var f = i.props.children; return Zi(f).map(i.getNewChild) }, i.setActiveKey = function (f) { "activeKey" in i.props || i.setState({ activeKey: f }), i.props.onChange(i.props.accordion ? f[0] : f) }; var s = r.activeKey, c = r.defaultActiveKey, o = c; return "activeKey" in r && (o = s), i.state = { activeKey: cI(o) }, i } return Fr(n, [{ key: "shouldComponentUpdate", value: function (i, s) { return !Cc(this.props, i) || !Cc(this.state, s) } }, { key: "render", value: function () { var i, s = this.props, c = s.prefixCls, o = s.className, f = s.style, p = s.accordion, v = Xe((i = {}, re(i, c, !0), re(i, o, !!o), i)); return I("div", { className: v, style: f, role: p ? "tablist" : null, children: this.getItems() }) } }], [{ key: "getDerivedStateFromProps", value: function (i) { var s = {}; return "activeKey" in i && (s.activeKey = cI(i.activeKey)), s } }]), n }(C.exports.Component); bm.defaultProps = { prefixCls: "rc-collapse", onChange: function () { }, accordion: !1, destroyInactivePanel: !1 }; bm.Panel = OL; bm.Panel; var lX = function (t) { var n = C.exports.useContext(zn), r = n.getPrefixCls, i = t.prefixCls, s = t.className, c = s === void 0 ? "" : s, o = t.showArrow, f = o === void 0 ? !0 : o, p = r("collapse", i), v = Xe(re({}, "".concat(p, "-no-arrow"), !f), c); return I(bm.Panel, { ...t, prefixCls: p, className: v }) }; const uX = lX; var DL = function (t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = t.prefixCls, o = t.className, f = o === void 0 ? "" : o, p = t.bordered, v = p === void 0 ? !0 : p, y = t.ghost, w = t.expandIconPosition, P = w === void 0 ? "start" : w, k = i("collapse", c), A = C.exports.useMemo(function () { return P === "left" ? "start" : P === "right" ? "end" : P }, [P]), N = function () { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, V = t.expandIcon, G = V ? V(B) : I(V2, { rotate: B.isActive ? 90 : void 0 }); return li(G, function () { return { className: Xe(G.props.className, "".concat(k, "-arrow")) } }) }, R = Xe("".concat(k, "-icon-position-").concat(A), (n = {}, re(n, "".concat(k, "-borderless"), !v), re(n, "".concat(k, "-rtl"), s === "rtl"), re(n, "".concat(k, "-ghost"), !!y), n), f), M = tt(tt({}, qp), { motionAppear: !1, leavedClassName: "".concat(k, "-content-hidden") }), O = function () { var B = t.children; return Zi(B).map(function (V, G) { var j; if (!((j = V.props) === null || j === void 0) && j.disabled) { var X = V.key || String(G), Y = V.props, se = Y.disabled, ee = Y.collapsible, Z = tt(tt({}, vi(V.props, ["disabled"])), { key: X, collapsible: ee != null ? ee : se ? "disabled" : void 0 }); return li(V, Z) } return V }) }; return I(bm, { openMotion: M, ...t, expandIcon: N, prefixCls: k, className: R, children: O() }) }; DL.Panel = uX; const dI = DL; var LL = C.exports.createContext(null), fI = []; function cX(e, t) { var n = C.exports.useState(function () { if (!wo()) return null; var k = document.createElement("div"); return k }), r = ze(n, 1), i = r[0], s = C.exports.useRef(!1), c = C.exports.useContext(LL), o = C.exports.useState(fI), f = ze(o, 2), p = f[0], v = f[1], y = c || (s.current ? void 0 : function (k) { v(function (A) { var N = [k].concat(Et(A)); return N }) }); function w() { i.parentElement || document.body.appendChild(i), s.current = !0 } function P() { var k; (k = i.parentElement) === null || k === void 0 || k.removeChild(i), s.current = !1 } return si(function () { return e ? c ? c(w) : w() : P(), P }, [e]), si(function () { p.length && (p.forEach(function (k) { return k() }), v(fI)) }, [p]), [i, y] } var L1; function qy(e) { if (typeof document > "u") return 0; if (e || L1 === void 0) { var t = document.createElement("div"); t.style.width = "100%", t.style.height = "200px"; var n = document.createElement("div"), r = n.style; r.position = "absolute", r.top = "0", r.left = "0", r.pointerEvents = "none", r.visibility = "hidden", r.width = "200px", r.height = "150px", r.overflow = "hidden", n.appendChild(t), document.body.appendChild(n); var i = t.offsetWidth; n.style.overflow = "scroll"; var s = t.offsetWidth; i === s && (s = n.clientWidth), document.body.removeChild(n), L1 = i - s } return L1 } function hI(e) { var t = e.match(/^(.*)px$/), n = Number(t == null ? void 0 : t[1]); return Number.isNaN(n) ? qy() : n } function pI(e) { if (typeof document > "u" || !e || !(e instanceof Element)) return { width: 0, height: 0 }; var t = getComputedStyle(e, "::-webkit-scrollbar"), n = t.width, r = t.height; return { width: hI(n), height: hI(r) } } function dX() { return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth } var fX = "rc-util-locker-".concat(Date.now()), mI = 0; function hX(e) {
|
|
|
var t = !!e, n = C.exports.useState(function () { return mI += 1, "".concat(fX, "_").concat(mI) }), r = ze(n, 1), i = r[0]; si(function () {
|
|
|
if (t) {
|
|
|
var s = qy(), c = dX(); hm(`
|
|
|
html body {
|
|
|
overflow-y: hidden;
|
|
|
`.concat(c ? "width: calc(100% - ".concat(s, "px);") : "", `
|
|
|
}`), i)
|
|
|
} else ek(i); return function () { ek(i) }
|
|
|
}, [t, i])
|
|
|
} var vI = !1; function pX(e) { return typeof e == "boolean" && (vI = e), vI } var gI = function (t) { return t === !1 ? !1 : !wo() || !t ? null : typeof t == "string" ? document.querySelector(t) : typeof t == "function" ? t() : t }, mX = C.exports.forwardRef(function (e, t) { var n = e.open, r = e.autoLock, i = e.getContainer; e.debug; var s = e.autoDestroy, c = s === void 0 ? !0 : s, o = e.children, f = C.exports.useState(n), p = ze(f, 2), v = p[0], y = p[1], w = v || n; C.exports.useEffect(function () { (c || n) && y(n) }, [n, c]); var P = C.exports.useState(function () { return gI(i) }), k = ze(P, 2), A = k[0], N = k[1]; C.exports.useEffect(function () { var se = gI(i); N(se != null ? se : null) }); var R = cX(w && !A), M = ze(R, 2), O = M[0], z = M[1], B = A != null ? A : O; hX(r && n && wo() && (B === O || B === document.body)); var V = null; if (o && Ic(o) && t) { var G = o; V = G.ref } var j = pN(V, t); if (!w || !wo() || A === void 0) return null; var X = B === !1 || pX(), Y = o; return t && (Y = C.exports.cloneElement(o, { ref: j })), I(LL.Provider, { value: z, children: X ? Y : pu.exports.createPortal(Y, B) }) }); function Zy(e) { var t = C.exports.useState(e), n = ze(t, 2), r = n[0], i = n[1]; return C.exports.useEffect(function () { var s = setTimeout(function () { i(e) }, e.length ? 0 : 10); return function () { clearTimeout(s) } }, [e]), r } var yI = []; function z1(e, t, n) { var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0; return { key: typeof e == "string" ? e : "".concat(n, "-").concat(r), error: e, errorStatus: t } } function zL(e) { var t = e.help, n = e.helpStatus, r = e.errors, i = r === void 0 ? yI : r, s = e.warnings, c = s === void 0 ? yI : s, o = e.className, f = e.fieldId, p = e.onVisibleChanged, v = C.exports.useContext(A2), y = v.prefixCls, w = C.exports.useContext(zn), P = w.getPrefixCls, k = "".concat(y, "-item-explain"), A = P(), N = Zy(i), R = Zy(c), M = C.exports.useMemo(function () { return t != null ? [z1(t, n, "help")] : [].concat(Et(N.map(function (z, B) { return z1(z, "error", "error", B) })), Et(R.map(function (z, B) { return z1(z, "warning", "warning", B) }))) }, [t, n, N, R]), O = {}; return f && (O.id = "".concat(f, "_help")), I(Sa, { motionDeadline: qp.motionDeadline, motionName: "".concat(A, "-show-help"), visible: !!M.length, onVisibleChanged: p, children: function (z) { var B = z.className, V = z.style; return I("div", { ...O, className: Xe(k, B, o), style: V, role: "alert", children: I(pO, { keys: M, ...qp, motionName: "".concat(A, "-show-help-item"), component: !1, children: function (G) { var j = G.key, X = G.error, Y = G.errorStatus, se = G.className, ee = G.style; return I("div", { className: Xe(se, re({}, "".concat(k, "-").concat(Y), Y)), style: ee, children: X }, j) } }) }) } }) } function xI(e) { return typeof e == "object" && e != null && e.nodeType === 1 } function _I(e, t) { return (!t || e !== "hidden") && e !== "visible" && e !== "clip" } function F1(e, t) { if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) { var n = getComputedStyle(e, null); return _I(n.overflowY, t) || _I(n.overflowX, t) || function (r) { var i = function (s) { if (!s.ownerDocument || !s.ownerDocument.defaultView) return null; try { return s.ownerDocument.defaultView.frameElement } catch { return null } }(r); return !!i && (i.clientHeight < r.scrollHeight || i.clientWidth < r.scrollWidth) }(e) } return !1 } function yg(e, t, n, r, i, s, c, o) { return s < e && c > t || s > e && c < t ? 0 : s <= e && o <= n || c >= t && o >= n ? s - e - r : c > t && o < n || s < e && o > n ? c - t + i : 0 } var bI = function (e, t) { var n = window, r = t.scrollMode, i = t.block, s = t.inline, c = t.boundary, o = t.skipOverflowHiddenElements, f = typeof c == "function" ? c : function (Pt) { return Pt !== c }; if (!xI(e)) throw new TypeError("Invalid target"); for (var p, v, y = document.scrollingElement || document.documentElement, w = [], P = e; xI(P) && f(P);) { if ((P = (v = (p = P).parentElement) == null ? p.getRootNode().host || null : v) === y) { w.push(P); break } P != null && P === document.body && F1(P) && !F1(document.documentElement) || P != null && F1(P, o) && w.push(P) } for (var k = n.visualViewport ? n.visualViewport.width : innerWidth, A = n.visualViewport ? n.visualViewport.height : innerHeight, N = window.scrollX || pageXOffset, R = window.scrollY || pageYOffset, M = e.getBoundingClientRect(), O = M.height, z = M.width, B = M.top, V = M.right, G = M.bottom, j = M.left, X = i === "start" || i === "nearest" ? B : i === "end" ? G : B + O / 2, Y = s === "center" ? j + z / 2 : s === "end" ? V : j, se = [], ee = 0; ee < w.length; ee++) { var Z = w[ee], J = Z.getBoundingClientRect(), ve = J.height, ie = J.width, ce = J.top, oe = J.right, ye = J.bottom, Ie = J.left; if (r === "if-needed" && B >= 0 && j >= 0 && G <= A && V <= k && B >= ce && G <= ye && j >= Ie && V <= oe) return se; var Te = getComputedStyle(Z), Pe = parseInt(Te.borderLeftWidth, 10), De = parseInt(Te.borderTopWidth, 10), Re = parseInt(Te.borderRightWidth, 10), ke = parseInt(Te.borderBottomWidth, 10), Oe = 0, $e = 0, He = "offsetWidth" in Z ? Z.offsetWidth - Z.clientWidth - Pe - Re : 0, Ue = "offsetHeight" in Z ? Z.offsetHeight - Z.clientHeight - De - ke : 0, st = "offsetWidth" in Z ? Z.offsetWidth === 0 ? 0 : ie / Z.offsetWidth : 0, ft = "offsetHeight" in Z ? Z.offsetHeight === 0 ? 0 : ve / Z.offsetHeight : 0; if (y === Z) Oe = i === "start" ? X : i === "end" ? X - A : i === "nearest" ? yg(R, R + A, A, De, ke, R + X, R + X + O, O) : X - A / 2, $e = s === "start" ? Y : s === "center" ? Y - k / 2 : s === "end" ? Y - k : yg(N, N + k, k, Pe, Re, N + Y, N + Y + z, z), Oe = Math.max(0, Oe + R), $e = Math.max(0, $e + N); else { Oe = i === "start" ? X - ce - De : i === "end" ? X - ye + ke + Ue : i === "nearest" ? yg(ce, ye, ve, De, ke + Ue, X, X + O, O) : X - (ce + ve / 2) + Ue / 2, $e = s === "start" ? Y - Ie - Pe : s === "center" ? Y - (Ie + ie / 2) + He / 2 : s === "end" ? Y - oe + Re + He : yg(Ie, oe, ie, Pe, Re + He, Y, Y + z, z); var It = Z.scrollLeft, We = Z.scrollTop; X += We - (Oe = Math.max(0, Math.min(We + Oe / ft, Z.scrollHeight - ve / ft + Ue))), Y += It - ($e = Math.max(0, Math.min(It + $e / st, Z.scrollWidth - ie / st + He))) } se.push({ el: Z, top: Oe, left: $e }) } return se }; function FL(e) { return e === Object(e) && Object.keys(e).length !== 0 } function vX(e, t) { t === void 0 && (t = "auto"); var n = "scrollBehavior" in document.body.style; e.forEach(function (r) { var i = r.el, s = r.top, c = r.left; i.scroll && n ? i.scroll({ top: s, left: c, behavior: t }) : (i.scrollTop = s, i.scrollLeft = c) }) } function gX(e) { return e === !1 ? { block: "end", inline: "nearest" } : FL(e) ? e : { block: "start", inline: "nearest" } } function yX(e, t) { var n = e.isConnected || e.ownerDocument.documentElement.contains(e); if (FL(t) && typeof t.behavior == "function") return t.behavior(n ? bI(e, t) : []); if (!!n) { var r = gX(t); return vX(bI(e, r), r.behavior) } } var xX = ["parentNode"], _X = "form_item"; function vp(e) { return e === void 0 || e === !1 ? [] : Array.isArray(e) ? e : [e] } function $L(e, t) { if (!!e.length) { var n = e.join("_"); if (t) return "".concat(t, "_").concat(n); var r = xX.includes(n); return r ? "".concat(_X, "_").concat(n) : n } } function wI(e) { var t = vp(e); return t.join("_") } function BL(e) { var t = n2(), n = ze(t, 1), r = n[0], i = C.exports.useRef({}), s = C.exports.useMemo(function () { return e != null ? e : tt(tt({}, r), { __INTERNAL__: { itemRef: function (o) { return function (f) { var p = wI(o); f ? i.current[p] = f : delete i.current[p] } } }, scrollToField: function (o) { var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = vp(o), v = $L(p, s.__INTERNAL__.name), y = v ? document.getElementById(v) : null; y && yX(y, tt({ scrollMode: "if-needed", block: "nearest" }, f)) }, getFieldInstance: function (o) { var f = wI(o); return i.current[f] } }) }, [e, r]); return [s] } var bX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, wX = function (t, n) { var r, i = C.exports.useContext(qa), s = C.exports.useContext(dl), c = C.exports.useContext(zn), o = c.getPrefixCls, f = c.direction, p = c.form, v = t.prefixCls, y = t.className, w = y === void 0 ? "" : y, P = t.size, k = P === void 0 ? i : P, A = t.disabled, N = A === void 0 ? s : A, R = t.form, M = t.colon, O = t.labelAlign, z = t.labelWrap, B = t.labelCol, V = t.wrapperCol, G = t.hideRequiredMark, j = t.layout, X = j === void 0 ? "horizontal" : j, Y = t.scrollToFirstError, se = t.requiredMark, ee = t.onFinishFailed, Z = t.name, J = bX(t, ["prefixCls", "className", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name"]), ve = C.exports.useMemo(function () { return se !== void 0 ? se : p && p.requiredMark !== void 0 ? p.requiredMark : !G }, [G, se, p]), ie = M != null ? M : p == null ? void 0 : p.colon, ce = o("form", v), oe = Xe(ce, (r = {}, re(r, "".concat(ce, "-").concat(X), !0), re(r, "".concat(ce, "-hide-required-mark"), ve === !1), re(r, "".concat(ce, "-rtl"), f === "rtl"), re(r, "".concat(ce, "-").concat(k), k), r), w), ye = BL(R), Ie = ze(ye, 1), Te = Ie[0], Pe = Te.__INTERNAL__; Pe.name = Z; var De = C.exports.useMemo(function () { return { name: Z, labelAlign: O, labelCol: B, labelWrap: z, wrapperCol: V, vertical: X === "vertical", colon: ie, requiredMark: ve, itemRef: Pe.itemRef, form: Te } }, [Z, O, B, V, X, ie, ve, Te]); C.exports.useImperativeHandle(n, function () { return Te }); var Re = function (Oe) { ee == null || ee(Oe); var $e = { block: "nearest" }; Y && Oe.errorFields.length && (ln(Y) === "object" && ($e = Y), Te.scrollToField(Oe.errorFields[0].name, $e)) }; return I(jO, { disabled: N, children: I(KO, { size: k, children: I(cu.Provider, { value: De, children: I(bf, { id: Z, ...J, name: Z, onFinishFailed: Re, form: Te, className: oe }) }) }) }) }, CX = C.exports.forwardRef(wX); const SX = CX; var EX = function () { var t = C.exports.useContext(Fo), n = t.status; return { status: n } }; const PX = EX; function TX(e) { var t = C.exports.useState(e), n = ze(t, 2), r = n[0], i = n[1], s = C.exports.useRef(null), c = C.exports.useRef([]), o = C.exports.useRef(!1); C.exports.useEffect(function () { return o.current = !1, function () { o.current = !0, nr.cancel(s.current), s.current = null } }, []); function f(p) { o.current || (s.current === null && (c.current = [], s.current = nr(function () { s.current = null, i(function (v) { var y = v; return c.current.forEach(function (w) { y = w(y) }), y }) })), c.current.push(p)) } return [r, f] } function kX() { var e = C.exports.useContext(cu), t = e.itemRef, n = C.exports.useRef({}); function r(i, s) { var c = s && ln(s) === "object" && s.ref, o = i.join("_"); return (n.current.name !== o || n.current.originRef !== c) && (n.current.name = o, n.current.originRef = c, n.current.ref = Po(t(i), c)), n.current.ref } return r } var IX = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "question-circle", theme: "outlined" }; const RX = IX; var VL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: RX }) }) }; VL.displayName = "QuestionCircleOutlined"; const MX = C.exports.forwardRef(VL); var AX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function NX(e) { return e ? ln(e) === "object" && !C.exports.isValidElement(e) ? e : { title: e } : null } var OX = function (t) { var n = t.prefixCls, r = t.label, i = t.htmlFor, s = t.labelCol, c = t.labelAlign, o = t.colon, f = t.required, p = t.requiredMark, v = t.tooltip, y = FN("Form"), w = ze(y, 1), P = w[0]; return r ? I(cu.Consumer, { children: function (k) { var A, N = k.vertical, R = k.labelAlign, M = k.labelCol, O = k.labelWrap, z = k.colon, B, V = s || M || {}, G = c || R, j = "".concat(n, "-item-label"), X = Xe(j, G === "left" && "".concat(j, "-left"), V.className, re({}, "".concat(j, "-wrap"), !!O)), Y = r, se = o === !0 || z !== !1 && o !== !1, ee = se && !N; ee && typeof r == "string" && r.trim() !== "" && (Y = r.replace(/[:|:]\s*$/, "")); var Z = NX(v); if (Z) { var J = Z.icon, ve = J === void 0 ? I(MX, {}) : J, ie = AX(Z, ["icon"]), ce = I(io, { ...ie, children: C.exports.cloneElement(ve, { className: "".concat(n, "-item-tooltip"), title: "" }) }); Y = Qe(An, { children: [Y, ce] }) } p === "optional" && !f && (Y = Qe(An, { children: [Y, I("span", { className: "".concat(n, "-item-optional"), title: "", children: (P == null ? void 0 : P.optional) || ((B = ol.Form) === null || B === void 0 ? void 0 : B.optional) })] })); var oe = Xe((A = {}, re(A, "".concat(n, "-item-required"), f), re(A, "".concat(n, "-item-required-mark-optional"), p === "optional"), re(A, "".concat(n, "-item-no-colon"), !se), A)); return I(Gy, { ...V, className: X, children: I("label", { htmlFor: i, className: oe, title: typeof r == "string" ? r : "", children: Y }) }) } }, "label") : null }; const DX = OX; var LX = function (t) { var n = t.prefixCls, r = t.status, i = t.wrapperCol, s = t.children, c = t.errors, o = t.warnings, f = t._internalItemRender, p = t.extra, v = t.help, y = t.fieldId, w = t.marginBottom, P = t.onErrorVisibleChanged, k = "".concat(n, "-item"), A = C.exports.useContext(cu), N = i || A.wrapperCol || {}, R = Xe("".concat(k, "-control"), N.className), M = C.exports.useMemo(function () { return tt({}, A) }, [A]); delete M.labelCol, delete M.wrapperCol; var O = I("div", { className: "".concat(k, "-control-input"), children: I("div", { className: "".concat(k, "-control-input-content"), children: s }) }), z = C.exports.useMemo(function () { return { prefixCls: n, status: r } }, [n, r]), B = w !== null || c.length || o.length ? Qe("div", { style: { display: "flex", flexWrap: "nowrap" }, children: [I(A2.Provider, { value: z, children: I(zL, { fieldId: y, errors: c, warnings: o, help: v, helpStatus: r, className: "".concat(k, "-explain-connected"), onVisibleChanged: P }) }), !!w && I("div", { style: { width: 0, height: w } })] }) : null, V = {}; y && (V.id = "".concat(y, "_extra")); var G = p ? I("div", { ...V, className: "".concat(k, "-extra"), children: p }) : null, j = f && f.mark === "pro_table_render" && f.render ? f.render(t, { input: O, errorList: B, extra: G }) : Qe(An, { children: [O, B, G] }); return I(cu.Provider, { value: M, children: I(Gy, { ...N, className: R, children: j }) }) }; const zX = LX; var FX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, $X = { success: a2, warning: s2, error: wf, validating: of }; function BX(e) { var t, n = e.prefixCls, r = e.className, i = e.style, s = e.help, c = e.errors, o = e.warnings, f = e.validateStatus, p = e.meta, v = e.hasFeedback, y = e.hidden, w = e.children, P = e.fieldId, k = e.isRequired, A = e.onSubItemMetaChange, N = FX(e, ["prefixCls", "className", "style", "help", "errors", "warnings", "validateStatus", "meta", "hasFeedback", "hidden", "children", "fieldId", "isRequired", "onSubItemMetaChange"]), R = "".concat(n, "-item"), M = C.exports.useContext(cu), O = M.requiredMark, z = C.exports.useRef(null), B = Zy(c), V = Zy(o), G = s != null, j = !!(G || c.length || o.length), X = C.exports.useState(null), Y = ze(X, 2), se = Y[0], ee = Y[1]; si(function () { if (j && z.current) { var ce = getComputedStyle(z.current); ee(parseInt(ce.marginBottom, 10)) } }, [j]); var Z = function (oe) { oe || ee(null) }, J = ""; f !== void 0 ? J = f : p.validating ? J = "validating" : B.length ? J = "error" : V.length ? J = "warning" : p.touched && (J = "success"); var ve = C.exports.useMemo(function () { var ce; if (v) { var oe = J && $X[J]; ce = oe ? I("span", { className: Xe("".concat(R, "-feedback-icon"), "".concat(R, "-feedback-icon-").concat(J)), children: I(oe, {}) }) : null } return { status: J, hasFeedback: v, feedbackIcon: ce, isFormItemInput: !0 } }, [J, v]), ie = (t = {}, re(t, R, !0), re(t, "".concat(R, "-with-help"), G || B.length || V.length), re(t, "".concat(r), !!r), re(t, "".concat(R, "-has-feedback"), J && v), re(t, "".concat(R, "-has-success"), J === "success"), re(t, "".concat(R, "-has-warning"), J === "warning"), re(t, "".concat(R, "-has-error"), J === "error"), re(t, "".concat(R, "-is-validating"), J === "validating"), re(t, "".concat(R, "-hidden"), y), t); return Qe("div", { className: Xe(ie), style: i, ref: z, children: [Qe(AL, { className: "".concat(R, "-row"), ...vi(N, ["_internalItemRender", "colon", "dependencies", "extra", "fieldKey", "getValueFromEvent", "getValueProps", "htmlFor", "id", "initialValue", "isListField", "label", "labelAlign", "labelCol", "labelWrap", "messageVariables", "name", "normalize", "noStyle", "preserve", "required", "requiredMark", "rules", "shouldUpdate", "trigger", "tooltip", "validateFirst", "validateTrigger", "valuePropName", "wrapperCol"]), children: [I(DX, { htmlFor: P, required: k, requiredMark: O, ...e, prefixCls: n }), I(zX, { ...e, ...p, errors: B, warnings: V, prefixCls: n, status: J, help: s, marginBottom: se, onErrorVisibleChanged: Z, children: I(ID.Provider, { value: A, children: I(Fo.Provider, { value: ve, children: w }) }) })] }), !!se && I("div", { className: "".concat(R, "-margin-offset"), style: { marginBottom: -se } })] }) } var VX = "__SPLIT__"; ia("success", "warning", "error", "validating", ""); var UX = C.exports.memo(function (e) { var t = e.children; return t }, function (e, t) { return e.value === t.value && e.update === t.update && e.childProps.length === t.childProps.length && e.childProps.every(function (n, r) { return n === t.childProps[r] }) }); function jX(e) { return e != null } function CI() { return { errors: [], warnings: [], touched: !1, validating: !1, name: [] } } function KX(e) { var t = e.name, n = e.noStyle, r = e.dependencies, i = e.prefixCls, s = e.shouldUpdate, c = e.rules, o = e.children, f = e.required, p = e.label, v = e.messageVariables, y = e.trigger, w = y === void 0 ? "onChange" : y, P = e.validateTrigger, k = e.hidden, A = C.exports.useContext(zn), N = A.getPrefixCls, R = C.exports.useContext(cu), M = R.name, O = typeof o == "function", z = C.exports.useContext(ID), B = C.exports.useContext(wc), V = B.validateTrigger, G = P !== void 0 ? P : V, j = jX(t), X = N("form", i), Y = C.exports.useContext(MN), se = C.exports.useRef(), ee = TX({}), Z = ze(ee, 2), J = Z[0], ve = Z[1], ie = ms(function () { return CI() }), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = function (st) { var ft = Y == null ? void 0 : Y.getKey(st.name); if (ye(st.destroy ? CI() : st, !0), n && z) { var It = st.name; if (st.destroy) It = se.current || It; else if (ft !== void 0) { var We = ze(ft, 2), Pt = We[0], pt = We[1]; It = [Pt].concat(Et(pt)), se.current = It } z(st, It) } }, Te = function (st, ft) { ve(function (It) { var We = tt({}, It), Pt = [].concat(Et(st.name.slice(0, -1)), Et(ft)), pt = Pt.join(VX); return st.destroy ? delete We[pt] : We[pt] = st, We }) }, Pe = C.exports.useMemo(function () { var Ue = Et(oe.errors), st = Et(oe.warnings); return Object.values(J).forEach(function (ft) { Ue.push.apply(Ue, Et(ft.errors || [])), st.push.apply(st, Et(ft.warnings || [])) }), [Ue, st] }, [J, oe.errors, oe.warnings]), De = ze(Pe, 2), Re = De[0], ke = De[1], Oe = kX(); function $e(Ue, st, ft) { return n && !k ? Ue : I(BX, { ...e, prefixCls: X, fieldId: st, isRequired: ft, errors: Re, warnings: ke, meta: oe, onSubItemMetaChange: Te, children: Ue }, "row") } if (!j && !O && !r) return $e(o); var He = {}; return typeof p == "string" ? He.label = p : t && (He.label = String(t)), v && (He = tt(tt({}, He), v)), I(t2, { ...e, messageVariables: He, trigger: w, validateTrigger: G, onMetaChange: Ie, children: function (Ue, st, ft) { var It = vp(t).length && st ? st.name : [], We = $L(It, M), Pt = f !== void 0 ? f : !!(c && c.some(function (ct) { if (ct && ln(ct) === "object" && ct.required && !ct.warningOnly) return !0; if (typeof ct == "function") { var rt = ct(ft); return rt && rt.required && !rt.warningOnly } return !1 })), pt = tt({}, Ue), Rt = null; if (Array.isArray(o) && j) Rt = o; else if (!(O && (!(s || r) || j))) { if (!(r && !O && !j)) if (zo(o)) { var yt = tt(tt({}, o.props), pt); if (yt.id || (yt.id = We), e.help || Re.length > 0 || ke.length > 0 || e.extra) { var Mt = []; (e.help || Re.length > 0) && Mt.push("".concat(We, "_help")), e.extra && Mt.push("".concat(We, "_extra")), yt["aria-describedby"] = Mt.join(" ") } Re.length > 0 && (yt["aria-invalid"] = "true"), Pt && (yt["aria-required"] = "true"), Ic(o) && (yt.ref = Oe(It, o)); var ut = new Set([].concat(Et(vp(w)), Et(vp(G)))); ut.forEach(function (ct) { yt[ct] = function () { for (var rt, ht, bt, Wt, Ut, Jt = arguments.length, Fe = new Array(Jt), Ge = 0; Ge < Jt; Ge++)Fe[Ge] = arguments[Ge]; (bt = pt[ct]) === null || bt === void 0 || (rt = bt).call.apply(rt, [pt].concat(Fe)), (Ut = (Wt = o.props)[ct]) === null || Ut === void 0 || (ht = Ut).call.apply(ht, [Wt].concat(Fe)) } }); var dt = [yt["aria-required"], yt["aria-invalid"], yt["aria-describedby"]]; Rt = I(UX, { value: pt[e.valuePropName || "value"], update: o, childProps: dt, children: li(o, yt) }) } else O && (s || r) && !j ? Rt = o(ft) : Rt = o } return $e(Rt, We, Pt) } }) } var UL = KX; UL.useStatus = PX; const HX = UL; var WX = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, GX = function (t) { var n = t.prefixCls, r = t.children, i = WX(t, ["prefixCls", "children"]), s = C.exports.useContext(zn), c = s.getPrefixCls, o = c("form", n), f = C.exports.useMemo(function () { return { prefixCls: o, status: "error" } }, [o]); return I(AN, { ...i, children: function (p, v, y) { return I(A2.Provider, { value: f, children: r(p.map(function (w) { return tt(tt({}, w), { fieldKey: w.key }) }), v, { errors: y.errors, warnings: y.warnings }) }) } }) }; const qX = GX; function ZX() { var e = C.exports.useContext(cu), t = e.form; return t } var fl = SX; fl.Item = HX; fl.List = qX; fl.ErrorList = zL; fl.useForm = BL; fl.useFormInstance = ZX; fl.useWatch = ON; fl.Provider = CW; fl.create = function () { }; const sc = fl; var XX = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, name: "eye", theme: "outlined" }; const YX = XX; var jL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: YX }) }) }; jL.displayName = "EyeOutlined"; const QX = C.exports.forwardRef(jL); function SI(e) { var t = e.getBoundingClientRect(), n = document.documentElement; return { left: t.left + (window.pageXOffset || n.scrollLeft) - (n.clientLeft || document.body.clientLeft || 0), top: t.top + (window.pageYOffset || n.scrollTop) - (n.clientTop || document.body.clientTop || 0) } } function JX() { var e = ge({}, ny); return e.useId } var EI = 0; function eY(e) { var t = C.exports.useState("ssr-id"), n = ze(t, 2), r = n[0], i = n[1], s = JX(), c = s == null ? void 0 : s(); return C.exports.useEffect(function () { if (!s) { var o = EI; EI += 1, i("rc_unique_".concat(o)) } }, []), e || c || r } function tY(e) { var t = e.prefixCls, n = e.style, r = e.visible, i = e.maskProps, s = e.motionName; return I(Sa, { visible: r, motionName: s, leavedClassName: "".concat(t, "-mask-hidden"), children: function (c, o) { var f = c.className, p = c.style; return I("div", { ref: o, style: ge(ge({}, p), n), className: Xe("".concat(t, "-mask"), f), ...i }) } }, "mask") } function PI(e, t, n) { var r = t; return !r && n && (r = "".concat(e, "-").concat(n)), r } function TI(e, t) { var n = e["page".concat(t ? "Y" : "X", "Offset")], r = "scroll".concat(t ? "Top" : "Left"); if (typeof n != "number") { var i = e.document; n = i.documentElement[r], typeof n != "number" && (n = i.body[r]) } return n } function nY(e) { var t = e.getBoundingClientRect(), n = { left: t.left, top: t.top }, r = e.ownerDocument, i = r.defaultView || r.parentWindow; return n.left += TI(i), n.top += TI(i, !0), n } const rY = C.exports.memo(function (e) { var t = e.children; return t }, function (e, t) { var n = t.shouldUpdate; return !n }); var kI = { width: 0, height: 0, overflow: "hidden", outline: "none" }, iY = tr.forwardRef(function (e, t) { var n = e.prefixCls, r = e.className, i = e.style, s = e.title, c = e.ariaId, o = e.footer, f = e.closable, p = e.closeIcon, v = e.onClose, y = e.children, w = e.bodyStyle, P = e.bodyProps, k = e.modalRender, A = e.onMouseDown, N = e.onMouseUp, R = e.holderRef, M = e.visible, O = e.forceRender, z = e.width, B = e.height, V = C.exports.useRef(), G = C.exports.useRef(); tr.useImperativeHandle(t, function () { return { focus: function () { var J; (J = V.current) === null || J === void 0 || J.focus() }, changeActive: function (J) { var ve = document, ie = ve.activeElement; J && ie === G.current ? V.current.focus() : !J && ie === V.current && G.current.focus() } } }); var j = {}; z !== void 0 && (j.width = z), B !== void 0 && (j.height = B); var X; o && (X = I("div", { className: "".concat(n, "-footer"), children: o })); var Y; s && (Y = I("div", { className: "".concat(n, "-header"), children: I("div", { className: "".concat(n, "-title"), id: c, children: s }) })); var se; f && (se = I("button", { type: "button", onClick: v, "aria-label": "Close", className: "".concat(n, "-close"), children: p || I("span", { className: "".concat(n, "-close-x") }) })); var ee = Qe("div", { className: "".concat(n, "-content"), children: [se, Y, I("div", { className: "".concat(n, "-body"), style: w, ...P, children: y }), X] }); return Qe("div", { role: "dialog", "aria-labelledby": s ? c : null, "aria-modal": "true", ref: R, style: ge(ge({}, i), j), className: Xe(n, r), onMouseDown: A, onMouseUp: N, children: [I("div", { tabIndex: 0, ref: V, style: kI, "aria-hidden": "true" }), I(rY, { shouldUpdate: M || O, children: k ? k(ee) : ee }), I("div", { tabIndex: 0, ref: G, style: kI, "aria-hidden": "true" })] }, "dialog-element") }), KL = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.title, i = e.style, s = e.className, c = e.visible, o = e.forceRender, f = e.destroyOnClose, p = e.motionName, v = e.ariaId, y = e.onVisibleChanged, w = e.mousePosition, P = C.exports.useRef(), k = C.exports.useState(), A = ze(k, 2), N = A[0], R = A[1], M = {}; N && (M.transformOrigin = N); function O() { var z = nY(P.current); R(w ? "".concat(w.x - z.left, "px ").concat(w.y - z.top, "px") : "") } return I(Sa, { visible: c, onVisibleChanged: y, onAppearPrepare: O, onEnterPrepare: O, forceRender: o, motionName: p, removeOnLeave: f, ref: P, children: function (z, B) { var V = z.className, G = z.style; return I(iY, { ...e, ref: t, title: r, ariaId: v, prefixCls: n, holderRef: B, style: ge(ge(ge({}, G), i), M), className: Xe(s, V) }) } }) }); KL.displayName = "Content"; function oY(e) { var t = e.prefixCls, n = t === void 0 ? "rc-dialog" : t, r = e.zIndex, i = e.visible, s = i === void 0 ? !1 : i, c = e.keyboard, o = c === void 0 ? !0 : c, f = e.focusTriggerAfterClose, p = f === void 0 ? !0 : f, v = e.wrapStyle, y = e.wrapClassName, w = e.wrapProps, P = e.onClose, k = e.afterClose, A = e.transitionName, N = e.animation, R = e.closable, M = R === void 0 ? !0 : R, O = e.mask, z = O === void 0 ? !0 : O, B = e.maskTransitionName, V = e.maskAnimation, G = e.maskClosable, j = G === void 0 ? !0 : G, X = e.maskStyle, Y = e.maskProps, se = e.rootClassName, ee = C.exports.useRef(), Z = C.exports.useRef(), J = C.exports.useRef(), ve = C.exports.useState(s), ie = ze(ve, 2), ce = ie[0], oe = ie[1], ye = eY(); function Ie() { hc(Z.current, document.activeElement) || (ee.current = document.activeElement) } function Te() { if (!hc(Z.current, document.activeElement)) { var st; (st = J.current) === null || st === void 0 || st.focus() } } function Pe(st) { if (st) Te(); else { if (oe(!1), z && ee.current && p) { try { ee.current.focus({ preventScroll: !0 }) } catch { } ee.current = null } ce && (k == null || k()) } } function De(st) { P == null || P(st) } var Re = C.exports.useRef(!1), ke = C.exports.useRef(), Oe = function () { clearTimeout(ke.current), Re.current = !0 }, $e = function () { ke.current = setTimeout(function () { Re.current = !1 }) }, He = null; j && (He = function (ft) { Re.current ? Re.current = !1 : Z.current === ft.target && De(ft) }); function Ue(st) { if (o && st.keyCode === St.ESC) { st.stopPropagation(), De(st); return } s && st.keyCode === St.TAB && J.current.changeActive(!st.shiftKey) } return C.exports.useEffect(function () { s && (oe(!0), Ie()) }, [s]), C.exports.useEffect(function () { return function () { clearTimeout(ke.current) } }, []), Qe("div", { className: Xe("".concat(n, "-root"), se), ...uu(e, { data: !0 }), children: [I(tY, { prefixCls: n, visible: z && s, motionName: PI(n, B, V), style: ge({ zIndex: r }, X), maskProps: Y }), I("div", { tabIndex: -1, onKeyDown: Ue, className: Xe("".concat(n, "-wrap"), y), ref: Z, onClick: He, style: ge(ge({ zIndex: r }, v), {}, { display: ce ? null : "none" }), ...w, children: I(KL, { ...e, onMouseDown: Oe, onMouseUp: $e, ref: J, closable: M, ariaId: ye, prefixCls: n, visible: s && ce, onClose: De, onVisibleChanged: Pe, motionName: PI(n, A, N) }) })] }) } var HL = function (t) { var n = t.visible, r = t.getContainer, i = t.forceRender, s = t.destroyOnClose, c = s === void 0 ? !1 : s, o = t.afterClose, f = C.exports.useState(n), p = ze(f, 2), v = p[0], y = p[1]; return C.exports.useEffect(function () { n && y(!0) }, [n]), !i && c && !v ? null : I(mX, { open: n || i || v, autoDestroy: !1, getContainer: r, autoLock: n || v, children: I(oY, { ...t, destroyOnClose: c, afterClose: function () { o == null || o(), y(!1) } }) }) }; HL.displayName = "Dialog"; var aY = function (t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = t.prefixCls, o = t.className, f = o === void 0 ? "" : o, p = i("input-group", c), v = Xe(p, (n = {}, re(n, "".concat(p, "-lg"), t.size === "large"), re(n, "".concat(p, "-sm"), t.size === "small"), re(n, "".concat(p, "-compact"), t.compact), re(n, "".concat(p, "-rtl"), s === "rtl"), n), f), y = C.exports.useContext(Fo), w = C.exports.useMemo(function () { return tt(tt({}, y), { isFormItemInput: !1 }) }, [y]); return I("span", { className: v, style: t.style, onMouseEnter: t.onMouseEnter, onMouseLeave: t.onMouseLeave, onFocus: t.onFocus, onBlur: t.onBlur, children: I(Fo.Provider, { value: w, children: t.children }) }) }; const sY = aY; function Wg(e) { return !!(e.addonBefore || e.addonAfter) } function WL(e) { return !!(e.prefix || e.suffix || e.allowClear) } function II(e, t, n, r) { if (!!n) { var i = t; if (t.type === "click") { var s = e.cloneNode(!0); i = Object.create(t, { target: { value: s }, currentTarget: { value: s } }), s.value = "", n(i); return } if (r !== void 0) { i = Object.create(t, { target: { value: e }, currentTarget: { value: e } }), e.value = r, n(i); return } n(i) } } function lY(e, t) { if (!!e) { e.focus(t); var n = t || {}, r = n.cursor; if (r) { var i = e.value.length; switch (r) { case "start": e.setSelectionRange(0, 0); break; case "end": e.setSelectionRange(i, i); break; default: e.setSelectionRange(0, i) } } } } function RI(e) { return typeof e > "u" || e === null ? "" : String(e) } var uY = function (t) { var n = t.inputElement, r = t.prefixCls, i = t.prefix, s = t.suffix, c = t.addonBefore, o = t.addonAfter, f = t.className, p = t.style, v = t.affixWrapperClassName, y = t.groupClassName, w = t.wrapperClassName, P = t.disabled, k = t.readOnly, A = t.focused, N = t.triggerFocus, R = t.allowClear, M = t.value, O = t.handleReset, z = t.hidden, B = C.exports.useRef(null), V = function (oe) { var ye; (ye = B.current) !== null && ye !== void 0 && ye.contains(oe.target) && (N == null || N()) }, G = function () { var oe; if (!R) return null; var ye = !P && !k && M, Ie = "".concat(r, "-clear-icon"), Te = ln(R) === "object" && R !== null && R !== void 0 && R.clearIcon ? R.clearIcon : "\u2716"; return I("span", { onClick: O, onMouseDown: function (De) { return De.preventDefault() }, className: Xe(Ie, (oe = {}, re(oe, "".concat(Ie, "-hidden"), !ye), re(oe, "".concat(Ie, "-has-suffix"), !!s), oe)), role: "button", tabIndex: -1, children: Te }) }, j = C.exports.cloneElement(n, { value: M, hidden: z }); if (WL(t)) { var X, Y = "".concat(r, "-affix-wrapper"), se = Xe(Y, (X = {}, re(X, "".concat(Y, "-disabled"), P), re(X, "".concat(Y, "-focused"), A), re(X, "".concat(Y, "-readonly"), k), re(X, "".concat(Y, "-input-with-clear-btn"), s && R && M), X), !Wg(t) && f, v), ee = (s || R) && Qe("span", { className: "".concat(r, "-suffix"), children: [G(), s] }); j = Qe("span", { className: se, style: p, hidden: !Wg(t) && z, onClick: V, ref: B, children: [i && I("span", { className: "".concat(r, "-prefix"), children: i }), C.exports.cloneElement(n, { style: null, value: M, hidden: null }), ee] }) } if (Wg(t)) { var Z = "".concat(r, "-group"), J = "".concat(Z, "-addon"), ve = Xe("".concat(r, "-wrapper"), Z, w), ie = Xe("".concat(r, "-group-wrapper"), f, y); return I("span", { className: ie, style: p, hidden: z, children: Qe("span", { className: ve, children: [c && I("span", { className: J, children: c }), C.exports.cloneElement(j, { style: null, hidden: null }), o && I("span", { className: J, children: o })] }) }) } return j }, cY = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "type", "inputClassName"], dY = C.exports.forwardRef(function (e, t) { var n = e.autoComplete, r = e.onChange, i = e.onFocus, s = e.onBlur, c = e.onPressEnter, o = e.onKeyDown, f = e.prefixCls, p = f === void 0 ? "rc-input" : f, v = e.disabled, y = e.htmlSize, w = e.className, P = e.maxLength, k = e.suffix, A = e.showCount, N = e.type, R = N === void 0 ? "text" : N, M = e.inputClassName, O = Rn(e, cY), z = Bi(e.defaultValue, { value: e.value }), B = ze(z, 2), V = B[0], G = B[1], j = C.exports.useState(!1), X = ze(j, 2), Y = X[0], se = X[1], ee = C.exports.useRef(null), Z = function (Pe) { ee.current && lY(ee.current, Pe) }; C.exports.useImperativeHandle(t, function () { return { focus: Z, blur: function () { var Pe; (Pe = ee.current) === null || Pe === void 0 || Pe.blur() }, setSelectionRange: function (Pe, De, Re) { var ke; (ke = ee.current) === null || ke === void 0 || ke.setSelectionRange(Pe, De, Re) }, select: function () { var Pe; (Pe = ee.current) === null || Pe === void 0 || Pe.select() }, input: ee.current } }), C.exports.useEffect(function () { se(function (Te) { return Te && v ? !1 : Te }) }, [v]); var J = function (Pe) { e.value === void 0 && G(Pe.target.value), ee.current && II(ee.current, Pe, r) }, ve = function (Pe) { c && Pe.key === "Enter" && c(Pe), o == null || o(Pe) }, ie = function (Pe) { se(!0), i == null || i(Pe) }, ce = function (Pe) { se(!1), s == null || s(Pe) }, oe = function (Pe) { G(""), Z(), ee.current && II(ee.current, Pe, r) }, ye = function () { var Pe = vi(e, ["prefixCls", "onPressEnter", "addonBefore", "addonAfter", "prefix", "suffix", "allowClear", "defaultValue", "showCount", "affixWrapperClassName", "groupClassName", "inputClassName", "wrapperClassName", "htmlSize"]); return I("input", { autoComplete: n, ...Pe, onChange: J, onFocus: ie, onBlur: ce, onKeyDown: ve, className: Xe(p, re({}, "".concat(p, "-disabled"), v), M, !Wg(e) && !WL(e) && w), ref: ee, size: y, type: R }) }, Ie = function () { var Pe = Number(P) > 0; if (k || A) { var De = RI(V), Re = Et(De).length, ke = ln(A) === "object" ? A.formatter({ value: De, count: Re, maxLength: P }) : "".concat(Re).concat(Pe ? " / ".concat(P) : ""); return Qe(An, { children: [!!A && I("span", { className: Xe("".concat(p, "-show-count-suffix"), re({}, "".concat(p, "-show-count-has-suffix"), !!k)), children: ke }), k] }) } return null }; return I(uY, { ...O, prefixCls: p, className: w, inputElement: ye(), handleReset: oe, value: RI(V), focused: Y, triggerFocus: Z, suffix: Ie(), disabled: v }) }); function GL(e, t) { var n = C.exports.useRef([]), r = function () { n.current.push(setTimeout(function () { var s, c, o, f; ((s = e.current) === null || s === void 0 ? void 0 : s.input) && ((c = e.current) === null || c === void 0 ? void 0 : c.input.getAttribute("type")) === "password" && ((o = e.current) === null || o === void 0 ? void 0 : o.input.hasAttribute("value")) && ((f = e.current) === null || f === void 0 || f.input.removeAttribute("value")) })) }; return C.exports.useEffect(function () { return t && r(), function () { return n.current.forEach(function (i) { i && clearTimeout(i) }) } }, []), r } function fY(e) { return !!(e.prefix || e.suffix || e.allowClear) } var hY = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function pY(e) { return typeof e > "u" || e === null ? "" : String(e) } function $1(e, t, n, r) { if (!!n) { var i = t; if (t.type === "click") { var s = e.cloneNode(!0); i = Object.create(t, { target: { value: s }, currentTarget: { value: s } }), s.value = "", n(i); return } if (r !== void 0) { i = Object.create(t, { target: { value: e }, currentTarget: { value: e } }), e.value = r, n(i); return } n(i) } } function mY(e, t) { if (!!e) { e.focus(t); var n = t || {}, r = n.cursor; if (r) { var i = e.value.length; switch (r) { case "start": e.setSelectionRange(0, 0); break; case "end": e.setSelectionRange(i, i); break; default: e.setSelectionRange(0, i); break } } } } var vY = C.exports.forwardRef(function (e, t) { var n, r, i, s = e.prefixCls, c = e.bordered, o = c === void 0 ? !0 : c, f = e.status, p = e.size, v = e.disabled, y = e.onBlur, w = e.onFocus, P = e.suffix, k = e.allowClear, A = e.addonAfter, N = e.addonBefore, R = e.className, M = e.onChange, O = hY(e, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "onChange"]), z = tr.useContext(zn), B = z.getPrefixCls, V = z.direction, G = z.input, j = B("input", s), X = C.exports.useRef(null), Y = Mc(j, V), se = Y.compactSize, ee = Y.compactItemClassnames, Z = tr.useContext(qa), J = se || p || Z, ve = tr.useContext(dl), ie = v != null ? v : ve, ce = C.exports.useContext(Fo), oe = ce.status, ye = ce.hasFeedback, Ie = ce.feedbackIcon, Te = Sf(oe, f), Pe = fY(e) || !!ye, De = C.exports.useRef(Pe); C.exports.useEffect(function () { Pe && De.current, De.current = Pe }, [Pe]); var Re = GL(X, !0), ke = function (ft) { Re(), y == null || y(ft) }, Oe = function (ft) { Re(), w == null || w(ft) }, $e = function (ft) { Re(), M == null || M(ft) }, He = (ye || P) && Qe(An, { children: [P, ye && Ie] }), Ue; return ln(k) === "object" && (k == null ? void 0 : k.clearIcon) ? Ue = k : k && (Ue = { clearIcon: I(wf, {}) }), I(dY, { ref: Po(t, X), prefixCls: j, autoComplete: G == null ? void 0 : G.autoComplete, ...O, disabled: ie || void 0, onBlur: ke, onFocus: Oe, suffix: He, allowClear: Ue, className: Xe(R, ee), onChange: $e, addonAfter: A && I(lf, { children: I(Gp, { override: !0, status: !0, children: A }) }), addonBefore: N && I(lf, { children: I(Gp, { override: !0, status: !0, children: N }) }), inputClassName: Xe((n = {}, re(n, "".concat(j, "-sm"), J === "small"), re(n, "".concat(j, "-lg"), J === "large"), re(n, "".concat(j, "-rtl"), V === "rtl"), re(n, "".concat(j, "-borderless"), !o), n), !Pe && Ha(j, Te)), affixWrapperClassName: Xe((r = {}, re(r, "".concat(j, "-affix-wrapper-sm"), J === "small"), re(r, "".concat(j, "-affix-wrapper-lg"), J === "large"), re(r, "".concat(j, "-affix-wrapper-rtl"), V === "rtl"), re(r, "".concat(j, "-affix-wrapper-borderless"), !o), r), Ha("".concat(j, "-affix-wrapper"), Te, ye)), wrapperClassName: Xe(re({}, "".concat(j, "-group-rtl"), V === "rtl")), groupClassName: Xe((i = {}, re(i, "".concat(j, "-group-wrapper-sm"), J === "small"), re(i, "".concat(j, "-group-wrapper-lg"), J === "large"), re(i, "".concat(j, "-group-wrapper-rtl"), V === "rtl"), i), Ha("".concat(j, "-group-wrapper"), Te, ye)) }) }); const Y2 = vY; var gY = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { tag: "path", attrs: { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, name: "eye-invisible", theme: "outlined" }; const yY = gY; var qL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: yY }) }) }; qL.displayName = "EyeInvisibleOutlined"; const xY = C.exports.forwardRef(qL); var _Y = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, bY = function (t) { return t ? I(QX, {}) : I(xY, {}) }, wY = { click: "onClick", hover: "onMouseOver" }, CY = C.exports.forwardRef(function (e, t) { var n = e.visibilityToggle, r = n === void 0 ? !0 : n, i = ln(r) === "object" && r.visible !== void 0, s = C.exports.useState(function () { return i ? r.visible : !1 }), c = ze(s, 2), o = c[0], f = c[1], p = C.exports.useRef(null); C.exports.useEffect(function () { i && f(r.visible) }, [i, r]); var v = GL(p), y = function () { var A = e.disabled; A || (o && v(), f(function (N) { var R, M = !N; return ln(r) === "object" && ((R = r.onVisibleChange) === null || R === void 0 || R.call(r, M)), M })) }, w = function (A) { var N, R = e.action, M = R === void 0 ? "click" : R, O = e.iconRender, z = O === void 0 ? bY : O, B = wY[M] || "", V = z(o), G = (N = {}, re(N, B, y), re(N, "className", "".concat(A, "-icon")), re(N, "key", "passwordIcon"), re(N, "onMouseDown", function (X) { X.preventDefault() }), re(N, "onMouseUp", function (X) { X.preventDefault() }), N); return C.exports.cloneElement(C.exports.isValidElement(V) ? V : I("span", { children: V }), G) }, P = function (A) { var N = A.getPrefixCls, R = e.className, M = e.prefixCls, O = e.inputPrefixCls, z = e.size, B = _Y(e, ["className", "prefixCls", "inputPrefixCls", "size"]), V = N("input", O), G = N("input-password", M), j = r && w(G), X = Xe(G, R, re({}, "".concat(G, "-").concat(z), !!z)), Y = tt(tt({}, vi(B, ["suffix", "iconRender", "visibilityToggle"])), { type: o ? "text" : "password", className: X, prefixCls: V, suffix: j }); return z && (Y.size = z), I(Y2, { ref: Po(t, p), ...Y }) }; return I(yu, { children: P }) }); const SY = CY; var EY = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, PY = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = e.inputPrefixCls, s = e.className, c = e.size, o = e.suffix, f = e.enterButton, p = f === void 0 ? !1 : f, v = e.addonAfter, y = e.loading, w = e.disabled, P = e.onSearch, k = e.onChange, A = e.onCompositionStart, N = e.onCompositionEnd, R = EY(e, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]), M = C.exports.useContext(zn), O = M.getPrefixCls, z = M.direction, B = C.exports.useContext(qa), V = C.exports.useRef(!1), G = O("input-search", r), j = O("input", i), X = Mc(G, z), Y = X.compactSize, se = Y || c || B, ee = C.exports.useRef(null), Z = function (Oe) { Oe && Oe.target && Oe.type === "click" && P && P(Oe.target.value, Oe), k && k(Oe) }, J = function (Oe) { var $e; document.activeElement === (($e = ee.current) === null || $e === void 0 ? void 0 : $e.input) && Oe.preventDefault() }, ve = function (Oe) { var $e, He; P && P((He = ($e = ee.current) === null || $e === void 0 ? void 0 : $e.input) === null || He === void 0 ? void 0 : He.value, Oe) }, ie = function (Oe) { V.current || y || ve(Oe) }, ce = typeof p == "boolean" ? I(O2, {}) : null, oe = "".concat(G, "-button"), ye, Ie = p || {}, Te = Ie.type && Ie.type.__ANT_BUTTON === !0; Te || Ie.type === "button" ? ye = li(Ie, tt({ onMouseDown: J, onClick: function (Oe) { var $e, He; (He = ($e = Ie == null ? void 0 : Ie.props) === null || $e === void 0 ? void 0 : $e.onClick) === null || He === void 0 || He.call($e, Oe), ve(Oe) }, key: "enterButton" }, Te ? { className: oe, size: se } : {})) : ye = I(gr, { className: oe, type: p ? "primary" : void 0, size: se, disabled: w, onMouseDown: J, onClick: ve, loading: y, icon: ce, children: p }, "enterButton"), v && (ye = [ye, li(v, { key: "addonAfter" })]); var Pe = Xe(G, (n = {}, re(n, "".concat(G, "-rtl"), z === "rtl"), re(n, "".concat(G, "-").concat(se), !!se), re(n, "".concat(G, "-with-button"), !!p), n), s), De = function (Oe) { V.current = !0, A == null || A(Oe) }, Re = function (Oe) { V.current = !1, N == null || N(Oe) }; return I(Y2, { ref: Po(ee, t), onPressEnter: ie, ...R, size: se, onCompositionStart: De, onCompositionEnd: Re, prefixCls: j, addonAfter: ye, suffix: o, onChange: Z, className: Pe, disabled: w }) }); const TY = PY; var kY = `
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important;
|
|
|
pointer-events: none !important;
|
|
|
`, IY = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "font-variant", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break"], B1 = {}, pa; function RY(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = e.getAttribute("id") || e.getAttribute("data-reactid") || e.getAttribute("name"); if (t && B1[n]) return B1[n]; var r = window.getComputedStyle(e), i = r.getPropertyValue("box-sizing") || r.getPropertyValue("-moz-box-sizing") || r.getPropertyValue("-webkit-box-sizing"), s = parseFloat(r.getPropertyValue("padding-bottom")) + parseFloat(r.getPropertyValue("padding-top")), c = parseFloat(r.getPropertyValue("border-bottom-width")) + parseFloat(r.getPropertyValue("border-top-width")), o = IY.map(function (p) { return "".concat(p, ":").concat(r.getPropertyValue(p)) }).join(";"), f = { sizingStyle: o, paddingSize: s, borderSize: c, boxSizing: i }; return t && n && (B1[n] = f), f } function MY(e) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; pa || (pa = document.createElement("textarea"), pa.setAttribute("tab-index", "-1"), pa.setAttribute("aria-hidden", "true"), document.body.appendChild(pa)), e.getAttribute("wrap") ? pa.setAttribute("wrap", e.getAttribute("wrap")) : pa.removeAttribute("wrap"); var i = RY(e, t), s = i.paddingSize, c = i.borderSize, o = i.boxSizing, f = i.sizingStyle; pa.setAttribute("style", "".concat(f, ";").concat(kY)), pa.value = e.value || e.placeholder || ""; var p = void 0, v = void 0, y, w = pa.scrollHeight; if (o === "border-box" ? w += c : o === "content-box" && (w -= s), n !== null || r !== null) { pa.value = " "; var P = pa.scrollHeight - s; n !== null && (p = P * n, o === "border-box" && (p = p + s + c), w = Math.max(p, w)), r !== null && (v = P * r, o === "border-box" && (v = v + s + c), y = w > v ? "" : "hidden", w = Math.min(v, w)) } var k = { height: w, overflowY: y, resize: "none" }; return p && (k.minHeight = p), v && (k.maxHeight = v), k } var AY = ["prefixCls", "onPressEnter", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"], V1 = 0, U1 = 1, j1 = 2, NY = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = n === void 0 ? "rc-textarea" : n; e.onPressEnter; var i = e.defaultValue, s = e.value, c = e.autoSize, o = e.onResize, f = e.className, p = e.style, v = e.disabled, y = e.onChange; e.onInternalAutoSize; var w = Rn(e, AY), P = Bi(i, { value: s, postState: function (Re) { return Re != null ? Re : "" } }), k = ze(P, 2), A = k[0], N = k[1], R = function (Re) { N(Re.target.value), y == null || y(Re) }, M = C.exports.useRef(); C.exports.useImperativeHandle(t, function () { return { textArea: M.current } }); var O = C.exports.useMemo(function () { return c && ln(c) === "object" ? [c.minRows, c.maxRows] : [] }, [c]), z = ze(O, 2), B = z[0], V = z[1], G = !!c, j = function () { try { if (document.activeElement === M.current) { var Re = M.current, ke = Re.selectionStart, Oe = Re.selectionEnd, $e = Re.scrollTop; M.current.setSelectionRange(ke, Oe), M.current.scrollTop = $e } } catch { } }, X = C.exports.useState(j1), Y = ze(X, 2), se = Y[0], ee = Y[1], Z = C.exports.useState(), J = ze(Z, 2), ve = J[0], ie = J[1], ce = function () { ee(V1) }; si(function () { G && ce() }, [s, B, V, G]), si(function () { if (se === V1) ee(U1); else if (se === U1) { var De = MY(M.current, !1, B, V); ee(j1), ie(De) } else j() }, [se]); var oe = C.exports.useRef(), ye = function () { nr.cancel(oe.current) }, Ie = function (Re) { se === j1 && (o == null || o(Re), c && (ye(), oe.current = nr(function () { ce() }))) }; C.exports.useEffect(function () { return ye }, []); var Te = G ? ve : null, Pe = ge(ge({}, p), Te); return (se === V1 || se === U1) && (Pe.overflowY = "hidden", Pe.overflowX = "hidden"), I(cl, { onResize: Ie, disabled: !(c || o), children: I("textarea", { ...w, ref: M, style: Pe, className: Xe(r, f, re({}, "".concat(r, "-disabled"), v)), disabled: v, value: A, onChange: R }) }) }), OY = function (e) { ui(n, e); var t = ci(n); function n(r) { var i; zr(this, n), i = t.call(this, r), i.resizableTextArea = void 0, i.focus = function () { i.resizableTextArea.textArea.focus() }, i.saveTextArea = function (c) { i.resizableTextArea = c }, i.handleChange = function (c) { var o = i.props.onChange; i.setValue(c.target.value), o && o(c) }, i.handleKeyDown = function (c) { var o = i.props, f = o.onPressEnter, p = o.onKeyDown; c.keyCode === 13 && f && f(c), p && p(c) }; var s = typeof r.value > "u" || r.value === null ? r.defaultValue : r.value; return i.state = { value: s }, i } return Fr(n, [{ key: "setValue", value: function (i, s) { "value" in this.props || this.setState({ value: i }, s) } }, { key: "blur", value: function () { this.resizableTextArea.textArea.blur() } }, { key: "render", value: function () { return I(NY, { ...this.props, value: this.state.value, onKeyDown: this.handleKeyDown, onChange: this.handleChange, ref: this.saveTextArea }) } }], [{ key: "getDerivedStateFromProps", value: function (i) { return "value" in i ? { value: i.value } : null } }]), n }(C.exports.Component), DY = ia("text", "input"); function LY(e) { return !!(e.addonBefore || e.addonAfter) } var zY = function (e) { ui(n, e); var t = ci(n); function n() { return zr(this, n), t.apply(this, arguments) } return Fr(n, [{ key: "renderClearIcon", value: function (i) { var s, c = this.props, o = c.value, f = c.disabled, p = c.readOnly, v = c.handleReset, y = c.suffix, w = !f && !p && o, P = "".concat(i, "-clear-icon"); return I(wf, { onClick: v, onMouseDown: function (A) { return A.preventDefault() }, className: Xe((s = {}, re(s, "".concat(P, "-hidden"), !w), re(s, "".concat(P, "-has-suffix"), !!y), s), P), role: "button" }) } }, { key: "renderTextAreaWithClearIcon", value: function (i, s, c) { var o, f = this.props, p = f.value, v = f.allowClear, y = f.className, w = f.style, P = f.direction, k = f.bordered, A = f.hidden, N = f.status, R = c.status, M = c.hasFeedback; if (!v) return li(s, { value: p }); var O = Xe("".concat(i, "-affix-wrapper"), "".concat(i, "-affix-wrapper-textarea-with-clear-btn"), Ha("".concat(i, "-affix-wrapper"), Sf(R, N), M), (o = {}, re(o, "".concat(i, "-affix-wrapper-rtl"), P === "rtl"), re(o, "".concat(i, "-affix-wrapper-borderless"), !k), re(o, "".concat(y), !LY(this.props) && y), o)); return Qe("span", { className: O, style: w, hidden: A, children: [li(s, { style: null, value: p }), this.renderClearIcon(i)] }) } }, { key: "render", value: function () { var i = this; return I(Fo.Consumer, { children: function (s) { var c = i.props, o = c.prefixCls, f = c.inputType, p = c.element; if (f === DY[0]) return i.renderTextAreaWithClearIcon(o, p, s) } }) } }]), n }(C.exports.Component); const FY = zY; var $Y = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function ZL(e, t) { return Et(e || "").slice(0, t).join("") } function MI(e, t, n, r) { var i = n; return e ? i = ZL(n, r) : Et(t || "").length < n.length && Et(n || "").length > r && (i = t), i } var BY = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = e.bordered, s = i === void 0 ? !0 : i, c = e.showCount, o = c === void 0 ? !1 : c, f = e.maxLength, p = e.className, v = e.style, y = e.size, w = e.disabled, P = e.onCompositionStart, k = e.onCompositionEnd, A = e.onChange, N = e.status, R = $Y(e, ["prefixCls", "bordered", "showCount", "maxLength", "className", "style", "size", "disabled", "onCompositionStart", "onCompositionEnd", "onChange", "status"]), M = C.exports.useContext(zn), O = M.getPrefixCls, z = M.direction, B = C.exports.useContext(qa), V = C.exports.useContext(dl), G = w != null ? w : V, j = C.exports.useContext(Fo), X = j.status, Y = j.hasFeedback, se = j.isFormItemInput, ee = j.feedbackIcon, Z = Sf(X, N), J = C.exports.useRef(null), ve = C.exports.useRef(null), ie = C.exports.useState(!1), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useRef(), Te = C.exports.useRef(0), Pe = Bi(R.defaultValue, { value: R.value }), De = ze(Pe, 2), Re = De[0], ke = De[1], Oe = R.hidden, $e = function (ct, rt) { R.value === void 0 && (ke(ct), rt == null || rt()) }, He = Number(f) > 0, Ue = function (ct) { ye(!0), Ie.current = Re, Te.current = ct.currentTarget.selectionStart, P == null || P(ct) }, st = function (ct) { var rt; ye(!1); var ht = ct.currentTarget.value; if (He) { var bt = Te.current >= f + 1 || Te.current === ((rt = Ie.current) === null || rt === void 0 ? void 0 : rt.length); ht = MI(bt, Ie.current, ht, f) } ht !== Re && ($e(ht), $1(ct.currentTarget, ct, A, ht)), k == null || k(ct) }, ft = function (ct) { var rt = ct.target.value; if (!oe && He) { var ht = ct.target.selectionStart >= f + 1 || ct.target.selectionStart === rt.length || !ct.target.selectionStart; rt = MI(ht, Re, rt, f) } $e(rt), $1(ct.currentTarget, ct, A, rt) }, It = function (ct) { var rt, ht, bt; $e(""), (rt = J.current) === null || rt === void 0 || rt.focus(), $1((bt = (ht = J.current) === null || ht === void 0 ? void 0 : ht.resizableTextArea) === null || bt === void 0 ? void 0 : bt.textArea, ct, A) }, We = O("input", r); C.exports.useImperativeHandle(t, function () { var dt; return { resizableTextArea: (dt = J.current) === null || dt === void 0 ? void 0 : dt.resizableTextArea, focus: function (rt) { var ht, bt; mY((bt = (ht = J.current) === null || ht === void 0 ? void 0 : ht.resizableTextArea) === null || bt === void 0 ? void 0 : bt.textArea, rt) }, blur: function () { var rt; return (rt = J.current) === null || rt === void 0 ? void 0 : rt.blur() } } }); var Pt = I(OY, { ...vi(R, ["allowClear"]), disabled: G, className: Xe((n = {}, re(n, "".concat(We, "-borderless"), !s), re(n, p, p && !o), re(n, "".concat(We, "-sm"), B === "small" || y === "small"), re(n, "".concat(We, "-lg"), B === "large" || y === "large"), n), Ha(We, Z)), style: o ? { resize: v == null ? void 0 : v.resize } : v, prefixCls: We, onCompositionStart: Ue, onChange: ft, onCompositionEnd: st, ref: J }), pt = pY(Re); !oe && He && (R.value === null || R.value === void 0) && (pt = ZL(pt, f)); var Rt = I(FY, { disabled: G, ...R, prefixCls: We, direction: z, inputType: "text", value: pt, element: Pt, handleReset: It, ref: ve, bordered: s, status: N, style: o ? void 0 : v }); if (o || Y) { var yt, Mt = Et(pt).length, ut = ""; return ln(o) === "object" ? ut = o.formatter({ value: pt, count: Mt, maxLength: f }) : ut = "".concat(Mt).concat(He ? " / ".concat(f) : ""), Qe("div", { hidden: Oe, className: Xe("".concat(We, "-textarea"), (yt = {}, re(yt, "".concat(We, "-textarea-rtl"), z === "rtl"), re(yt, "".concat(We, "-textarea-show-count"), o), re(yt, "".concat(We, "-textarea-in-form-item"), se), yt), Ha("".concat(We, "-textarea"), Z, Y), p), style: v, "data-count": ut, children: [Rt, Y && I("span", { className: "".concat(We, "-textarea-suffix"), children: ee })] }) } return Rt }); const XL = BY; var wm = Y2; wm.Group = sY; wm.Search = TY; wm.TextArea = XL; wm.Password = SY; const Xy = wm; var VY = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, name: "up", theme: "outlined" }; const UY = VY; var YL = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: UY }) }) }; YL.displayName = "UpOutlined"; const jY = C.exports.forwardRef(YL); function rC() { return typeof BigInt == "function" } function mc(e) { var t = e.trim(), n = t.startsWith("-"); n && (t = t.slice(1)), t = t.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, ""), t.startsWith(".") && (t = "0".concat(t)); var r = t || "0", i = r.split("."), s = i[0] || "0", c = i[1] || "0"; s === "0" && c === "0" && (n = !1); var o = n ? "-" : ""; return { negative: n, negativeStr: o, trimStr: r, integerStr: s, decimalStr: c, fullStr: "".concat(o).concat(r) } } function Q2(e) { var t = String(e); return !Number.isNaN(Number(t)) && t.includes("e") } function Xp(e) { var t = String(e); if (Q2(e)) { var n = Number(t.slice(t.indexOf("e-") + 2)), r = t.match(/\.(\d+)/); return r != null && r[1] && (n += r[1].length), n } return t.includes(".") && J2(t) ? t.length - t.indexOf(".") - 1 : 0 } function ox(e) { var t = String(e); if (Q2(e)) { if (e > Number.MAX_SAFE_INTEGER) return String(rC() ? BigInt(e).toString() : Number.MAX_SAFE_INTEGER); if (e < Number.MIN_SAFE_INTEGER) return String(rC() ? BigInt(e).toString() : Number.MIN_SAFE_INTEGER); t = e.toFixed(Xp(t)) } return mc(t).fullStr } function J2(e) { return typeof e == "number" ? !Number.isNaN(e) : e ? /^\s*-?\d+(\.\d+)?\s*$/.test(e) || /^\s*-?\d+\.\s*$/.test(e) || /^\s*-?\.\d+\s*$/.test(e) : !1 } function AI(e) { var t = typeof e == "number" ? ox(e) : mc(e).fullStr, n = t.includes("."); return n ? mc(t.replace(/(\d)\.(\d)/g, "$1$2.")).fullStr : e + "0" } var KY = function () { function e(t) { if (zr(this, e), this.origin = "", this.number = void 0, this.empty = void 0, !t && t !== 0 || !String(t).trim()) { this.empty = !0; return } this.origin = String(t), this.number = Number(t) } return Fr(e, [{ key: "negate", value: function () { return new e(-this.toNumber()) } }, { key: "add", value: function (n) { if (this.isInvalidate()) return new e(n); var r = Number(n); if (Number.isNaN(r)) return this; var i = this.number + r; if (i > Number.MAX_SAFE_INTEGER) return new e(Number.MAX_SAFE_INTEGER); if (i < Number.MIN_SAFE_INTEGER) return new e(Number.MIN_SAFE_INTEGER); var s = Math.max(Xp(this.number), Xp(r)); return new e(i.toFixed(s)) } }, { key: "isEmpty", value: function () { return this.empty } }, { key: "isNaN", value: function () { return Number.isNaN(this.number) } }, { key: "isInvalidate", value: function () { return this.isEmpty() || this.isNaN() } }, { key: "equals", value: function (n) { return this.toNumber() === (n == null ? void 0 : n.toNumber()) } }, { key: "lessEquals", value: function (n) { return this.add(n.negate().toString()).toNumber() <= 0 } }, { key: "toNumber", value: function () { return this.number } }, { key: "toString", value: function () { var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0; return n ? this.isInvalidate() ? "" : ox(this.number) : this.origin } }]), e }(), HY = function () { function e(t) { if (zr(this, e), this.origin = "", this.negative = void 0, this.integer = void 0, this.decimal = void 0, this.decimalLen = void 0, this.empty = void 0, this.nan = void 0, !t && t !== 0 || !String(t).trim()) { this.empty = !0; return } if (this.origin = String(t), t === "-") { this.nan = !0; return } var n = t; if (Q2(n) && (n = Number(n)), n = typeof n == "string" ? n : ox(n), J2(n)) { var r = mc(n); this.negative = r.negative; var i = r.trimStr.split("."); this.integer = BigInt(i[0]); var s = i[1] || "0"; this.decimal = BigInt(s), this.decimalLen = s.length } else this.nan = !0 } return Fr(e, [{ key: "getMark", value: function () { return this.negative ? "-" : "" } }, { key: "getIntegerStr", value: function () { return this.integer.toString() } }, { key: "getDecimalStr", value: function () { return this.decimal.toString().padStart(this.decimalLen, "0") } }, { key: "alignDecimal", value: function (n) { var r = "".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(n, "0")); return BigInt(r) } }, { key: "negate", value: function () { var n = new e(this.toString()); return n.negative = !n.negative, n } }, { key: "add", value: function (n) { if (this.isInvalidate()) return new e(n); var r = new e(n); if (r.isInvalidate()) return this; var i = Math.max(this.getDecimalStr().length, r.getDecimalStr().length), s = this.alignDecimal(i), c = r.alignDecimal(i), o = (s + c).toString(), f = mc(o), p = f.negativeStr, v = f.trimStr, y = "".concat(p).concat(v.padStart(i + 1, "0")); return new e("".concat(y.slice(0, -i), ".").concat(y.slice(-i))) } }, { key: "isEmpty", value: function () { return this.empty } }, { key: "isNaN", value: function () { return this.nan } }, { key: "isInvalidate", value: function () { return this.isEmpty() || this.isNaN() } }, { key: "equals", value: function (n) { return this.toString() === (n == null ? void 0 : n.toString()) } }, { key: "lessEquals", value: function (n) { return this.add(n.negate().toString()).toNumber() <= 0 } }, { key: "toNumber", value: function () { return this.isNaN() ? NaN : Number(this.toString()) } }, { key: "toString", value: function () { var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0; return n ? this.isInvalidate() ? "" : mc("".concat(this.getMark()).concat(this.getIntegerStr(), ".").concat(this.getDecimalStr())).fullStr : this.origin } }]), e }(); function Fa(e) { return rC() ? new HY(e) : new KY(e) } function Gg(e, t, n) { var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; if (e === "") return ""; var i = mc(e), s = i.negativeStr, c = i.integerStr, o = i.decimalStr, f = "".concat(t).concat(o), p = "".concat(s).concat(c); if (n >= 0) { var v = Number(o[n]); if (v >= 5 && !r) { var y = Fa(e).add("".concat(s, "0.").concat("0".repeat(n)).concat(10 - v)); return Gg(y.toString(), t, n, r) } return n === 0 ? p : "".concat(p).concat(t).concat(o.padEnd(n, "0").slice(0, n)) } return f === ".0" ? p : "".concat(p).concat(f) } var WY = 200, GY = 600; function qY(e) { var t = e.prefixCls, n = e.upNode, r = e.downNode, i = e.upDisabled, s = e.downDisabled, c = e.onStep, o = C.exports.useRef(), f = C.exports.useRef(); f.current = c; var p = function (N, R) { N.preventDefault(), f.current(R); function M() { f.current(R), o.current = setTimeout(M, WY) } o.current = setTimeout(M, GY) }, v = function () { clearTimeout(o.current) }; if (C.exports.useEffect(function () { return v }, []), g2()) return null; var y = "".concat(t, "-handler"), w = Xe(y, "".concat(y, "-up"), re({}, "".concat(y, "-up-disabled"), i)), P = Xe(y, "".concat(y, "-down"), re({}, "".concat(y, "-down-disabled"), s)), k = { unselectable: "on", role: "button", onMouseUp: v, onMouseLeave: v }; return Qe("div", { className: "".concat(y, "-wrap"), children: [I("span", { ...k, onMouseDown: function (N) { p(N, !0) }, "aria-label": "Increase Value", "aria-disabled": i, className: w, children: n || I("span", { unselectable: "on", className: "".concat(t, "-handler-up-inner") }) }), I("span", { ...k, onMouseDown: function (N) { p(N, !1) }, "aria-label": "Decrease Value", "aria-disabled": s, className: P, children: r || I("span", { unselectable: "on", className: "".concat(t, "-handler-down-inner") }) })] }) } function ZY(e, t) { var n = C.exports.useRef(null); function r() { try { var s = e.selectionStart, c = e.selectionEnd, o = e.value, f = o.substring(0, s), p = o.substring(c); n.current = { start: s, end: c, value: o, beforeTxt: f, afterTxt: p } } catch { } } function i() { if (e && n.current && t) try { var s = e.value, c = n.current, o = c.beforeTxt, f = c.afterTxt, p = c.start, v = s.length; if (s.endsWith(f)) v = s.length - n.current.afterTxt.length; else if (s.startsWith(o)) v = o.length; else { var y = o[p - 1], w = s.indexOf(y, p - 1); w !== -1 && (v = w + 1) } e.setSelectionRange(v, v) } catch (P) { Rr(!1, "Something warning of cursor restore. Please fire issue about this: ".concat(P.message)) } } return [r, i] } const XY = function () { var e = C.exports.useRef(0), t = function () { nr.cancel(e.current) }; return C.exports.useEffect(function () { return t }, []), function (n) { t(), e.current = nr(function () { n() }) } }; var YY = ["prefixCls", "className", "style", "min", "max", "step", "defaultValue", "value", "disabled", "readOnly", "upHandler", "downHandler", "keyboard", "controls", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep"], NI = function (t, n) { return t || n.isEmpty() ? n.toString() : n.toNumber() }, OI = function (t) { var n = Fa(t); return n.isInvalidate() ? null : n }, QL = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = r === void 0 ? "rc-input-number" : r, s = e.className, c = e.style, o = e.min, f = e.max, p = e.step, v = p === void 0 ? 1 : p, y = e.defaultValue, w = e.value, P = e.disabled, k = e.readOnly, A = e.upHandler, N = e.downHandler, R = e.keyboard, M = e.controls, O = M === void 0 ? !0 : M, z = e.stringMode, B = e.parser, V = e.formatter, G = e.precision, j = e.decimalSeparator, X = e.onChange, Y = e.onInput, se = e.onPressEnter, ee = e.onStep, Z = Rn(e, YY), J = "".concat(i, "-input"), ve = C.exports.useRef(null), ie = C.exports.useState(!1), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useRef(!1), Te = C.exports.useRef(!1), Pe = C.exports.useRef(!1), De = C.exports.useState(function () { return Fa(w != null ? w : y) }), Re = ze(De, 2), ke = Re[0], Oe = Re[1]; function $e(At) { w === void 0 && Oe(At) } var He = C.exports.useCallback(function (At, Xt) { if (!Xt) return G >= 0 ? G : Math.max(Xp(At), Xp(v)) }, [G, v]), Ue = C.exports.useCallback(function (At) { var Xt = String(At); if (B) return B(Xt); var en = Xt; return j && (en = en.replace(j, ".")), en.replace(/[^\w.-]+/g, "") }, [B, j]), st = C.exports.useRef(""), ft = C.exports.useCallback(function (At, Xt) { if (V) return V(At, { userTyping: Xt, input: String(st.current) }); var en = typeof At == "number" ? ox(At) : At; if (!Xt) { var gt = He(en, Xt); if (J2(en) && (j || gt >= 0)) { var yn = j || "."; en = Gg(en, yn, gt) } } return en }, [V, He, j]), It = C.exports.useState(function () { var At = y != null ? y : w; return ke.isInvalidate() && ["string", "number"].includes(ln(At)) ? Number.isNaN(At) ? "" : At : ft(ke.toString(), !1) }), We = ze(It, 2), Pt = We[0], pt = We[1]; st.current = Pt; function Rt(At, Xt) { pt(ft(At.isInvalidate() ? At.toString(!1) : At.toString(!Xt), Xt)) } var yt = C.exports.useMemo(function () { return OI(f) }, [f, G]), Mt = C.exports.useMemo(function () { return OI(o) }, [o, G]), ut = C.exports.useMemo(function () { return !yt || !ke || ke.isInvalidate() ? !1 : yt.lessEquals(ke) }, [yt, ke]), dt = C.exports.useMemo(function () { return !Mt || !ke || ke.isInvalidate() ? !1 : ke.lessEquals(Mt) }, [Mt, ke]), ct = ZY(ve.current, oe), rt = ze(ct, 2), ht = rt[0], bt = rt[1], Wt = function (Xt) { return yt && !Xt.lessEquals(yt) ? yt : Mt && !Mt.lessEquals(Xt) ? Mt : null }, Ut = function (Xt) { return !Wt(Xt) }, Jt = function (Xt, en) { var gt = Xt, yn = Ut(gt) || gt.isEmpty(); if (!gt.isEmpty() && !en && (gt = Wt(gt) || gt, yn = !0), !k && !P && yn) { var Sn = gt.toString(), dn = He(Sn, en); return dn >= 0 && (gt = Fa(Gg(Sn, ".", dn)), Ut(gt) || (gt = Fa(Gg(Sn, ".", dn, !0)))), gt.equals(ke) || ($e(gt), X == null || X(gt.isEmpty() ? null : NI(z, gt)), w === void 0 && Rt(gt, en)), gt } return ke }, Fe = XY(), Ge = function At(Xt) { if (ht(), pt(Xt), !Te.current) { var en = Ue(Xt), gt = Fa(en); gt.isNaN() || Jt(gt, !0) } Y == null || Y(Xt), Fe(function () { var yn = Xt; B || (yn = Xt.replace(/。/g, ".")), yn !== Xt && At(yn) }) }, Zt = function () { Te.current = !0 }, cn = function () { Te.current = !1, Ge(ve.current.value) }, jt = function (Xt) { Ge(Xt.target.value) }, Kt = function (Xt) { var en; if (!(Xt && ut || !Xt && dt)) { Ie.current = !1; var gt = Fa(Pe.current ? AI(v) : v); Xt || (gt = gt.negate()); var yn = (ke || Fa(0)).add(gt.toString()), Sn = Jt(yn, !1); ee == null || ee(NI(z, Sn), { offset: Pe.current ? AI(v) : v, type: Xt ? "up" : "down" }), (en = ve.current) === null || en === void 0 || en.focus() } }, nn = function (Xt) { var en = Fa(Ue(Pt)), gt = en; en.isNaN() ? gt = ke : gt = Jt(en, Xt), w !== void 0 ? Rt(ke, !1) : gt.isNaN() || Rt(gt, !1) }, Cn = function () { Ie.current = !0 }, Nn = function (Xt) { var en = Xt.which, gt = Xt.shiftKey; Ie.current = !0, gt ? Pe.current = !0 : Pe.current = !1, en === St.ENTER && (Te.current || (Ie.current = !1), nn(!1), se == null || se(Xt)), R !== !1 && !Te.current && [St.UP, St.DOWN].includes(en) && (Kt(St.UP === en), Xt.preventDefault()) }, wt = function () { Ie.current = !1, Pe.current = !1 }, qt = function () { nn(!1), ye(!1), Ie.current = !1 }; return hp(function () { ke.isInvalidate() || Rt(ke, !1) }, [G]), hp(function () { var At = Fa(w); Oe(At); var Xt = Fa(Ue(Pt)); (!At.equals(Xt) || !Ie.current || V) && Rt(At, Ie.current) }, [w]), hp(function () { V && bt() }, [Pt]), Qe("div", { className: Xe(i, s, (n = {}, re(n, "".concat(i, "-focused"), oe), re(n, "".concat(i, "-disabled"), P), re(n, "".concat(i, "-readonly"), k), re(n, "".concat(i, "-not-a-number"), ke.isNaN()), re(n, "".concat(i, "-out-of-range"), !ke.isInvalidate() && !Ut(ke)), n)), style: c, onFocus: function () { ye(!0) }, onBlur: qt, onKeyDown: Nn, onKeyUp: wt, onCompositionStart: Zt, onCompositionEnd: cn, onBeforeInput: Cn, children: [O && I(qY, { prefixCls: i, upNode: A, downNode: N, upDisabled: ut, downDisabled: dt, onStep: Kt }), I("div", { className: "".concat(J, "-wrap"), children: I("input", { autoComplete: "off", role: "spinbutton", "aria-valuemin": o, "aria-valuemax": f, "aria-valuenow": ke.isInvalidate() ? null : ke.toString(), step: v, ...Z, ref: Po(ve, t), className: J, value: Pt, onChange: jt, disabled: P, readOnly: k }) })] }) }); QL.displayName = "InputNumber"; var QY = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, JY = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = C.exports.useContext(qa), o = C.exports.useState(!1), f = ze(o, 2), p = f[0], v = f[1], y = C.exports.useRef(null); C.exports.useImperativeHandle(t, function () { return y.current }); var w = e.className, P = e.size, k = e.disabled, A = e.prefixCls, N = e.addonBefore, R = e.addonAfter, M = e.prefix, O = e.bordered, z = O === void 0 ? !0 : O, B = e.readOnly, V = e.status, G = e.controls, j = QY(e, ["className", "size", "disabled", "prefixCls", "addonBefore", "addonAfter", "prefix", "bordered", "readOnly", "status", "controls"]), X = i("input-number", A), Y = Mc(X, s), se = Y.compactSize, ee = Y.compactItemClassnames, Z = I(jY, { className: "".concat(X, "-handler-up-inner") }), J = I(N2, { className: "".concat(X, "-handler-down-inner") }), ve = typeof G == "boolean" ? G : void 0; ln(G) === "object" && (Z = typeof G.upIcon > "u" ? Z : I("span", { className: "".concat(X, "-handler-up-inner"), children: G.upIcon }), J = typeof G.downIcon > "u" ? J : I("span", { className: "".concat(X, "-handler-down-inner"), children: G.downIcon })); var ie = C.exports.useContext(Fo), ce = ie.hasFeedback, oe = ie.status, ye = ie.isFormItemInput, Ie = ie.feedbackIcon, Te = Sf(oe, V), Pe = se || P || c, De = C.exports.useContext(dl), Re = k != null ? k : De, ke = Xe((n = {}, re(n, "".concat(X, "-lg"), Pe === "large"), re(n, "".concat(X, "-sm"), Pe === "small"), re(n, "".concat(X, "-rtl"), s === "rtl"), re(n, "".concat(X, "-borderless"), !z), re(n, "".concat(X, "-in-form-item"), ye), n), Ha(X, Te), ee, w), Oe = I(QL, { ref: y, disabled: Re, className: ke, upHandler: Z, downHandler: J, prefixCls: X, readOnly: B, controls: ve, ...j }); if (M != null || ce) { var $e, He = Xe("".concat(X, "-affix-wrapper"), Ha("".concat(X, "-affix-wrapper"), Te, ce), ($e = {}, re($e, "".concat(X, "-affix-wrapper-focused"), p), re($e, "".concat(X, "-affix-wrapper-disabled"), e.disabled), re($e, "".concat(X, "-affix-wrapper-sm"), c === "small"), re($e, "".concat(X, "-affix-wrapper-lg"), c === "large"), re($e, "".concat(X, "-affix-wrapper-rtl"), s === "rtl"), re($e, "".concat(X, "-affix-wrapper-readonly"), B), re($e, "".concat(X, "-affix-wrapper-borderless"), !z), re($e, "".concat(w), !(N || R) && w), $e)); Oe = Qe("div", { className: He, style: e.style, onMouseUp: function () { return y.current.focus() }, children: [M && I("span", { className: "".concat(X, "-prefix"), children: M }), li(Oe, { style: null, value: e.value, onFocus: function (yt) { var Mt; v(!0), (Mt = e.onFocus) === null || Mt === void 0 || Mt.call(e, yt) }, onBlur: function (yt) { var Mt; v(!1), (Mt = e.onBlur) === null || Mt === void 0 || Mt.call(e, yt) } }), ce && I("span", { className: "".concat(X, "-suffix"), children: Ie })] }) } if (N != null || R != null) { var Ue, st = "".concat(X, "-group"), ft = "".concat(st, "-addon"), It = N ? I("div", { className: ft, children: N }) : null, We = R ? I("div", { className: ft, children: R }) : null, Pt = Xe("".concat(X, "-wrapper"), st, re({}, "".concat(st, "-rtl"), s === "rtl")), pt = Xe("".concat(X, "-group-wrapper"), (Ue = {}, re(Ue, "".concat(X, "-group-wrapper-sm"), c === "small"), re(Ue, "".concat(X, "-group-wrapper-lg"), c === "large"), re(Ue, "".concat(X, "-group-wrapper-rtl"), s === "rtl"), Ue), Ha("".concat(X, "-group-wrapper"), Te, ce), w); Oe = I("div", { className: pt, style: e.style, children: Qe("div", { className: Pt, children: [It && I(lf, { children: I(Gp, { status: !0, override: !0, children: It }) }), li(Oe, { style: null, disabled: Re }), We && I(lf, { children: I(Gp, { status: !0, override: !0, children: We }) })] }) }) } return Oe }); const JL = JY; var eQ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z" } }] }, name: "double-left", theme: "outlined" }; const tQ = eQ; var ez = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: tQ }) }) }; ez.displayName = "DoubleLeftOutlined"; const nQ = C.exports.forwardRef(ez); var rQ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, name: "double-right", theme: "outlined" }; const iQ = rQ; var tz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: iQ }) }) }; tz.displayName = "DoubleRightOutlined"; const oQ = C.exports.forwardRef(tz); var Uh = function (t) { var n, r = "".concat(t.rootPrefixCls, "-item"), i = Xe(r, "".concat(r, "-").concat(t.page), (n = {}, re(n, "".concat(r, "-active"), t.active), re(n, "".concat(r, "-disabled"), !t.page), re(n, t.className, !!t.className), n)), s = function () { t.onClick(t.page) }, c = function (f) { t.onKeyPress(f, t.onClick, t.page) }; return I("li", { title: t.showTitle ? t.page : null, className: i, onClick: s, onKeyPress: c, tabIndex: "0", children: t.itemRender(t.page, "page", I("a", { rel: "nofollow", children: t.page })) }) }; const Xu = { ZERO: 48, NINE: 57, NUMPAD_ZERO: 96, NUMPAD_NINE: 105, BACKSPACE: 8, DELETE: 46, ENTER: 13, ARROW_UP: 38, ARROW_DOWN: 40 }; var nz = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.state = { goInputText: "" }, r.buildOptionText = function (o) { return "".concat(o, " ").concat(r.props.locale.items_per_page) }, r.changeSize = function (o) { r.props.changeSize(Number(o)) }, r.handleChange = function (o) { r.setState({ goInputText: o.target.value }) }, r.handleBlur = function (o) { var f = r.props, p = f.goButton, v = f.quickGo, y = f.rootPrefixCls, w = r.state.goInputText; p || w === "" || (r.setState({ goInputText: "" }), !(o.relatedTarget && (o.relatedTarget.className.indexOf("".concat(y, "-item-link")) >= 0 || o.relatedTarget.className.indexOf("".concat(y, "-item")) >= 0)) && v(r.getValidValue())) }, r.go = function (o) { var f = r.state.goInputText; f !== "" && (o.keyCode === Xu.ENTER || o.type === "click") && (r.setState({ goInputText: "" }), r.props.quickGo(r.getValidValue())) }, r } return Fr(n, [{ key: "getValidValue", value: function () { var i = this.state.goInputText; return !i || isNaN(i) ? void 0 : Number(i) } }, { key: "getPageSizeOptions", value: function () { var i = this.props, s = i.pageSize, c = i.pageSizeOptions; return c.some(function (o) { return o.toString() === s.toString() }) ? c : c.concat([s.toString()]).sort(function (o, f) { var p = isNaN(Number(o)) ? 0 : Number(o), v = isNaN(Number(f)) ? 0 : Number(f); return p - v }) } }, { key: "render", value: function () { var i = this, s = this.props, c = s.pageSize, o = s.locale, f = s.rootPrefixCls, p = s.changeSize, v = s.quickGo, y = s.goButton, w = s.selectComponentClass, P = s.buildOptionText, k = s.selectPrefixCls, A = s.disabled, N = this.state.goInputText, R = "".concat(f, "-options"), M = w, O = null, z = null, B = null; if (!p && !v) return null; var V = this.getPageSizeOptions(); if (p && M) { var G = V.map(function (j, X) { return I(M.Option, { value: j.toString(), children: (P || i.buildOptionText)(j) }, X) }); O = I(M, { disabled: A, prefixCls: k, showSearch: !1, className: "".concat(R, "-size-changer"), optionLabelProp: "children", dropdownMatchSelectWidth: !1, value: (c || V[0]).toString(), onChange: this.changeSize, getPopupContainer: function (X) { return X.parentNode }, "aria-label": o.page_size, defaultOpen: !1, children: G }) } return v && (y && (B = typeof y == "boolean" ? I("button", { type: "button", onClick: this.go, onKeyUp: this.go, disabled: A, className: "".concat(R, "-quick-jumper-button"), children: o.jump_to_confirm }) : I("span", { onClick: this.go, onKeyUp: this.go, children: y })), z = Qe("div", { className: "".concat(R, "-quick-jumper"), children: [o.jump_to, I("input", { disabled: A, type: "text", value: N, onChange: this.handleChange, onKeyUp: this.go, onBlur: this.handleBlur, "aria-label": o.page }), o.page, B] })), Qe("li", { className: "".concat(R), children: [O, z] }) } }]), n }(tr.Component); nz.defaultProps = { pageSizeOptions: ["10", "20", "50", "100"] }; const aQ = { items_per_page: "\u6761/\u9875", jump_to: "\u8DF3\u81F3", jump_to_confirm: "\u786E\u5B9A", page: "\u9875", prev_page: "\u4E0A\u4E00\u9875", next_page: "\u4E0B\u4E00\u9875", prev_5: "\u5411\u524D 5 \u9875", next_5: "\u5411\u540E 5 \u9875", prev_3: "\u5411\u524D 3 \u9875", next_3: "\u5411\u540E 3 \u9875", page_size: "\u9875\u7801" }; function iC() { } function DI(e) { var t = Number(e); return typeof t == "number" && !isNaN(t) && isFinite(t) && Math.floor(t) === t } function sQ(e, t, n) { return n } function Ol(e, t, n) { var r = typeof e > "u" ? t.pageSize : e; return Math.floor((n.total - 1) / r) + 1 } var rz = function (e) { ui(n, e); var t = ci(n); function n(r) { var i; zr(this, n), i = t.call(this, r), i.getJumpPrevPage = function () { return Math.max(1, i.state.current - (i.props.showLessItems ? 3 : 5)) }, i.getJumpNextPage = function () { return Math.min(Ol(void 0, i.state, i.props), i.state.current + (i.props.showLessItems ? 3 : 5)) }, i.getItemIcon = function (p, v) { var y = i.props.prefixCls, w = p || I("button", { type: "button", "aria-label": v, className: "".concat(y, "-item-link") }); return typeof p == "function" && (w = tr.createElement(p, ge({}, i.props))), w }, i.savePaginationNode = function (p) { i.paginationNode = p }, i.isValid = function (p) { var v = i.props.total; return DI(p) && p !== i.state.current && DI(v) && v > 0 }, i.shouldDisplayQuickJumper = function () { var p = i.props, v = p.showQuickJumper, y = p.total, w = i.state.pageSize; return y <= w ? !1 : v }, i.handleKeyDown = function (p) { (p.keyCode === Xu.ARROW_UP || p.keyCode === Xu.ARROW_DOWN) && p.preventDefault() }, i.handleKeyUp = function (p) { var v = i.getValidValue(p), y = i.state.currentInputValue; v !== y && i.setState({ currentInputValue: v }), p.keyCode === Xu.ENTER ? i.handleChange(v) : p.keyCode === Xu.ARROW_UP ? i.handleChange(v - 1) : p.keyCode === Xu.ARROW_DOWN && i.handleChange(v + 1) }, i.handleBlur = function (p) { var v = i.getValidValue(p); i.handleChange(v) }, i.changePageSize = function (p) { var v = i.state.current, y = Ol(p, i.state, i.props); v = v > y ? y : v, y === 0 && (v = i.state.current), typeof p == "number" && ("pageSize" in i.props || i.setState({ pageSize: p }), "current" in i.props || i.setState({ current: v, currentInputValue: v })), i.props.onShowSizeChange(v, p), "onChange" in i.props && i.props.onChange && i.props.onChange(v, p) }, i.handleChange = function (p) { var v = i.props, y = v.disabled, w = v.onChange, P = i.state, k = P.pageSize, A = P.current, N = P.currentInputValue; if (i.isValid(p) && !y) { var R = Ol(void 0, i.state, i.props), M = p; return p > R ? M = R : p < 1 && (M = 1), "current" in i.props || i.setState({ current: M }), M !== N && i.setState({ currentInputValue: M }), w(M, k), M } return A }, i.prev = function () { i.hasPrev() && i.handleChange(i.state.current - 1) }, i.next = function () { i.hasNext() && i.handleChange(i.state.current + 1) }, i.jumpPrev = function () { i.handleChange(i.getJumpPrevPage()) }, i.jumpNext = function () { i.handleChange(i.getJumpNextPage()) }, i.hasPrev = function () { return i.state.current > 1 }, i.hasNext = function () { return i.state.current < Ol(void 0, i.state, i.props) }, i.runIfEnter = function (p, v) { if (p.key === "Enter" || p.charCode === 13) { for (var y = arguments.length, w = new Array(y > 2 ? y - 2 : 0), P = 2; P < y; P++)w[P - 2] = arguments[P]; v.apply(void 0, w) } }, i.runIfEnterPrev = function (p) { i.runIfEnter(p, i.prev) }, i.runIfEnterNext = function (p) { i.runIfEnter(p, i.next) }, i.runIfEnterJumpPrev = function (p) { i.runIfEnter(p, i.jumpPrev) }, i.runIfEnterJumpNext = function (p) { i.runIfEnter(p, i.jumpNext) }, i.handleGoTO = function (p) { (p.keyCode === Xu.ENTER || p.type === "click") && i.handleChange(i.state.currentInputValue) }; var s = r.onChange !== iC, c = "current" in r; c && !s && console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component."); var o = r.defaultCurrent; "current" in r && (o = r.current); var f = r.defaultPageSize; return "pageSize" in r && (f = r.pageSize), o = Math.min(o, Ol(f, void 0, r)), i.state = { current: o, currentInputValue: o, pageSize: f }, i } return Fr(n, [{ key: "componentDidUpdate", value: function (i, s) { var c = this.props.prefixCls; if (s.current !== this.state.current && this.paginationNode) { var o = this.paginationNode.querySelector(".".concat(c, "-item-").concat(s.current)); o && document.activeElement === o && o.blur() } } }, { key: "getValidValue", value: function (i) { var s = i.target.value, c = Ol(void 0, this.state, this.props), o = this.state.currentInputValue, f; return s === "" ? f = s : isNaN(Number(s)) ? f = o : s >= c ? f = c : f = Number(s), f } }, { key: "getShowSizeChanger", value: function () { var i = this.props, s = i.showSizeChanger, c = i.total, o = i.totalBoundaryShowSizeChanger; return typeof s < "u" ? s : c > o } }, { key: "renderPrev", value: function (i) { var s = this.props, c = s.prevIcon, o = s.itemRender, f = o(i, "prev", this.getItemIcon(c, "prev page")), p = !this.hasPrev(); return C.exports.isValidElement(f) ? C.exports.cloneElement(f, { disabled: p }) : f } }, { key: "renderNext", value: function (i) { var s = this.props, c = s.nextIcon, o = s.itemRender, f = o(i, "next", this.getItemIcon(c, "next page")), p = !this.hasNext(); return C.exports.isValidElement(f) ? C.exports.cloneElement(f, { disabled: p }) : f } }, { key: "render", value: function () { var i = this, s = this.props, c = s.prefixCls, o = s.className, f = s.style, p = s.disabled, v = s.hideOnSinglePage, y = s.total, w = s.locale, P = s.showQuickJumper, k = s.showLessItems, A = s.showTitle, N = s.showTotal, R = s.simple, M = s.itemRender, O = s.showPrevNextJumpers, z = s.jumpPrevIcon, B = s.jumpNextIcon, V = s.selectComponentClass, G = s.selectPrefixCls, j = s.pageSizeOptions, X = this.state, Y = X.current, se = X.pageSize, ee = X.currentInputValue; if (v === !0 && y <= se) return null; var Z = Ol(void 0, this.state, this.props), J = [], ve = null, ie = null, ce = null, oe = null, ye = null, Ie = P && P.goButton, Te = k ? 1 : 2, Pe = Y - 1 > 0 ? Y - 1 : 0, De = Y + 1 < Z ? Y + 1 : Z, Re = Object.keys(this.props).reduce(function (yt, Mt) { return (Mt.substr(0, 5) === "data-" || Mt.substr(0, 5) === "aria-" || Mt === "role") && (yt[Mt] = i.props[Mt]), yt }, {}), ke = N && I("li", { className: "".concat(c, "-total-text"), children: N(y, [y === 0 ? 0 : (Y - 1) * se + 1, Y * se > y ? y : Y * se]) }); if (R) return Ie && (typeof Ie == "boolean" ? ye = I("button", { type: "button", onClick: this.handleGoTO, onKeyUp: this.handleGoTO, children: w.jump_to_confirm }) : ye = I("span", { onClick: this.handleGoTO, onKeyUp: this.handleGoTO, children: Ie }), ye = I("li", { title: A ? "".concat(w.jump_to).concat(Y, "/").concat(Z) : null, className: "".concat(c, "-simple-pager"), children: ye })), Qe("ul", { className: Xe(c, "".concat(c, "-simple"), re({}, "".concat(c, "-disabled"), p), o), style: f, ref: this.savePaginationNode, ...Re, children: [ke, I("li", { title: A ? w.prev_page : null, onClick: this.prev, tabIndex: this.hasPrev() ? 0 : null, onKeyPress: this.runIfEnterPrev, className: Xe("".concat(c, "-prev"), re({}, "".concat(c, "-disabled"), !this.hasPrev())), "aria-disabled": !this.hasPrev(), children: this.renderPrev(Pe) }), Qe("li", { title: A ? "".concat(Y, "/").concat(Z) : null, className: "".concat(c, "-simple-pager"), children: [I("input", { type: "text", value: ee, disabled: p, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onChange: this.handleKeyUp, onBlur: this.handleBlur, size: "3" }), I("span", { className: "".concat(c, "-slash"), children: "/" }), Z] }), I("li", { title: A ? w.next_page : null, onClick: this.next, tabIndex: this.hasPrev() ? 0 : null, onKeyPress: this.runIfEnterNext, className: Xe("".concat(c, "-next"), re({}, "".concat(c, "-disabled"), !this.hasNext())), "aria-disabled": !this.hasNext(), children: this.renderNext(De) }), ye] }); if (Z <= 3 + Te * 2) { var Oe = { locale: w, rootPrefixCls: c, onClick: this.handleChange, onKeyPress: this.runIfEnter, showTitle: A, itemRender: M }; Z || J.push(C.exports.createElement(Uh, { ...Oe, key: "noPager", page: 1, className: "".concat(c, "-item-disabled") })); for (var $e = 1; $e <= Z; $e += 1) { var He = Y === $e; J.push(C.exports.createElement(Uh, { ...Oe, key: $e, page: $e, active: He })) } } else { var Ue = k ? w.prev_3 : w.prev_5, st = k ? w.next_3 : w.next_5; O && (ve = I("li", { title: A ? Ue : null, onClick: this.jumpPrev, tabIndex: "0", onKeyPress: this.runIfEnterJumpPrev, className: Xe("".concat(c, "-jump-prev"), re({}, "".concat(c, "-jump-prev-custom-icon"), !!z)), children: M(this.getJumpPrevPage(), "jump-prev", this.getItemIcon(z, "prev page")) }, "prev"), ie = I("li", { title: A ? st : null, tabIndex: "0", onClick: this.jumpNext, onKeyPress: this.runIfEnterJumpNext, className: Xe("".concat(c, "-jump-next"), re({}, "".concat(c, "-jump-next-custom-icon"), !!B)), children: M(this.getJumpNextPage(), "jump-next", this.getItemIcon(B, "next page")) }, "next")), oe = I(Uh, { locale: w, last: !0, rootPrefixCls: c, onClick: this.handleChange, onKeyPress: this.runIfEnter, page: Z, active: !1, showTitle: A, itemRender: M }, Z), ce = I(Uh, { locale: w, rootPrefixCls: c, onClick: this.handleChange, onKeyPress: this.runIfEnter, page: 1, active: !1, showTitle: A, itemRender: M }, 1); var ft = Math.max(1, Y - Te), It = Math.min(Y + Te, Z); Y - 1 <= Te && (It = 1 + Te * 2), Z - Y <= Te && (ft = Z - Te * 2); for (var We = ft; We <= It; We += 1) { var Pt = Y === We; J.push(I(Uh, { locale: w, rootPrefixCls: c, onClick: this.handleChange, onKeyPress: this.runIfEnter, page: We, active: Pt, showTitle: A, itemRender: M }, We)) } Y - 1 >= Te * 2 && Y !== 1 + 2 && (J[0] = C.exports.cloneElement(J[0], { className: "".concat(c, "-item-after-jump-prev") }), J.unshift(ve)), Z - Y >= Te * 2 && Y !== Z - 2 && (J[J.length - 1] = C.exports.cloneElement(J[J.length - 1], { className: "".concat(c, "-item-before-jump-next") }), J.push(ie)), ft !== 1 && J.unshift(ce), It !== Z && J.push(oe) } var pt = !this.hasPrev() || !Z, Rt = !this.hasNext() || !Z; return Qe("ul", { className: Xe(c, o, re({}, "".concat(c, "-disabled"), p)), style: f, ref: this.savePaginationNode, ...Re, children: [ke, I("li", { title: A ? w.prev_page : null, onClick: this.prev, tabIndex: pt ? null : 0, onKeyPress: this.runIfEnterPrev, className: Xe("".concat(c, "-prev"), re({}, "".concat(c, "-disabled"), pt)), "aria-disabled": pt, children: this.renderPrev(Pe) }), J, I("li", { title: A ? w.next_page : null, onClick: this.next, tabIndex: Rt ? null : 0, onKeyPress: this.runIfEnterNext, className: Xe("".concat(c, "-next"), re({}, "".concat(c, "-disabled"), Rt)), "aria-disabled": Rt, children: this.renderNext(De) }), I(nz, { disabled: p, locale: w, rootPrefixCls: c, selectComponentClass: V, selectPrefixCls: G, changeSize: this.getShowSizeChanger() ? this.changePageSize : null, current: Y, pageSize: se, pageSizeOptions: j, quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null, goButton: Ie })] }) } }], [{ key: "getDerivedStateFromProps", value: function (i, s) { var c = {}; if ("current" in i && (c.current = i.current, i.current !== s.current && (c.currentInputValue = c.current)), "pageSize" in i && i.pageSize !== s.pageSize) { var o = s.current, f = Ol(i.pageSize, s, i); o = o > f ? f : o, "current" in i || (c.current = o, c.currentInputValue = o), c.pageSize = i.pageSize } return c } }]), n }(tr.Component); rz.defaultProps = { defaultCurrent: 1, total: 0, defaultPageSize: 10, onChange: iC, className: "", selectPrefixCls: "rc-select", prefixCls: "rc-pagination", selectComponentClass: null, hideOnSinglePage: !1, showPrevNextJumpers: !0, showQuickJumper: !1, showLessItems: !1, showTitle: !0, onShowSizeChange: iC, locale: aQ, style: {}, itemRender: sQ, totalBoundaryShowSizeChanger: 50 }; var iz = function (t) { return I(sl, { ...t, size: "small" }) }, oz = function (t) { return I(sl, { ...t, size: "middle" }) }; iz.Option = sl.Option; oz.Option = sl.Option; var lQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, uQ = function (t) { var n = t.prefixCls, r = t.selectPrefixCls, i = t.className, s = t.size, c = t.locale, o = t.selectComponentClass, f = t.responsive, p = t.showSizeChanger, v = lQ(t, ["prefixCls", "selectPrefixCls", "className", "size", "locale", "selectComponentClass", "responsive", "showSizeChanger"]), y = VD(f), w = y.xs, P = C.exports.useContext(zn), k = P.getPrefixCls, A = P.direction, N = P.pagination, R = N === void 0 ? {} : N, M = k("pagination", n), O = p != null ? p : R.showSizeChanger, z = function () { var V = I("span", { className: "".concat(M, "-item-ellipsis"), children: "\u2022\u2022\u2022" }), G = I("button", { className: "".concat(M, "-item-link"), type: "button", tabIndex: -1, children: I(FG, {}) }), j = I("button", { className: "".concat(M, "-item-link"), type: "button", tabIndex: -1, children: I(V2, {}) }), X = I("a", { className: "".concat(M, "-item-link"), children: Qe("div", { className: "".concat(M, "-item-container"), children: [I(nQ, { className: "".concat(M, "-item-link-icon") }), V] }) }), Y = I("a", { className: "".concat(M, "-item-link"), children: Qe("div", { className: "".concat(M, "-item-container"), children: [I(oQ, { className: "".concat(M, "-item-link-icon") }), V] }) }); if (A === "rtl") { var se = [j, G]; G = se[0], j = se[1]; var ee = [Y, X]; X = ee[0], Y = ee[1] } return { prevIcon: G, nextIcon: j, jumpPrevIcon: X, jumpNextIcon: Y } }; return I(fm, { componentName: "Pagination", defaultLocale: DN, children: function (B) { var V, G = tt(tt({}, B), c), j = s === "small" || !!(w && !s && f), X = k("select", r), Y = Xe((V = {}, re(V, "".concat(M, "-mini"), j), re(V, "".concat(M, "-rtl"), A === "rtl"), V), i); return I(rz, { ...z(), ...v, prefixCls: M, selectPrefixCls: X, className: Y, selectComponentClass: o || (j ? iz : oz), locale: G, showSizeChanger: O }) } }) }; const cQ = uQ; var dQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; ia("small", "default", "large"); var qg = null; function fQ(e, t) { var n = t.indicator, r = "".concat(e, "-dot"); return n === null ? null : zo(n) ? li(n, { className: Xe(n.props.className, r) }) : zo(qg) ? li(qg, { className: Xe(qg.props.className, r) }) : Qe("span", { className: Xe(r, "".concat(e, "-dot-spin")), children: [I("i", { className: "".concat(e, "-dot-item") }), I("i", { className: "".concat(e, "-dot-item") }), I("i", { className: "".concat(e, "-dot-item") }), I("i", { className: "".concat(e, "-dot-item") })] }) } function hQ(e, t) { return !!e && !!t && !isNaN(Number(t)) } var pQ = function (t) { var n = t.spinPrefixCls, r = t.spinning, i = r === void 0 ? !0 : r, s = t.delay, c = t.className, o = t.size, f = o === void 0 ? "default" : o, p = t.tip, v = t.wrapperClassName, y = t.style, w = t.children, P = dQ(t, ["spinPrefixCls", "spinning", "delay", "className", "size", "tip", "wrapperClassName", "style", "children"]), k = C.exports.useState(function () { return i && !hQ(i, s) }), A = ze(k, 2), N = A[0], R = A[1]; C.exports.useEffect(function () { var z = AZ(function () { R(i) }, s); return z(), function () { var B; (B = z == null ? void 0 : z.cancel) === null || B === void 0 || B.call(z) } }, [s, i]); var M = function () { return typeof w < "u" }, O = function (B) { var V, G = B.direction, j = Xe(n, (V = {}, re(V, "".concat(n, "-sm"), f === "small"), re(V, "".concat(n, "-lg"), f === "large"), re(V, "".concat(n, "-spinning"), N), re(V, "".concat(n, "-show-text"), !!p), re(V, "".concat(n, "-rtl"), G === "rtl"), V), c), X = vi(P, ["indicator", "prefixCls"]), Y = Qe("div", { ...X, style: y, className: j, "aria-live": "polite", "aria-busy": N, children: [fQ(n, t), p ? I("div", { className: "".concat(n, "-text"), children: p }) : null] }); if (M()) { var se = Xe("".concat(n, "-container"), re({}, "".concat(n, "-blur"), N)); return Qe("div", { ...X, className: Xe("".concat(n, "-nested-loading"), v), children: [N && I("div", { children: Y }, "loading"), I("div", { className: se, children: w }, "container")] }) } return Y }; return I(yu, { children: O }) }, az = function (t) { var n = t.prefixCls, r = C.exports.useContext(zn), i = r.getPrefixCls, s = i("spin", n), c = tt(tt({}, t), { spinPrefixCls: s }); return I(pQ, { ...c }) }; az.setDefaultIndicator = function (e) { qg = e }; const Pf = az; function LI(e) { return !!(e && !!e.then) } var mQ = function (t) { var n = C.exports.useRef(!1), r = C.exports.useRef(null), i = ms(!1), s = ze(i, 2), c = s[0], o = s[1], f = t.close, p = function () { f == null || f.apply(void 0, arguments) }; C.exports.useEffect(function () { var N = null; return t.autoFocus && (N = setTimeout(function () { var R; (R = r.current) === null || R === void 0 || R.focus() })), function () { N && clearTimeout(N) } }, []); var v = function (R) { !LI(R) || (o(!0), R.then(function () { o(!1, !0), p.apply(void 0, arguments), n.current = !1 }, function (M) { console.error(M), o(!1, !0), n.current = !1 })) }, y = function (R) { var M = t.actionFn; if (!n.current) { if (n.current = !0, !M) { p(); return } var O; if (t.emitEvent) { if (O = M(R), t.quitOnNullishReturnValue && !LI(O)) { n.current = !1, p(R); return } } else if (M.length) O = M(f), n.current = !1; else if (O = M(), !O) { p(); return } v(O) } }, w = t.type, P = t.children, k = t.prefixCls, A = t.buttonProps; return I(gr, { ...hL(w), onClick: y, loading: c, prefixCls: k, ...A, ref: r, children: P }) }; const zI = mQ; var vQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, oC, gQ = function (t) { oC = { x: t.pageX, y: t.pageY }, setTimeout(function () { oC = null }, 100) }; mL() && document.documentElement.addEventListener("click", gQ, !0); var yQ = function (t) { var n, r, i = C.exports.useContext(zn), s = i.getPopupContainer, c = i.getPrefixCls, o = i.direction, f = function (J) { var ve = t.onCancel; ve == null || ve(J) }, p = function (J) { var ve = t.onOk; ve == null || ve(J) }, v = t.prefixCls, y = t.footer, w = t.visible, P = t.open, k = P === void 0 ? !1 : P, A = t.wrapClassName, N = t.centered, R = t.getContainer, M = t.closeIcon, O = t.focusTriggerAfterClose, z = O === void 0 ? !0 : O, B = t.width, V = B === void 0 ? 520 : B, G = vQ(t, ["prefixCls", "footer", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose", "width"]), j = c("modal", v), X = c(), Y = I(fm, { componentName: "Modal", defaultLocale: zN(), children: function (Z) { var J = t.okText, ve = t.okType, ie = ve === void 0 ? "primary" : ve, ce = t.cancelText, oe = t.confirmLoading, ye = oe === void 0 ? !1 : oe; return Qe(An, { children: [I(gr, { onClick: f, ...t.cancelButtonProps, children: ce || Z.cancelText }), I(gr, { ...hL(ie), loading: ye, onClick: p, ...t.okButtonProps, children: J != null ? J : Z.okText })] }) } }), se = I("span", { className: "".concat(j, "-close-x"), children: M || I(H0, { className: "".concat(j, "-close-icon") }) }), ee = Xe(A, (n = {}, re(n, "".concat(j, "-centered"), !!N), re(n, "".concat(j, "-wrap-rtl"), o === "rtl"), n)); return I(lf, { children: I(Gp, { status: !0, override: !0, children: I(HL, { width: V, ...G, getContainer: R === void 0 ? s : R, prefixCls: j, wrapClassName: ee, footer: y === void 0 ? Y : y, visible: k || w, mousePosition: (r = G.mousePosition) !== null && r !== void 0 ? r : oC, onClose: f, closeIcon: se, focusTriggerAfterClose: z, transitionName: al(X, "zoom", t.transitionName), maskTransitionName: al(X, "fade", t.maskTransitionName) }) }) }) }; const sz = yQ; var xQ = function (t) { var n = t.icon, r = t.onCancel, i = t.onOk, s = t.close, c = t.zIndex, o = t.afterClose, f = t.visible, p = t.open, v = t.keyboard, y = t.centered, w = t.getContainer, P = t.maskStyle, k = t.okText, A = t.okButtonProps, N = t.cancelText, R = t.cancelButtonProps, M = t.direction, O = t.prefixCls, z = t.wrapClassName, B = t.rootPrefixCls, V = t.iconPrefixCls, G = t.bodyStyle, j = t.closable, X = j === void 0 ? !1 : j, Y = t.closeIcon, se = t.modalRender, ee = t.focusTriggerAfterClose, Z = t.okType || "primary", J = "".concat(O, "-confirm"), ve = "okCancel" in t ? t.okCancel : !0, ie = t.width || 416, ce = t.style || {}, oe = t.mask === void 0 ? !0 : t.mask, ye = t.maskClosable === void 0 ? !1 : t.maskClosable, Ie = t.autoFocusButton === null ? !1 : t.autoFocusButton || "ok", Te = Xe(J, "".concat(J, "-").concat(t.type), re({}, "".concat(J, "-rtl"), M === "rtl"), t.className), Pe = ve && I(zI, { actionFn: r, close: s, autoFocus: Ie === "cancel", buttonProps: R, prefixCls: "".concat(B, "-btn"), children: N }); return I(Cf, { prefixCls: B, iconPrefixCls: V, direction: M, children: I(sz, { prefixCls: O, className: Te, wrapClassName: Xe(re({}, "".concat(J, "-centered"), !!t.centered), z), onCancel: function () { return s == null ? void 0 : s({ triggerCancel: !0 }) }, open: p || f, title: "", footer: "", transitionName: al(B, "zoom", t.transitionName), maskTransitionName: al(B, "fade", t.maskTransitionName), mask: oe, maskClosable: ye, maskStyle: P, style: ce, bodyStyle: G, width: ie, zIndex: c, afterClose: o, keyboard: v, centered: y, getContainer: w, closable: X, closeIcon: Y, modalRender: se, focusTriggerAfterClose: ee, children: Qe("div", { className: "".concat(J, "-body-wrapper"), children: [Qe("div", { className: "".concat(J, "-body"), children: [n, t.title === void 0 ? null : I("span", { className: "".concat(J, "-title"), children: t.title }), I("div", { className: "".concat(J, "-content"), children: t.content })] }), Qe("div", { className: "".concat(J, "-btns"), children: [Pe, I(zI, { type: Z, actionFn: i, close: s, autoFocus: Ie === "ok", buttonProps: A, prefixCls: "".concat(B, "-btn"), children: k })] })] }) }) }) }; const lz = xQ; var _Q = []; const zd = _Q; var bQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, uz = ""; function wQ() { return uz } function Cm(e) { var t = document.createDocumentFragment(), n = tt(tt({}, e), { close: c, open: !0 }), r; function i() { for (var f = arguments.length, p = new Array(f), v = 0; v < f; v++)p[v] = arguments[v]; var y = p.some(function (k) { return k && k.triggerCancel }); e.onCancel && y && e.onCancel.apply(e, [function () { }].concat(Et(p.slice(1)))); for (var w = 0; w < zd.length; w++) { var P = zd[w]; if (P === c) { zd.splice(w, 1); break } } nO(t) } function s(f) { var p = f.okText, v = f.cancelText, y = f.prefixCls, w = bQ(f, ["okText", "cancelText", "prefixCls"]); clearTimeout(r), r = setTimeout(function () { var P = zN(), k = m2(), A = k.getPrefixCls, N = k.getIconPrefixCls, R = A(void 0, wQ()), M = y || "".concat(R, "-modal"), O = N(); tO(I(lz, { ...w, prefixCls: M, rootPrefixCls: R, iconPrefixCls: O, okText: p || (w.okCancel ? P.okText : P.justOkText), cancelText: v || P.cancelText }), t) }) } function c() { for (var f = this, p = arguments.length, v = new Array(p), y = 0; y < p; y++)v[y] = arguments[y]; n = tt(tt({}, n), { open: !1, afterClose: function () { typeof e.afterClose == "function" && e.afterClose(), i.apply(f, v) } }), n.visible && delete n.visible, s(n) } function o(f) { typeof f == "function" ? n = f(n) : n = tt(tt({}, n), f), s(n) } return s(n), zd.push(c), { destroy: c, update: o } } function cz(e) { return tt(tt({ icon: I(W0, {}), okCancel: !1 }, e), { type: "warning" }) } function dz(e) { return tt(tt({ icon: I(p2, {}), okCancel: !1 }, e), { type: "info" }) } function fz(e) { return tt(tt({ icon: I(f2, {}), okCancel: !1 }, e), { type: "success" }) } function hz(e) { return tt(tt({ icon: I(h2, {}), okCancel: !1 }, e), { type: "error" }) } function pz(e) { return tt(tt({ icon: I(W0, {}), okCancel: !0 }, e), { type: "confirm" }) } function CQ(e) { var t = e.rootPrefixCls; uz = t } function SQ() { var e = C.exports.useState([]), t = ze(e, 2), n = t[0], r = t[1], i = C.exports.useCallback(function (s) { return r(function (c) { return [].concat(Et(c), [s]) }), function () { r(function (c) { return c.filter(function (o) { return o !== s }) }) } }, []); return [n, i] } var EQ = function (t, n) { var r = t.afterClose, i = t.config, s = C.exports.useState(!0), c = ze(s, 2), o = c[0], f = c[1], p = C.exports.useState(i), v = ze(p, 2), y = v[0], w = v[1], P = C.exports.useContext(zn), k = P.direction, A = P.getPrefixCls, N = A("modal"), R = A(), M = function () { f(!1); for (var z = arguments.length, B = new Array(z), V = 0; V < z; V++)B[V] = arguments[V]; var G = B.some(function (j) { return j && j.triggerCancel }); y.onCancel && G && y.onCancel.apply(y, [function () { }].concat(Et(B.slice(1)))) }; return C.exports.useImperativeHandle(n, function () { return { destroy: M, update: function (z) { w(function (B) { return tt(tt({}, B), z) }) } } }), I(fm, { componentName: "Modal", defaultLocale: ol.Modal, children: function (O) { return I(lz, { prefixCls: N, rootPrefixCls: R, ...y, close: M, open: o, afterClose: r, okText: y.okText || (y.okCancel ? O.okText : O.justOkText), direction: k, cancelText: y.cancelText || O.cancelText }) } }) }; const PQ = C.exports.forwardRef(EQ); var FI = 0, TQ = C.exports.memo(C.exports.forwardRef(function (e, t) { var n = SQ(), r = ze(n, 2), i = r[0], s = r[1]; return C.exports.useImperativeHandle(t, function () { return { patchElement: s } }, []), I(An, { children: i }) })); function kQ() { var e = C.exports.useRef(null), t = C.exports.useState([]), n = ze(t, 2), r = n[0], i = n[1]; C.exports.useEffect(function () { if (r.length) { var o = Et(r); o.forEach(function (f) { f() }), i([]) } }, [r]); var s = C.exports.useCallback(function (o) { return function (p) { var v; FI += 1; var y = C.exports.createRef(), w, P = I(PQ, { config: o(p), ref: y, afterClose: function () { w == null || w() } }, "modal-".concat(FI)); return w = (v = e.current) === null || v === void 0 ? void 0 : v.patchElement(P), { destroy: function () { function A() { var N; (N = y.current) === null || N === void 0 || N.destroy() } y.current ? A() : i(function (N) { return [].concat(Et(N), [A]) }) }, update: function (A) { function N() { var R; (R = y.current) === null || R === void 0 || R.update(A) } y.current ? N() : i(function (R) { return [].concat(Et(R), [N]) }) } } } }, []), c = C.exports.useMemo(function () { return { info: s(dz), success: s(fz), error: s(hz), warning: s(cz), confirm: s(pz) } }, []); return [c, I(TQ, { ref: e })] } function mz(e) { return Cm(cz(e)) } var xs = sz; xs.useModal = kQ; xs.info = function (t) { return Cm(dz(t)) }; xs.success = function (t) { return Cm(fz(t)) }; xs.error = function (t) { return Cm(hz(t)) }; xs.warning = mz; xs.warn = mz; xs.confirm = function (t) { return Cm(pz(t)) }; xs.destroyAll = function () { for (; zd.length;) { var t = zd.pop(); t && t() } }; xs.config = CQ; const vz = xs; var IQ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z" } }] }, name: "arrow-right", theme: "outlined" }; const RQ = IQ; var MQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, AQ = { border: 0, background: "transparent", padding: 0, lineHeight: "inherit", display: "inline-block" }, NQ = C.exports.forwardRef(function (e, t) { var n = function (v) { var y = v.keyCode; y === St.ENTER && v.preventDefault() }, r = function (v) { var y = v.keyCode, w = e.onClick; y === St.ENTER && w && w() }, i = e.style, s = e.noStyle, c = e.disabled, o = MQ(e, ["style", "noStyle", "disabled"]), f = {}; return s || (f = tt({}, AQ)), c && (f.pointerEvents = "none"), f = tt(tt({}, f), i), I("div", { role: "button", tabIndex: 0, ref: t, ...o, onKeyDown: n, onKeyUp: r, style: f }) }); const $I = NQ; var Ac = C.exports.createContext({ min: 0, max: 0, direction: "ltr", step: 1, includedStart: 0, includedEnd: 0, tabIndex: 0 }); function aC(e, t, n) { return (e - t) / (n - t) } function eE(e, t, n, r) { var i = aC(t, n, r), s = {}; switch (e) { case "rtl": s.right = "".concat(i * 100, "%"), s.transform = "translateX(50%)"; break; case "btt": s.bottom = "".concat(i * 100, "%"), s.transform = "translateY(50%)"; break; case "ttb": s.top = "".concat(i * 100, "%"), s.transform = "translateY(-50%)"; break; default: s.left = "".concat(i * 100, "%"), s.transform = "translateX(-50%)"; break }return s } function Fd(e, t) { return Array.isArray(e) ? e[t] : e } var OQ = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange"], DQ = C.exports.forwardRef(function (e, t) { var n, r, i = e.prefixCls, s = e.value, c = e.valueIndex, o = e.onStartMove, f = e.style, p = e.render, v = e.dragging, y = e.onOffsetChange, w = Rn(e, OQ), P = C.exports.useContext(Ac), k = P.min, A = P.max, N = P.direction, R = P.disabled, M = P.range, O = P.tabIndex, z = P.ariaLabelForHandle, B = P.ariaLabelledByForHandle, V = P.ariaValueTextFormatterForHandle, G = "".concat(i, "-handle"), j = function (Z) { R || o(Z, c) }, X = function (Z) { if (!R) { var J = null; switch (Z.which || Z.keyCode) { case St.LEFT: J = N === "ltr" || N === "btt" ? -1 : 1; break; case St.RIGHT: J = N === "ltr" || N === "btt" ? 1 : -1; break; case St.UP: J = N !== "ttb" ? 1 : -1; break; case St.DOWN: J = N !== "ttb" ? -1 : 1; break; case St.HOME: J = "min"; break; case St.END: J = "max"; break; case St.PAGE_UP: J = 2; break; case St.PAGE_DOWN: J = -2; break }J !== null && (Z.preventDefault(), y(J, c)) } }, Y = eE(N, s, k, A), se = I("div", { ref: t, className: Xe(G, (n = {}, re(n, "".concat(G, "-").concat(c + 1), M), re(n, "".concat(G, "-dragging"), v), n)), style: ge(ge({}, Y), f), onMouseDown: j, onTouchStart: j, onKeyDown: X, tabIndex: R ? null : Fd(O, c), role: "slider", "aria-valuemin": k, "aria-valuemax": A, "aria-valuenow": s, "aria-disabled": R, "aria-label": Fd(z, c), "aria-labelledby": Fd(B, c), "aria-valuetext": (r = Fd(V, c)) === null || r === void 0 ? void 0 : r(s), ...w }); return p && (se = p(se, { index: c, prefixCls: i, value: s, dragging: v })), se }), LQ = ["prefixCls", "style", "onStartMove", "onOffsetChange", "values", "handleRender", "draggingIndex"], zQ = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.style, i = e.onStartMove, s = e.onOffsetChange, c = e.values, o = e.handleRender, f = e.draggingIndex, p = Rn(e, LQ), v = C.exports.useRef({}); return C.exports.useImperativeHandle(t, function () { return { focus: function (w) { var P; (P = v.current[w]) === null || P === void 0 || P.focus() } } }), I(An, { children: c.map(function (y, w) { return I(DQ, { ref: function (k) { k ? v.current[w] = k : delete v.current[w] }, dragging: f === w, prefixCls: n, style: Fd(r, w), value: y, valueIndex: w, onStartMove: i, onOffsetChange: s, render: o, ...p }, w) }) }) }); function BI(e) { var t = "touches" in e ? e.touches[0] : e; return { pageX: t.pageX, pageY: t.pageY } } function FQ(e, t, n, r, i, s, c, o, f) { var p = C.exports.useState(null), v = ze(p, 2), y = v[0], w = v[1], P = C.exports.useState(-1), k = ze(P, 2), A = k[0], N = k[1], R = C.exports.useState(n), M = ze(R, 2), O = M[0], z = M[1], B = C.exports.useState(n), V = ze(B, 2), G = V[0], j = V[1], X = C.exports.useRef(null), Y = C.exports.useRef(null); C.exports.useEffect(function () { A === -1 && z(n) }, [n, A]), C.exports.useEffect(function () { return function () { document.removeEventListener("mousemove", X.current), document.removeEventListener("mouseup", Y.current), document.removeEventListener("touchmove", X.current), document.removeEventListener("touchend", Y.current) } }, []); var se = function (ce, oe) { O.some(function (ye, Ie) { return ye !== ce[Ie] }) && (oe !== void 0 && w(oe), z(ce), c(ce)) }, ee = function (ce, oe) { if (ce === -1) { var ye = G[0], Ie = G[G.length - 1], Te = r - ye, Pe = i - Ie, De = oe * (i - r); De = Math.max(De, Te), De = Math.min(De, Pe); var Re = s(ye + De); De = Re - ye; var ke = G.map(function (Ue) { return Ue + De }); se(ke) } else { var Oe = (i - r) * oe, $e = Et(O); $e[ce] = G[ce]; var He = f($e, Oe, ce, "dist"); se(He.values, He.value) } }, Z = C.exports.useRef(ee); Z.current = ee; var J = function (ce, oe) { ce.stopPropagation(); var ye = n[oe]; N(oe), w(ye), j(n); var Ie = BI(ce), Te = Ie.pageX, Pe = Ie.pageY, De = function (Oe) { Oe.preventDefault(); var $e = BI(Oe), He = $e.pageX, Ue = $e.pageY, st = He - Te, ft = Ue - Pe, It = e.current.getBoundingClientRect(), We = It.width, Pt = It.height, pt; switch (t) { case "btt": pt = -ft / Pt; break; case "ttb": pt = ft / Pt; break; case "rtl": pt = -st / We; break; default: pt = st / We }Z.current(oe, pt) }, Re = function ke(Oe) { Oe.preventDefault(), document.removeEventListener("mouseup", ke), document.removeEventListener("mousemove", De), document.removeEventListener("touchend", ke), document.removeEventListener("touchmove", De), X.current = null, Y.current = null, N(-1), o() }; document.addEventListener("mouseup", Re), document.addEventListener("mousemove", De), document.addEventListener("touchend", Re), document.addEventListener("touchmove", De), X.current = De, Y.current = Re }, ve = C.exports.useMemo(function () { var ie = Et(n).sort(function (oe, ye) { return oe - ye }), ce = Et(O).sort(function (oe, ye) { return oe - ye }); return ie.every(function (oe, ye) { return oe === ce[ye] }) ? O : n }, [n, O]); return [A, y, ve, J] } function $Q(e) { var t = e.prefixCls, n = e.style, r = e.start, i = e.end, s = e.index, c = e.onStartMove, o = C.exports.useContext(Ac), f = o.direction, p = o.min, v = o.max, y = o.disabled, w = o.range, P = "".concat(t, "-track"), k = aC(r, p, v), A = aC(i, p, v), N = function (O) { !y && c && c(O, -1) }, R = {}; switch (f) { case "rtl": R.right = "".concat(k * 100, "%"), R.width = "".concat(A * 100 - k * 100, "%"); break; case "btt": R.bottom = "".concat(k * 100, "%"), R.height = "".concat(A * 100 - k * 100, "%"); break; case "ttb": R.top = "".concat(k * 100, "%"), R.height = "".concat(A * 100 - k * 100, "%"); break; default: R.left = "".concat(k * 100, "%"), R.width = "".concat(A * 100 - k * 100, "%") }return I("div", { className: Xe(P, w && "".concat(P, "-").concat(s + 1)), style: ge(ge({}, R), n), onMouseDown: N, onTouchStart: N }) } function BQ(e) { var t = e.prefixCls, n = e.style, r = e.values, i = e.startPoint, s = e.onStartMove, c = C.exports.useContext(Ac), o = c.included, f = c.range, p = c.min, v = C.exports.useMemo(function () { if (!f) { if (r.length === 0) return []; var y = i != null ? i : p, w = r[0]; return [{ start: Math.min(y, w), end: Math.max(y, w) }] } for (var P = [], k = 0; k < r.length - 1; k += 1)P.push({ start: r[k], end: r[k + 1] }); return P }, [r, f, i, p]); return o ? v.map(function (y, w) { var P = y.start, k = y.end; return I($Q, { index: w, prefixCls: t, style: Fd(n, w), start: P, end: k, onStartMove: s }, w) }) : null } function VQ(e) { var t = e.prefixCls, n = e.style, r = e.children, i = e.value, s = e.onClick, c = C.exports.useContext(Ac), o = c.min, f = c.max, p = c.direction, v = c.includedStart, y = c.includedEnd, w = c.included, P = "".concat(t, "-text"), k = eE(p, i, o, f); return I("span", { className: Xe(P, re({}, "".concat(P, "-active"), w && v <= i && i <= y)), style: ge(ge({}, k), n), onMouseDown: function (N) { N.stopPropagation() }, onClick: function () { s(i) }, children: r }) } function UQ(e) { var t = e.prefixCls, n = e.marks, r = e.onClick, i = "".concat(t, "-mark"); return n.length ? I("div", { className: i, children: n.map(function (s) { var c = s.value, o = s.style, f = s.label; return I(VQ, { prefixCls: i, style: o, value: c, onClick: r, children: f }, c) }) }) : null } function jQ(e) { var t = e.prefixCls, n = e.value, r = e.style, i = e.activeStyle, s = C.exports.useContext(Ac), c = s.min, o = s.max, f = s.direction, p = s.included, v = s.includedStart, y = s.includedEnd, w = "".concat(t, "-dot"), P = p && v <= n && n <= y, k = ge(ge({}, eE(f, n, c, o)), typeof r == "function" ? r(n) : r); return P && (k = ge(ge({}, k), typeof i == "function" ? i(n) : i)), I("span", { className: Xe(w, re({}, "".concat(w, "-active"), P)), style: k }) } function KQ(e) { var t = e.prefixCls, n = e.marks, r = e.dots, i = e.style, s = e.activeStyle, c = C.exports.useContext(Ac), o = c.min, f = c.max, p = c.step, v = C.exports.useMemo(function () { var y = new Set; if (n.forEach(function (P) { y.add(P.value) }), r && p !== null) for (var w = o; w <= f;)y.add(w), w += p; return Array.from(y) }, [o, f, p, r, n]); return I("div", { className: "".concat(t, "-step"), children: v.map(function (y) { return I(jQ, { prefixCls: t, value: y, style: i, activeStyle: s }, y) }) }) } function HQ(e, t, n, r, i, s) { var c = C.exports.useCallback(function (P) { var k = isFinite(P) ? P : e; return k = Math.min(t, P), k = Math.max(e, k), k }, [e, t]), o = C.exports.useCallback(function (P) { if (n !== null) { var k = e + Math.round((c(P) - e) / n) * n, A = function (O) { return (String(O).split(".")[1] || "").length }, N = Math.max(A(n), A(t), A(e)), R = Number(k.toFixed(N)); return e <= R && R <= t ? R : null } return null }, [n, e, t, c]), f = C.exports.useCallback(function (P) { var k = c(P), A = r.map(function (M) { return M.value }); n !== null && A.push(o(P)), A.push(e, t); var N = A[0], R = t - e; return A.forEach(function (M) { var O = Math.abs(k - M); O <= R && (N = M, R = O) }), N }, [e, t, r, n, c, o]), p = function P(k, A, N) { var R = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unit"; if (typeof A == "number") { var M, O = k[N], z = O + A, B = []; r.forEach(function (Y) { B.push(Y.value) }), B.push(e, t), B.push(o(O)); var V = A > 0 ? 1 : -1; R === "unit" ? B.push(o(O + V * n)) : B.push(o(z)), B = B.filter(function (Y) { return Y !== null }).filter(function (Y) { return A < 0 ? Y <= O : Y >= O }), R === "unit" && (B = B.filter(function (Y) { return Y !== O })); var G = R === "unit" ? O : z; M = B[0]; var j = Math.abs(M - G); if (B.forEach(function (Y) { var se = Math.abs(Y - G); se < j && (M = Y, j = se) }), M === void 0) return A < 0 ? e : t; if (R === "dist") return M; if (Math.abs(A) > 1) { var X = Et(k); return X[N] = M, P(X, A - V, N, R) } return M } else { if (A === "min") return e; if (A === "max") return t } }, v = function (k, A, N) { var R = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unit", M = k[N], O = p(k, A, N, R); return { value: O, changed: O !== M } }, y = function (k) { return s === null && k === 0 || typeof s == "number" && k < s }, w = function (k, A, N) { var R = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unit", M = k.map(f), O = M[N], z = p(M, A, N, R); if (M[N] = z, i === !1) { var B = s || 0; N > 0 && M[N - 1] !== O && (M[N] = Math.max(M[N], M[N - 1] + B)), N < M.length - 1 && M[N + 1] !== O && (M[N] = Math.min(M[N], M[N + 1] - B)) } else if (typeof s == "number" || s === null) { for (var V = N + 1; V < M.length; V += 1)for (var G = !0; y(M[V] - M[V - 1]) && G;) { var j = v(M, 1, V); M[V] = j.value, G = j.changed } for (var X = N; X > 0; X -= 1)for (var Y = !0; y(M[X] - M[X - 1]) && Y;) { var se = v(M, -1, X - 1); M[X - 1] = se.value, Y = se.changed } for (var ee = M.length - 1; ee > 0; ee -= 1)for (var Z = !0; y(M[ee] - M[ee - 1]) && Z;) { var J = v(M, -1, ee - 1); M[ee - 1] = J.value, Z = J.changed } for (var ve = 0; ve < M.length - 1; ve += 1)for (var ie = !0; y(M[ve + 1] - M[ve]) && ie;) { var ce = v(M, 1, ve + 1); M[ve + 1] = ce.value, ie = ce.changed } } return { value: M[N], values: M } }; return [f, w] } var WQ = C.exports.forwardRef(function (e, t) { var n, r = e.prefixCls, i = r === void 0 ? "rc-slider" : r, s = e.className, c = e.style, o = e.disabled, f = o === void 0 ? !1 : o, p = e.autoFocus, v = e.onFocus, y = e.onBlur, w = e.min, P = w === void 0 ? 0 : w, k = e.max, A = k === void 0 ? 100 : k, N = e.step, R = N === void 0 ? 1 : N, M = e.value, O = e.defaultValue, z = e.range, B = e.count, V = e.onChange, G = e.onBeforeChange, j = e.onAfterChange, X = e.allowCross, Y = X === void 0 ? !0 : X, se = e.pushable, ee = se === void 0 ? !1 : se, Z = e.draggableTrack, J = e.reverse, ve = e.vertical, ie = e.included, ce = ie === void 0 ? !0 : ie, oe = e.startPoint, ye = e.trackStyle, Ie = e.handleStyle, Te = e.railStyle, Pe = e.dotStyle, De = e.activeDotStyle, Re = e.marks, ke = e.dots, Oe = e.handleRender, $e = e.tabIndex, He = $e === void 0 ? 0 : $e, Ue = e.ariaLabelForHandle, st = e.ariaLabelledByForHandle, ft = e.ariaValueTextFormatterForHandle, It = C.exports.useRef(), We = C.exports.useRef(), Pt = C.exports.useMemo(function () { return ve ? J ? "ttb" : "btt" : J ? "rtl" : "ltr" }, [J, ve]), pt = C.exports.useMemo(function () { return isFinite(P) ? P : 0 }, [P]), Rt = C.exports.useMemo(function () { return isFinite(A) ? A : 100 }, [A]), yt = C.exports.useMemo(function () { return R !== null && R <= 0 ? 1 : R }, [R]), Mt = C.exports.useMemo(function () { return ee === !0 ? yt : ee >= 0 ? ee : !1 }, [ee, yt]), ut = C.exports.useMemo(function () { var me = Object.keys(Re || {}); return me.map(function (H) { var q = Re[H], de = { value: Number(H) }; return q && ln(q) === "object" && !C.exports.isValidElement(q) && ("label" in q || "style" in q) ? (de.style = q.style, de.label = q.label) : de.label = q, de }).filter(function (H) { var q = H.label; return q || typeof q == "number" }).sort(function (H, q) { return H.value - q.value }) }, [Re]), dt = HQ(pt, Rt, yt, ut, Y, Mt), ct = ze(dt, 2), rt = ct[0], ht = ct[1], bt = Bi(O, { value: M }), Wt = ze(bt, 2), Ut = Wt[0], Jt = Wt[1], Fe = C.exports.useMemo(function () { var me = Ut == null ? [] : Array.isArray(Ut) ? Ut : [Ut], H = ze(me, 1), q = H[0], de = q === void 0 ? pt : q, le = Ut === null ? [] : [de]; if (z) { if (le = Et(me), B || Ut === void 0) { var xe = B >= 0 ? B + 1 : 2; for (le = le.slice(0, xe); le.length < xe;) { var Ee; le.push((Ee = le[le.length - 1]) !== null && Ee !== void 0 ? Ee : pt) } } le.sort(function (be, Ce) { return be - Ce }) } return le.forEach(function (be, Ce) { le[Ce] = rt(be) }), le }, [Ut, z, pt, B, rt]), Ge = C.exports.useRef(Fe); Ge.current = Fe; var Zt = function (H) { return z ? H : H[0] }, cn = function (H) { var q = Et(H).sort(function (de, le) { return de - le }); V && !Cc(q, Ge.current) && V(Zt(q)), Jt(q) }, jt = function (H) { if (!f) { var q = 0, de = Rt - pt; Fe.forEach(function (xe, Ee) { var be = Math.abs(H - xe); be <= de && (de = be, q = Ee) }); var le = Et(Fe); le[q] = H, z && !Fe.length && B === void 0 && le.push(H), G == null || G(Zt(le)), cn(le), j == null || j(Zt(le)) } }, Kt = function (H) { H.preventDefault(); var q = We.current.getBoundingClientRect(), de = q.width, le = q.height, xe = q.left, Ee = q.top, be = q.bottom, Ce = q.right, Le = H.clientX, qe = H.clientY, Ze; switch (Pt) { case "btt": Ze = (be - qe) / le; break; case "ttb": Ze = (qe - Ee) / le; break; case "rtl": Ze = (Ce - Le) / de; break; default: Ze = (Le - xe) / de }var Ve = pt + Ze * (Rt - pt); jt(rt(Ve)) }, nn = C.exports.useState(null), Cn = ze(nn, 2), Nn = Cn[0], wt = Cn[1], qt = function (H, q) { if (!f) { var de = ht(Fe, H, q); G == null || G(Zt(Fe)), cn(de.values), j == null || j(Zt(de.values)), wt(de.value) } }; C.exports.useEffect(function () { if (Nn !== null) { var me = Fe.indexOf(Nn); me >= 0 && It.current.focus(me) } wt(null) }, [Nn]); var At = C.exports.useMemo(function () { return Z && yt === null ? !1 : Z }, [Z, yt]), Xt = function () { j == null || j(Zt(Ge.current)) }, en = FQ(We, Pt, Fe, pt, Rt, rt, cn, Xt, ht), gt = ze(en, 4), yn = gt[0], Sn = gt[1], dn = gt[2], zt = gt[3], ot = function (H, q) { zt(H, q), G == null || G(Zt(Ge.current)) }, mt = yn !== -1; C.exports.useEffect(function () { if (!mt) { var me = Fe.lastIndexOf(Sn); It.current.focus(me) } }, [mt]); var Dt = C.exports.useMemo(function () { return Et(dn).sort(function (me, H) { return me - H }) }, [dn]), Bt = C.exports.useMemo(function () { return z ? [Dt[0], Dt[Dt.length - 1]] : [pt, Dt[0]] }, [Dt, z, pt]), pn = ze(Bt, 2), On = pn[0], Zn = pn[1]; C.exports.useImperativeHandle(t, function () { return { focus: function () { It.current.focus(0) }, blur: function () { var H = document, q = H.activeElement; We.current.contains(q) && (q == null || q.blur()) } } }), C.exports.useEffect(function () { p && It.current.focus(0) }, []); var Xn = C.exports.useMemo(function () { return { min: pt, max: Rt, direction: Pt, disabled: f, step: yt, included: ce, includedStart: On, includedEnd: Zn, range: z, tabIndex: He, ariaLabelForHandle: Ue, ariaLabelledByForHandle: st, ariaValueTextFormatterForHandle: ft } }, [pt, Rt, Pt, f, yt, ce, On, Zn, z, He, Ue, st, ft]); return I(Ac.Provider, { value: Xn, children: Qe("div", { ref: We, className: Xe(i, s, (n = {}, re(n, "".concat(i, "-disabled"), f), re(n, "".concat(i, "-vertical"), ve), re(n, "".concat(i, "-horizontal"), !ve), re(n, "".concat(i, "-with-marks"), ut.length), n)), style: c, onMouseDown: Kt, children: [I("div", { className: "".concat(i, "-rail"), style: Te }), I(BQ, { prefixCls: i, style: ye, values: Dt, startPoint: oe, onStartMove: At ? ot : null }), I(KQ, { prefixCls: i, marks: ut, dots: ke, style: Pe, activeStyle: De }), I(zQ, { ref: It, prefixCls: i, style: Ie, values: dn, draggingIndex: yn, onStartMove: ot, onOffsetChange: qt, onFocus: v, onBlur: y, handleRender: Oe }), I(UQ, { prefixCls: i, marks: ut, onClick: jt })] }) }) }), GQ = C.exports.forwardRef(function (e, t) { var n = e.open, r = C.exports.useRef(null), i = C.exports.useRef(null); function s() { nr.cancel(i.current), i.current = null } function c() { i.current = nr(function () { var o; (o = r.current) === null || o === void 0 || o.forcePopupAlign(), i.current = null }) } return C.exports.useEffect(function () { return n ? c() : s(), s }, [n, e.title]), I(io, { ref: Po(r, t), ...e }) }); const qQ = GQ; var ZQ = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, XQ = C.exports.forwardRef(function (e, t) { var n = C.exports.useContext(zn), r = n.getPrefixCls, i = n.direction, s = n.getPopupContainer, c = C.exports.useState({}), o = ze(c, 2), f = o[0], p = o[1], v = function (j, X) { p(function (Y) { return tt(tt({}, Y), re({}, j, X)) }) }, y = function (j, X) { return j || (X ? i === "rtl" ? "left" : "right" : "top") }, w = e.prefixCls, P = e.range, k = e.className, A = ZQ(e, ["prefixCls", "range", "className"]), N = r("slider", w), R = Xe(k, re({}, "".concat(N, "-rtl"), i === "rtl")); i === "rtl" && !A.vertical && (A.reverse = !A.reverse); var M = C.exports.useMemo(function () { return P ? ln(P) === "object" ? [!0, P.draggableTrack] : [!0, !1] : [!1] }, [P]), O = ze(M, 2), z = O[0], B = O[1], V = function (j, X) { var Y, se = X.index, ee = X.dragging, Z = r(), J = e.tooltip, ve = J === void 0 ? {} : J, ie = e.vertical, ce = tt({ formatter: (Y = e.tipFormatter) !== null && Y !== void 0 ? Y : function ($e) { return typeof $e == "number" ? $e.toString() : "" }, open: e.tooltipVisible, placement: e.tooltipPlacement, getPopupContainer: e.getTooltipPopupContainer }, ve), oe = ce.open, ye = ce.placement, Ie = ce.getPopupContainer, Te = ce.prefixCls, Pe = ce.formatter, De = Pe ? f[se] || ee : !1, Re = oe || oe === void 0 && De, ke = tt(tt({}, j.props), { onMouseEnter: function () { return v(se, !0) }, onMouseLeave: function () { return v(se, !1) } }), Oe = r("tooltip", Te); return I(qQ, { prefixCls: Oe, title: Pe ? Pe(X.value) : "", open: Re, placement: y(ye, ie), transitionName: "".concat(Z, "-zoom-down"), overlayClassName: "".concat(N, "-tooltip"), getPopupContainer: Ie || s, children: C.exports.cloneElement(j, ke) }, se) }; return I(WQ, { ...A, step: A.step, range: z, draggableTrack: B, className: R, ref: t, prefixCls: N, handleRender: V }) }); const YQ = XQ; function QQ(e) { return null } function JQ(e) { return null } var eJ = "RC_TABLE_KEY"; function gz(e) { return e == null ? [] : Array.isArray(e) ? e : [e] } function yz(e, t) { if (!t && typeof t != "number") return e; for (var n = gz(t), r = e, i = 0; i < n.length; i += 1) { if (!r) return null; var s = n[i]; r = r[s] } return r } function ax(e) { var t = [], n = {}; return e.forEach(function (r) { for (var i = r || {}, s = i.key, c = i.dataIndex, o = s || gz(c).join("-") || eJ; n[o];)o = "".concat(o, "_next"); n[o] = !0, t.push(o) }), t } function sC(e) { return e != null } var xz = C.exports.createContext(!1); function tJ() { var e = C.exports.createContext(null), t = function (r) { var i = r.value, s = r.children, c = C.exports.useRef(i); c.current = i; var o = C.exports.useState(function () { return { getValue: function () { return c.current }, listeners: new Set } }), f = ze(o, 1), p = f[0]; return si(function () { p.listeners.forEach(function (v) { v(i) }) }, [i]), I(e.Provider, { value: p, children: s }) }; return { Context: e, Provider: t } } function nJ(e, t) { var n = Hp(t), r = C.exports.useContext(e == null ? void 0 : e.Context), i = r || {}, s = i.listeners, c = i.getValue, o = C.exports.useState(function () { return n(r ? c() : null) }), f = ze(o, 2), p = f[0], v = f[1]; return si(function () { if (!r) return; function y(w) { v(function (P) { var k = n(w); return Cc(P, k) ? P : k }) } return s.add(y), function () { s.delete(y) } }, [r]), p } var _z = tJ(), sx = C.exports.createContext(null), bz = C.exports.createContext({ renderWithProps: !1 }), rJ = ["colSpan", "rowSpan", "style", "className"]; function iJ(e, t, n, r) { var i = e + t - 1; return e <= r && i >= n } function oJ(e) { return e && ln(e) === "object" && !Array.isArray(e) && !C.exports.isValidElement(e) } function aJ(e) { return typeof e == "string" ? !0 : Ic(e) } var sJ = function (t) { var n = t.ellipsis, r = t.rowType, i = t.children, s, c = n === !0 ? { showTitle: !0 } : n; return c && (c.showTitle || r === "header") && (typeof i == "string" || typeof i == "number" ? s = i.toString() : C.exports.isValidElement(i) && typeof i.props.children == "string" && (s = i.props.children)), s }; function lJ(e, t) { var n, r, i, s = e.prefixCls, c = e.className, o = e.record, f = e.index, p = e.renderIndex, v = e.dataIndex, y = e.render, w = e.children, P = e.component, k = P === void 0 ? "td" : P, A = e.colSpan, N = e.rowSpan, R = e.fixLeft, M = e.fixRight, O = e.firstFixLeft, z = e.lastFixLeft, B = e.firstFixRight, V = e.lastFixRight, G = e.appendNode, j = e.additionalProps, X = j === void 0 ? {} : j, Y = e.ellipsis, se = e.align, ee = e.rowType, Z = e.isSticky, J = e.hovering, ve = e.onHover, ie = "".concat(s, "-cell"), ce = C.exports.useContext(bz), oe = C.exports.useContext(xz), ye = C.exports.useContext(sx), Ie = ye.allColumnsFixedLeft, Te = C.exports.useMemo(function () { if (sC(w)) return [w]; var rt = yz(o, v), ht = rt, bt = void 0; if (y) { var Wt = y(rt, o, p); oJ(Wt) ? (ht = Wt.children, bt = Wt.props, ce.renderWithProps = !0) : ht = Wt } return [ht, bt] }, [ce.renderWithProps ? Math.random() : 0, w, v, ce, o, y, p]), Pe = ze(Te, 2), De = Pe[0], Re = Pe[1], ke = De; ln(ke) === "object" && !Array.isArray(ke) && !C.exports.isValidElement(ke) && (ke = null), Y && (z || B) && (ke = I("span", { className: "".concat(ie, "-content"), children: ke })); var Oe = Re || {}, $e = Oe.colSpan, He = Oe.rowSpan, Ue = Oe.style, st = Oe.className, ft = Rn(Oe, rJ), It = (n = $e !== void 0 ? $e : A) !== null && n !== void 0 ? n : 1, We = (r = He !== void 0 ? He : N) !== null && r !== void 0 ? r : 1; if (It === 0 || We === 0) return null; var Pt = {}, pt = typeof R == "number" && oe, Rt = typeof M == "number" && oe; pt && (Pt.position = "sticky", Pt.left = R), Rt && (Pt.position = "sticky", Pt.right = M); var yt = {}; se && (yt.textAlign = se); var Mt = function (ht) { var bt; o && ve(f, f + We - 1), X == null || (bt = X.onMouseEnter) === null || bt === void 0 || bt.call(X, ht) }, ut = function (ht) { var bt; o && ve(-1, -1), X == null || (bt = X.onMouseLeave) === null || bt === void 0 || bt.call(X, ht) }, dt = sJ({ rowType: ee, ellipsis: Y, children: De }), ct = ge(ge(ge({ title: dt }, ft), X), {}, { colSpan: It !== 1 ? It : null, rowSpan: We !== 1 ? We : null, className: Xe(ie, c, (i = {}, re(i, "".concat(ie, "-fix-left"), pt && oe), re(i, "".concat(ie, "-fix-left-first"), O && oe), re(i, "".concat(ie, "-fix-left-last"), z && oe), re(i, "".concat(ie, "-fix-left-all"), z && Ie && oe), re(i, "".concat(ie, "-fix-right"), Rt && oe), re(i, "".concat(ie, "-fix-right-first"), B && oe), re(i, "".concat(ie, "-fix-right-last"), V && oe), re(i, "".concat(ie, "-ellipsis"), Y), re(i, "".concat(ie, "-with-append"), G), re(i, "".concat(ie, "-fix-sticky"), (pt || Rt) && Z && oe), re(i, "".concat(ie, "-row-hover"), !Re && J), i), X.className, st), style: ge(ge(ge(ge({}, X.style), yt), Pt), Ue), onMouseEnter: Mt, onMouseLeave: ut, ref: aJ(k) ? t : null }); return Qe(k, { ...ct, children: [G, ke] }) } var wz = C.exports.forwardRef(lJ); wz.displayName = "Cell"; var uJ = ["expanded", "className", "hovering"], cJ = C.exports.memo(wz, function (e, t) { return t.shouldCellUpdate ? uJ.every(function (n) { return e[n] === t[n] }) && !t.shouldCellUpdate(t.record, e.record) : Cc(e, t) }), Sm = C.exports.forwardRef(function (e, t) { var n = e.index, r = e.additionalProps, i = r === void 0 ? {} : r, s = e.colSpan, c = e.rowSpan, o = i.colSpan, f = i.rowSpan, p = s != null ? s : o, v = c != null ? c : f, y = nJ(_z, function (k) { var A = iJ(n, v || 1, k == null ? void 0 : k.startRow, k == null ? void 0 : k.endRow); return { onHover: k == null ? void 0 : k.onHover, hovering: A } }), w = y.onHover, P = y.hovering; return I(cJ, { ...e, colSpan: p, rowSpan: v, hovering: P, ref: t, onHover: w }) }); Sm.displayName = "WrappedCell"; var _s = C.exports.createContext(null); function tE(e, t, n, r, i) { var s = n[e] || {}, c = n[t] || {}, o, f; s.fixed === "left" ? o = r.left[e] : c.fixed === "right" && (f = r.right[t]); var p = !1, v = !1, y = !1, w = !1, P = n[t + 1], k = n[e - 1]; if (i === "rtl") { if (o !== void 0) { var A = k && k.fixed === "left"; w = !A } else if (f !== void 0) { var N = P && P.fixed === "right"; y = !N } } else if (o !== void 0) { var R = P && P.fixed === "left"; p = !R } else if (f !== void 0) { var M = k && k.fixed === "right"; v = !M } return { fixLeft: o, fixRight: f, lastFixLeft: p, firstFixRight: v, lastFixRight: y, firstFixLeft: w, isSticky: r.isSticky } } function Cz(e) { var t = e.cells, n = e.stickyOffsets, r = e.flattenColumns, i = e.rowComponent, s = e.cellComponent, c = e.onHeaderRow, o = e.index, f = C.exports.useContext(_s), p = f.prefixCls, v = f.direction, y; c && (y = c(t.map(function (P) { return P.column }), o)); var w = ax(t.map(function (P) { return P.column })); return I(i, { ...y, children: t.map(function (P, k) { var A = P.column, N = tE(P.colStart, P.colEnd, r, n, v), R; return A && A.onHeaderCell && (R = P.column.onHeaderCell(A)), C.exports.createElement(Sm, { ...P, ellipsis: A.ellipsis, align: A.align, component: s, prefixCls: p, key: w[k], ...N, additionalProps: R, rowType: "header" }) }) }) } Cz.displayName = "HeaderRow"; function dJ(e) { var t = []; function n(c, o) { var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0; t[f] = t[f] || []; var p = o, v = c.filter(Boolean).map(function (y) { var w = { key: y.key, className: y.className || "", children: y.title, column: y, colStart: p }, P = 1, k = y.children; return k && k.length > 0 && (P = n(k, p, f + 1).reduce(function (A, N) { return A + N }, 0), w.hasSubColumns = !0), "colSpan" in y && (P = y.colSpan), "rowSpan" in y && (w.rowSpan = y.rowSpan), w.colSpan = P, w.colEnd = w.colStart + P - 1, t[f].push(w), p += P, P }); return v } n(e, 0); for (var r = t.length, i = function (o) { t[o].forEach(function (f) { !("rowSpan" in f) && !f.hasSubColumns && (f.rowSpan = r - o) }) }, s = 0; s < r; s += 1)i(s); return t } function VI(e) { var t = e.stickyOffsets, n = e.columns, r = e.flattenColumns, i = e.onHeaderRow, s = C.exports.useContext(_s), c = s.prefixCls, o = s.getComponent, f = C.exports.useMemo(function () { return dJ(n) }, [n]), p = o(["header", "wrapper"], "thead"), v = o(["header", "row"], "tr"), y = o(["header", "cell"], "th"); return I(p, { className: "".concat(c, "-thead"), children: f.map(function (w, P) { var k = I(Cz, { flattenColumns: r, cells: w, stickyOffsets: t, rowComponent: v, cellComponent: y, onHeaderRow: i, index: P }, P); return k }) }) } var Sz = C.exports.createContext(null); function Ez(e) { var t = e.prefixCls, n = e.children, r = e.component, i = e.cellComponent, s = e.className, c = e.expanded, o = e.colSpan, f = e.isEmpty, p = C.exports.useContext(_s), v = p.scrollbarSize, y = C.exports.useContext(Sz), w = y.fixHeader, P = y.fixColumn, k = y.componentWidth, A = y.horizonScroll; return C.exports.useMemo(function () { var N = n; return (f ? A : P) && (N = I("div", { style: { width: k - (w ? v : 0), position: "sticky", left: 0, overflow: "hidden" }, className: "".concat(t, "-expanded-row-fixed"), children: k !== 0 && N })), I(r, { className: s, style: { display: c ? null : "none" }, children: I(Sm, { component: i, prefixCls: t, colSpan: o, children: N }) }) }, [n, r, s, c, o, f, v, k, P, w, A]) } var Pz = C.exports.createContext(null); function Tz(e) { var t = e.className, n = e.style, r = e.record, i = e.index, s = e.renderIndex, c = e.rowKey, o = e.rowExpandable, f = e.expandedKeys, p = e.onRow, v = e.indent, y = v === void 0 ? 0 : v, w = e.rowComponent, P = e.cellComponent, k = e.childrenColumnName, A = C.exports.useContext(_s), N = A.prefixCls, R = A.fixedInfoList, M = C.exports.useContext(sx), O = M.flattenColumns, z = M.expandableType, B = M.expandRowByClick, V = M.onTriggerExpand, G = M.rowClassName, j = M.expandedRowClassName, X = M.indentSize, Y = M.expandIcon, se = M.expandedRowRender, ee = M.expandIconColumnIndex, Z = C.exports.useState(!1), J = ze(Z, 2), ve = J[0], ie = J[1], ce = f && f.has(e.recordKey); C.exports.useEffect(function () { ce && ie(!0) }, [ce]); var oe = z === "row" && (!o || o(r)), ye = z === "nest", Ie = k && r && r[k], Te = oe || ye, Pe = C.exports.useRef(V); Pe.current = V; var De = function () { Pe.current.apply(Pe, arguments) }, Re = p == null ? void 0 : p(r, i), ke = function (We) { var Pt; B && Te && De(r, We); for (var pt = arguments.length, Rt = new Array(pt > 1 ? pt - 1 : 0), yt = 1; yt < pt; yt++)Rt[yt - 1] = arguments[yt]; Re == null || (Pt = Re.onClick) === null || Pt === void 0 || Pt.call.apply(Pt, [Re, We].concat(Rt)) }, Oe; typeof G == "string" ? Oe = G : typeof G == "function" && (Oe = G(r, i, y)); var $e = ax(O), He = I(w, { ...Re, "data-row-key": c, className: Xe(t, "".concat(N, "-row"), "".concat(N, "-row-level-").concat(y), Oe, Re && Re.className), style: ge(ge({}, n), Re ? Re.style : null), onClick: ke, children: O.map(function (It, We) { var Pt = It.render, pt = It.dataIndex, Rt = It.className, yt = $e[We], Mt = R[We], ut; We === (ee || 0) && ye && (ut = Qe(An, { children: [I("span", { style: { paddingLeft: "".concat(X * y, "px") }, className: "".concat(N, "-row-indent indent-level-").concat(y) }), Y({ prefixCls: N, expanded: ce, expandable: Ie, record: r, onExpand: De })] })); var dt; return It.onCell && (dt = It.onCell(r, i)), I(Sm, { className: Rt, ellipsis: It.ellipsis, align: It.align, component: P, prefixCls: N, record: r, index: i, renderIndex: s, dataIndex: pt, render: Pt, shouldCellUpdate: It.shouldCellUpdate, expanded: ut && ce, ...Mt, appendNode: ut, additionalProps: dt }, yt) }) }), Ue; if (oe && (ve || ce)) { var st = se(r, i, y + 1, ce), ft = j && j(r, i, y); Ue = I(Ez, { expanded: ce, className: Xe("".concat(N, "-expanded-row"), "".concat(N, "-expanded-row-level-").concat(y + 1), ft), prefixCls: N, component: w, cellComponent: P, colSpan: O.length, isEmpty: !1, children: st }) } return Qe(An, { children: [He, Ue] }) } Tz.displayName = "BodyRow"; function kz(e, t, n, r, i, s) { var c = []; c.push({ record: e, indent: t, index: s }); var o = i(e), f = r == null ? void 0 : r.has(o); if (e && Array.isArray(e[n]) && f) for (var p = 0; p < e[n].length; p += 1) { var v = kz(e[n][p], t + 1, n, r, i, p); c.push.apply(c, Et(v)) } return c } function fJ(e, t, n, r) { var i = C.exports.useMemo(function () { if (n != null && n.size) { for (var s = [], c = 0; c < (e == null ? void 0 : e.length); c += 1) { var o = e[c]; s.push.apply(s, Et(kz(o, 0, t, n, r, c))) } return s } return e == null ? void 0 : e.map(function (f, p) { return { record: f, indent: 0, index: p } }) }, [e, t, n, r]); return i } function hJ(e) { var t = e.columnKey, n = e.onColumnResize, r = C.exports.useRef(); return C.exports.useEffect(function () { r.current && n(t, r.current.offsetWidth) }, []), I(cl, { data: t, children: I("td", { ref: r, style: { padding: 0, border: 0, height: 0 }, children: I("div", { style: { height: 0, overflow: "hidden" }, children: "\xA0" }) }) }) } function pJ(e) { var t = e.prefixCls, n = e.columnsKey, r = e.onColumnResize; return I("tr", { "aria-hidden": "true", className: "".concat(t, "-measure-row"), style: { height: 0, fontSize: 0 }, children: I(cl.Collection, { onBatchResize: function (s) { s.forEach(function (c) { var o = c.data, f = c.size; r(o, f.offsetWidth) }) }, children: n.map(function (i) { return I(hJ, { columnKey: i, onColumnResize: r }, i) }) }) }) } function mJ(e) { var t = e.data, n = e.getRowKey, r = e.measureColumnWidth, i = e.expandedKeys, s = e.onRow, c = e.rowExpandable, o = e.emptyNode, f = e.childrenColumnName, p = C.exports.useContext(Pz), v = p.onColumnResize, y = C.exports.useContext(_s), w = y.prefixCls, P = y.getComponent, k = C.exports.useContext(sx), A = k.flattenColumns, N = fJ(t, f, i, n), R = C.exports.useRef({ renderWithProps: !1 }), M = C.exports.useState(-1), O = ze(M, 2), z = O[0], B = O[1], V = C.exports.useState(-1), G = ze(V, 2), j = G[0], X = G[1], Y = C.exports.useCallback(function (ee, Z) { B(ee), X(Z) }, []), se = C.exports.useMemo(function () { var ee = P(["body", "wrapper"], "tbody"), Z = P(["body", "row"], "tr"), J = P(["body", "cell"], "td"), ve; t.length ? ve = N.map(function (ce, oe) { var ye = ce.record, Ie = ce.indent, Te = ce.index, Pe = n(ye, oe); return I(Tz, { rowKey: Pe, record: ye, recordKey: Pe, index: oe, renderIndex: Te, rowComponent: Z, cellComponent: J, expandedKeys: i, onRow: s, getRowKey: n, rowExpandable: c, childrenColumnName: f, indent: Ie }, Pe) }) : ve = I(Ez, { expanded: !0, className: "".concat(w, "-placeholder"), prefixCls: w, component: Z, cellComponent: J, colSpan: A.length, isEmpty: !0, children: o }); var ie = ax(A); return Qe(ee, { className: "".concat(w, "-tbody"), children: [r && I(pJ, { prefixCls: w, columnsKey: ie, onColumnResize: v }), ve] }) }, [t, w, s, r, i, n, P, o, A, f, v, c, N]); return I(bz.Provider, { value: R.current, children: I(_z.Provider, { value: { startRow: z, endRow: j, onHover: Y }, children: se }) }) } var Iz = C.exports.memo(mJ); Iz.displayName = "Body"; var vJ = ["expandable"], gp = "RC_TABLE_INTERNAL_COL_DEFINE"; function gJ(e) { var t = e.expandable, n = Rn(e, vJ), r; return "expandable" in e ? r = ge(ge({}, n), t) : r = n, r.showExpandColumn === !1 && (r.expandIconColumnIndex = -1), r } var Yu = {}, yJ = ["children"], xJ = ["fixed"]; function nE(e) { return Zi(e).filter(function (t) { return C.exports.isValidElement(t) }).map(function (t) { var n = t.key, r = t.props, i = r.children, s = Rn(r, yJ), c = ge({ key: n }, s); return i && (c.children = nE(i)), c }) } function lC(e) { return e.reduce(function (t, n) { var r = n.fixed, i = r === !0 ? "left" : r, s = n.children; return s && s.length > 0 ? [].concat(Et(t), Et(lC(s).map(function (c) { return ge({ fixed: i }, c) }))) : [].concat(Et(t), [ge(ge({}, n), {}, { fixed: i })]) }, []) } function _J(e) { return e.map(function (t) { var n = t.fixed, r = Rn(t, xJ), i = n; return n === "left" ? i = "right" : n === "right" && (i = "left"), ge({ fixed: i }, r) }) } function bJ(e, t) { var n = e.prefixCls, r = e.columns, i = e.children, s = e.expandable, c = e.expandedKeys, o = e.columnTitle, f = e.getRowKey, p = e.onTriggerExpand, v = e.expandIcon, y = e.rowExpandable, w = e.expandIconColumnIndex, P = e.direction, k = e.expandRowByClick, A = e.columnWidth, N = e.fixed, R = C.exports.useMemo(function () { return r || nE(i) }, [r, i]), M = C.exports.useMemo(function () { if (s) { var B, V = R.slice(); if (!V.includes(Yu)) { var G = w || 0; G >= 0 && V.splice(G, 0, Yu) } var j = V.indexOf(Yu); V = V.filter(function (ee, Z) { return ee !== Yu || Z === j }); var X = R[j], Y; (N === "left" || N) && !w ? Y = "left" : (N === "right" || N) && w === R.length ? Y = "right" : Y = X ? X.fixed : null; var se = (B = {}, re(B, gp, { className: "".concat(n, "-expand-icon-col"), columnType: "EXPAND_COLUMN" }), re(B, "title", o), re(B, "fixed", Y), re(B, "className", "".concat(n, "-row-expand-icon-cell")), re(B, "width", A), re(B, "render", function (Z, J, ve) { var ie = f(J, ve), ce = c.has(ie), oe = y ? y(J) : !0, ye = v({ prefixCls: n, expanded: ce, expandable: oe, record: J, onExpand: p }); return k ? I("span", { onClick: function (Te) { return Te.stopPropagation() }, children: ye }) : ye }), B); return V.map(function (ee) { return ee === Yu ? se : ee }) } return R.filter(function (ee) { return ee !== Yu }) }, [s, R, f, c, v, P]), O = C.exports.useMemo(function () { var B = M; return t && (B = t(B)), B.length || (B = [{ render: function () { return null } }]), B }, [t, M, P]), z = C.exports.useMemo(function () { return P === "rtl" ? _J(lC(O)) : lC(O) }, [O, P]); return [O, z] } function Rz(e) { var t = C.exports.useRef(e), n = C.exports.useState({}), r = ze(n, 2), i = r[1], s = C.exports.useRef(null), c = C.exports.useRef([]); function o(f) { c.current.push(f); var p = Promise.resolve(); s.current = p, p.then(function () { if (s.current === p) { var v = c.current, y = t.current; c.current = [], v.forEach(function (w) { t.current = w(t.current) }), s.current = null, y !== t.current && i({}) } }) } return C.exports.useEffect(function () { return function () { s.current = null } }, []), [t.current, o] } function wJ(e) { var t = C.exports.useRef(e || null), n = C.exports.useRef(); function r() { window.clearTimeout(n.current) } function i(c) { t.current = c, r(), n.current = window.setTimeout(function () { t.current = null, n.current = void 0 }, 100) } function s() { return t.current } return C.exports.useEffect(function () { return r }, []), [i, s] } function CJ(e, t, n) { var r = C.exports.useMemo(function () { for (var i = [], s = [], c = 0, o = 0, f = 0; f < t; f += 1)if (n === "rtl") { s[f] = o, o += e[f] || 0; var p = t - f - 1; i[p] = c, c += e[p] || 0 } else { i[f] = c, c += e[f] || 0; var v = t - f - 1; s[v] = o, o += e[v] || 0 } return { left: i, right: s } }, [e, t, n]); return r } var SJ = ["columnType"]; function Mz(e) { for (var t = e.colWidths, n = e.columns, r = e.columCount, i = [], s = r || n.length, c = !1, o = s - 1; o >= 0; o -= 1) { var f = t[o], p = n && n[o], v = p && p[gp]; if (f || v || c) { var y = v || {}; y.columnType; var w = Rn(y, SJ); i.unshift(I("col", { style: { width: f }, ...w }, o)), c = !0 } } return I("colgroup", { children: i }) } function UI(e) { var t = e.className, n = e.children; return I("div", { className: t, children: n }) } var Az = C.exports.createContext({}); function EJ(e) { var t = e.className, n = e.index, r = e.children, i = e.colSpan, s = i === void 0 ? 1 : i, c = e.rowSpan, o = e.align, f = C.exports.useContext(_s), p = f.prefixCls, v = f.direction, y = C.exports.useContext(Az), w = y.scrollColumnIndex, P = y.stickyOffsets, k = y.flattenColumns, A = n + s - 1, N = A + 1 === w ? s + 1 : s, R = tE(n, n + N - 1, k, P, v); return I(Sm, { className: t, index: n, component: "td", prefixCls: p, record: null, dataIndex: null, align: o, colSpan: N, rowSpan: c, render: function () { return r }, ...R }) } var PJ = ["children"]; function TJ(e) { var t = e.children, n = Rn(e, PJ); return I("tr", { ...n, children: t }) } function lx(e) { var t = e.children; return t } lx.Row = TJ; lx.Cell = EJ; function xg(e) { var t = e.children, n = e.stickyOffsets, r = e.flattenColumns, i = C.exports.useContext(_s), s = i.prefixCls, c = r.length - 1, o = r[c], f = C.exports.useMemo(function () { return { stickyOffsets: n, flattenColumns: r, scrollColumnIndex: o != null && o.scrollbar ? c : null } }, [o, r, c, n]); return I(Az.Provider, { value: f, children: I("tfoot", { className: "".concat(s, "-summary"), children: t }) }) } var Nz = lx; function kJ(e) { var t, n = e.prefixCls, r = e.record, i = e.onExpand, s = e.expanded, c = e.expandable, o = "".concat(n, "-row-expand-icon"); if (!c) return I("span", { className: Xe(o, "".concat(n, "-row-spaced")) }); var f = function (v) { i(r, v), v.stopPropagation() }; return I("span", { className: Xe(o, (t = {}, re(t, "".concat(n, "-row-expanded"), s), re(t, "".concat(n, "-row-collapsed"), !s), t)), onClick: f }) } function IJ(e, t, n) { var r = []; function i(s) { (s || []).forEach(function (c, o) { r.push(t(c, o)), i(c[n]) }) } return i(e), r } var RJ = function (t, n) { var r, i, s = t.scrollBodyRef, c = t.onScroll, o = t.offsetScroll, f = t.container, p = C.exports.useContext(_s), v = p.prefixCls, y = ((r = s.current) === null || r === void 0 ? void 0 : r.scrollWidth) || 0, w = ((i = s.current) === null || i === void 0 ? void 0 : i.clientWidth) || 0, P = y && w * (w / y), k = C.exports.useRef(), A = Rz({ scrollLeft: 0, isHiddenScrollBar: !1 }), N = ze(A, 2), R = N[0], M = N[1], O = C.exports.useRef({ delta: 0, x: 0 }), z = C.exports.useState(!1), B = ze(z, 2), V = B[0], G = B[1], j = function () { G(!1) }, X = function (J) { J.persist(), O.current.delta = J.pageX - R.scrollLeft, O.current.x = 0, G(!0), J.preventDefault() }, Y = function (J) { var ve, ie = J || ((ve = window) === null || ve === void 0 ? void 0 : ve.event), ce = ie.buttons; if (!V || ce === 0) { V && G(!1); return } var oe = O.current.x + J.pageX - O.current.x - O.current.delta; oe <= 0 && (oe = 0), oe + P >= w && (oe = w - P), c({ scrollLeft: oe / w * (y + 2) }), O.current.x = J.pageX }, se = function () { if (!!s.current) { var J = SI(s.current).top, ve = J + s.current.offsetHeight, ie = f === window ? document.documentElement.scrollTop + window.innerHeight : SI(f).top + f.clientHeight; ve - qy() <= ie || J >= ie - o ? M(function (ce) { return ge(ge({}, ce), {}, { isHiddenScrollBar: !0 }) }) : M(function (ce) { return ge(ge({}, ce), {}, { isHiddenScrollBar: !1 }) }) } }, ee = function (J) { M(function (ve) { return ge(ge({}, ve), {}, { scrollLeft: J / y * w || 0 }) }) }; return C.exports.useImperativeHandle(n, function () { return { setScrollLeft: ee } }), C.exports.useEffect(function () { var Z = Xs(document.body, "mouseup", j, !1), J = Xs(document.body, "mousemove", Y, !1); return se(), function () { Z.remove(), J.remove() } }, [P, V]), C.exports.useEffect(function () { var Z = Xs(f, "scroll", se, !1), J = Xs(window, "resize", se, !1); return function () { Z.remove(), J.remove() } }, [f]), C.exports.useEffect(function () { R.isHiddenScrollBar || M(function (Z) { var J = s.current; return J ? ge(ge({}, Z), {}, { scrollLeft: J.scrollLeft / J.scrollWidth * J.clientWidth }) : Z }) }, [R.isHiddenScrollBar]), y <= w || !P || R.isHiddenScrollBar ? null : I("div", { style: { height: qy(), width: w, bottom: o }, className: "".concat(v, "-sticky-scroll"), children: I("div", { onMouseDown: X, ref: k, className: Xe("".concat(v, "-sticky-scroll-bar"), re({}, "".concat(v, "-sticky-scroll-bar-active"), V)), style: { width: "".concat(P, "px"), transform: "translate3d(".concat(R.scrollLeft, "px, 0, 0)") } }) }) }; const MJ = C.exports.forwardRef(RJ); var jI = wo() ? window : null; function AJ(e, t) { var n = ln(e) === "object" ? e : {}, r = n.offsetHeader, i = r === void 0 ? 0 : r, s = n.offsetSummary, c = s === void 0 ? 0 : s, o = n.offsetScroll, f = o === void 0 ? 0 : o, p = n.getContainer, v = p === void 0 ? function () { return jI } : p, y = v() || jI; return C.exports.useMemo(function () { var w = !!e; return { isSticky: w, stickyClassName: w ? "".concat(t, "-sticky-holder") : "", offsetHeader: i, offsetSummary: c, offsetScroll: f, container: y } }, [f, i, c, t, y]) } var NJ = ["className", "noData", "columns", "flattenColumns", "colWidths", "columCount", "stickyOffsets", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName", "onScroll", "maxContentScroll", "children"]; function OJ(e, t) { return C.exports.useMemo(function () { for (var n = [], r = 0; r < t; r += 1) { var i = e[r]; if (i !== void 0) n[r] = i; else return null } return n }, [e.join("_"), t]) } var uC = C.exports.forwardRef(function (e, t) { var n = e.className, r = e.noData, i = e.columns, s = e.flattenColumns, c = e.colWidths, o = e.columCount, f = e.stickyOffsets, p = e.direction, v = e.fixHeader, y = e.stickyTopOffset, w = e.stickyBottomOffset, P = e.stickyClassName, k = e.onScroll, A = e.maxContentScroll, N = e.children, R = Rn(e, NJ), M = C.exports.useContext(_s), O = M.prefixCls, z = M.scrollbarSize, B = M.isSticky, V = B && !v ? 0 : z, G = C.exports.useRef(null), j = C.exports.useCallback(function (ie) { Iy(t, ie), Iy(G, ie) }, []); C.exports.useEffect(function () { var ie; function ce(oe) { var ye = oe.currentTarget, Ie = oe.deltaX; Ie && (k({ currentTarget: ye, scrollLeft: ye.scrollLeft + Ie }), oe.preventDefault()) } return (ie = G.current) === null || ie === void 0 || ie.addEventListener("wheel", ce), function () { var oe; (oe = G.current) === null || oe === void 0 || oe.removeEventListener("wheel", ce) } }, []); var X = C.exports.useMemo(function () { return s.every(function (ie) { return ie.width >= 0 }) }, [s]), Y = s[s.length - 1], se = { fixed: Y ? Y.fixed : null, scrollbar: !0, onHeaderCell: function () { return { className: "".concat(O, "-cell-scrollbar") } } }, ee = C.exports.useMemo(function () { return V ? [].concat(Et(i), [se]) : i }, [V, i]), Z = C.exports.useMemo(function () { return V ? [].concat(Et(s), [se]) : s }, [V, s]), J = C.exports.useMemo(function () { var ie = f.right, ce = f.left; return ge(ge({}, f), {}, { left: p === "rtl" ? [].concat(Et(ce.map(function (oe) { return oe + V })), [0]) : ce, right: p === "rtl" ? ie : [].concat(Et(ie.map(function (oe) { return oe + V })), [0]), isSticky: B }) }, [V, f, B]), ve = OJ(c, o); return I("div", { style: ge({ overflow: "hidden" }, B ? { top: y, bottom: w } : {}), ref: j, className: Xe(n, re({}, P, !!P)), children: Qe("table", { style: { tableLayout: "fixed", visibility: r || ve ? null : "hidden" }, children: [(!r || !A || X) && I(Mz, { colWidths: ve ? [].concat(Et(ve), [V]) : [], columCount: o + 1, columns: Z }), N(ge(ge({}, R), {}, { stickyOffsets: J, columns: ee, flattenColumns: Z }))] }) }) }); uC.displayName = "FixedHolder"; var DJ = [], LJ = {}, Zg = "rc-table-internal-hook", zJ = C.exports.memo(function (e) { var t = e.children; return t }, function (e, t) { return Cc(e.props, t.props) ? e.pingLeft !== t.pingLeft || e.pingRight !== t.pingRight : !1 }); function Nc(e) { var t, n = e.prefixCls, r = e.className, i = e.rowClassName, s = e.style, c = e.data, o = e.rowKey, f = e.scroll, p = e.tableLayout, v = e.direction, y = e.title, w = e.footer, P = e.summary, k = e.id, A = e.showHeader, N = e.components, R = e.emptyText, M = e.onRow, O = e.onHeaderRow, z = e.internalHooks, B = e.transformColumns, V = e.internalRefs, G = e.sticky, j = c || DJ, X = !!j.length, Y = C.exports.useCallback(function (Bn, Yn) { return yz(N || {}, Bn) || Yn }, [N]), se = C.exports.useMemo(function () { return typeof o == "function" ? o : function (Bn) { var Yn = Bn && Bn[o]; return Yn } }, [o]), ee = gJ(e), Z = ee.expandIcon, J = ee.expandedRowKeys, ve = ee.defaultExpandedRowKeys, ie = ee.defaultExpandAllRows, ce = ee.expandedRowRender, oe = ee.columnTitle, ye = ee.onExpand, Ie = ee.onExpandedRowsChange, Te = ee.expandRowByClick, Pe = ee.rowExpandable, De = ee.expandIconColumnIndex, Re = ee.expandedRowClassName, ke = ee.childrenColumnName, Oe = ee.indentSize, $e = Z || kJ, He = ke || "children", Ue = C.exports.useMemo(function () { return ce ? "row" : e.expandable && z === Zg && e.expandable.__PARENT_RENDER_ICON__ || j.some(function (Bn) { return Bn && ln(Bn) === "object" && Bn[He] }) ? "nest" : !1 }, [!!ce, j]), st = C.exports.useState(function () { return ve || (ie ? IJ(j, se, He) : []) }), ft = ze(st, 2), It = ft[0], We = ft[1], Pt = C.exports.useMemo(function () { return new Set(J || It || []) }, [J, It]), pt = C.exports.useCallback(function (Bn) { var Yn = se(Bn, j.indexOf(Bn)), Ar, Ei = Pt.has(Yn); Ei ? (Pt.delete(Yn), Ar = Et(Pt)) : Ar = [].concat(Et(Pt), [Yn]), We(Ar), ye && ye(!Ei, Bn), Ie && Ie(Ar) }, [se, Pt, j, ye, Ie]), Rt = C.exports.useState(0), yt = ze(Rt, 2), Mt = yt[0], ut = yt[1], dt = bJ(ge(ge(ge({}, e), ee), {}, { expandable: !!ce, columnTitle: oe, expandedKeys: Pt, getRowKey: se, onTriggerExpand: pt, expandIcon: $e, expandIconColumnIndex: De, direction: v }), z === Zg ? B : null), ct = ze(dt, 2), rt = ct[0], ht = ct[1], bt = C.exports.useMemo(function () { return { columns: rt, flattenColumns: ht } }, [rt, ht]), Wt = C.exports.useRef(), Ut = C.exports.useRef(), Jt = C.exports.useRef(), Fe = C.exports.useRef(), Ge = C.exports.useRef(), Zt = C.exports.useState(!1), cn = ze(Zt, 2), jt = cn[0], Kt = cn[1], nn = C.exports.useState(!1), Cn = ze(nn, 2), Nn = Cn[0], wt = Cn[1], qt = Rz(new Map), At = ze(qt, 2), Xt = At[0], en = At[1], gt = ax(ht), yn = gt.map(function (Bn) { return Xt.get(Bn) }), Sn = C.exports.useMemo(function () { return yn }, [yn.join("_")]), dn = CJ(Sn, ht.length, v), zt = f && sC(f.y), ot = f && sC(f.x) || Boolean(ee.fixed), mt = ot && ht.some(function (Bn) { var Yn = Bn.fixed; return Yn }), Dt = C.exports.useRef(), Bt = AJ(G, n), pn = Bt.isSticky, On = Bt.offsetHeader, Zn = Bt.offsetSummary, Xn = Bt.offsetScroll, me = Bt.stickyClassName, H = Bt.container, q = P == null ? void 0 : P(j), de = (zt || pn) && C.exports.isValidElement(q) && q.type === lx && q.props.fixed, le, xe, Ee; zt && (xe = { overflowY: "scroll", maxHeight: f.y }), ot && (le = { overflowX: "auto" }, zt || (xe = { overflowY: "hidden" }), Ee = { width: (f == null ? void 0 : f.x) === !0 ? "auto" : f == null ? void 0 : f.x, minWidth: "100%" }); var be = C.exports.useCallback(function (Bn, Yn) { E2(Wt.current) && en(function (Ar) { if (Ar.get(Bn) !== Yn) { var Ei = new Map(Ar); return Ei.set(Bn, Yn), Ei } return Ar }) }, []), Ce = wJ(null), Le = ze(Ce, 2), qe = Le[0], Ze = Le[1]; function Ve(Bn, Yn) { !Yn || (typeof Yn == "function" ? Yn(Bn) : Yn.scrollLeft !== Bn && (Yn.scrollLeft = Bn)) } var Lt = function (Yn) { var Ar = Yn.currentTarget, Ei = Yn.scrollLeft, Xa = v === "rtl", To = typeof Ei == "number" ? Ei : Ar.scrollLeft, Es = Ar || LJ; if (!Ze() || Ze() === Es) { var Pa; qe(Es), Ve(To, Ut.current), Ve(To, Jt.current), Ve(To, Ge.current), Ve(To, (Pa = Dt.current) === null || Pa === void 0 ? void 0 : Pa.setScrollLeft) } if (Ar) { var xr = Ar.scrollWidth, Ta = Ar.clientWidth; if (xr === Ta) { Kt(!1), wt(!1); return } Xa ? (Kt(-To < xr - Ta), wt(-To > 0)) : (Kt(To > 0), wt(To < xr - Ta)) } }, Ct = function () { ot && Jt.current ? Lt({ currentTarget: Jt.current }) : (Kt(!1), wt(!1)) }, Je = function (Yn) { var Ar = Yn.width; Ar !== Mt && (Ct(), ut(Wt.current ? Wt.current.offsetWidth : Ar)) }, Ot = C.exports.useRef(!1); C.exports.useEffect(function () { Ot.current && Ct() }, [ot, c, rt.length]), C.exports.useEffect(function () { Ot.current = !0 }, []); var Vt = C.exports.useState(0), bn = ze(Vt, 2), un = bn[0], wn = bn[1], Vn = C.exports.useState(!0), rr = ze(Vn, 2), $r = rr[0], sr = rr[1]; C.exports.useEffect(function () { Jt.current instanceof Element ? wn(pI(Jt.current).width) : wn(pI(Fe.current).width), sr(tC("position", "sticky")) }, []), C.exports.useEffect(function () { z === Zg && V && (V.body.current = Jt.current) }); var Mr = Y(["table"], "table"), Mn = C.exports.useMemo(function () { return p || (mt ? (f == null ? void 0 : f.x) === "max-content" ? "auto" : "fixed" : zt || pn || ht.some(function (Bn) { var Yn = Bn.ellipsis; return Yn }) ? "fixed" : "auto") }, [zt, mt, ht, p, pn]), kn, Dn = { colWidths: Sn, columCount: ht.length, stickyOffsets: dn, onHeaderRow: O, fixHeader: zt, scroll: f }, Gr = C.exports.useMemo(function () { return X ? null : typeof R == "function" ? R() : R }, [X, R]), yr = I(Iz, { data: j, measureColumnWidth: zt || ot || pn, expandedKeys: Pt, rowExpandable: Pe, getRowKey: se, onRow: M, emptyNode: Gr, childrenColumnName: He }), Kn = I(Mz, { colWidths: ht.map(function (Bn) { var Yn = Bn.width; return Yn }), columns: ht }), $n = Y(["body"]); if (zt || pn) { var Jn; typeof $n == "function" ? (Jn = $n(j, { scrollbarSize: un, ref: Jt, onScroll: Lt }), Dn.colWidths = ht.map(function (Bn, Yn) { var Ar = Bn.width, Ei = Yn === rt.length - 1 ? Ar - un : Ar; return typeof Ei == "number" && !Number.isNaN(Ei) ? Ei : (Rr(!1, "When use `components.body` with render props. Each column should have a fixed `width` value."), 0) })) : Jn = I("div", { style: ge(ge({}, le), xe), onScroll: Lt, ref: Jt, className: Xe("".concat(n, "-body")), children: Qe(Mr, { style: ge(ge({}, Ee), {}, { tableLayout: Mn }), children: [Kn, yr, !de && q && I(xg, { stickyOffsets: dn, flattenColumns: ht, children: q })] }) }); var br = ge(ge(ge({ noData: !j.length, maxContentScroll: ot && f.x === "max-content" }, Dn), bt), {}, { direction: v, stickyClassName: me, onScroll: Lt }); kn = Qe(An, { children: [A !== !1 && I(uC, { ...br, stickyTopOffset: On, className: "".concat(n, "-header"), ref: Ut, children: function (Bn) { return Qe(An, { children: [I(VI, { ...Bn }), de === "top" && I(xg, { ...Bn, children: q })] }) } }), Jn, de && de !== "top" && I(uC, { ...br, stickyBottomOffset: Zn, className: "".concat(n, "-summary"), ref: Ge, children: function (Bn) { return I(xg, { ...Bn, children: q }) } }), pn && I(MJ, { ref: Dt, offsetScroll: Xn, scrollBodyRef: Jt, onScroll: Lt, container: H })] }) } else kn = I("div", { style: ge(ge({}, le), xe), className: Xe("".concat(n, "-content")), onScroll: Lt, ref: Jt, children: Qe(Mr, { style: ge(ge({}, Ee), {}, { tableLayout: Mn }), children: [Kn, A !== !1 && I(VI, { ...Dn, ...bt }), yr, q && I(xg, { stickyOffsets: dn, flattenColumns: ht, children: q })] }) }); var Cr = uu(e, { aria: !0, data: !0 }), Br = I("div", { className: Xe(n, r, (t = {}, re(t, "".concat(n, "-rtl"), v === "rtl"), re(t, "".concat(n, "-ping-left"), jt), re(t, "".concat(n, "-ping-right"), Nn), re(t, "".concat(n, "-layout-fixed"), p === "fixed"), re(t, "".concat(n, "-fixed-header"), zt), re(t, "".concat(n, "-fixed-column"), mt), re(t, "".concat(n, "-scroll-horizontal"), ot), re(t, "".concat(n, "-has-fix-left"), ht[0] && ht[0].fixed), re(t, "".concat(n, "-has-fix-right"), ht[ht.length - 1] && ht[ht.length - 1].fixed === "right"), t)), style: s, id: k, ref: Wt, ...Cr, children: Qe(zJ, { pingLeft: jt, pingRight: Nn, props: ge(ge({}, e), {}, { stickyOffsets: dn, mergedExpandedKeys: Pt }), children: [y && I(UI, { className: "".concat(n, "-title"), children: y(j) }), I("div", { ref: Fe, className: "".concat(n, "-container"), children: kn }), w && I(UI, { className: "".concat(n, "-footer"), children: w(j) })] }) }); ot && (Br = I(cl, { onResize: Je, children: Br })); var so = C.exports.useMemo(function () { return { prefixCls: n, getComponent: Y, scrollbarSize: un, direction: v, fixedInfoList: ht.map(function (Bn, Yn) { return tE(Yn, Yn, ht, dn, v) }), isSticky: pn } }, [n, Y, un, v, ht, dn, pn]), gl = C.exports.useMemo(function () { return ge(ge({}, bt), {}, { tableLayout: Mn, rowClassName: i, expandedRowClassName: Re, expandIcon: $e, expandableType: Ue, expandRowByClick: Te, expandedRowRender: ce, onTriggerExpand: pt, expandIconColumnIndex: De, indentSize: Oe, allColumnsFixedLeft: bt.flattenColumns.every(function (Bn) { return Bn.fixed === "left" }) }) }, [bt, Mn, i, Re, $e, Ue, Te, ce, pt, De, Oe]), Bc = C.exports.useMemo(function () { return { componentWidth: Mt, fixHeader: zt, fixColumn: mt, horizonScroll: ot } }, [Mt, zt, mt, ot]), Ea = C.exports.useMemo(function () { return { onColumnResize: be } }, [be]); return I(xz.Provider, { value: $r, children: I(_s.Provider, { value: so, children: I(sx.Provider, { value: gl, children: I(Sz.Provider, { value: Bc, children: I(Pz.Provider, { value: Ea, children: Br }) }) }) }) }) } Nc.EXPAND_COLUMN = Yu; Nc.Column = JQ; Nc.ColumnGroup = QQ; Nc.Summary = Nz; Nc.defaultProps = { rowKey: "key", prefixCls: "rc-table", emptyText: function () { return "No Data" } }; function FJ(e) { return null } function $J(e) { return null } function BJ(e) { return function (n) { var r, i = n.prefixCls, s = n.onExpand, c = n.record, o = n.expanded, f = n.expandable, p = "".concat(i, "-row-expand-icon"); return I("button", { type: "button", onClick: function (y) { s(c, y), y.stopPropagation() }, className: Xe(p, (r = {}, re(r, "".concat(p, "-spaced"), !f), re(r, "".concat(p, "-expanded"), f && o), re(r, "".concat(p, "-collapsed"), f && !o), r)), "aria-label": o ? e.collapse : e.expand, "aria-expanded": o }) } } function uf(e, t) { return "key" in e && e.key !== void 0 && e.key !== null ? e.key : e.dataIndex ? Array.isArray(e.dataIndex) ? e.dataIndex.join(".") : e.dataIndex : t } function ux(e, t) { return t ? "".concat(t, "-").concat(e) : "".concat(e) } function cx(e, t) { return typeof e == "function" ? e(t) : e } function VJ(e, t) { var n = cx(e, t); return Object.prototype.toString.call(n) === "[object Object]" ? "" : n } var UJ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z" } }] }, name: "filter", theme: "filled" }; const jJ = UJ; var Oz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: jJ }) }) }; Oz.displayName = "FilterFilled"; const KJ = C.exports.forwardRef(Oz); function HJ() { this.__data__ = [], this.size = 0 } var WJ = HJ; function GJ(e, t) { return e === t || e !== e && t !== t } var Dz = GJ, qJ = Dz; function ZJ(e, t) { for (var n = e.length; n--;)if (qJ(e[n][0], t)) return n; return -1 } var dx = ZJ, XJ = dx, YJ = Array.prototype, QJ = YJ.splice; function JJ(e) { var t = this.__data__, n = XJ(t, e); if (n < 0) return !1; var r = t.length - 1; return n == r ? t.pop() : QJ.call(t, n, 1), --this.size, !0 } var eee = JJ, tee = dx; function nee(e) { var t = this.__data__, n = tee(t, e); return n < 0 ? void 0 : t[n][1] } var ree = nee, iee = dx; function oee(e) { return iee(this.__data__, e) > -1 } var aee = oee, see = dx; function lee(e, t) { var n = this.__data__, r = see(n, e); return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this } var uee = lee, cee = WJ, dee = eee, fee = ree, hee = aee, pee = uee; function Tf(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } Tf.prototype.clear = cee; Tf.prototype.delete = dee; Tf.prototype.get = fee; Tf.prototype.has = hee; Tf.prototype.set = pee; var fx = Tf, mee = fx; function vee() { this.__data__ = new mee, this.size = 0 } var gee = vee; function yee(e) { var t = this.__data__, n = t.delete(e); return this.size = t.size, n } var xee = yee; function _ee(e) { return this.__data__.get(e) } var bee = _ee; function wee(e) { return this.__data__.has(e) } var Cee = wee, See = ym, Eee = nx, Pee = "[object AsyncFunction]", Tee = "[object Function]", kee = "[object GeneratorFunction]", Iee = "[object Proxy]"; function Ree(e) { if (!Eee(e)) return !1; var t = See(e); return t == Tee || t == kee || t == Pee || t == Iee } var Lz = Ree, Mee = ys, Aee = Mee["__core-js_shared__"], Nee = Aee, K1 = Nee, KI = function () { var e = /[^.]+$/.exec(K1 && K1.keys && K1.keys.IE_PROTO || ""); return e ? "Symbol(src)_1." + e : "" }(); function Oee(e) { return !!KI && KI in e } var Dee = Oee, Lee = Function.prototype, zee = Lee.toString; function Fee(e) { if (e != null) { try { return zee.call(e) } catch { } try { return e + "" } catch { } } return "" } var zz = Fee, $ee = Lz, Bee = Dee, Vee = nx, Uee = zz, jee = /[\\^$.*+?()[\]{}|]/g, Kee = /^\[object .+?Constructor\]$/, Hee = Function.prototype, Wee = Object.prototype, Gee = Hee.toString, qee = Wee.hasOwnProperty, Zee = RegExp("^" + Gee.call(qee).replace(jee, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); function Xee(e) { if (!Vee(e) || Bee(e)) return !1; var t = $ee(e) ? Zee : Kee; return t.test(Uee(e)) } var Yee = Xee; function Qee(e, t) { return e == null ? void 0 : e[t] } var Jee = Qee, ete = Yee, tte = Jee; function nte(e, t) { var n = tte(e, t); return ete(n) ? n : void 0 } var kf = nte, rte = kf, ite = ys, ote = rte(ite, "Map"), rE = ote, ate = kf, ste = ate(Object, "create"), hx = ste, HI = hx; function lte() { this.__data__ = HI ? HI(null) : {}, this.size = 0 } var ute = lte; function cte(e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t } var dte = cte, fte = hx, hte = "__lodash_hash_undefined__", pte = Object.prototype, mte = pte.hasOwnProperty; function vte(e) { var t = this.__data__; if (fte) { var n = t[e]; return n === hte ? void 0 : n } return mte.call(t, e) ? t[e] : void 0 } var gte = vte, yte = hx, xte = Object.prototype, _te = xte.hasOwnProperty; function bte(e) { var t = this.__data__; return yte ? t[e] !== void 0 : _te.call(t, e) } var wte = bte, Cte = hx, Ste = "__lodash_hash_undefined__"; function Ete(e, t) { var n = this.__data__; return this.size += this.has(e) ? 0 : 1, n[e] = Cte && t === void 0 ? Ste : t, this } var Pte = Ete, Tte = ute, kte = dte, Ite = gte, Rte = wte, Mte = Pte; function If(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } If.prototype.clear = Tte; If.prototype.delete = kte; If.prototype.get = Ite; If.prototype.has = Rte; If.prototype.set = Mte; var Ate = If, WI = Ate, Nte = fx, Ote = rE; function Dte() { this.size = 0, this.__data__ = { hash: new WI, map: new (Ote || Nte), string: new WI } } var Lte = Dte; function zte(e) { var t = typeof e; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null } var Fte = zte, $te = Fte; function Bte(e, t) { var n = e.__data__; return $te(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map } var px = Bte, Vte = px; function Ute(e) { var t = Vte(this, e).delete(e); return this.size -= t ? 1 : 0, t } var jte = Ute, Kte = px; function Hte(e) { return Kte(this, e).get(e) } var Wte = Hte, Gte = px; function qte(e) { return Gte(this, e).has(e) } var Zte = qte, Xte = px; function Yte(e, t) { var n = Xte(this, e), r = n.size; return n.set(e, t), this.size += n.size == r ? 0 : 1, this } var Qte = Yte, Jte = Lte, ene = jte, tne = Wte, nne = Zte, rne = Qte; function Rf(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n;) { var r = e[t]; this.set(r[0], r[1]) } } Rf.prototype.clear = Jte; Rf.prototype.delete = ene; Rf.prototype.get = tne; Rf.prototype.has = nne; Rf.prototype.set = rne; var Fz = Rf, ine = fx, one = rE, ane = Fz, sne = 200; function lne(e, t) { var n = this.__data__; if (n instanceof ine) { var r = n.__data__; if (!one || r.length < sne - 1) return r.push([e, t]), this.size = ++n.size, this; n = this.__data__ = new ane(r) } return n.set(e, t), this.size = n.size, this } var une = lne, cne = fx, dne = gee, fne = xee, hne = bee, pne = Cee, mne = une; function Mf(e) { var t = this.__data__ = new cne(e); this.size = t.size } Mf.prototype.clear = dne; Mf.prototype.delete = fne; Mf.prototype.get = hne; Mf.prototype.has = pne; Mf.prototype.set = mne; var vne = Mf, gne = "__lodash_hash_undefined__"; function yne(e) { return this.__data__.set(e, gne), this } var xne = yne; function _ne(e) { return this.__data__.has(e) } var bne = _ne, wne = Fz, Cne = xne, Sne = bne; function Yy(e) { var t = -1, n = e == null ? 0 : e.length; for (this.__data__ = new wne; ++t < n;)this.add(e[t]) } Yy.prototype.add = Yy.prototype.push = Cne; Yy.prototype.has = Sne; var Ene = Yy; function Pne(e, t) { for (var n = -1, r = e == null ? 0 : e.length; ++n < r;)if (t(e[n], n, e)) return !0; return !1 } var Tne = Pne; function kne(e, t) { return e.has(t) } var Ine = kne, Rne = Ene, Mne = Tne, Ane = Ine, Nne = 1, One = 2; function Dne(e, t, n, r, i, s) { var c = n & Nne, o = e.length, f = t.length; if (o != f && !(c && f > o)) return !1; var p = s.get(e), v = s.get(t); if (p && v) return p == t && v == e; var y = -1, w = !0, P = n & One ? new Rne : void 0; for (s.set(e, t), s.set(t, e); ++y < o;) { var k = e[y], A = t[y]; if (r) var N = c ? r(A, k, y, t, e, s) : r(k, A, y, e, t, s); if (N !== void 0) { if (N) continue; w = !1; break } if (P) { if (!Mne(t, function (R, M) { if (!Ane(P, M) && (k === R || i(k, R, n, r, s))) return P.push(M) })) { w = !1; break } } else if (!(k === A || i(k, A, n, r, s))) { w = !1; break } } return s.delete(e), s.delete(t), w } var $z = Dne, Lne = ys, zne = Lne.Uint8Array, Fne = zne; function $ne(e) { var t = -1, n = Array(e.size); return e.forEach(function (r, i) { n[++t] = [i, r] }), n } var Bne = $ne; function Vne(e) { var t = -1, n = Array(e.size); return e.forEach(function (r) { n[++t] = r }), n } var Une = Vne, GI = H2, qI = Fne, jne = Dz, Kne = $z, Hne = Bne, Wne = Une, Gne = 1, qne = 2, Zne = "[object Boolean]", Xne = "[object Date]", Yne = "[object Error]", Qne = "[object Map]", Jne = "[object Number]", ere = "[object RegExp]", tre = "[object Set]", nre = "[object String]", rre = "[object Symbol]", ire = "[object ArrayBuffer]", ore = "[object DataView]", ZI = GI ? GI.prototype : void 0, H1 = ZI ? ZI.valueOf : void 0; function are(e, t, n, r, i, s, c) { switch (n) { case ore: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; e = e.buffer, t = t.buffer; case ire: return !(e.byteLength != t.byteLength || !s(new qI(e), new qI(t))); case Zne: case Xne: case Jne: return jne(+e, +t); case Yne: return e.name == t.name && e.message == t.message; case ere: case nre: return e == t + ""; case Qne: var o = Hne; case tre: var f = r & Gne; if (o || (o = Wne), e.size != t.size && !f) return !1; var p = c.get(e); if (p) return p == t; r |= qne, c.set(e, t); var v = Kne(o(e), o(t), r, i, s, c); return c.delete(e), v; case rre: if (H1) return H1.call(e) == H1.call(t) }return !1 } var sre = are; function lre(e, t) { for (var n = -1, r = t.length, i = e.length; ++n < r;)e[i + n] = t[n]; return e } var ure = lre, cre = ure, dre = W2; function fre(e, t, n) { var r = t(e); return dre(e) ? r : cre(r, n(e)) } var hre = fre; function pre(e, t) { for (var n = -1, r = e == null ? 0 : e.length, i = 0, s = []; ++n < r;) { var c = e[n]; t(c, n, e) && (s[i++] = c) } return s } var mre = pre; function vre() { return [] } var gre = vre, yre = mre, xre = gre, _re = Object.prototype, bre = _re.propertyIsEnumerable, XI = Object.getOwnPropertySymbols, wre = XI ? function (e) { return e == null ? [] : (e = Object(e), yre(XI(e), function (t) { return bre.call(e, t) })) } : xre, Cre = wre; function Sre(e, t) { for (var n = -1, r = Array(e); ++n < e;)r[n] = t(n); return r } var Ere = Sre, Pre = ym, Tre = xm, kre = "[object Arguments]"; function Ire(e) { return Tre(e) && Pre(e) == kre } var Rre = Ire, YI = Rre, Mre = xm, Bz = Object.prototype, Are = Bz.hasOwnProperty, Nre = Bz.propertyIsEnumerable, Ore = YI(function () { return arguments }()) ? YI : function (e) { return Mre(e) && Are.call(e, "callee") && !Nre.call(e, "callee") }, Dre = Ore, Qy = { exports: {} }; function Lre() { return !1 } var zre = Lre; (function (e, t) { var n = ys, r = zre, i = t && !t.nodeType && t, s = i && !0 && e && !e.nodeType && e, c = s && s.exports === i, o = c ? n.Buffer : void 0, f = o ? o.isBuffer : void 0, p = f || r; e.exports = p })(Qy, Qy.exports); var Fre = 9007199254740991, $re = /^(?:0|[1-9]\d*)$/; function Bre(e, t) { var n = typeof e; return t = t == null ? Fre : t, !!t && (n == "number" || n != "symbol" && $re.test(e)) && e > -1 && e % 1 == 0 && e < t } var Vre = Bre, Ure = 9007199254740991; function jre(e) { return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Ure } var Vz = jre, Kre = ym, Hre = Vz, Wre = xm, Gre = "[object Arguments]", qre = "[object Array]", Zre = "[object Boolean]", Xre = "[object Date]", Yre = "[object Error]", Qre = "[object Function]", Jre = "[object Map]", eie = "[object Number]", tie = "[object Object]", nie = "[object RegExp]", rie = "[object Set]", iie = "[object String]", oie = "[object WeakMap]", aie = "[object ArrayBuffer]", sie = "[object DataView]", lie = "[object Float32Array]", uie = "[object Float64Array]", cie = "[object Int8Array]", die = "[object Int16Array]", fie = "[object Int32Array]", hie = "[object Uint8Array]", pie = "[object Uint8ClampedArray]", mie = "[object Uint16Array]", vie = "[object Uint32Array]", Hr = {}; Hr[lie] = Hr[uie] = Hr[cie] = Hr[die] = Hr[fie] = Hr[hie] = Hr[pie] = Hr[mie] = Hr[vie] = !0; Hr[Gre] = Hr[qre] = Hr[aie] = Hr[Zre] = Hr[sie] = Hr[Xre] = Hr[Yre] = Hr[Qre] = Hr[Jre] = Hr[eie] = Hr[tie] = Hr[nie] = Hr[rie] = Hr[iie] = Hr[oie] = !1; function gie(e) { return Wre(e) && Hre(e.length) && !!Hr[Kre(e)] } var yie = gie; function xie(e) { return function (t) { return e(t) } } var _ie = xie, cC = { exports: {} }; (function (e, t) { var n = wL, r = t && !t.nodeType && t, i = r && !0 && e && !e.nodeType && e, s = i && i.exports === r, c = s && n.process, o = function () { try { var f = i && i.require && i.require("util").types; return f || c && c.binding && c.binding("util") } catch { } }(); e.exports = o })(cC, cC.exports); var bie = yie, wie = _ie, QI = cC.exports, JI = QI && QI.isTypedArray, Cie = JI ? wie(JI) : bie, Uz = Cie, Sie = Ere, Eie = Dre, Pie = W2, Tie = Qy.exports, kie = Vre, Iie = Uz, Rie = Object.prototype, Mie = Rie.hasOwnProperty; function Aie(e, t) { var n = Pie(e), r = !n && Eie(e), i = !n && !r && Tie(e), s = !n && !r && !i && Iie(e), c = n || r || i || s, o = c ? Sie(e.length, String) : [], f = o.length; for (var p in e) (t || Mie.call(e, p)) && !(c && (p == "length" || i && (p == "offset" || p == "parent") || s && (p == "buffer" || p == "byteLength" || p == "byteOffset") || kie(p, f))) && o.push(p); return o } var Nie = Aie, Oie = Object.prototype; function Die(e) { var t = e && e.constructor, n = typeof t == "function" && t.prototype || Oie; return e === n } var Lie = Die; function zie(e, t) { return function (n) { return e(t(n)) } } var Fie = zie, $ie = Fie, Bie = $ie(Object.keys, Object), Vie = Bie, Uie = Lie, jie = Vie, Kie = Object.prototype, Hie = Kie.hasOwnProperty; function Wie(e) { if (!Uie(e)) return jie(e); var t = []; for (var n in Object(e)) Hie.call(e, n) && n != "constructor" && t.push(n); return t } var Gie = Wie, qie = Lz, Zie = Vz; function Xie(e) { return e != null && Zie(e.length) && !qie(e) } var Yie = Xie, Qie = Nie, Jie = Gie, eoe = Yie; function toe(e) { return eoe(e) ? Qie(e) : Jie(e) } var noe = toe, roe = hre, ioe = Cre, ooe = noe; function aoe(e) { return roe(e, ooe, ioe) } var soe = aoe, e3 = soe, loe = 1, uoe = Object.prototype, coe = uoe.hasOwnProperty; function doe(e, t, n, r, i, s) { var c = n & loe, o = e3(e), f = o.length, p = e3(t), v = p.length; if (f != v && !c) return !1; for (var y = f; y--;) { var w = o[y]; if (!(c ? w in t : coe.call(t, w))) return !1 } var P = s.get(e), k = s.get(t); if (P && k) return P == t && k == e; var A = !0; s.set(e, t), s.set(t, e); for (var N = c; ++y < f;) { w = o[y]; var R = e[w], M = t[w]; if (r) var O = c ? r(M, R, w, t, e, s) : r(R, M, w, e, t, s); if (!(O === void 0 ? R === M || i(R, M, n, r, s) : O)) { A = !1; break } N || (N = w == "constructor") } if (A && !N) { var z = e.constructor, B = t.constructor; z != B && "constructor" in e && "constructor" in t && !(typeof z == "function" && z instanceof z && typeof B == "function" && B instanceof B) && (A = !1) } return s.delete(e), s.delete(t), A } var foe = doe, hoe = kf, poe = ys, moe = hoe(poe, "DataView"), voe = moe, goe = kf, yoe = ys, xoe = goe(yoe, "Promise"), _oe = xoe, boe = kf, woe = ys, Coe = boe(woe, "Set"), Soe = Coe, Eoe = kf, Poe = ys, Toe = Eoe(Poe, "WeakMap"), koe = Toe, dC = voe, fC = rE, hC = _oe, pC = Soe, mC = koe, jz = ym, Af = zz, t3 = "[object Map]", Ioe = "[object Object]", n3 = "[object Promise]", r3 = "[object Set]", i3 = "[object WeakMap]", o3 = "[object DataView]", Roe = Af(dC), Moe = Af(fC), Aoe = Af(hC), Noe = Af(pC), Ooe = Af(mC), Qu = jz; (dC && Qu(new dC(new ArrayBuffer(1))) != o3 || fC && Qu(new fC) != t3 || hC && Qu(hC.resolve()) != n3 || pC && Qu(new pC) != r3 || mC && Qu(new mC) != i3) && (Qu = function (e) { var t = jz(e), n = t == Ioe ? e.constructor : void 0, r = n ? Af(n) : ""; if (r) switch (r) { case Roe: return o3; case Moe: return t3; case Aoe: return n3; case Noe: return r3; case Ooe: return i3 }return t }); var Doe = Qu, W1 = vne, Loe = $z, zoe = sre, Foe = foe, a3 = Doe, s3 = W2, l3 = Qy.exports, $oe = Uz, Boe = 1, u3 = "[object Arguments]", c3 = "[object Array]", _g = "[object Object]", Voe = Object.prototype, d3 = Voe.hasOwnProperty; function Uoe(e, t, n, r, i, s) { var c = s3(e), o = s3(t), f = c ? c3 : a3(e), p = o ? c3 : a3(t); f = f == u3 ? _g : f, p = p == u3 ? _g : p; var v = f == _g, y = p == _g, w = f == p; if (w && l3(e)) { if (!l3(t)) return !1; c = !0, v = !1 } if (w && !v) return s || (s = new W1), c || $oe(e) ? Loe(e, t, n, r, i, s) : zoe(e, t, f, n, r, i, s); if (!(n & Boe)) { var P = v && d3.call(e, "__wrapped__"), k = y && d3.call(t, "__wrapped__"); if (P || k) { var A = P ? e.value() : e, N = k ? t.value() : t; return s || (s = new W1), i(A, N, n, r, s) } } return w ? (s || (s = new W1), Foe(e, t, n, r, i, s)) : !1 } var joe = Uoe, Koe = joe, f3 = xm; function Kz(e, t, n, r, i) { return e === t ? !0 : e == null || t == null || !f3(e) && !f3(t) ? e !== e && t !== t : Koe(e, t, n, r, Kz, i) } var Hoe = Kz, Woe = Hoe; function Goe(e, t) { return Woe(e, t) } var h3 = Goe; function Hz(e) { if (e == null) throw new TypeError("Cannot destructure " + e) } var qoe = ["className", "style", "motion", "motionNodes", "motionType", "onMotionStart", "onMotionEnd", "active", "treeNodeRequiredProps"], Wz = function (t, n) { var r = t.className, i = t.style, s = t.motion, c = t.motionNodes, o = t.motionType, f = t.onMotionStart, p = t.onMotionEnd, v = t.active, y = t.treeNodeRequiredProps, w = Rn(t, qoe), P = C.exports.useState(!0), k = ze(P, 2), A = k[0], N = k[1], R = C.exports.useContext(q2), M = R.prefixCls, O = C.exports.useRef(!1), z = function () { O.current || p(), O.current = !0 }; return C.exports.useEffect(function () { c && o === "hide" && A && N(!1) }, [c]), C.exports.useEffect(function () { return c && f(), function () { c && z() } }, []), c ? I(Sa, { ref: n, visible: A, ...s, motionAppear: o === "show", onAppearEnd: z, onLeaveEnd: z, children: function (B, V) { var G = B.className, j = B.style; return I("div", { ref: V, className: Xe("".concat(M, "-treenode-motion"), G), style: j, children: c.map(function (X) { var Y = tt({}, (Hz(X.data), X.data)), se = X.title, ee = X.key, Z = X.isStart, J = X.isEnd; delete Y.children; var ve = mp(ee, y); return C.exports.createElement(Sc, { ...Y, ...ve, title: se, active: v, data: X.data, key: ee, isStart: Z, isEnd: J }) }) }) } }) : I(Sc, { domRef: n, className: r, style: i, ...w, active: v }) }; Wz.displayName = "MotionTreeNode"; var Zoe = C.exports.forwardRef(Wz); function Xoe() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = e.length, r = t.length; if (Math.abs(n - r) !== 1) return { add: !1, key: null }; function i(s, c) { var o = new Map; s.forEach(function (p) { o.set(p, !0) }); var f = c.filter(function (p) { return !o.has(p) }); return f.length === 1 ? f[0] : null } return n < r ? { add: !0, key: i(e, t) } : { add: !1, key: i(t, e) } } function p3(e, t, n) { var r = e.findIndex(function (o) { return o.key === n }), i = e[r + 1], s = t.findIndex(function (o) { return o.key === n }); if (i) { var c = t.findIndex(function (o) { return o.key === i.key }); return t.slice(s + 1, c) } return t.slice(s + 1) } var Yoe = ["prefixCls", "data", "selectable", "checkable", "expandedKeys", "selectedKeys", "checkedKeys", "loadedKeys", "loadingKeys", "halfCheckedKeys", "keyEntities", "disabled", "dragging", "dragOverNodeKey", "dropPosition", "motion", "height", "itemHeight", "virtual", "focusable", "activeItem", "focused", "tabIndex", "onKeyDown", "onFocus", "onBlur", "onActiveChange", "onListChangeStart", "onListChangeEnd"], m3 = { width: 0, height: 0, display: "flex", overflow: "hidden", opacity: 0, border: 0, padding: 0, margin: 0 }, Qoe = function () { }, Ec = "RC_TREE_MOTION_".concat(Math.random()), vC = { key: Ec }, Gz = { key: Ec, level: 0, index: 0, pos: "0", node: vC, nodes: [vC] }, v3 = { parent: null, children: [], pos: Gz.pos, data: vC, title: null, key: Ec, isStart: [], isEnd: [] }; function g3(e, t, n, r) { return t === !1 || !n ? e : e.slice(0, Math.ceil(n / r) + 1) } function y3(e) { var t = e.key, n = e.pos; return _m(t, n) } function Joe(e) { for (var t = String(e.data.key), n = e; n.parent;)n = n.parent, t = "".concat(n.data.key, " > ").concat(t); return t } var qz = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.data; e.selectable, e.checkable; var i = e.expandedKeys, s = e.selectedKeys, c = e.checkedKeys, o = e.loadedKeys, f = e.loadingKeys, p = e.halfCheckedKeys, v = e.keyEntities, y = e.disabled, w = e.dragging, P = e.dragOverNodeKey, k = e.dropPosition, A = e.motion, N = e.height, R = e.itemHeight, M = e.virtual, O = e.focusable, z = e.activeItem, B = e.focused, V = e.tabIndex, G = e.onKeyDown, j = e.onFocus, X = e.onBlur, Y = e.onActiveChange, se = e.onListChangeStart, ee = e.onListChangeEnd, Z = Rn(e, Yoe), J = C.exports.useRef(null), ve = C.exports.useRef(null); C.exports.useImperativeHandle(t, function () { return { scrollTo: function (ct) { J.current.scrollTo(ct) }, getIndentWidth: function () { return ve.current.offsetWidth } } }); var ie = C.exports.useState(i), ce = ze(ie, 2), oe = ce[0], ye = ce[1], Ie = C.exports.useState(r), Te = ze(Ie, 2), Pe = Te[0], De = Te[1], Re = C.exports.useState(r), ke = ze(Re, 2), Oe = ke[0], $e = ke[1], He = C.exports.useState([]), Ue = ze(He, 2), st = Ue[0], ft = Ue[1], It = C.exports.useState(null), We = ze(It, 2), Pt = We[0], pt = We[1], Rt = C.exports.useRef(r); Rt.current = r; function yt() { var dt = Rt.current; De(dt), $e(dt), ft([]), pt(null), ee() } C.exports.useEffect(function () { ye(i); var dt = Xoe(oe, i); if (dt.key !== null) if (dt.add) { var ct = Pe.findIndex(function (Jt) { var Fe = Jt.key; return Fe === dt.key }), rt = g3(p3(Pe, r, dt.key), M, N, R), ht = Pe.slice(); ht.splice(ct + 1, 0, v3), $e(ht), ft(rt), pt("show") } else { var bt = r.findIndex(function (Jt) { var Fe = Jt.key; return Fe === dt.key }), Wt = g3(p3(r, Pe, dt.key), M, N, R), Ut = r.slice(); Ut.splice(bt + 1, 0, v3), $e(Ut), ft(Wt), pt("hide") } else Pe !== r && (De(r), $e(r)) }, [i, r]), C.exports.useEffect(function () { w || yt() }, [w]); var Mt = A ? Oe : r, ut = { expandedKeys: i, selectedKeys: s, loadedKeys: o, loadingKeys: f, checkedKeys: c, halfCheckedKeys: p, dragOverNodeKey: P, dropPosition: k, keyEntities: v }; return Qe(An, { children: [B && z && I("span", { style: m3, "aria-live": "assertive", children: Joe(z) }), I("div", { children: I("input", { style: m3, disabled: O === !1 || y, tabIndex: O !== !1 ? V : null, onKeyDown: G, onFocus: j, onBlur: X, value: "", onChange: Qoe, "aria-label": "for screen reader" }) }), I("div", { className: "".concat(n, "-treenode"), "aria-hidden": !0, style: { position: "absolute", pointerEvents: "none", visibility: "hidden", height: 0, overflow: "hidden", border: 0, padding: 0 }, children: I("div", { className: "".concat(n, "-indent"), children: I("div", { ref: ve, className: "".concat(n, "-indent-unit") }) }) }), I(k2, { ...Z, data: Mt, itemKey: y3, height: N, fullHeight: !1, virtual: M, itemHeight: R, prefixCls: "".concat(n, "-list"), ref: J, onVisibleChange: function (ct, rt) { var ht = new Set(ct), bt = rt.filter(function (Wt) { return !ht.has(Wt) }); bt.some(function (Wt) { return y3(Wt) === Ec }) && yt() }, children: function (dt) { var ct = dt.pos, rt = tt({}, (Hz(dt.data), dt.data)), ht = dt.title, bt = dt.key, Wt = dt.isStart, Ut = dt.isEnd, Jt = _m(bt, ct); delete rt.key, delete rt.children; var Fe = mp(Jt, ut); return I(Zoe, { ...rt, ...Fe, title: ht, active: !!z && bt === z.key, pos: ct, data: dt.data, isStart: Wt, isEnd: Ut, motion: A, motionNodes: bt === Ec ? st : null, motionType: Pt, onMotionStart: se, onMotionEnd: yt, treeNodeRequiredProps: ut, onMouseMove: function () { Y(null) } }) } })] }) }); qz.displayName = "NodeList"; function eae(e) { var t = e.dropPosition, n = e.dropLevelOffset, r = e.indent, i = { pointerEvents: "none", position: "absolute", right: 0, backgroundColor: "red", height: 2 }; switch (t) { case -1: i.top = 0, i.left = -n * r; break; case 1: i.bottom = 0, i.left = -n * r; break; case 0: i.bottom = 0, i.left = r; break }return I("div", { style: i }) } var tae = 10, mx = function (e) { ui(n, e); var t = ci(n); function n() { var r; zr(this, n); for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)s[c] = arguments[c]; return r = t.call.apply(t, [this].concat(s)), r.destroyed = !1, r.delayedDragEnterLogic = void 0, r.loadingRetryTimes = {}, r.state = { keyEntities: {}, indent: null, selectedKeys: [], checkedKeys: [], halfCheckedKeys: [], loadedKeys: [], loadingKeys: [], expandedKeys: [], draggingNodeKey: null, dragChildrenKeys: [], dropTargetKey: null, dropPosition: null, dropContainerKey: null, dropLevelOffset: null, dropTargetPos: null, dropAllowed: !0, dragOverNodeKey: null, treeData: [], flattenNodes: [], focused: !1, activeKey: null, listChanging: !1, prevProps: null, fieldNames: Wy() }, r.dragStartMousePosition = null, r.dragNode = void 0, r.currentMouseOverDroppableNodeKey = null, r.listRef = C.exports.createRef(), r.onNodeDragStart = function (o, f) { var p = r.state, v = p.expandedKeys, y = p.keyEntities, w = r.props.onDragStart, P = f.props.eventKey; r.dragNode = f, r.dragStartMousePosition = { x: o.clientX, y: o.clientY }; var k = ss(v, P); r.setState({ draggingNodeKey: P, dragChildrenKeys: UZ(P, y), indent: r.listRef.current.getIndentWidth() }), r.setExpandedKeys(k), window.addEventListener("dragend", r.onWindowDragEnd), w == null || w({ event: o, node: Ci(f.props) }) }, r.onNodeDragEnter = function (o, f) { var p = r.state, v = p.expandedKeys, y = p.keyEntities, w = p.dragChildrenKeys, P = p.flattenNodes, k = p.indent, A = r.props, N = A.onDragEnter, R = A.onExpand, M = A.allowDrop, O = A.direction, z = f.props, B = z.pos, V = z.eventKey, G = Ln(r), j = G.dragNode; if (r.currentMouseOverDroppableNodeKey !== V && (r.currentMouseOverDroppableNodeKey = V), !j) { r.resetDragState(); return } var X = sI(o, j, f, k, r.dragStartMousePosition, M, P, y, v, O), Y = X.dropPosition, se = X.dropLevelOffset, ee = X.dropTargetKey, Z = X.dropContainerKey, J = X.dropTargetPos, ve = X.dropAllowed, ie = X.dragOverNodeKey; if (w.indexOf(ee) !== -1 || !ve) { r.resetDragState(); return } if (r.delayedDragEnterLogic || (r.delayedDragEnterLogic = {}), Object.keys(r.delayedDragEnterLogic).forEach(function (ce) { clearTimeout(r.delayedDragEnterLogic[ce]) }), j.props.eventKey !== f.props.eventKey && (o.persist(), r.delayedDragEnterLogic[B] = window.setTimeout(function () { if (r.state.draggingNodeKey !== null) { var ce = Et(v), oe = y[f.props.eventKey]; oe && (oe.children || []).length && (ce = Bs(v, f.props.eventKey)), "expandedKeys" in r.props || r.setExpandedKeys(ce), R == null || R(ce, { node: Ci(f.props), expanded: !0, nativeEvent: o.nativeEvent }) } }, 800)), j.props.eventKey === ee && se === 0) { r.resetDragState(); return } r.setState({ dragOverNodeKey: ie, dropPosition: Y, dropLevelOffset: se, dropTargetKey: ee, dropContainerKey: Z, dropTargetPos: J, dropAllowed: ve }), N == null || N({ event: o, node: Ci(f.props), expandedKeys: v }) }, r.onNodeDragOver = function (o, f) { var p = r.state, v = p.dragChildrenKeys, y = p.flattenNodes, w = p.keyEntities, P = p.expandedKeys, k = p.indent, A = r.props, N = A.onDragOver, R = A.allowDrop, M = A.direction, O = Ln(r), z = O.dragNode; if (!!z) { var B = sI(o, z, f, k, r.dragStartMousePosition, R, y, w, P, M), V = B.dropPosition, G = B.dropLevelOffset, j = B.dropTargetKey, X = B.dropContainerKey, Y = B.dropAllowed, se = B.dropTargetPos, ee = B.dragOverNodeKey; v.indexOf(j) !== -1 || !Y || (z.props.eventKey === j && G === 0 ? r.state.dropPosition === null && r.state.dropLevelOffset === null && r.state.dropTargetKey === null && r.state.dropContainerKey === null && r.state.dropTargetPos === null && r.state.dropAllowed === !1 && r.state.dragOverNodeKey === null || r.resetDragState() : V === r.state.dropPosition && G === r.state.dropLevelOffset && j === r.state.dropTargetKey && X === r.state.dropContainerKey && se === r.state.dropTargetPos && Y === r.state.dropAllowed && ee === r.state.dragOverNodeKey || r.setState({ dropPosition: V, dropLevelOffset: G, dropTargetKey: j, dropContainerKey: X, dropTargetPos: se, dropAllowed: Y, dragOverNodeKey: ee }), N == null || N({ event: o, node: Ci(f.props) })) } }, r.onNodeDragLeave = function (o, f) { r.currentMouseOverDroppableNodeKey === f.props.eventKey && !o.currentTarget.contains(o.relatedTarget) && (r.resetDragState(), r.currentMouseOverDroppableNodeKey = null); var p = r.props.onDragLeave; p == null || p({ event: o, node: Ci(f.props) }) }, r.onWindowDragEnd = function (o) { r.onNodeDragEnd(o, null, !0), window.removeEventListener("dragend", r.onWindowDragEnd) }, r.onNodeDragEnd = function (o, f) { var p = r.props.onDragEnd; r.setState({ dragOverNodeKey: null }), r.cleanDragState(), p == null || p({ event: o, node: Ci(f.props) }), r.dragNode = null, window.removeEventListener("dragend", r.onWindowDragEnd) }, r.onNodeDrop = function (o, f) { var p, v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, y = r.state, w = y.dragChildrenKeys, P = y.dropPosition, k = y.dropTargetKey, A = y.dropTargetPos, N = y.dropAllowed; if (!!N) { var R = r.props.onDrop; if (r.setState({ dragOverNodeKey: null }), r.cleanDragState(), k !== null) { var M = ge(ge({}, mp(k, r.getTreeNodeRequiredProps())), {}, { active: ((p = r.getActiveItem()) === null || p === void 0 ? void 0 : p.key) === k, data: r.state.keyEntities[k].node }), O = w.indexOf(k) !== -1; Rr(!O, "Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue."); var z = Z2(A), B = { event: o, node: Ci(M), dragNode: r.dragNode ? Ci(r.dragNode.props) : null, dragNodesKeys: [r.dragNode.props.eventKey].concat(w), dropToGap: P !== 0, dropPosition: P + Number(z[z.length - 1]) }; v || R == null || R(B), r.dragNode = null } } }, r.cleanDragState = function () { var o = r.state.draggingNodeKey; o !== null && r.setState({ draggingNodeKey: null, dropPosition: null, dropContainerKey: null, dropTargetKey: null, dropLevelOffset: null, dropAllowed: !0, dragOverNodeKey: null }), r.dragStartMousePosition = null, r.currentMouseOverDroppableNodeKey = null }, r.triggerExpandActionExpand = function (o, f) { var p = r.state, v = p.expandedKeys, y = p.flattenNodes, w = f.expanded, P = f.key, k = f.isLeaf; if (!(k || o.shiftKey || o.metaKey || o.ctrlKey)) { var A = y.filter(function (R) { return R.key === P })[0], N = Ci(ge(ge({}, mp(P, r.getTreeNodeRequiredProps())), {}, { data: A.data })); r.setExpandedKeys(w ? ss(v, P) : Bs(v, P)), r.onNodeExpand(o, N) } }, r.onNodeClick = function (o, f) { var p = r.props, v = p.onClick, y = p.expandAction; y === "click" && r.triggerExpandActionExpand(o, f), v == null || v(o, f) }, r.onNodeDoubleClick = function (o, f) { var p = r.props, v = p.onDoubleClick, y = p.expandAction; y === "doubleClick" && r.triggerExpandActionExpand(o, f), v == null || v(o, f) }, r.onNodeSelect = function (o, f) { var p = r.state.selectedKeys, v = r.state, y = v.keyEntities, w = v.fieldNames, P = r.props, k = P.onSelect, A = P.multiple, N = f.selected, R = f[w.key], M = !N; M ? A ? p = Bs(p, R) : p = [R] : p = ss(p, R); var O = p.map(function (z) { var B = y[z]; return B ? B.node : null }).filter(function (z) { return z }); r.setUncontrolledState({ selectedKeys: p }), k == null || k(p, { event: "select", selected: M, node: f, selectedNodes: O, nativeEvent: o.nativeEvent }) }, r.onNodeCheck = function (o, f, p) { var v = r.state, y = v.keyEntities, w = v.checkedKeys, P = v.halfCheckedKeys, k = r.props, A = k.checkStrictly, N = k.onCheck, R = f.key, M, O = { event: "check", node: f, checked: p, nativeEvent: o.nativeEvent }; if (A) { var z = p ? Bs(w, R) : ss(w, R), B = ss(P, R); M = { checked: z, halfChecked: B }, O.checkedNodes = z.map(function (se) { return y[se] }).filter(function (se) { return se }).map(function (se) { return se.node }), r.setUncontrolledState({ checkedKeys: z }) } else { var V = Qs([].concat(Et(w), [R]), !0, y), G = V.checkedKeys, j = V.halfCheckedKeys; if (!p) { var X = new Set(G); X.delete(R); var Y = Qs(Array.from(X), { checked: !1, halfCheckedKeys: j }, y); G = Y.checkedKeys, j = Y.halfCheckedKeys } M = G, O.checkedNodes = [], O.checkedNodesPositions = [], O.halfCheckedKeys = j, G.forEach(function (se) { var ee = y[se]; if (!!ee) { var Z = ee.node, J = ee.pos; O.checkedNodes.push(Z), O.checkedNodesPositions.push({ node: Z, pos: J }) } }), r.setUncontrolledState({ checkedKeys: G }, !1, { halfCheckedKeys: j }) } N == null || N(M, O) }, r.onNodeLoad = function (o) { var f = o.key, p = new Promise(function (v, y) { r.setState(function (w) { var P = w.loadedKeys, k = P === void 0 ? [] : P, A = w.loadingKeys, N = A === void 0 ? [] : A, R = r.props, M = R.loadData, O = R.onLoad; if (!M || k.indexOf(f) !== -1 || N.indexOf(f) !== -1) return null; var z = M(o); return z.then(function () { var B = r.state.loadedKeys, V = Bs(B, f); O == null || O(V, { event: "load", node: o }), r.setUncontrolledState({ loadedKeys: V }), r.setState(function (G) { return { loadingKeys: ss(G.loadingKeys, f) } }), v() }).catch(function (B) { if (r.setState(function (G) { return { loadingKeys: ss(G.loadingKeys, f) } }), r.loadingRetryTimes[f] = (r.loadingRetryTimes[f] || 0) + 1, r.loadingRetryTimes[f] >= tae) { var V = r.state.loadedKeys; Rr(!1, "Retry for `loadData` many times but still failed. No more retry."), r.setUncontrolledState({ loadedKeys: Bs(V, f) }), v() } y(B) }), { loadingKeys: Bs(N, f) } }) }); return p.catch(function () { }), p }, r.onNodeMouseEnter = function (o, f) { var p = r.props.onMouseEnter; p == null || p({ event: o, node: f }) }, r.onNodeMouseLeave = function (o, f) { var p = r.props.onMouseLeave; p == null || p({ event: o, node: f }) }, r.onNodeContextMenu = function (o, f) { var p = r.props.onRightClick; p && (o.preventDefault(), p({ event: o, node: f })) }, r.onFocus = function () { var o = r.props.onFocus; r.setState({ focused: !0 }); for (var f = arguments.length, p = new Array(f), v = 0; v < f; v++)p[v] = arguments[v]; o == null || o.apply(void 0, p) }, r.onBlur = function () { var o = r.props.onBlur; r.setState({ focused: !1 }), r.onActiveChange(null); for (var f = arguments.length, p = new Array(f), v = 0; v < f; v++)p[v] = arguments[v]; o == null || o.apply(void 0, p) }, r.getTreeNodeRequiredProps = function () { var o = r.state, f = o.expandedKeys, p = o.selectedKeys, v = o.loadedKeys, y = o.loadingKeys, w = o.checkedKeys, P = o.halfCheckedKeys, k = o.dragOverNodeKey, A = o.dropPosition, N = o.keyEntities; return { expandedKeys: f || [], selectedKeys: p || [], loadedKeys: v || [], loadingKeys: y || [], checkedKeys: w || [], halfCheckedKeys: P || [], dragOverNodeKey: k, dropPosition: A, keyEntities: N } }, r.setExpandedKeys = function (o) { var f = r.state, p = f.treeData, v = f.fieldNames, y = D1(p, o, v); r.setUncontrolledState({ expandedKeys: o, flattenNodes: y }, !0) }, r.onNodeExpand = function (o, f) { var p = r.state.expandedKeys, v = r.state, y = v.listChanging, w = v.fieldNames, P = r.props, k = P.onExpand, A = P.loadData, N = f.expanded, R = f[w.key]; if (!y) { var M = p.indexOf(R), O = !N; if (Rr(N && M !== -1 || !N && M === -1, "Expand state not sync with index check"), O ? p = Bs(p, R) : p = ss(p, R), r.setExpandedKeys(p), k == null || k(p, { node: f, expanded: O, nativeEvent: o.nativeEvent }), O && A) { var z = r.onNodeLoad(f); z && z.then(function () { var B = D1(r.state.treeData, p, w); r.setUncontrolledState({ flattenNodes: B }) }).catch(function () { var B = r.state.expandedKeys, V = ss(B, R); r.setExpandedKeys(V) }) } } }, r.onListChangeStart = function () { r.setUncontrolledState({ listChanging: !0 }) }, r.onListChangeEnd = function () { setTimeout(function () { r.setUncontrolledState({ listChanging: !1 }) }) }, r.onActiveChange = function (o) { var f = r.state.activeKey, p = r.props.onActiveChange; f !== o && (r.setState({ activeKey: o }), o !== null && r.scrollTo({ key: o }), p == null || p(o)) }, r.getActiveItem = function () { var o = r.state, f = o.activeKey, p = o.flattenNodes; return f === null ? null : p.find(function (v) { var y = v.key; return y === f }) || null }, r.offsetActiveKey = function (o) { var f = r.state, p = f.flattenNodes, v = f.activeKey, y = p.findIndex(function (k) { var A = k.key; return A === v }); y === -1 && o < 0 && (y = p.length), y = (y + o + p.length) % p.length; var w = p[y]; if (w) { var P = w.key; r.onActiveChange(P) } else r.onActiveChange(null) }, r.onKeyDown = function (o) { var f = r.state, p = f.activeKey, v = f.expandedKeys, y = f.checkedKeys, w = f.fieldNames, P = r.props, k = P.onKeyDown, A = P.checkable, N = P.selectable; switch (o.which) { case St.UP: { r.offsetActiveKey(-1), o.preventDefault(); break } case St.DOWN: { r.offsetActiveKey(1), o.preventDefault(); break } }var R = r.getActiveItem(); if (R && R.data) { var M = r.getTreeNodeRequiredProps(), O = R.data.isLeaf === !1 || !!(R.data[w.children] || []).length, z = Ci(ge(ge({}, mp(p, M)), {}, { data: R.data, active: !0 })); switch (o.which) { case St.LEFT: { O && v.includes(p) ? r.onNodeExpand({}, z) : R.parent && r.onActiveChange(R.parent.key), o.preventDefault(); break } case St.RIGHT: { O && !v.includes(p) ? r.onNodeExpand({}, z) : R.children && R.children.length && r.onActiveChange(R.children[0].key), o.preventDefault(); break } case St.ENTER: case St.SPACE: { A && !z.disabled && z.checkable !== !1 && !z.disableCheckbox ? r.onNodeCheck({}, z, !y.includes(p)) : !A && N && !z.disabled && z.selectable !== !1 && r.onNodeSelect({}, z); break } } } k == null || k(o) }, r.setUncontrolledState = function (o) { var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, p = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; if (!r.destroyed) { var v = !1, y = !0, w = {}; Object.keys(o).forEach(function (P) { if (P in r.props) { y = !1; return } v = !0, w[P] = o[P] }), v && (!f || y) && r.setState(ge(ge({}, w), p)) } }, r.scrollTo = function (o) { r.listRef.current.scrollTo(o) }, r } return Fr(n, [{ key: "componentDidMount", value: function () { this.destroyed = !1, this.onUpdated() } }, { key: "componentDidUpdate", value: function () { this.onUpdated() } }, { key: "onUpdated", value: function () { var i = this.props.activeKey; i !== void 0 && i !== this.state.activeKey && (this.setState({ activeKey: i }), i !== null && this.scrollTo({ key: i })) } }, { key: "componentWillUnmount", value: function () { window.removeEventListener("dragend", this.onWindowDragEnd), this.destroyed = !0 } }, { key: "resetDragState", value: function () { this.setState({ dragOverNodeKey: null, dropPosition: null, dropLevelOffset: null, dropTargetKey: null, dropContainerKey: null, dropTargetPos: null, dropAllowed: !1 }) } }, { key: "render", value: function () { var i, s = this.state, c = s.focused, o = s.flattenNodes, f = s.keyEntities, p = s.draggingNodeKey, v = s.activeKey, y = s.dropLevelOffset, w = s.dropContainerKey, P = s.dropTargetKey, k = s.dropPosition, A = s.dragOverNodeKey, N = s.indent, R = this.props, M = R.prefixCls, O = R.className, z = R.style, B = R.showLine, V = R.focusable, G = R.tabIndex, j = G === void 0 ? 0 : G, X = R.selectable, Y = R.showIcon, se = R.icon, ee = R.switcherIcon, Z = R.draggable, J = R.checkable, ve = R.checkStrictly, ie = R.disabled, ce = R.motion, oe = R.loadData, ye = R.filterTreeNode, Ie = R.height, Te = R.itemHeight, Pe = R.virtual, De = R.titleRender, Re = R.dropIndicatorRender, ke = R.onContextMenu, Oe = R.onScroll, $e = R.direction, He = R.rootClassName, Ue = R.rootStyle, st = uu(this.props, { aria: !0, data: !0 }), ft; return Z && (ln(Z) === "object" ? ft = Z : typeof Z == "function" ? ft = { nodeDraggable: Z } : ft = {}), I(q2.Provider, { value: { prefixCls: M, selectable: X, showIcon: Y, icon: se, switcherIcon: ee, draggable: ft, draggingNodeKey: p, checkable: J, checkStrictly: ve, disabled: ie, keyEntities: f, dropLevelOffset: y, dropContainerKey: w, dropTargetKey: P, dropPosition: k, dragOverNodeKey: A, indent: N, direction: $e, dropIndicatorRender: Re, loadData: oe, filterTreeNode: ye, titleRender: De, onNodeClick: this.onNodeClick, onNodeDoubleClick: this.onNodeDoubleClick, onNodeExpand: this.onNodeExpand, onNodeSelect: this.onNodeSelect, onNodeCheck: this.onNodeCheck, onNodeLoad: this.onNodeLoad, onNodeMouseEnter: this.onNodeMouseEnter, onNodeMouseLeave: this.onNodeMouseLeave, onNodeContextMenu: this.onNodeContextMenu, onNodeDragStart: this.onNodeDragStart, onNodeDragEnter: this.onNodeDragEnter, onNodeDragOver: this.onNodeDragOver, onNodeDragLeave: this.onNodeDragLeave, onNodeDragEnd: this.onNodeDragEnd, onNodeDrop: this.onNodeDrop }, children: I("div", { role: "tree", className: Xe(M, O, He, (i = {}, re(i, "".concat(M, "-show-line"), B), re(i, "".concat(M, "-focused"), c), re(i, "".concat(M, "-active-focused"), v !== null), i)), style: Ue, children: I(qz, { ref: this.listRef, prefixCls: M, style: z, data: o, disabled: ie, selectable: X, checkable: !!J, motion: ce, dragging: p !== null, height: Ie, itemHeight: Te, virtual: Pe, focusable: V, focused: c, tabIndex: j, activeItem: this.getActiveItem(), onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, onActiveChange: this.onActiveChange, onListChangeStart: this.onListChangeStart, onListChangeEnd: this.onListChangeEnd, onContextMenu: ke, onScroll: Oe, ...this.getTreeNodeRequiredProps(), ...st }) }) }) } }], [{ key: "getDerivedStateFromProps", value: function (i, s) { var c = s.prevProps, o = { prevProps: i }; function f(V) { return !c && V in i || c && c[V] !== i[V] } var p, v = s.fieldNames; if (f("fieldNames") && (v = Wy(i.fieldNames), o.fieldNames = v), f("treeData") ? p = i.treeData : f("children") && (Rr(!1, "`children` of Tree is deprecated. Please use `treeData` instead."), p = IL(i.children)), p) { o.treeData = p; var y = ix(p, { fieldNames: v }); o.keyEntities = ge(re({}, Ec, Gz), y.keyEntities) } var w = o.keyEntities || s.keyEntities; if (f("expandedKeys") || c && f("autoExpandParent")) o.expandedKeys = i.autoExpandParent || !c && i.defaultExpandParent ? nC(i.expandedKeys, w) : i.expandedKeys; else if (!c && i.defaultExpandAll) { var P = ge({}, w); delete P[Ec], o.expandedKeys = Object.keys(P).map(function (V) { return P[V].key }) } else !c && i.defaultExpandedKeys && (o.expandedKeys = i.autoExpandParent || i.defaultExpandParent ? nC(i.defaultExpandedKeys, w) : i.defaultExpandedKeys); if (o.expandedKeys || delete o.expandedKeys, p || o.expandedKeys) { var k = D1(p || s.treeData, o.expandedKeys || s.expandedKeys, v); o.flattenNodes = k } if (i.selectable && (f("selectedKeys") ? o.selectedKeys = lI(i.selectedKeys, i) : !c && i.defaultSelectedKeys && (o.selectedKeys = lI(i.defaultSelectedKeys, i))), i.checkable) { var A; if (f("checkedKeys") ? A = O1(i.checkedKeys) || {} : !c && i.defaultCheckedKeys ? A = O1(i.defaultCheckedKeys) || {} : p && (A = O1(i.checkedKeys) || { checkedKeys: s.checkedKeys, halfCheckedKeys: s.halfCheckedKeys }), A) { var N = A, R = N.checkedKeys, M = R === void 0 ? [] : R, O = N.halfCheckedKeys, z = O === void 0 ? [] : O; if (!i.checkStrictly) { var B = Qs(M, !0, w); M = B.checkedKeys, z = B.halfCheckedKeys } o.checkedKeys = M, o.halfCheckedKeys = z } } return f("loadedKeys") && (o.loadedKeys = i.loadedKeys), o } }]), n }(C.exports.Component); mx.defaultProps = { prefixCls: "rc-tree", showLine: !1, showIcon: !0, selectable: !0, multiple: !1, checkable: !1, disabled: !1, checkStrictly: !1, draggable: !1, defaultExpandParent: !0, autoExpandParent: !1, defaultExpandAll: !1, defaultExpandedKeys: [], defaultCheckedKeys: [], defaultSelectedKeys: [], dropIndicatorRender: eae, allowDrop: function () { return !0 }, expandAction: !1 }; mx.TreeNode = Sc; var nae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z" } }] }, name: "holder", theme: "outlined" }; const rae = nae; var Zz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: rae }) }) }; Zz.displayName = "HolderOutlined"; const iae = C.exports.forwardRef(Zz); var x3 = 4; function oae(e) { var t, n = e.dropPosition, r = e.dropLevelOffset, i = e.prefixCls, s = e.indent, c = e.direction, o = c === void 0 ? "ltr" : c, f = o === "ltr" ? "left" : "right", p = o === "ltr" ? "right" : "left", v = (t = {}, re(t, f, -r * s + x3), re(t, p, 0), t); switch (n) { case -1: v.top = -3; break; case 1: v.bottom = -3; break; default: v.bottom = -3, v[f] = s + x3; break }return I("div", { style: v, className: "".concat(i, "-drop-indicator") }) } var aae = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, name: "caret-down", theme: "filled" }; const sae = aae; var Xz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: sae }) }) }; Xz.displayName = "CaretDownFilled"; const lae = C.exports.forwardRef(Xz); var uae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z" } }] }, name: "file", theme: "outlined" }; const cae = uae; var Yz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: cae }) }) }; Yz.displayName = "FileOutlined"; const Qz = C.exports.forwardRef(Yz); var dae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "minus-square", theme: "outlined" }; const fae = dae; var Jz = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: fae }) }) }; Jz.displayName = "MinusSquareOutlined"; const hae = C.exports.forwardRef(Jz); var pae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "plus-square", theme: "outlined" }; const mae = pae; var e5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: mae }) }) }; e5.displayName = "PlusSquareOutlined"; const vae = C.exports.forwardRef(e5); function t5(e, t, n, r) { var i = r.isLeaf, s = r.expanded, c = r.loading; if (c) return I(of, { className: "".concat(e, "-switcher-loading-icon") }); var o; if (n && ln(n) === "object" && (o = n.showLeafIcon), i) { if (!n) return null; if (typeof o != "boolean" && !!o) { var f = typeof o == "function" ? o(r) : o, p = "".concat(e, "-switcher-line-custom-icon"); return zo(f) ? li(f, { className: Xe(f.props.className || "", p) }) : f } return o ? I(Qz, { className: "".concat(e, "-switcher-line-icon") }) : I("span", { className: "".concat(e, "-switcher-leaf-line") }) } var v = "".concat(e, "-switcher-icon"), y = typeof t == "function" ? t(r) : t; return zo(y) ? li(y, { className: Xe(y.props.className || "", v) }) : y || (n ? s ? I(hae, { className: "".concat(e, "-switcher-line-icon") }) : I(vae, { className: "".concat(e, "-switcher-line-icon") }) : I(lae, { className: v })) } var gae = C.exports.forwardRef(function (e, t) { var n, r = C.exports.useContext(zn), i = r.getPrefixCls, s = r.direction, c = r.virtual, o = e.prefixCls, f = e.className, p = e.showIcon, v = p === void 0 ? !1 : p, y = e.showLine, w = e.switcherIcon, P = e.blockNode, k = P === void 0 ? !1 : P, A = e.children, N = e.checkable, R = N === void 0 ? !1 : N, M = e.selectable, O = M === void 0 ? !0 : M, z = e.draggable, B = e.motion, V = B === void 0 ? tt(tt({}, qp), { motionAppear: !1 }) : B, G = i("tree", o), j = tt(tt({}, e), { checkable: R, selectable: O, showIcon: v, motion: V, blockNode: k, showLine: Boolean(y), dropIndicatorRender: oae }), X = C.exports.useMemo(function () { if (!z) return !1; var Y = {}; switch (ln(z)) { case "function": Y.nodeDraggable = z; break; case "object": Y = tt({}, z); break }return Y.icon !== !1 && (Y.icon = Y.icon || I(iae, {})), Y }, [z]); return I(mx, { itemHeight: 20, ref: t, virtual: c, ...j, prefixCls: G, className: Xe((n = {}, re(n, "".concat(G, "-icon-hide"), !v), re(n, "".concat(G, "-block-node"), k), re(n, "".concat(G, "-unselectable"), !O), re(n, "".concat(G, "-rtl"), s === "rtl"), n), f), direction: s, checkable: R && I("span", { className: "".concat(G, "-checkbox-inner") }), selectable: O, switcherIcon: function (se) { return t5(G, w, y, se) }, draggable: X, children: A }) }); const n5 = gae; var yae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, name: "folder-open", theme: "outlined" }; const xae = yae; var r5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: xae }) }) }; r5.displayName = "FolderOpenOutlined"; const _ae = C.exports.forwardRef(r5); var bae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, name: "folder", theme: "outlined" }; const wae = bae; var i5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: wae }) }) }; i5.displayName = "FolderOutlined"; const Cae = C.exports.forwardRef(i5); var Us; (function (e) { e[e.None = 0] = "None", e[e.Start = 1] = "Start", e[e.End = 2] = "End" })(Us || (Us = {})); function iE(e, t) { function n(r) { var i = r.key, s = r.children; t(i, r) !== !1 && iE(s || [], t) } e.forEach(n) } function Sae(e) { var t = e.treeData, n = e.expandedKeys, r = e.startKey, i = e.endKey, s = [], c = Us.None; if (r && r === i) return [r]; if (!r || !i) return []; function o(f) { return f === r || f === i } return iE(t, function (f) { if (c === Us.End) return !1; if (o(f)) { if (s.push(f), c === Us.None) c = Us.Start; else if (c === Us.Start) return c = Us.End, !1 } else c === Us.Start && s.push(f); return n.includes(f) }), s } function G1(e, t) { var n = Et(t), r = []; return iE(e, function (i, s) { var c = n.indexOf(i); return c !== -1 && (r.push(s), n.splice(c, 1)), !!n.length }), r } var _3 = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function Eae(e) { var t = e.isLeaf, n = e.expanded; return t ? I(Qz, {}) : n ? I(_ae, {}) : I(Cae, {}) } function b3(e) { var t = e.treeData, n = e.children; return t || IL(n) } var Pae = function (t, n) { var r = t.defaultExpandAll, i = t.defaultExpandParent, s = t.defaultExpandedKeys, c = _3(t, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]), o = C.exports.useRef(), f = C.exports.useRef(), p = function () { var ce = ix(b3(c)), oe = ce.keyEntities, ye; return r ? ye = Object.keys(oe) : i ? ye = nC(c.expandedKeys || s || [], oe) : ye = c.expandedKeys || s, ye }, v = C.exports.useState(c.selectedKeys || c.defaultSelectedKeys || []), y = ze(v, 2), w = y[0], P = y[1], k = C.exports.useState(function () { return p() }), A = ze(k, 2), N = A[0], R = A[1]; C.exports.useEffect(function () { "selectedKeys" in c && P(c.selectedKeys) }, [c.selectedKeys]), C.exports.useEffect(function () { "expandedKeys" in c && R(c.expandedKeys) }, [c.expandedKeys]); var M = function (ce, oe) { var ye; return "expandedKeys" in c || R(ce), (ye = c.onExpand) === null || ye === void 0 ? void 0 : ye.call(c, ce, oe) }, O = function (ce, oe) { var ye, Ie = c.multiple, Te = oe.node, Pe = oe.nativeEvent, De = Te.key, Re = De === void 0 ? "" : De, ke = b3(c), Oe = tt(tt({}, oe), { selected: !0 }), $e = (Pe == null ? void 0 : Pe.ctrlKey) || (Pe == null ? void 0 : Pe.metaKey), He = Pe == null ? void 0 : Pe.shiftKey, Ue; Ie && $e ? (Ue = ce, o.current = Re, f.current = Ue, Oe.selectedNodes = G1(ke, Ue)) : Ie && He ? (Ue = Array.from(new Set([].concat(Et(f.current || []), Et(Sae({ treeData: ke, expandedKeys: N, startKey: Re, endKey: o.current }))))), Oe.selectedNodes = G1(ke, Ue)) : (Ue = [Re], o.current = Re, f.current = Ue, Oe.selectedNodes = G1(ke, Ue)), (ye = c.onSelect) === null || ye === void 0 || ye.call(c, Ue, Oe), "selectedKeys" in c || P(Ue) }, z = C.exports.useContext(zn), B = z.getPrefixCls, V = z.direction, G = c.prefixCls, j = c.className, X = c.showIcon, Y = X === void 0 ? !0 : X, se = c.expandAction, ee = se === void 0 ? "click" : se, Z = _3(c, ["prefixCls", "className", "showIcon", "expandAction"]), J = B("tree", G), ve = Xe("".concat(J, "-directory"), re({}, "".concat(J, "-directory-rtl"), V === "rtl"), j); return I(n5, { icon: Eae, ref: n, blockNode: !0, ...Z, showIcon: Y, expandAction: ee, prefixCls: J, className: ve, expandedKeys: N, selectedKeys: w, onSelect: O, onExpand: M }) }, Tae = C.exports.forwardRef(Pae); const kae = Tae; var oE = n5; oE.DirectoryTree = kae; oE.TreeNode = Sc; const Iae = oE; function Rae(e) { var t = C.exports.useRef(e), n = BD(); return [function () { return t.current }, function (r) { t.current = r, n() }] } function w3(e) { var t = e.value, n = e.onChange, r = e.filterSearch, i = e.tablePrefixCls, s = e.locale; return r ? I("div", { className: "".concat(i, "-filter-dropdown-search"), children: I(Xy, { prefix: I(O2, {}), placeholder: s.filterSearchPlaceholder, onChange: n, value: t, htmlSize: 1, className: "".concat(i, "-filter-dropdown-search-input") }) }) : null } var Mae = function (t) { var n = t.keyCode; n === St.ENTER && t.stopPropagation() }, Aae = function (t) { return I("div", { className: t.className, onClick: function (r) { return r.stopPropagation() }, onKeyDown: Mae, children: t.children }) }; const Nae = Aae; function Oae(e) { return e.some(function (t) { var n = t.children; return n }) } function o5(e, t) { return typeof t == "string" || typeof t == "number" ? t == null ? void 0 : t.toString().toLowerCase().includes(e.trim().toLowerCase()) : !1 } function a5(e) { var t = e.filters, n = e.prefixCls, r = e.filteredKeys, i = e.filterMultiple, s = e.searchValue, c = e.filterSearch; return t.map(function (o, f) { var p = String(o.value); if (o.children) return { key: p || f, label: o.text, popupClassName: "".concat(n, "-dropdown-submenu"), children: a5({ filters: o.children, prefixCls: n, filteredKeys: r, filterMultiple: i, searchValue: s, filterSearch: c }) }; var v = i ? pc : PL, y = { key: o.value !== void 0 ? p : f, label: Qe(An, { children: [I(v, { checked: r.includes(p) }), I("span", { children: o.text })] }) }; return s.trim() ? typeof c == "function" ? c(s, o) ? y : null : o5(s, o.text) ? y : null : y }) } function Dae(e) { var t, n = e.tablePrefixCls, r = e.prefixCls, i = e.column, s = e.dropdownPrefixCls, c = e.columnKey, o = e.filterMultiple, f = e.filterMode, p = f === void 0 ? "menu" : f, v = e.filterSearch, y = v === void 0 ? !1 : v, w = e.filterState, P = e.triggerFilter, k = e.locale, A = e.children, N = e.getPopupContainer, R = i.filterDropdownOpen, M = i.onFilterDropdownOpenChange, O = i.filterDropdownVisible, z = i.onFilterDropdownVisibleChange, B = i.filterResetToDefaultFilteredValue, V = i.defaultFilteredValue, G = C.exports.useState(!1), j = ze(G, 2), X = j[0], Y = j[1], se = !!(w && (((t = w.filteredKeys) === null || t === void 0 ? void 0 : t.length) || w.forceFiltered)), ee = function (Ge) { Y(Ge), M == null || M(Ge), z == null || z(Ge) }, Z; typeof R == "boolean" ? Z = R : Z = typeof O == "boolean" ? O : X; var J = w == null ? void 0 : w.filteredKeys, ve = Rae(J || []), ie = ze(ve, 2), ce = ie[0], oe = ie[1], ye = function (Ge) { var Zt = Ge.selectedKeys; oe(Zt) }, Ie = function (Ge, Zt) { var cn = Zt.node, jt = Zt.checked; ye(o ? { selectedKeys: Ge } : { selectedKeys: jt && cn.key ? [cn.key] : [] }) }; C.exports.useEffect(function () { !X || ye({ selectedKeys: J || [] }) }, [J]); var Te = C.exports.useState([]), Pe = ze(Te, 2), De = Pe[0], Re = Pe[1], ke = function (Ge) { Re(Ge) }, Oe = C.exports.useState(""), $e = ze(Oe, 2), He = $e[0], Ue = $e[1], st = function (Ge) { var Zt = Ge.target.value; Ue(Zt) }; C.exports.useEffect(function () { X || Ue("") }, [X]); var ft = function (Ge) { var Zt = Ge && Ge.length ? Ge : null; if (Zt === null && (!w || !w.filteredKeys) || h3(Zt, w == null ? void 0 : w.filteredKeys)) return null; P({ column: i, key: c, filteredKeys: Zt }) }, It = function () { ee(!1), ft(ce()) }, We = function () { var Ge = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { confirm: !1, closeDropdown: !1 }, Zt = Ge.confirm, cn = Ge.closeDropdown; Zt && ft([]), cn && ee(!1), Ue(""), oe(B ? (V || []).map(function (jt) { return String(jt) }) : []) }, Pt = function () { var Ge = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { closeDropdown: !0 }, Zt = Ge.closeDropdown; Zt && ee(!1), ft(ce()) }, pt = function (Ge) { Ge && J !== void 0 && oe(J || []), ee(Ge), !Ge && !i.filterDropdown && It() }, Rt = Xe(re({}, "".concat(s, "-menu-without-submenu"), !Oae(i.filters || []))), yt = function (Ge) { if (Ge.target.checked) { var Zt = Gd(i == null ? void 0 : i.filters).map(function (cn) { return String(cn) }); oe(Zt) } else oe([]) }, Mt = function Fe(Ge) { var Zt = Ge.filters; return (Zt || []).map(function (cn, jt) { var Kt = String(cn.value), nn = { title: cn.text, key: cn.value !== void 0 ? Kt : jt }; return cn.children && (nn.children = Fe({ filters: cn.children })), nn }) }, ut = function Fe(Ge) { var Zt; return tt(tt({}, Ge), { text: Ge.title, value: Ge.key, children: ((Zt = Ge.children) === null || Zt === void 0 ? void 0 : Zt.map(function (cn) { return Fe(cn) })) || [] }) }, dt; if (typeof i.filterDropdown == "function") dt = i.filterDropdown({ prefixCls: "".concat(s, "-custom"), setSelectedKeys: function (Ge) { return ye({ selectedKeys: Ge }) }, selectedKeys: ce(), confirm: Pt, clearFilters: We, filters: i.filters, visible: Z, close: function () { ee(!1) } }); else if (i.filterDropdown) dt = i.filterDropdown; else { var ct = ce() || [], rt = function () { return (i.filters || []).length === 0 ? I(cs, { image: cs.PRESENTED_IMAGE_SIMPLE, description: k.filterEmptyText, imageStyle: { height: 24 }, style: { margin: 0, padding: "16px 0" } }) : p === "tree" ? Qe(An, { children: [I(w3, { filterSearch: y, value: He, onChange: st, tablePrefixCls: n, locale: k }), Qe("div", { className: "".concat(n, "-filter-dropdown-tree"), children: [o ? I(pc, { checked: ct.length === Gd(i.filters).length, indeterminate: ct.length > 0 && ct.length < Gd(i.filters).length, className: "".concat(n, "-filter-dropdown-checkall"), onChange: yt, children: k.filterCheckall }) : null, I(Iae, { checkable: !0, selectable: !1, blockNode: !0, multiple: o, checkStrictly: !o, className: "".concat(s, "-menu"), onCheck: Ie, checkedKeys: ct, selectedKeys: ct, showIcon: !1, treeData: Mt({ filters: i.filters }), autoExpandParent: !0, defaultExpandAll: !0, filterTreeNode: He.trim() ? function (Ge) { return typeof y == "function" ? y(He, ut(Ge)) : o5(He, Ge.title) } : void 0 })] })] }) : Qe(An, { children: [I(w3, { filterSearch: y, value: He, onChange: st, tablePrefixCls: n, locale: k }), I(cL, { selectable: !0, multiple: o, prefixCls: "".concat(s, "-menu"), className: Rt, onSelect: ye, onDeselect: ye, selectedKeys: ct, getPopupContainer: N, openKeys: De, onOpenChange: ke, items: a5({ filters: i.filters || [], filterSearch: y, prefixCls: r, filteredKeys: ce(), filterMultiple: o, searchValue: He }) })] }) }, ht = function () { return B ? h3((V || []).map(function (Ge) { return String(Ge) }), ct) : ct.length === 0 }; dt = Qe(An, { children: [rt(), Qe("div", { className: "".concat(r, "-dropdown-btns"), children: [I(gr, { type: "link", size: "small", disabled: ht(), onClick: function () { return We() }, children: k.filterReset }), I(gr, { type: "primary", size: "small", onClick: It, children: k.filterConfirm })] })] }) } i.filterDropdown && (dt = I(uL, { selectable: void 0, children: dt })); var bt = function () { return I(Nae, { className: "".concat(r, "-dropdown"), children: dt }) }, Wt; typeof i.filterIcon == "function" ? Wt = i.filterIcon(se) : i.filterIcon ? Wt = i.filterIcon : Wt = I(KJ, {}); var Ut = C.exports.useContext(zn), Jt = Ut.direction; return Qe("div", { className: "".concat(r, "-column"), children: [I("span", { className: "".concat(n, "-column-title"), children: A }), I(K2, { dropdownRender: bt, trigger: ["click"], open: Z, onOpenChange: pt, getPopupContainer: N, placement: Jt === "rtl" ? "bottomLeft" : "bottomRight", children: I("span", { role: "button", tabIndex: -1, className: Xe("".concat(r, "-trigger"), { active: se }), onClick: function (Ge) { Ge.stopPropagation() }, children: Wt }) })] }) } function gC(e, t, n) { var r = []; return (e || []).forEach(function (i, s) { var c, o = ux(s, n); if (i.filters || "filterDropdown" in i || "onFilter" in i) if ("filteredValue" in i) { var f = i.filteredValue; "filterDropdown" in i || (f = (c = f == null ? void 0 : f.map(String)) !== null && c !== void 0 ? c : f), r.push({ column: i, key: uf(i, o), filteredKeys: f, forceFiltered: i.filtered }) } else r.push({ column: i, key: uf(i, o), filteredKeys: t && i.defaultFilteredValue ? i.defaultFilteredValue : void 0, forceFiltered: i.filtered }); "children" in i && (r = [].concat(Et(r), Et(gC(i.children, t, o)))) }), r } function s5(e, t, n, r, i, s, c, o) { return n.map(function (f, p) { var v = ux(p, o), y = f.filterMultiple, w = y === void 0 ? !0 : y, P = f.filterMode, k = f.filterSearch, A = f; if (A.filters || A.filterDropdown) { var N = uf(A, v), R = r.find(function (M) { var O = M.key; return N === O }); A = tt(tt({}, A), { title: function (O) { return I(Dae, { tablePrefixCls: e, prefixCls: "".concat(e, "-filter"), dropdownPrefixCls: t, column: A, columnKey: N, filterState: R, filterMultiple: w, filterMode: P, filterSearch: k, triggerFilter: i, locale: c, getPopupContainer: s, children: cx(f.title, O) }) } }) } return "children" in A && (A = tt(tt({}, A), { children: s5(e, t, A.children, r, i, s, c, v) })), A }) } function Gd(e) { var t = []; return (e || []).forEach(function (n) { var r = n.value, i = n.children; t.push(r), i && (t = [].concat(Et(t), Et(Gd(i)))) }), t } function C3(e) { var t = {}; return e.forEach(function (n) { var r = n.key, i = n.filteredKeys, s = n.column, c = s.filters, o = s.filterDropdown; if (o) t[r] = i || null; else if (Array.isArray(i)) { var f = Gd(c); t[r] = f.filter(function (p) { return i.includes(String(p)) }) } else t[r] = null }), t } function S3(e, t) { return t.reduce(function (n, r) { var i = r.column, s = i.onFilter, c = i.filters, o = r.filteredKeys; return s && o && o.length ? n.filter(function (f) { return o.some(function (p) { var v = Gd(c), y = v.findIndex(function (P) { return String(P) === String(p) }), w = y !== -1 ? v[y] : p; return s(w, f) }) }) : n }, e) } function Lae(e) { var t = e.prefixCls, n = e.dropdownPrefixCls, r = e.mergedColumns, i = e.onFilterChange, s = e.getPopupContainer, c = e.locale, o = C.exports.useState(function () { return gC(r, !0) }), f = ze(o, 2), p = f[0], v = f[1], y = C.exports.useMemo(function () { var A = gC(r, !1), N = !0; return A.forEach(function (R) { var M = R.filteredKeys; M !== void 0 && (N = !1) }), N ? p : A }, [r, p]), w = C.exports.useMemo(function () { return C3(y) }, [y]), P = function (N) { var R = y.filter(function (M) { var O = M.key; return O !== N.key }); R.push(N), v(R), i(C3(R), R) }, k = function (N) { return s5(t, n, N, y, P, s, c) }; return [k, y, w] } function zae(e, t, n) { var r = C.exports.useRef({}); function i(s) { if (!r.current || r.current.data !== e || r.current.childrenColumnName !== t || r.current.getRowKey !== n) { let f = function (p) { p.forEach(function (v, y) { var w = n(v, y); c.set(w, v), v && ln(v) === "object" && t in v && f(v[t] || []) }) }; var o = f, c = new Map; f(e), r.current = { data: e, childrenColumnName: t, kvMap: c, getRowKey: n } } return r.current.kvMap.get(s) } return [i] } var Fae = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, l5 = 10; function $ae(e, t) { var n = { current: t.current, pageSize: t.pageSize }, r = e && ln(e) === "object" ? e : {}; return Object.keys(r).forEach(function (i) { var s = t[i]; typeof s != "function" && (n[i] = s) }), n } function Bae() { for (var e = {}, t = arguments.length, n = new Array(t), r = 0; r < t; r++)n[r] = arguments[r]; return n.forEach(function (i) { i && Object.keys(i).forEach(function (s) { var c = i[s]; c !== void 0 && (e[s] = c) }) }), e } function Vae(e, t, n) { var r = t && ln(t) === "object" ? t : {}, i = r.total, s = i === void 0 ? 0 : i, c = Fae(r, ["total"]), o = C.exports.useState(function () { return { current: "defaultCurrent" in c ? c.defaultCurrent : 1, pageSize: "defaultPageSize" in c ? c.defaultPageSize : l5 } }), f = ze(o, 2), p = f[0], v = f[1], y = Bae(p, c, { total: s > 0 ? s : e }), w = Math.ceil((s || e) / y.pageSize); y.current > w && (y.current = w || 1); var P = function (N, R) { v({ current: N != null ? N : 1, pageSize: R || y.pageSize }) }, k = function (N, R) { var M; t && ((M = t.onChange) === null || M === void 0 || M.call(t, N, R)), P(N, R), n(N, R || (y == null ? void 0 : y.pageSize)) }; return t === !1 ? [{}, function () { }] : [tt(tt({}, y), { onChange: k }), P] } var $l = {}, yC = "SELECT_ALL", xC = "SELECT_INVERT", _C = "SELECT_NONE", E3 = []; function u5(e, t) { var n = []; return (e || []).forEach(function (r) { n.push(r), r && ln(r) === "object" && t in r && (n = [].concat(Et(n), Et(u5(r[t], t)))) }), n } function Uae(e, t) { var n = e || {}, r = n.preserveSelectedRowKeys, i = n.selectedRowKeys, s = n.defaultSelectedRowKeys, c = n.getCheckboxProps, o = n.onChange, f = n.onSelect, p = n.onSelectAll, v = n.onSelectInvert, y = n.onSelectNone, w = n.onSelectMultiple, P = n.columnWidth, k = n.type, A = n.selections, N = n.fixed, R = n.renderCell, M = n.hideSelectAll, O = n.checkStrictly, z = O === void 0 ? !0 : O, B = t.prefixCls, V = t.data, G = t.pageData, j = t.getRecordByKey, X = t.getRowKey, Y = t.expandType, se = t.childrenColumnName, ee = t.locale, Z = t.getPopupContainer, J = Bi(i || s || E3, { value: i }), ve = ze(J, 2), ie = ve[0], ce = ve[1], oe = C.exports.useRef(new Map), ye = C.exports.useCallback(function (ut) { if (r) { var dt = new Map; ut.forEach(function (ct) { var rt = j(ct); !rt && oe.current.has(ct) && (rt = oe.current.get(ct)), dt.set(ct, rt) }), oe.current = dt } }, [j, r]); C.exports.useEffect(function () { ye(ie) }, [ie]); var Ie = C.exports.useMemo(function () { return z ? { keyEntities: null } : ix(V, { externalGetKey: X, childrenPropName: se }) }, [V, X, z, se]), Te = Ie.keyEntities, Pe = C.exports.useMemo(function () { return u5(G, se) }, [G, se]), De = C.exports.useMemo(function () { var ut = new Map; return Pe.forEach(function (dt, ct) { var rt = X(dt, ct), ht = (c ? c(dt) : null) || {}; ut.set(rt, ht) }), ut }, [Pe, X, c]), Re = C.exports.useCallback(function (ut) { var dt; return !!(!((dt = De.get(X(ut))) === null || dt === void 0) && dt.disabled) }, [De, X]), ke = C.exports.useMemo(function () { if (z) return [ie || [], []]; var ut = Qs(ie, !0, Te, Re), dt = ut.checkedKeys, ct = ut.halfCheckedKeys; return [dt || [], ct] }, [ie, z, Te, Re]), Oe = ze(ke, 2), $e = Oe[0], He = Oe[1], Ue = C.exports.useMemo(function () { var ut = k === "radio" ? $e.slice(0, 1) : $e; return new Set(ut) }, [$e, k]), st = C.exports.useMemo(function () { return k === "radio" ? new Set : new Set(He) }, [He, k]), ft = C.exports.useState(null), It = ze(ft, 2), We = It[0], Pt = It[1]; C.exports.useEffect(function () { e || ce(E3) }, [!!e]); var pt = C.exports.useCallback(function (ut, dt) { var ct, rt; ye(ut), r ? (ct = ut, rt = ut.map(function (ht) { return oe.current.get(ht) })) : (ct = [], rt = [], ut.forEach(function (ht) { var bt = j(ht); bt !== void 0 && (ct.push(ht), rt.push(bt)) })), ce(ct), o == null || o(ct, rt, { type: dt }) }, [ce, j, o, r]), Rt = C.exports.useCallback(function (ut, dt, ct, rt) { if (f) { var ht = ct.map(function (bt) { return j(bt) }); f(j(ut), dt, ht, rt) } pt(ct, "single") }, [f, j, pt]), yt = C.exports.useMemo(function () { if (!A || M) return null; var ut = A === !0 ? [yC, xC, _C] : A; return ut.map(function (dt) { return dt === yC ? { key: "all", text: ee.selectionAll, onSelect: function () { pt(V.map(function (rt, ht) { return X(rt, ht) }).filter(function (rt) { var ht = De.get(rt); return !(ht != null && ht.disabled) || Ue.has(rt) }), "all") } } : dt === xC ? { key: "invert", text: ee.selectInvert, onSelect: function () { var rt = new Set(Ue); G.forEach(function (bt, Wt) { var Ut = X(bt, Wt), Jt = De.get(Ut); Jt != null && Jt.disabled || (rt.has(Ut) ? rt.delete(Ut) : rt.add(Ut)) }); var ht = Array.from(rt); v && v(ht), pt(ht, "invert") } } : dt === _C ? { key: "none", text: ee.selectNone, onSelect: function () { y == null || y(), pt(Array.from(Ue).filter(function (rt) { var ht = De.get(rt); return ht == null ? void 0 : ht.disabled }), "none") } } : dt }).map(function (dt) { return tt(tt({}, dt), { onSelect: function () { for (var rt, ht, bt = arguments.length, Wt = new Array(bt), Ut = 0; Ut < bt; Ut++)Wt[Ut] = arguments[Ut]; (ht = dt.onSelect) === null || ht === void 0 || (rt = ht).call.apply(rt, [dt].concat(Wt)), Pt(null) } }) }) }, [A, Ue, G, X, v, pt]), Mt = C.exports.useCallback(function (ut) { var dt; if (!e) return ut.filter(function (dn) { return dn !== $l }); var ct = Et(ut), rt = new Set(Ue), ht = Pe.map(X).filter(function (dn) { return !De.get(dn).disabled }), bt = ht.every(function (dn) { return rt.has(dn) }), Wt = ht.some(function (dn) { return rt.has(dn) }), Ut = function () { var zt = []; bt ? ht.forEach(function (mt) { rt.delete(mt), zt.push(mt) }) : ht.forEach(function (mt) { rt.has(mt) || (rt.add(mt), zt.push(mt)) }); var ot = Array.from(rt); p == null || p(!bt, ot.map(function (mt) { return j(mt) }), zt.map(function (mt) { return j(mt) })), pt(ot, "all"), Pt(null) }, Jt; if (k !== "radio") { var Fe; if (yt) { var Ge = { getPopupContainer: Z, items: yt.map(function (dn, zt) { var ot = dn.key, mt = dn.text, Dt = dn.onSelect; return { key: ot || zt, onClick: function () { Dt == null || Dt(ht) }, label: mt } }) }; Fe = I("div", { className: "".concat(B, "-selection-extra"), children: I(K2, { menu: Ge, getPopupContainer: Z, children: I("span", { children: I(N2, {}) }) }) }) } var Zt = Pe.map(function (dn, zt) { var ot = X(dn, zt), mt = De.get(ot) || {}; return tt({ checked: rt.has(ot) }, mt) }).filter(function (dn) { var zt = dn.disabled; return zt }), cn = !!Zt.length && Zt.length === Pe.length, jt = cn && Zt.every(function (dn) { var zt = dn.checked; return zt }), Kt = cn && Zt.some(function (dn) { var zt = dn.checked; return zt }); Jt = !M && Qe("div", { className: "".concat(B, "-selection"), children: [I(pc, { checked: cn ? jt : !!Pe.length && bt, indeterminate: cn ? !jt && Kt : !bt && Wt, onChange: Ut, disabled: Pe.length === 0 || cn, "aria-label": Fe ? "Custom selection" : "Select all", skipGroup: !0 }), Fe] }) } var nn; k === "radio" ? nn = function (zt, ot, mt) { var Dt = X(ot, mt), Bt = rt.has(Dt); return { node: I(PL, { ...De.get(Dt), checked: Bt, onClick: function (On) { return On.stopPropagation() }, onChange: function (On) { rt.has(Dt) || Rt(Dt, !0, [Dt], On.nativeEvent) } }), checked: Bt } } : nn = function (zt, ot, mt) { var Dt, Bt = X(ot, mt), pn = rt.has(Bt), On = st.has(Bt), Zn = De.get(Bt), Xn; return Y === "nest" ? Xn = On : Xn = (Dt = Zn == null ? void 0 : Zn.indeterminate) !== null && Dt !== void 0 ? Dt : On, { node: I(pc, { ...Zn, indeterminate: Xn, checked: pn, skipGroup: !0, onClick: function (H) { return H.stopPropagation() }, onChange: function (H) { var q = H.nativeEvent, de = q.shiftKey, le = -1, xe = -1; if (de && z) { var Ee = new Set([We, Bt]); ht.some(function (Vt, bn) { if (Ee.has(Vt)) if (le === -1) le = bn; else return xe = bn, !0; return !1 }) } if (xe !== -1 && le !== xe && z) { var be = ht.slice(le, xe + 1), Ce = []; pn ? be.forEach(function (Vt) { rt.has(Vt) && (Ce.push(Vt), rt.delete(Vt)) }) : be.forEach(function (Vt) { rt.has(Vt) || (Ce.push(Vt), rt.add(Vt)) }); var Le = Array.from(rt); w == null || w(!pn, Le.map(function (Vt) { return j(Vt) }), Ce.map(function (Vt) { return j(Vt) })), pt(Le, "multiple") } else { var qe = $e; if (z) { var Ze = pn ? ss(qe, Bt) : Bs(qe, Bt); Rt(Bt, !pn, Ze, q) } else { var Ve = Qs([].concat(Et(qe), [Bt]), !0, Te, Re), Lt = Ve.checkedKeys, Ct = Ve.halfCheckedKeys, Je = Lt; if (pn) { var Ot = new Set(Lt); Ot.delete(Bt), Je = Qs(Array.from(Ot), { checked: !1, halfCheckedKeys: Ct }, Te, Re).checkedKeys } Rt(Bt, !pn, Je, q) } } Pt(pn ? null : Bt) } }), checked: pn } }; var Cn = function (zt, ot, mt) { var Dt = nn(zt, ot, mt), Bt = Dt.node, pn = Dt.checked; return R ? R(pn, ot, mt, Bt) : Bt }; if (!ct.includes($l)) if (ct.findIndex(function (dn) { var zt; return ((zt = dn[gp]) === null || zt === void 0 ? void 0 : zt.columnType) === "EXPAND_COLUMN" }) === 0) { var Nn = ct, wt = JS(Nn), qt = wt[0], At = wt.slice(1); ct = [qt, $l].concat(Et(At)) } else ct = [$l].concat(Et(ct)); var Xt = ct.indexOf($l); ct = ct.filter(function (dn, zt) { return dn !== $l || zt === Xt }); var en = ct[Xt - 1], gt = ct[Xt + 1], yn = N; yn === void 0 && ((gt == null ? void 0 : gt.fixed) !== void 0 ? yn = gt.fixed : (en == null ? void 0 : en.fixed) !== void 0 && (yn = en.fixed)), yn && en && ((dt = en[gp]) === null || dt === void 0 ? void 0 : dt.columnType) === "EXPAND_COLUMN" && en.fixed === void 0 && (en.fixed = yn); var Sn = re({ fixed: yn, width: P, className: "".concat(B, "-selection-column"), title: e.columnTitle || Jt, render: Cn }, gp, { className: "".concat(B, "-selection-col") }); return ct.map(function (dn) { return dn === $l ? Sn : dn }) }, [X, Pe, e, $e, Ue, st, P, yt, Y, We, De, w, Rt, Re]); return [Mt, Ue] } var jae = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, name: "caret-down", theme: "outlined" }; const Kae = jae; var c5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Kae }) }) }; c5.displayName = "CaretDownOutlined"; const Hae = C.exports.forwardRef(c5); var Wae = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, name: "caret-up", theme: "outlined" }; const Gae = Wae; var d5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Gae }) }) }; d5.displayName = "CaretUpOutlined"; const qae = C.exports.forwardRef(d5); var Xg = "ascend", q1 = "descend"; function Jy(e) { return ln(e.sorter) === "object" && typeof e.sorter.multiple == "number" ? e.sorter.multiple : !1 } function P3(e) { return typeof e == "function" ? e : e && ln(e) === "object" && e.compare ? e.compare : !1 } function Zae(e, t) { return t ? e[e.indexOf(t) + 1] : e[0] } function bC(e, t, n) { var r = []; function i(s, c) { r.push({ column: s, key: uf(s, c), multiplePriority: Jy(s), sortOrder: s.sortOrder }) } return (e || []).forEach(function (s, c) { var o = ux(c, n); s.children ? ("sortOrder" in s && i(s, o), r = [].concat(Et(r), Et(bC(s.children, t, o)))) : s.sorter && ("sortOrder" in s ? i(s, o) : t && s.defaultSortOrder && r.push({ column: s, key: uf(s, o), multiplePriority: Jy(s), sortOrder: s.defaultSortOrder })) }), r } function f5(e, t, n, r, i, s, c, o) { return (t || []).map(function (f, p) { var v = ux(p, o), y = f; if (y.sorter) { var w = y.sortDirections || i, P = y.showSorterTooltip === void 0 ? c : y.showSorterTooltip, k = uf(y, v), A = n.find(function (Y) { var se = Y.key; return se === k }), N = A ? A.sortOrder : null, R = Zae(w, N), M = w.includes(Xg) && I(qae, { className: Xe("".concat(e, "-column-sorter-up"), { active: N === Xg }), role: "presentation" }), O = w.includes(q1) && I(Hae, { className: Xe("".concat(e, "-column-sorter-down"), { active: N === q1 }), role: "presentation" }), z = s || {}, B = z.cancelSort, V = z.triggerAsc, G = z.triggerDesc, j = B; R === q1 ? j = G : R === Xg && (j = V); var X = ln(P) === "object" ? P : { title: j }; y = tt(tt({}, y), { className: Xe(y.className, re({}, "".concat(e, "-column-sort"), N)), title: function (se) { var ee = Qe("div", { className: "".concat(e, "-column-sorters"), children: [I("span", { className: "".concat(e, "-column-title"), children: cx(f.title, se) }), I("span", { className: Xe("".concat(e, "-column-sorter"), re({}, "".concat(e, "-column-sorter-full"), !!(M && O))), children: Qe("span", { className: "".concat(e, "-column-sorter-inner"), children: [M, O] }) })] }); return P ? I(io, { ...X, children: ee }) : ee }, onHeaderCell: function (se) { var ee = f.onHeaderCell && f.onHeaderCell(se) || {}, Z = ee.onClick, J = ee.onKeyDown; ee.onClick = function (ce) { r({ column: f, key: k, sortOrder: R, multiplePriority: Jy(f) }), Z == null || Z(ce) }, ee.onKeyDown = function (ce) { ce.keyCode === St.ENTER && (r({ column: f, key: k, sortOrder: R, multiplePriority: Jy(f) }), J == null || J(ce)) }; var ve = VJ(f.title, {}), ie = ve == null ? void 0 : ve.toString(); return N ? ee["aria-sort"] = N === "ascend" ? "ascending" : "descending" : ee["aria-label"] = ie || "", ee.className = Xe(ee.className, "".concat(e, "-column-has-sorters")), ee.tabIndex = 0, f.ellipsis && (ee.title = (ve != null ? ve : "").toString()), ee } }) } return "children" in y && (y = tt(tt({}, y), { children: f5(e, y.children, n, r, i, s, c, v) })), y }) } function T3(e) { var t = e.column, n = e.sortOrder; return { column: t, order: n, field: t.dataIndex, columnKey: t.key } } function k3(e) { var t = e.filter(function (n) { var r = n.sortOrder; return r }).map(T3); return t.length === 0 && e.length ? tt(tt({}, T3(e[e.length - 1])), { column: void 0 }) : t.length <= 1 ? t[0] || {} : t } function wC(e, t, n) { var r = t.slice().sort(function (c, o) { return o.multiplePriority - c.multiplePriority }), i = e.slice(), s = r.filter(function (c) { var o = c.column.sorter, f = c.sortOrder; return P3(o) && f }); return s.length ? i.sort(function (c, o) { for (var f = 0; f < s.length; f += 1) { var p = s[f], v = p.column.sorter, y = p.sortOrder, w = P3(v); if (w && y) { var P = w(c, o, y); if (P !== 0) return y === Xg ? P : -P } } return 0 }).map(function (c) { var o = c[n]; return o ? tt(tt({}, c), re({}, n, wC(o, t, n))) : c }) : i } function Xae(e) { var t = e.prefixCls, n = e.mergedColumns, r = e.onSorterChange, i = e.sortDirections, s = e.tableLocale, c = e.showSorterTooltip, o = C.exports.useState(bC(n, !0)), f = ze(o, 2), p = f[0], v = f[1], y = C.exports.useMemo(function () { var N = !0, R = bC(n, !1); if (!R.length) return p; var M = []; function O(B) { N ? M.push(B) : M.push(tt(tt({}, B), { sortOrder: null })) } var z = null; return R.forEach(function (B) { z === null ? (O(B), B.sortOrder && (B.multiplePriority === !1 ? N = !1 : z = !0)) : (z && B.multiplePriority !== !1 || (N = !1), O(B)) }), M }, [n, p]), w = C.exports.useMemo(function () { var N = y.map(function (R) { var M = R.column, O = R.sortOrder; return { column: M, order: O } }); return { sortColumns: N, sortColumn: N[0] && N[0].column, sortOrder: N[0] && N[0].order } }, [y]); function P(N) { var R; N.multiplePriority === !1 || !y.length || y[0].multiplePriority === !1 ? R = [N] : R = [].concat(Et(y.filter(function (M) { var O = M.key; return O !== N.key })), [N]), v(R), r(k3(R), R) } var k = function (R) { return f5(t, R, y, P, i, s, c) }, A = function () { return k3(y) }; return [k, y, w, A] } function h5(e, t) { return e.map(function (n) { var r = tt({}, n); return r.title = cx(n.title, t), "children" in r && (r.children = h5(r.children, t)), r }) } function Yae(e) { var t = C.exports.useCallback(function (n) { return h5(n, e) }, [e]); return [t] } var Qae = []; function Jae(e, t) { var n, r = e.prefixCls, i = e.className, s = e.style, c = e.size, o = e.bordered, f = e.dropdownPrefixCls, p = e.dataSource, v = e.pagination, y = e.rowSelection, w = e.rowKey, P = w === void 0 ? "key" : w, k = e.rowClassName, A = e.columns, N = e.children, R = e.childrenColumnName, M = e.onChange, O = e.getPopupContainer, z = e.loading, B = e.expandIcon, V = e.expandable, G = e.expandedRowRender, j = e.expandIconColumnIndex, X = e.indentSize, Y = e.scroll, se = e.sortDirections, ee = e.locale, Z = e.showSorterTooltip, J = Z === void 0 ? !0 : Z;[["filterDropdownVisible", "filterDropdownOpen"], ["onFilterDropdownVisibleChange", "onFilterDropdownOpenChange"]].forEach(function (Ze) { var Ve = ze(Ze, 2); Ve[0], Ve[1] }); var ve = C.exports.useMemo(function () { return A || nE(N) }, [A, N]), ie = C.exports.useMemo(function () { return ve.some(function (Ze) { return Ze.responsive }) }, [ve]), ce = VD(ie), oe = C.exports.useMemo(function () { var Ze = new Set(Object.keys(ce).filter(function (Ve) { return ce[Ve] })); return ve.filter(function (Ve) { return !Ve.responsive || Ve.responsive.some(function (Lt) { return Ze.has(Lt) }) }) }, [ve, ce]), ye = vi(e, ["className", "style", "columns"]), Ie = C.exports.useContext(qa), Te = C.exports.useContext(zn), Pe = Te.locale, De = Pe === void 0 ? ol : Pe, Re = Te.renderEmpty, ke = Te.direction, Oe = c || Ie, $e = tt(tt({}, De.Table), ee), He = p || Qae, Ue = C.exports.useContext(zn), st = Ue.getPrefixCls, ft = st("table", r), It = st("dropdown", f), We = tt({ childrenColumnName: R, expandIconColumnIndex: j }, V), Pt = We.childrenColumnName, pt = Pt === void 0 ? "children" : Pt, Rt = C.exports.useMemo(function () { return He.some(function (Ze) { return Ze == null ? void 0 : Ze[pt] }) ? "nest" : G || V && V.expandedRowRender ? "row" : null }, [He]), yt = { body: C.exports.useRef() }, Mt = C.exports.useMemo(function () { return typeof P == "function" ? P : function (Ze) { return Ze == null ? void 0 : Ze[P] } }, [P]), ut = zae(He, pt, Mt), dt = ze(ut, 1), ct = dt[0], rt = {}, ht = function (Ve, Lt) { var Ct = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, Je = tt(tt({}, rt), Ve); Ct && (rt.resetPagination(), Je.pagination.current && (Je.pagination.current = 1), v && v.onChange && v.onChange(1, Je.pagination.pageSize)), Y && Y.scrollToFirstRowOnChange !== !1 && yt.body.current && mK(0, { getContainer: function () { return yt.body.current } }), M == null || M(Je.pagination, Je.filters, Je.sorter, { currentDataSource: S3(wC(He, Je.sorterStates, pt), Je.filterStates), action: Lt }) }, bt = function (Ve, Lt) { ht({ sorter: Ve, sorterStates: Lt }, "sort", !1) }, Wt = Xae({ prefixCls: ft, mergedColumns: oe, onSorterChange: bt, sortDirections: se || ["ascend", "descend"], tableLocale: $e, showSorterTooltip: J }), Ut = ze(Wt, 4), Jt = Ut[0], Fe = Ut[1], Ge = Ut[2], Zt = Ut[3], cn = C.exports.useMemo(function () { return wC(He, Fe, pt) }, [He, Fe]); rt.sorter = Zt(), rt.sorterStates = Fe; var jt = function (Ve, Lt) { ht({ filters: Ve, filterStates: Lt }, "filter", !0) }, Kt = Lae({ prefixCls: ft, locale: $e, dropdownPrefixCls: It, mergedColumns: oe, onFilterChange: jt, getPopupContainer: O }), nn = ze(Kt, 3), Cn = nn[0], Nn = nn[1], wt = nn[2], qt = S3(cn, Nn); rt.filters = wt, rt.filterStates = Nn; var At = C.exports.useMemo(function () { var Ze = {}; return Object.keys(wt).forEach(function (Ve) { wt[Ve] !== null && (Ze[Ve] = wt[Ve]) }), tt(tt({}, Ge), { filters: Ze }) }, [Ge, wt]), Xt = Yae(At), en = ze(Xt, 1), gt = en[0], yn = function (Ve, Lt) { ht({ pagination: tt(tt({}, rt.pagination), { current: Ve, pageSize: Lt }) }, "paginate") }, Sn = Vae(qt.length, v, yn), dn = ze(Sn, 2), zt = dn[0], ot = dn[1]; rt.pagination = v === !1 ? {} : $ae(v, zt), rt.resetPagination = ot; var mt = C.exports.useMemo(function () { if (v === !1 || !zt.pageSize) return qt; var Ze = zt.current, Ve = Ze === void 0 ? 1 : Ze, Lt = zt.total, Ct = zt.pageSize, Je = Ct === void 0 ? l5 : Ct; return qt.length < Lt ? qt.length > Je ? qt.slice((Ve - 1) * Je, Ve * Je) : qt : qt.slice((Ve - 1) * Je, Ve * Je) }, [!!v, qt, zt && zt.current, zt && zt.pageSize, zt && zt.total]), Dt = Uae(y, { prefixCls: ft, data: qt, pageData: mt, getRowKey: Mt, getRecordByKey: ct, expandType: Rt, childrenColumnName: pt, locale: $e, getPopupContainer: O }), Bt = ze(Dt, 2), pn = Bt[0], On = Bt[1], Zn = function (Ve, Lt, Ct) { var Je; return typeof k == "function" ? Je = Xe(k(Ve, Lt, Ct)) : Je = Xe(k), Xe(re({}, "".concat(ft, "-row-selected"), On.has(Mt(Ve, Lt))), Je) }; We.__PARENT_RENDER_ICON__ = We.expandIcon, We.expandIcon = We.expandIcon || B || BJ($e), Rt === "nest" && We.expandIconColumnIndex === void 0 ? We.expandIconColumnIndex = y ? 1 : 0 : We.expandIconColumnIndex > 0 && y && (We.expandIconColumnIndex -= 1), typeof We.indentSize != "number" && (We.indentSize = typeof X == "number" ? X : 15); var Xn = C.exports.useCallback(function (Ze) { return gt(pn(Cn(Jt(Ze)))) }, [Jt, Cn, pn]), me, H; if (v !== !1 && (zt == null ? void 0 : zt.total)) { var q; zt.size ? q = zt.size : q = Oe === "small" || Oe === "middle" ? "small" : void 0; var de = function (Ve) { return I(cQ, { ...zt, className: Xe("".concat(ft, "-pagination ").concat(ft, "-pagination-").concat(Ve), zt.className), size: q }) }, le = ke === "rtl" ? "left" : "right", xe = zt.position; if (xe !== null && Array.isArray(xe)) { var Ee = xe.find(function (Ze) { return Ze.includes("top") }), be = xe.find(function (Ze) { return Ze.includes("bottom") }), Ce = xe.every(function (Ze) { return "".concat(Ze) === "none" }); !Ee && !be && !Ce && (H = de(le)), Ee && (me = de(Ee.toLowerCase().replace("top", ""))), be && (H = de(be.toLowerCase().replace("bottom", ""))) } else H = de(le) } var Le; typeof z == "boolean" ? Le = { spinning: z } : ln(z) === "object" && (Le = tt({ spinning: !0 }, z)); var qe = Xe("".concat(ft, "-wrapper"), re({}, "".concat(ft, "-wrapper-rtl"), ke === "rtl"), i); return I("div", { ref: t, className: qe, style: s, children: Qe(Pf, { spinning: !1, ...Le, children: [me, I(Nc, { ...ye, columns: oe, direction: ke, expandable: We, prefixCls: ft, className: Xe((n = {}, re(n, "".concat(ft, "-middle"), Oe === "middle"), re(n, "".concat(ft, "-small"), Oe === "small"), re(n, "".concat(ft, "-bordered"), o), re(n, "".concat(ft, "-empty"), He.length === 0), n)), data: mt, rowKey: Mt, rowClassName: Zn, emptyText: ee && ee.emptyText || (Re || M2)("Table"), internalHooks: Zg, internalRefs: yt, transformColumns: Xn }), H] }) }) } var ese = C.exports.forwardRef(Jae), hl = ese; hl.SELECTION_COLUMN = $l; hl.EXPAND_COLUMN = Nc.EXPAND_COLUMN; hl.SELECTION_ALL = yC; hl.SELECTION_INVERT = xC; hl.SELECTION_NONE = _C; hl.Column = FJ; hl.ColumnGroup = $J; hl.Summary = Nz; const p5 = hl; var m5 = C.exports.createContext(null), v5 = C.exports.createContext(null); function tse(e) { return Array.isArray(e) ? e : e !== void 0 ? [e] : [] } function nse(e) { var t = e || {}, n = t.label, r = t.value, i = t.children, s = r || "value"; return { _title: n ? [n] : ["title", "label"], value: s, key: s, children: i || "children" } } function CC(e) { return !e || e.disabled || e.disableCheckbox || e.checkable === !1 } function rse(e, t) { var n = []; function r(i) { i.forEach(function (s) { var c = s[t.children]; c && (n.push(s[t.value]), r(c)) }) } return r(e), n } function I3(e) { return e == null } var ise = { width: 0, height: 0, display: "flex", overflow: "hidden", opacity: 0, border: 0, padding: 0, margin: 0 }, ose = function (t, n) { var r = YO(), i = r.prefixCls, s = r.multiple, c = r.searchValue, o = r.toggleOpen, f = r.open, p = r.notFoundContent, v = C.exports.useContext(v5), y = v.virtual, w = v.listHeight, P = v.listItemHeight, k = v.treeData, A = v.fieldNames, N = v.onSelect, R = v.dropdownMatchSelectWidth, M = v.treeExpandAction, O = C.exports.useContext(m5), z = O.checkable, B = O.checkedKeys, V = O.halfCheckedKeys, G = O.treeExpandedKeys, j = O.treeDefaultExpandAll, X = O.treeDefaultExpandedKeys, Y = O.onTreeExpand, se = O.treeIcon, ee = O.showTreeIcon, Z = O.switcherIcon, J = O.treeLine, ve = O.treeNodeFilterProp, ie = O.loadData, ce = O.treeLoadedKeys, oe = O.treeMotion, ye = O.onTreeLoad, Ie = O.keyEntities, Te = C.exports.useRef(), Pe = cm(function () { return k }, [f, k], function (bt, Wt) { return Wt[0] && bt[1] !== Wt[1] }), De = C.exports.useMemo(function () { return z ? { checked: B, halfChecked: V } : null }, [z, B, V]); C.exports.useEffect(function () { if (f && !s && B.length) { var bt; (bt = Te.current) === null || bt === void 0 || bt.scrollTo({ key: B[0] }) } }, [f]); var Re = String(c).toLowerCase(), ke = function (Wt) { return Re ? String(Wt[ve]).toLowerCase().includes(Re) : !1 }, Oe = C.exports.useState(X), $e = ze(Oe, 2), He = $e[0], Ue = $e[1], st = C.exports.useState(null), ft = ze(st, 2), It = ft[0], We = ft[1], Pt = C.exports.useMemo(function () { return G ? Et(G) : c ? It : He }, [He, It, G, c]); C.exports.useEffect(function () { c && We(rse(k, A)) }, [c]); var pt = function (Wt) { Ue(Wt), We(Wt), Y && Y(Wt) }, Rt = function (Wt) { Wt.preventDefault() }, yt = function (Wt, Ut) { var Jt = Ut.node; z && CC(Jt) || (N(Jt.key, { selected: !B.includes(Jt.key) }), s || o(!1)) }, Mt = C.exports.useState(null), ut = ze(Mt, 2), dt = ut[0], ct = ut[1], rt = Ie[dt]; if (C.exports.useImperativeHandle(n, function () { var bt; return { scrollTo: (bt = Te.current) === null || bt === void 0 ? void 0 : bt.scrollTo, onKeyDown: function (Ut) { var Jt, Fe = Ut.which; switch (Fe) { case St.UP: case St.DOWN: case St.LEFT: case St.RIGHT: (Jt = Te.current) === null || Jt === void 0 || Jt.onKeyDown(Ut); break; case St.ENTER: { if (rt) { var Ge = (rt == null ? void 0 : rt.node) || {}, Zt = Ge.selectable, cn = Ge.value; Zt !== !1 && yt(null, { node: { key: dt }, selected: !B.includes(cn) }) } break } case St.ESC: o(!1) } }, onKeyUp: function () { } } }), Pe.length === 0) return I("div", { role: "listbox", className: "".concat(i, "-empty"), onMouseDown: Rt, children: p }); var ht = { fieldNames: A }; return ce && (ht.loadedKeys = ce), Pt && (ht.expandedKeys = Pt), Qe("div", { onMouseDown: Rt, children: [rt && f && I("span", { style: ise, "aria-live": "assertive", children: rt.node.value }), I(mx, { ref: Te, focusable: !1, prefixCls: "".concat(i, "-tree"), treeData: Pe, height: w, itemHeight: P, virtual: y !== !1 && R !== !1, multiple: s, icon: se, showIcon: ee, switcherIcon: Z, showLine: J, loadData: c ? null : ie, motion: oe, activeKey: dt, checkable: z, checkStrictly: !0, checkedKeys: De, selectedKeys: z ? [] : B, defaultExpandAll: j, ...ht, onActiveChange: ct, onSelect: yt, onCheck: yt, onExpand: pt, onLoad: ye, filterTreeNode: ke, expandAction: M })] }) }, g5 = C.exports.forwardRef(ose); g5.displayName = "OptionList"; var aE = function () { return null }, y5 = "SHOW_ALL", sE = "SHOW_PARENT", vx = "SHOW_CHILD"; function R3(e, t, n, r) { var i = new Set(e); return t === vx ? e.filter(function (s) { var c = n[s]; return !(c && c.children && c.children.some(function (o) { var f = o.node; return i.has(f[r.value]) }) && c.children.every(function (o) { var f = o.node; return CC(f) || i.has(f[r.value]) })) }) : t === sE ? e.filter(function (s) { var c = n[s], o = c ? c.parent : null; return !(o && !CC(o.node) && i.has(o.key)) }) : e } var ase = ["children", "value"]; function x5(e) { return Zi(e).map(function (t) { if (!C.exports.isValidElement(t) || !t.type) return null; var n = t, r = n.key, i = n.props, s = i.children, c = i.value, o = Rn(i, ase), f = ge({ key: r, value: c }, o), p = x5(s); return p.length && (f.children = p), f }).filter(function (t) { return t }) } function SC(e) { if (!e) return e; var t = ge({}, e); return "props" in t || Object.defineProperty(t, "props", { get: function () { return Rr(!1, "New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."), t } }), t } function sse(e, t, n, r, i, s) { var c = null, o = null; function f() { function p(v) { var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "0", w = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1; return v.map(function (P, k) { var A = "".concat(y, "-").concat(k), N = P[s.value], R = n.includes(N), M = p(P[s.children] || [], A, R), O = I(aE, { ...P, children: M.map(function (B) { return B.node }) }); if (t === N && (c = O), R) { var z = { pos: A, node: O, children: M }; return w || o.push(z), z } return null }).filter(function (P) { return P }) } o || (o = [], p(r), o.sort(function (v, y) { var w = v.node.props.value, P = y.node.props.value, k = n.indexOf(w), A = n.indexOf(P); return k - A })) } Object.defineProperty(e, "triggerNode", { get: function () { return Rr(!1, "`triggerNode` is deprecated. Please consider decoupling data with node."), f(), c } }), Object.defineProperty(e, "allCheckedNodes", { get: function () { return Rr(!1, "`allCheckedNodes` is deprecated. Please consider decoupling data with node."), f(), i ? o : o.map(function (v) { var y = v.node; return y }) } }) } function lse(e, t) { var n = t.id, r = t.pId, i = t.rootPId, s = {}, c = [], o = e.map(function (f) { var p = ge({}, f), v = p[n]; return s[v] = p, p.key = p.key || v, p }); return o.forEach(function (f) { var p = f[r], v = s[p]; v && (v.children = v.children || [], v.children.push(f)), (p === i || !v && i === null) && c.push(f) }), c } function use(e, t, n) { return C.exports.useMemo(function () { return e ? n ? lse(e, ge({ id: "id", pId: "pId", rootPId: null }, n !== !0 ? n : {})) : e : x5(t) }, [t, n, e]) } const cse = function (e) { var t = C.exports.useRef({ valueLabels: new Map }); return C.exports.useMemo(function () { var n = t.current.valueLabels, r = new Map, i = e.map(function (s) { var c, o = s.value, f = (c = s.label) !== null && c !== void 0 ? c : n.get(o); return r.set(o, f), ge(ge({}, s), {}, { label: f }) }); return t.current.valueLabels = r, [i] }, [e]) }; function M3(e) { var t = C.exports.useRef(); t.current = e; var n = C.exports.useCallback(function () { return t.current.apply(t, arguments) }, []); return n } const dse = function (e, t) { return C.exports.useMemo(function () { var n = ix(e, { fieldNames: t, initWrapper: function (i) { return ge(ge({}, i), {}, { valueEntities: new Map }) }, processEntity: function (i, s) { var c = i.node[t.value]; s.valueEntities.set(c, i) } }); return n }, [e, t]) }, fse = function (e, t, n, r) { return C.exports.useMemo(function () { var i = e.map(function (f) { var p = f.value; return p }), s = t.map(function (f) { var p = f.value; return p }), c = i.filter(function (f) { return !r[f] }); if (n) { var o = Qs(i, !0, r); i = o.checkedKeys, s = o.halfCheckedKeys } return [Array.from(new Set([].concat(Et(c), Et(i)))), s] }, [e, t, n, r]) }, hse = function (e, t, n) { var r = n.treeNodeFilterProp, i = n.filterTreeNode, s = n.fieldNames, c = s.children; return C.exports.useMemo(function () { if (!t || i === !1) return e; var o; if (typeof i == "function") o = i; else { var f = t.toUpperCase(); o = function (y, w) { var P = w[r]; return String(P).toUpperCase().includes(f) } } function p(v) { var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; return v.map(function (w) { var P = w[c], k = y || o(t, SC(w)), A = p(P || [], k); return k || A.length ? ge(ge({}, w), {}, re({ isLeaf: void 0 }, c, A)) : null }).filter(function (w) { return w }) } return p(e) }, [e, t, c, r, i]) }; var pse = ["id", "prefixCls", "value", "defaultValue", "onChange", "onSelect", "onDeselect", "searchValue", "inputValue", "onSearch", "autoClearSearchValue", "filterTreeNode", "treeNodeFilterProp", "showCheckedStrategy", "treeNodeLabelProp", "multiple", "treeCheckable", "treeCheckStrictly", "labelInValue", "fieldNames", "treeDataSimpleMode", "treeData", "children", "loadData", "treeLoadedKeys", "onTreeLoad", "treeDefaultExpandAll", "treeExpandedKeys", "treeDefaultExpandedKeys", "onTreeExpand", "treeExpandAction", "virtual", "listHeight", "listItemHeight", "onDropdownVisibleChange", "dropdownMatchSelectWidth", "treeLine", "treeIcon", "showTreeIcon", "switcherIcon", "treeMotion"]; function mse(e) { return !e || ln(e) !== "object" } var vse = C.exports.forwardRef(function (e, t) { var n = e.id, r = e.prefixCls, i = r === void 0 ? "rc-tree-select" : r, s = e.value, c = e.defaultValue, o = e.onChange, f = e.onSelect, p = e.onDeselect, v = e.searchValue, y = e.inputValue, w = e.onSearch, P = e.autoClearSearchValue, k = P === void 0 ? !0 : P, A = e.filterTreeNode, N = e.treeNodeFilterProp, R = N === void 0 ? "value" : N, M = e.showCheckedStrategy, O = M === void 0 ? vx : M, z = e.treeNodeLabelProp, B = e.multiple, V = e.treeCheckable, G = e.treeCheckStrictly, j = e.labelInValue, X = e.fieldNames, Y = e.treeDataSimpleMode, se = e.treeData, ee = e.children, Z = e.loadData, J = e.treeLoadedKeys, ve = e.onTreeLoad, ie = e.treeDefaultExpandAll, ce = e.treeExpandedKeys, oe = e.treeDefaultExpandedKeys, ye = e.onTreeExpand, Ie = e.treeExpandAction, Te = e.virtual, Pe = e.listHeight, De = Pe === void 0 ? 200 : Pe, Re = e.listItemHeight, ke = Re === void 0 ? 20 : Re, Oe = e.onDropdownVisibleChange, $e = e.dropdownMatchSelectWidth, He = $e === void 0 ? !0 : $e, Ue = e.treeLine, st = e.treeIcon, ft = e.showTreeIcon, It = e.switcherIcon, We = e.treeMotion, Pt = Rn(e, pse), pt = bD(n), Rt = V && !G, yt = V || G, Mt = G || j, ut = yt || B, dt = Bi(c, { value: s }), ct = ze(dt, 2), rt = ct[0], ht = ct[1], bt = C.exports.useMemo(function () { return nse(X) }, [JSON.stringify(X)]), Wt = Bi("", { value: v !== void 0 ? v : y, postState: function (xe) { return xe || "" } }), Ut = ze(Wt, 2), Jt = Ut[0], Fe = Ut[1], Ge = function (xe) { Fe(xe), w == null || w(xe) }, Zt = use(se, ee, Y), cn = dse(Zt, bt), jt = cn.keyEntities, Kt = cn.valueEntities, nn = C.exports.useCallback(function (le) { var xe = [], Ee = []; return le.forEach(function (be) { Kt.has(be) ? Ee.push(be) : xe.push(be) }), { missingRawValues: xe, existRawValues: Ee } }, [Kt]), Cn = hse(Zt, Jt, { fieldNames: bt, treeNodeFilterProp: R, filterTreeNode: A }), Nn = C.exports.useCallback(function (le) { if (le) { if (z) return le[z]; for (var xe = bt._title, Ee = 0; Ee < xe.length; Ee += 1) { var be = le[xe[Ee]]; if (be !== void 0) return be } } }, [bt, z]), wt = C.exports.useCallback(function (le) { var xe = tse(le); return xe.map(function (Ee) { return mse(Ee) ? { value: Ee } : Ee }) }, []), qt = C.exports.useCallback(function (le) { var xe = wt(le); return xe.map(function (Ee) { var be = Ee.label, Ce = Ee.value, Le = Ee.halfChecked, qe, Ze = Kt.get(Ce); if (Ze) { var Ve; be = (Ve = be) !== null && Ve !== void 0 ? Ve : Nn(Ze.node), qe = Ze.node.disabled } else if (be === void 0) { var Lt = wt(rt).find(function (Ct) { return Ct.value === Ce }); be = Lt.label } return { label: be, value: Ce, halfChecked: Le, disabled: qe } }) }, [Kt, Nn, wt, rt]), At = C.exports.useMemo(function () { return wt(rt) }, [wt, rt]), Xt = C.exports.useMemo(function () { var le = [], xe = []; return At.forEach(function (Ee) { Ee.halfChecked ? xe.push(Ee) : le.push(Ee) }), [le, xe] }, [At]), en = ze(Xt, 2), gt = en[0], yn = en[1], Sn = C.exports.useMemo(function () { return gt.map(function (le) { return le.value }) }, [gt]), dn = fse(gt, yn, Rt, jt), zt = ze(dn, 2), ot = zt[0], mt = zt[1], Dt = C.exports.useMemo(function () { var le = R3(ot, O, jt, bt), xe = le.map(function (Le) { var qe, Ze, Ve; return (qe = (Ze = jt[Le]) === null || Ze === void 0 || (Ve = Ze.node) === null || Ve === void 0 ? void 0 : Ve[bt.value]) !== null && qe !== void 0 ? qe : Le }), Ee = xe.map(function (Le) { var qe = gt.find(function (Ze) { return Ze.value === Le }); return { value: Le, label: qe == null ? void 0 : qe.label } }), be = qt(Ee), Ce = be[0]; return !ut && Ce && I3(Ce.value) && I3(Ce.label) ? [] : be.map(function (Le) { var qe; return ge(ge({}, Le), {}, { label: (qe = Le.label) !== null && qe !== void 0 ? qe : Le.value }) }) }, [bt, ut, ot, gt, qt, O, jt]), Bt = cse(Dt), pn = ze(Bt, 1), On = pn[0], Zn = M3(function (le, xe, Ee) { var be = qt(le); if (ht(be), k && Fe(""), o) { var Ce = le; if (Rt) { var Le = R3(le, O, jt, bt); Ce = Le.map(function (un) { var wn = Kt.get(un); return wn ? wn.node[bt.value] : un }) } var qe = xe || { triggerValue: void 0, selected: void 0 }, Ze = qe.triggerValue, Ve = qe.selected, Lt = Ce; if (G) { var Ct = yn.filter(function (un) { return !Ce.includes(un.value) }); Lt = [].concat(Et(Lt), Et(Ct)) } var Je = qt(Lt), Ot = { preValue: gt, triggerValue: Ze }, Vt = !0; (G || Ee === "selection" && !Ve) && (Vt = !1), sse(Ot, Ze, le, Zt, Vt, bt), yt ? Ot.checked = Ve : Ot.selected = Ve; var bn = Mt ? Je : Je.map(function (un) { return un.value }); o(ut ? bn : bn[0], Mt ? null : Je.map(function (un) { return un.label }), Ot) } }), Xn = C.exports.useCallback(function (le, xe) { var Ee, be = xe.selected, Ce = xe.source, Le = jt[le], qe = Le == null ? void 0 : Le.node, Ze = (Ee = qe == null ? void 0 : qe[bt.value]) !== null && Ee !== void 0 ? Ee : le; if (!ut) Zn([Ze], { selected: !0, triggerValue: Ze }, "option"); else { var Ve = be ? [].concat(Et(Sn), [Ze]) : ot.filter(function (wn) { return wn !== Ze }); if (Rt) { var Lt = nn(Ve), Ct = Lt.missingRawValues, Je = Lt.existRawValues, Ot = Je.map(function (wn) { return Kt.get(wn).key }), Vt; if (be) { var bn = Qs(Ot, !0, jt); Vt = bn.checkedKeys } else { var un = Qs(Ot, { checked: !1, halfCheckedKeys: mt }, jt); Vt = un.checkedKeys } Ve = [].concat(Et(Ct), Et(Vt.map(function (wn) { return jt[wn].node[bt.value] }))) } Zn(Ve, { selected: be, triggerValue: Ze }, Ce || "option") } be || !ut ? f == null || f(Ze, SC(qe)) : p == null || p(Ze, SC(qe)) }, [nn, Kt, jt, bt, ut, Sn, Zn, Rt, f, p, ot, mt]), me = C.exports.useCallback(function (le) { if (Oe) { var xe = {}; Object.defineProperty(xe, "documentClickClose", { get: function () { return Rr(!1, "Second param of `onDropdownVisibleChange` has been removed."), !1 } }), Oe(le, xe) } }, [Oe]), H = M3(function (le, xe) { var Ee = le.map(function (be) { return be.value }); if (xe.type === "clear") { Zn(Ee, {}, "selection"); return } xe.values.length && Xn(xe.values[0].value, { selected: !1, source: "selection" }) }), q = C.exports.useMemo(function () { return { virtual: Te, dropdownMatchSelectWidth: He, listHeight: De, listItemHeight: ke, treeData: Cn, fieldNames: bt, onSelect: Xn, treeExpandAction: Ie } }, [Te, He, De, ke, Cn, bt, Xn, Ie]), de = C.exports.useMemo(function () { return { checkable: yt, loadData: Z, treeLoadedKeys: J, onTreeLoad: ve, checkedKeys: ot, halfCheckedKeys: mt, treeDefaultExpandAll: ie, treeExpandedKeys: ce, treeDefaultExpandedKeys: oe, onTreeExpand: ye, treeIcon: st, treeMotion: We, showTreeIcon: ft, switcherIcon: It, treeLine: Ue, treeNodeFilterProp: R, keyEntities: jt } }, [yt, Z, J, ve, ot, mt, ie, ce, oe, ye, st, We, ft, It, Ue, R, jt]); return I(v5.Provider, { value: q, children: I(m5.Provider, { value: de, children: I(_D, { ref: t, ...Pt, id: pt, prefixCls: i, mode: ut ? "multiple" : void 0, displayValues: On, onDisplayValuesChange: H, searchValue: Jt, onSearch: Ge, OptionList: g5, emptyOptions: !Zt.length, onDropdownVisibleChange: me, dropdownMatchSelectWidth: He }) }) }) }), Em = vse; Em.TreeNode = aE; Em.SHOW_ALL = y5; Em.SHOW_PARENT = sE; Em.SHOW_CHILD = vx; var gse = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, yse = function (t, n) { var r, i = t.prefixCls, s = t.size, c = t.disabled, o = t.bordered, f = o === void 0 ? !0 : o, p = t.className, v = t.treeCheckable, y = t.multiple, w = t.listHeight, P = w === void 0 ? 256 : w, k = t.listItemHeight, A = k === void 0 ? 26 : k, N = t.placement, R = t.notFoundContent, M = t.switcherIcon, O = t.treeLine, z = t.getPopupContainer, B = t.dropdownClassName, V = t.popupClassName, G = t.treeIcon, j = G === void 0 ? !1 : G, X = t.transitionName, Y = t.choiceTransitionName, se = Y === void 0 ? "" : Y, ee = t.status, Z = t.showArrow, J = t.treeExpandAction, ve = gse(t, ["prefixCls", "size", "disabled", "bordered", "className", "treeCheckable", "multiple", "listHeight", "listItemHeight", "placement", "notFoundContent", "switcherIcon", "treeLine", "getPopupContainer", "dropdownClassName", "popupClassName", "treeIcon", "transitionName", "choiceTransitionName", "status", "showArrow", "treeExpandAction"]), ie = C.exports.useContext(zn), ce = ie.getPopupContainer, oe = ie.getPrefixCls, ye = ie.renderEmpty, Ie = ie.direction, Te = ie.virtual, Pe = ie.dropdownMatchSelectWidth, De = C.exports.useContext(qa), Re = oe("select", i), ke = oe("select-tree", i), Oe = oe("tree-select", i), $e = Mc(Re, Ie), He = $e.compactSize, Ue = $e.compactItemClassnames, st = Xe(V || B, "".concat(Oe, "-dropdown"), re({}, "".concat(Oe, "-dropdown-rtl"), Ie === "rtl")), ft = !!(v || y), It = Z !== void 0 ? Z : ve.loading || !ft, We = C.exports.useContext(Fo), Pt = We.status, pt = We.hasFeedback, Rt = We.isFormItemInput, yt = We.feedbackIcon, Mt = Sf(Pt, ee), ut = LD(tt(tt({}, ve), { multiple: ft, showArrow: It, hasFeedback: pt, feedbackIcon: yt, prefixCls: Re })), dt = ut.suffixIcon, ct = ut.removeIcon, rt = ut.clearIcon, ht; R !== void 0 ? ht = R : ht = (ye || M2)("Select"); var bt = vi(ve, ["suffixIcon", "itemIcon", "removeIcon", "clearIcon", "switcherIcon"]), Wt = function () { return N !== void 0 ? N : Ie === "rtl" ? "bottomRight" : "bottomLeft" }, Ut = He || s || De, Jt = C.exports.useContext(dl), Fe = c != null ? c : Jt, Ge = Xe(!i && Oe, (r = {}, re(r, "".concat(Re, "-lg"), Ut === "large"), re(r, "".concat(Re, "-sm"), Ut === "small"), re(r, "".concat(Re, "-rtl"), Ie === "rtl"), re(r, "".concat(Re, "-borderless"), !f), re(r, "".concat(Re, "-in-form-item"), Rt), r), Ha(Re, Mt, pt), Ue, p), Zt = oe(); return I(Em, { virtual: Te, dropdownMatchSelectWidth: Pe, disabled: Fe, ...bt, ref: n, prefixCls: Re, className: Ge, listHeight: P, listItemHeight: A, treeCheckable: v && I("span", { className: "".concat(Re, "-tree-checkbox-inner") }), treeLine: !!O, inputIcon: dt, multiple: y, placement: Wt(), removeIcon: ct, clearIcon: rt, switcherIcon: function (jt) { return t5(ke, M, O, jt) }, showTreeIcon: j, notFoundContent: ht, getPopupContainer: z || ce, treeMotion: null, dropdownClassName: st, choiceTransitionName: al(Zt, "", se), transitionName: al(Zt, RD(N), X), showArrow: pt || Z, treeExpandAction: J }) }, xse = C.exports.forwardRef(yse), Pm = xse; Pm.TreeNode = aE; Pm.SHOW_ALL = y5; Pm.SHOW_PARENT = sE; Pm.SHOW_CHILD = vx; const _5 = Pm; var _se = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, name: "copy", theme: "outlined" }; const bse = _se; var b5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: bse }) }) }; b5.displayName = "CopyOutlined"; const wse = C.exports.forwardRef(b5); var Cse = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, name: "edit", theme: "outlined" }; const Sse = Cse; var w5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Sse }) }) }; w5.displayName = "EditOutlined"; const Ese = C.exports.forwardRef(w5); var Pse = function () { var e = document.getSelection(); if (!e.rangeCount) return function () { }; for (var t = document.activeElement, n = [], r = 0; r < e.rangeCount; r++)n.push(e.getRangeAt(r)); switch (t.tagName.toUpperCase()) { case "INPUT": case "TEXTAREA": t.blur(); break; default: t = null; break }return e.removeAllRanges(), function () { e.type === "Caret" && e.removeAllRanges(), e.rangeCount || n.forEach(function (i) { e.addRange(i) }), t && t.focus() } }, Tse = Pse, A3 = { "text/plain": "Text", "text/html": "Url", default: "Text" }, kse = "Copy to clipboard: #{key}, Enter"; function Ise(e) { var t = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C"; return e.replace(/#{\s*key\s*}/g, t) } function Rse(e, t) { var n, r, i, s, c, o, f = !1; t || (t = {}), n = t.debug || !1; try { i = Tse(), s = document.createRange(), c = document.getSelection(), o = document.createElement("span"), o.textContent = e, o.ariaHidden = "true", o.style.all = "unset", o.style.position = "fixed", o.style.top = 0, o.style.clip = "rect(0, 0, 0, 0)", o.style.whiteSpace = "pre", o.style.webkitUserSelect = "text", o.style.MozUserSelect = "text", o.style.msUserSelect = "text", o.style.userSelect = "text", o.addEventListener("copy", function (v) { if (v.stopPropagation(), t.format) if (v.preventDefault(), typeof v.clipboardData > "u") { n && console.warn("unable to use e.clipboardData"), n && console.warn("trying IE specific stuff"), window.clipboardData.clearData(); var y = A3[t.format] || A3.default; window.clipboardData.setData(y, e) } else v.clipboardData.clearData(), v.clipboardData.setData(t.format, e); t.onCopy && (v.preventDefault(), t.onCopy(v.clipboardData)) }), document.body.appendChild(o), s.selectNodeContents(o), c.addRange(s); var p = document.execCommand("copy"); if (!p) throw new Error("copy command was unsuccessful"); f = !0 } catch (v) { n && console.error("unable to copy using execCommand: ", v), n && console.warn("trying IE specific stuff"); try { window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), f = !0 } catch (y) { n && console.error("unable to copy using clipboardData: ", y), n && console.error("falling back to prompt"), r = Ise("message" in t ? t.message : kse), window.prompt(r, e) } } finally { c && (typeof c.removeRange == "function" ? c.removeRange(s) : c.removeAllRanges()), o && document.body.removeChild(o), i() } return f } var Mse = Rse, Ase = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z" } }] }, name: "enter", theme: "outlined" }; const Nse = Ase; var C5 = function (t, n) { return I(cr, { ...ge(ge({}, t), {}, { ref: n, icon: Nse }) }) }; C5.displayName = "EnterOutlined"; const Ose = C.exports.forwardRef(C5); var Dse = function (t) { var n = t.prefixCls, r = t["aria-label"], i = t.className, s = t.style, c = t.direction, o = t.maxLength, f = t.autoSize, p = f === void 0 ? !0 : f, v = t.value, y = t.onSave, w = t.onCancel, P = t.onEnd, k = t.component, A = t.enterIcon, N = A === void 0 ? I(Ose, {}) : A, R = C.exports.useRef(null), M = C.exports.useRef(!1), O = C.exports.useRef(), z = C.exports.useState(v), B = ze(z, 2), V = B[0], G = B[1]; C.exports.useEffect(function () { G(v) }, [v]), C.exports.useEffect(function () { if (R.current && R.current.resizableTextArea) { var ce = R.current.resizableTextArea.textArea; ce.focus(); var oe = ce.value.length; ce.setSelectionRange(oe, oe) } }, []); var j = function (oe) { var ye = oe.target; G(ye.value.replace(/[\n\r]/g, "")) }, X = function () { M.current = !0 }, Y = function () { M.current = !1 }, se = function (oe) { var ye = oe.keyCode; M.current || (O.current = ye) }, ee = function () { y(V.trim()) }, Z = function (oe) { var ye = oe.keyCode, Ie = oe.ctrlKey, Te = oe.altKey, Pe = oe.metaKey, De = oe.shiftKey; O.current === ye && !M.current && !Ie && !Te && !Pe && !De && (ye === St.ENTER ? (ee(), P == null || P()) : ye === St.ESC && w()) }, J = function () { ee() }, ve = k ? "".concat(n, "-").concat(k) : "", ie = Xe(n, "".concat(n, "-edit-content"), re({}, "".concat(n, "-rtl"), c === "rtl"), i, ve); return Qe("div", { className: ie, style: s, children: [I(XL, { ref: R, maxLength: o, value: V, onChange: j, onKeyDown: se, onKeyUp: Z, onCompositionStart: X, onCompositionEnd: Y, onBlur: J, "aria-label": r, rows: 1, autoSize: p }), N !== null ? li(N, { className: "".concat(n, "-edit-content-confirm") }) : null] }) }; const Lse = Dse; function Z1(e, t) { return C.exports.useMemo(function () { var n = !!e; return [n, tt(tt({}, t), n && ln(e) === "object" ? e : null)] }, [e]) } var zse = function (t, n) { var r = C.exports.useRef(!1); C.exports.useEffect(function () { r.current ? t() : r.current = !0 }, n) }; const Fse = zse; var $se = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, Bse = C.exports.forwardRef(function (e, t) { var n = e.prefixCls, r = e.component, i = r === void 0 ? "article" : r, s = e.className, c = e.setContentRef, o = e.children, f = e.direction, p = $se(e, ["prefixCls", "component", "className", "setContentRef", "children", "direction"]), v = C.exports.useContext(zn), y = v.getPrefixCls, w = v.direction, P = f != null ? f : w, k = t; c && (k = Po(t, c)); var A = y("typography", n), N = Xe(A, re({}, "".concat(A, "-rtl"), P === "rtl"), s); return I(i, { className: N, ref: k, ...p, children: o }) }); const S5 = Bse; function E5(e) { var t = ln(e); return t === "string" || t === "number" } function Vse(e) { var t = 0; return e.forEach(function (n) { E5(n) ? t += String(n).length : t += 1 }), t } function N3(e, t) { for (var n = 0, r = [], i = 0; i < e.length; i += 1) { if (n === t) return r; var s = e[i], c = E5(s), o = c ? String(s).length : 1, f = n + o; if (f > t) { var p = t - n; return r.push(String(s).slice(0, p)), r } r.push(s), n = f } return e } var Use = 0, bg = 1, O3 = 2, X1 = 3, D3 = 4, jse = function (t) { var n = t.enabledMeasure, r = t.children, i = t.text, s = t.width, c = t.fontSize, o = t.rows, f = t.onEllipsis, p = C.exports.useState([0, 0, 0]), v = ze(p, 2), y = ze(v[0], 3), w = y[0], P = y[1], k = y[2], A = v[1], N = C.exports.useState(Use), R = ze(N, 2), M = R[0], O = R[1], z = C.exports.useState(0), B = ze(z, 2), V = B[0], G = B[1], j = C.exports.useRef(null), X = C.exports.useRef(null), Y = C.exports.useMemo(function () { return Zi(i) }, [i]), se = C.exports.useMemo(function () { return Vse(Y) }, [Y]), ee = C.exports.useMemo(function () { return !n || M !== X1 ? r(Y, !1) : r(N3(Y, P), P < se) }, [n, M, r, Y, P, se]); si(function () { n && s && c && se && (O(bg), A([0, Math.ceil(se / 2), se])) }, [n, s, c, i, se, o]), si(function () { var ie; M === bg && G(((ie = j.current) === null || ie === void 0 ? void 0 : ie.offsetHeight) || 0) }, [M]), si(function () { var ie, ce; if (V) { if (M === bg) { var oe = ((ie = X.current) === null || ie === void 0 ? void 0 : ie.offsetHeight) || 0, ye = o * V; oe <= ye ? (O(D3), f(!1)) : O(O3) } else if (M === O3) if (w !== k) { var Ie = ((ce = X.current) === null || ce === void 0 ? void 0 : ce.offsetHeight) || 0, Te = o * V, Pe = w, De = k; w === k - 1 ? De = w : Ie <= Te ? Pe = P : De = P; var Re = Math.ceil((Pe + De) / 2); A([Pe, Re, De]) } else O(X1), f(!0) } }, [M, w, k, o, V]); var Z = { width: s, whiteSpace: "normal", margin: 0, padding: 0 }, J = function (ce, oe, ye) { return I("span", { "aria-hidden": !0, ref: oe, style: tt({ position: "fixed", display: "block", left: 0, top: 0, zIndex: -9999, visibility: "hidden", pointerEvents: "none", fontSize: Math.floor(c / 2) * 2 }, ye), children: ce }) }, ve = function (ce, oe) { var ye = N3(Y, ce); return J(r(ye, !0), oe, Z) }; return Qe(An, { children: [ee, n && M !== X1 && M !== D3 && Qe(An, { children: [J("lg", j, { wordBreak: "keep-all", whiteSpace: "nowrap" }), M === bg ? J(r(Y, !1), X, Z) : ve(P, X)] })] }) }; const Kse = jse; var Hse = function (t) { var n = t.enabledEllipsis, r = t.isEllipsis, i = t.children, s = t.tooltipProps; return !(s != null && s.title) || !n ? i : I(io, { open: r ? void 0 : !1, ...s, children: i }) }; const Wse = Hse; var Gse = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function qse(e, t) { var n = e.mark, r = e.code, i = e.underline, s = e.delete, c = e.strong, o = e.keyboard, f = e.italic, p = t; function v(y, w) { !y || (p = C.exports.createElement(w, {}, p)) } return v(c, "strong"), v(i, "u"), v(s, "del"), v(r, "code"), v(n, "mark"), v(o, "kbd"), v(f, "i"), p } function wg(e, t, n) { return e === !0 || e === void 0 ? t : e || n && t } function L3(e) { return e === !1 ? [!1, !1] : Array.isArray(e) ? e : [e] } var Zse = "...", Xse = C.exports.forwardRef(function (e, t) { var n, r, i, s = e.prefixCls, c = e.className, o = e.style, f = e.type, p = e.disabled, v = e.children, y = e.ellipsis, w = e.editable, P = e.copyable, k = e.component, A = e.title, N = Gse(e, ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"]), R = C.exports.useContext(zn), M = R.getPrefixCls, O = R.direction, z = FN("Text")[0], B = C.exports.useRef(null), V = C.exports.useRef(null), G = M("typography", s), j = vi(N, ["mark", "code", "delete", "underline", "strong", "keyboard", "italic"]), X = Z1(w), Y = ze(X, 2), se = Y[0], ee = Y[1], Z = Bi(!1, { value: ee.editing }), J = ze(Z, 2), ve = J[0], ie = J[1], ce = ee.triggerType, oe = ce === void 0 ? ["icon"] : ce, ye = function (Je) { var Ot; Je && ((Ot = ee.onStart) === null || Ot === void 0 || Ot.call(ee)), ie(Je) }; Fse(function () { var Ct; ve || (Ct = V.current) === null || Ct === void 0 || Ct.focus() }, [ve]); var Ie = function (Je) { Je == null || Je.preventDefault(), ye(!0) }, Te = function (Je) { var Ot; (Ot = ee.onChange) === null || Ot === void 0 || Ot.call(ee, Je), ye(!1) }, Pe = function () { var Je; (Je = ee.onCancel) === null || Je === void 0 || Je.call(ee), ye(!1) }, De = Z1(P), Re = ze(De, 2), ke = Re[0], Oe = Re[1], $e = C.exports.useState(!1), He = ze($e, 2), Ue = He[0], st = He[1], ft = C.exports.useRef(), It = {}; Oe.format && (It.format = Oe.format); var We = function () { window.clearTimeout(ft.current) }, Pt = function (Je) { var Ot; Je == null || Je.preventDefault(), Je == null || Je.stopPropagation(), Mse(Oe.text || String(v) || "", It), st(!0), We(), ft.current = window.setTimeout(function () { st(!1) }, 3e3), (Ot = Oe.onCopy) === null || Ot === void 0 || Ot.call(Oe, Je) }; C.exports.useEffect(function () { return We }, []); var pt = C.exports.useState(!1), Rt = ze(pt, 2), yt = Rt[0], Mt = Rt[1], ut = C.exports.useState(!1), dt = ze(ut, 2), ct = dt[0], rt = dt[1], ht = C.exports.useState(!1), bt = ze(ht, 2), Wt = bt[0], Ut = bt[1], Jt = C.exports.useState(!1), Fe = ze(Jt, 2), Ge = Fe[0], Zt = Fe[1], cn = C.exports.useState(!1), jt = ze(cn, 2), Kt = jt[0], nn = jt[1], Cn = C.exports.useState(!0), Nn = ze(Cn, 2), wt = Nn[0], qt = Nn[1], At = Z1(y, { expandable: !1 }), Xt = ze(At, 2), en = Xt[0], gt = Xt[1], yn = en && !Wt, Sn = gt.rows, dn = Sn === void 0 ? 1 : Sn, zt = C.exports.useMemo(function () { return !yn || gt.suffix !== void 0 || gt.onEllipsis || gt.expandable || se || ke }, [yn, gt, se, ke]); si(function () { en && !zt && (Mt(tC("webkitLineClamp")), rt(tC("textOverflow"))) }, [zt, en]); var ot = C.exports.useMemo(function () { return zt ? !1 : dn === 1 ? ct : yt }, [zt, ct, yt]), mt = yn && (ot ? Kt : Ge), Dt = yn && dn === 1 && ot, Bt = yn && dn > 1 && ot, pn = function (Je) { var Ot; Ut(!0), (Ot = gt.onExpand) === null || Ot === void 0 || Ot.call(gt, Je) }, On = C.exports.useState(0), Zn = ze(On, 2), Xn = Zn[0], me = Zn[1], H = C.exports.useState(0), q = ze(H, 2), de = q[0], le = q[1], xe = function (Je, Ot) { var Vt = Je.offsetWidth, bn; me(Vt), le(parseInt((bn = window.getComputedStyle) === null || bn === void 0 ? void 0 : bn.call(window, Ot).fontSize, 10) || 0) }, Ee = function (Je) { var Ot; Zt(Je), Ge !== Je && ((Ot = gt.onEllipsis) === null || Ot === void 0 || Ot.call(gt, Je)) }; C.exports.useEffect(function () { var Ct = B.current; if (en && ot && Ct) { var Je = Bt ? Ct.offsetHeight < Ct.scrollHeight : Ct.offsetWidth < Ct.scrollWidth; Kt !== Je && nn(Je) } }, [en, ot, v, Bt, wt]), C.exports.useEffect(function () { var Ct = B.current; if (!(typeof IntersectionObserver > "u" || !Ct || !ot || !yn)) { var Je = new IntersectionObserver(function () { qt(!!Ct.offsetParent) }); return Je.observe(Ct), function () { Je.disconnect() } } }, [ot, yn]); var be = {}; gt.tooltip === !0 ? be = { title: (n = ee.text) !== null && n !== void 0 ? n : v } : C.exports.isValidElement(gt.tooltip) ? be = { title: gt.tooltip } : ln(gt.tooltip) === "object" ? be = tt({ title: (r = ee.text) !== null && r !== void 0 ? r : v }, gt.tooltip) : be = { title: gt.tooltip }; var Ce = C.exports.useMemo(function () { var Ct = function (Ot) { return ["string", "number"].includes(ln(Ot)) }; if (!(!en || ot)) { if (Ct(ee.text)) return ee.text; if (Ct(v)) return v; if (Ct(A)) return A; if (Ct(be.title)) return be.title } }, [en, ot, A, be.title, mt]); if (ve) return I(Lse, { value: (i = ee.text) !== null && i !== void 0 ? i : typeof v == "string" ? v : "", onSave: Te, onCancel: Pe, onEnd: ee.onEnd, prefixCls: G, className: c, style: o, direction: O, component: k, maxLength: ee.maxLength, autoSize: ee.autoSize, enterIcon: ee.enterIcon }); var Le = function () { var Je = gt.expandable, Ot = gt.symbol; if (!Je) return null; var Vt; return Ot ? Vt = Ot : Vt = z.expand, I("a", { className: "".concat(G, "-expand"), onClick: pn, "aria-label": z.expand, children: Vt }, "expand") }, qe = function () { if (!!se) { var Je = ee.icon, Ot = ee.tooltip, Vt = Zi(Ot)[0] || z.edit, bn = typeof Vt == "string" ? Vt : ""; return oe.includes("icon") ? I(io, { title: Ot === !1 ? "" : Vt, children: I($I, { ref: V, className: "".concat(G, "-edit"), onClick: Ie, "aria-label": bn, children: Je || I(Ese, { role: "button" }) }) }, "edit") : null } }, Ze = function () { if (!!ke) { var Je = Oe.tooltips, Ot = Oe.icon, Vt = L3(Je), bn = L3(Ot), un = Ue ? wg(Vt[1], z.copied) : wg(Vt[0], z.copy), wn = Ue ? z.copied : z.copy, Vn = typeof un == "string" ? un : wn; return I(io, { title: un, children: I($I, { className: Xe("".concat(G, "-copy"), Ue && "".concat(G, "-copy-success")), onClick: Pt, "aria-label": Vn, children: Ue ? wg(bn[1], I(AD, {}), !0) : wg(bn[0], I(wse, {}), !0) }) }, "copy") } }, Ve = function (Je) { return [Je && Le(), qe(), Ze()] }, Lt = function (Je) { return [Je && I("span", { "aria-hidden": !0, children: Zse }, "ellipsis"), gt.suffix, Ve(Je)] }; return I(cl, { onResize: xe, disabled: !yn || ot, children: function (Ct) { var Je; return I(Wse, { tooltipProps: be, enabledEllipsis: yn, isEllipsis: mt, children: I(S5, { className: Xe((Je = {}, re(Je, "".concat(G, "-").concat(f), f), re(Je, "".concat(G, "-disabled"), p), re(Je, "".concat(G, "-ellipsis"), en), re(Je, "".concat(G, "-single-line"), yn && dn === 1), re(Je, "".concat(G, "-ellipsis-single-line"), Dt), re(Je, "".concat(G, "-ellipsis-multiple-line"), Bt), Je), c), prefixCls: s, style: tt(tt({}, o), { WebkitLineClamp: Bt ? dn : void 0 }), component: k, ref: Po(Ct, B, t), direction: O, onClick: oe.includes("text") ? Ie : void 0, "aria-label": Ce == null ? void 0 : Ce.toString(), title: A, ...j, children: I(Kse, { enabledMeasure: yn && !ot, text: v, rows: dn, width: Xn, fontSize: de, onEllipsis: Ee, children: function (Ot, Vt) { var bn = Ot; Ot.length && Vt && Ce && (bn = I("span", { "aria-hidden": !0, children: bn }, "show-content")); var un = qse(e, Qe(An, { children: [bn, Lt(Vt)] })); return un } }) }) }) } }) }); const gx = Xse; var Yse = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, Qse = C.exports.forwardRef(function (e, t) { var n = e.ellipsis, r = e.rel, i = Yse(e, ["ellipsis", "rel"]), s = tt(tt({}, i), { rel: r === void 0 && i.target === "_blank" ? "noopener noreferrer" : r }); return delete s.navigate, I(gx, { ...s, ref: t, ellipsis: !!n, component: "a" }) }); const Jse = Qse; var ele = C.exports.forwardRef(function (e, t) { return I(gx, { ref: t, ...e, component: "div" }) }); const tle = ele; var nle = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, rle = function (t, n) { var r = t.ellipsis, i = nle(t, ["ellipsis"]), s = C.exports.useMemo(function () { return r && ln(r) === "object" ? vi(r, ["expandable", "rows"]) : r }, [r]); return I(gx, { ref: n, ...i, ellipsis: s, component: "span" }) }; const ile = C.exports.forwardRef(rle); var ole = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }, ale = SW(1, 2, 3, 4, 5), sle = C.exports.forwardRef(function (e, t) { var n = e.level, r = n === void 0 ? 1 : n, i = ole(e, ["level"]), s; return ale.includes(r) ? s = "h".concat(r) : s = "h1", I(gx, { ref: t, ...i, component: s }) }); const lle = sle; var Tm = S5; Tm.Text = ile; Tm.Link = Jse; Tm.Title = lle; Tm.Paragraph = tle; const P5 = Tm; var ule = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, name: "download", theme: "outlined" }; const cle = ule; var dle = C.exports.createContext({}); const T5 = dle; var Cg = 2, z3 = .16, fle = .05, hle = .05, ple = .15, k5 = 5, I5 = 4, mle = [{ index: 7, opacity: .15 }, { index: 6, opacity: .25 }, { index: 5, opacity: .3 }, { index: 5, opacity: .45 }, { index: 5, opacity: .65 }, { index: 5, opacity: .85 }, { index: 4, opacity: .9 }, { index: 3, opacity: .95 }, { index: 2, opacity: .97 }, { index: 1, opacity: .98 }]; function F3(e) { var t = e.r, n = e.g, r = e.b, i = Ay(t, n, r); return { h: i.h * 360, s: i.s, v: i.v } } function Sg(e) { var t = e.r, n = e.g, r = e.b; return "#".concat(Ny(t, n, r, !1)) } function vle(e, t, n) { var r = n / 100, i = { r: (t.r - e.r) * r + e.r, g: (t.g - e.g) * r + e.g, b: (t.b - e.b) * r + e.b }; return i } function $3(e, t, n) { var r; return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? r = n ? Math.round(e.h) - Cg * t : Math.round(e.h) + Cg * t : r = n ? Math.round(e.h) + Cg * t : Math.round(e.h) - Cg * t, r < 0 ? r += 360 : r >= 360 && (r -= 360), r } function B3(e, t, n) { if (e.h === 0 && e.s === 0) return e.s; var r; return n ? r = e.s - z3 * t : t === I5 ? r = e.s + z3 : r = e.s + fle * t, r > 1 && (r = 1), n && t === k5 && r > .1 && (r = .1), r < .06 && (r = .06), Number(r.toFixed(2)) } function V3(e, t, n) { var r; return n ? r = e.v + hle * t : r = e.v - ple * t, r > 1 && (r = 1), Number(r.toFixed(2)) } function EC(e) { for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = [], r = Ua(e), i = k5; i > 0; i -= 1) { var s = F3(r), c = Sg(Ua({ h: $3(s, i, !0), s: B3(s, i, !0), v: V3(s, i, !0) })); n.push(c) } n.push(Sg(r)); for (var o = 1; o <= I5; o += 1) { var f = F3(r), p = Sg(Ua({ h: $3(f, o), s: B3(f, o), v: V3(f, o) })); n.push(p) } return t.theme === "dark" ? mle.map(function (v) { var y = v.index, w = v.opacity, P = Sg(vle(Ua(t.backgroundColor || "#141414"), Ua(n[y]), w * 100)); return P }) : n } var Y1 = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1677FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666" }, Q1 = {}, J1 = {}; Object.keys(Y1).forEach(function (e) { Q1[e] = EC(Y1[e]), Q1[e].primary = Q1[e][5], J1[e] = EC(Y1[e], { theme: "dark", backgroundColor: "#141414" }), J1[e].primary = J1[e][5] }); function gle(e, t) { Rr(e, "[@ant-design/icons] ".concat(t)) } function U3(e) { return ln(e) === "object" && typeof e.name == "string" && typeof e.theme == "string" && (ln(e.icon) === "object" || typeof e.icon == "function") } function j3() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return Object.keys(e).reduce(function (t, n) { var r = e[n]; switch (n) { case "class": t.className = r, delete t.class; break; default: t[n] = r }return t }, {}) } function PC(e, t, n) { return n ? tr.createElement(e.tag, ge(ge({ key: t }, j3(e.attrs)), n), (e.children || []).map(function (r, i) { return PC(r, "".concat(t, "-").concat(e.tag, "-").concat(i)) })) : tr.createElement(e.tag, ge({ key: t }, j3(e.attrs)), (e.children || []).map(function (r, i) { return PC(r, "".concat(t, "-").concat(e.tag, "-").concat(i)) })) } function R5(e) { return EC(e)[0] } function M5(e) { return e ? Array.isArray(e) ? e : [e] : [] } var yle = `
|
|
|
.anticon {
|
|
|
display: inline-block;
|
|
|
color: inherit;
|
|
|
font-style: normal;
|
|
|
line-height: 0;
|
|
|
text-align: center;
|
|
|
text-transform: none;
|
|
|
vertical-align: -0.125em;
|
|
|
text-rendering: optimizeLegibility;
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
}
|
|
|
|
|
|
.anticon > * {
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.anticon svg {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|
|
|
.anticon::before {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
.anticon .anticon-icon {
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.anticon[tabindex] {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.anticon-spin::before,
|
|
|
.anticon-spin {
|
|
|
display: inline-block;
|
|
|
-webkit-animation: loadingCircle 1s infinite linear;
|
|
|
animation: loadingCircle 1s infinite linear;
|
|
|
}
|
|
|
|
|
|
@-webkit-keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@keyframes loadingCircle {
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
}
|
|
|
`, xle = function () { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yle, n = C.exports.useContext(T5), r = n.csp, i = n.prefixCls, s = t; i && (s = s.replace(/anticon/g, i)), C.exports.useEffect(function () { hm(s, "@ant-design-icons", { prepend: !0, csp: r }) }, []) }, _le = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], yp = { primaryColor: "#333", secondaryColor: "#E6E6E6", calculated: !1 }; function ble(e) { var t = e.primaryColor, n = e.secondaryColor; yp.primaryColor = t, yp.secondaryColor = n || R5(t), yp.calculated = !!n } function wle() { return ge({}, yp) } var yx = function (t) { var n = t.icon, r = t.className, i = t.onClick, s = t.style, c = t.primaryColor, o = t.secondaryColor, f = Rn(t, _le), p = yp; if (c && (p = { primaryColor: c, secondaryColor: o || R5(c) }), xle(), gle(U3(n), "icon should be icon definiton, but got ".concat(n)), !U3(n)) return null; var v = n; return v && typeof v.icon == "function" && (v = ge(ge({}, v), {}, { icon: v.icon(p.primaryColor, p.secondaryColor) })), PC(v.icon, "svg-".concat(v.name), ge({ className: r, onClick: i, style: s, "data-icon": v.name, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" }, f)) }; yx.displayName = "IconReact"; yx.getTwoToneColors = wle; yx.setTwoToneColors = ble; const lE = yx; function A5(e) { var t = M5(e), n = ze(t, 2), r = n[0], i = n[1]; return lE.setTwoToneColors({ primaryColor: r, secondaryColor: i }) } function Cle() { var e = lE.getTwoToneColors(); return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor } var Sle = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"]; A5("#1890ff"); var xx = C.exports.forwardRef(function (e, t) { var n, r = e.className, i = e.icon, s = e.spin, c = e.rotate, o = e.tabIndex, f = e.onClick, p = e.twoToneColor, v = Rn(e, Sle), y = C.exports.useContext(T5), w = y.prefixCls, P = w === void 0 ? "anticon" : w, k = y.rootClassName, A = Xe(k, P, (n = {}, re(n, "".concat(P, "-").concat(i.name), !!i.name), re(n, "".concat(P, "-spin"), !!s || i.name === "loading"), n), r), N = o; N === void 0 && f && (N = -1); var R = c ? { msTransform: "rotate(".concat(c, "deg)"), transform: "rotate(".concat(c, "deg)") } : void 0, M = M5(p), O = ze(M, 2), z = O[0], B = O[1]; return I("span", { ...ge(ge({ role: "img", "aria-label": i.name }, v), {}, { ref: t, tabIndex: N, onClick: f, className: A }), children: I(lE, { icon: i, primaryColor: z, secondaryColor: B, style: R }) }) }); xx.displayName = "AntdIcon"; xx.getTwoToneColor = Cle; xx.setTwoToneColor = A5; const xu = xx; var N5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: RQ }) }) }; N5.displayName = "ArrowRightOutlined"; const O5 = C.exports.forwardRef(N5); var D5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: cle }) }) }; D5.displayName = "DownloadOutlined"; const Ele = C.exports.forwardRef(D5); var Ple = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z" } }] }, name: "fullscreen-exit", theme: "outlined" }; const Tle = Ple; var L5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: Tle }) }) }; L5.displayName = "FullscreenExitOutlined"; const kle = C.exports.forwardRef(L5); var Ile = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z" } }] }, name: "fullscreen", theme: "outlined" }; const Rle = Ile; var z5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: Rle }) }) }; z5.displayName = "FullscreenOutlined"; const Mle = C.exports.forwardRef(z5); var Ale = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z" } }] }, name: "lock", theme: "outlined" }; const Nle = Ale; var F5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: Nle }) }) }; F5.displayName = "LockOutlined"; const Ole = C.exports.forwardRef(F5); var Dle = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z" } }] }, name: "logout", theme: "outlined" }; const Lle = Dle; var $5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: Lle }) }) }; $5.displayName = "LogoutOutlined"; const zle = C.exports.forwardRef($5); var B5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: OD }) }) }; B5.displayName = "SearchOutlined"; const uE = C.exports.forwardRef(B5); var Fle = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z" } }] }, name: "user", theme: "outlined" }; const $le = Fle; var V5 = function (t, n) { return I(xu, { ...ge(ge({}, t), {}, { ref: n, icon: $le }) }) }; V5.displayName = "UserOutlined"; const Ble = C.exports.forwardRef(V5); function U5(e, t) { return function () { return e.apply(t, arguments) } } const { toString: j5 } = Object.prototype, { getPrototypeOf: cE } = Object, dE = (e => t => { const n = j5.call(t); return e[n] || (e[n] = n.slice(8, -1).toLowerCase()) })(Object.create(null)), pl = e => (e = e.toLowerCase(), t => dE(t) === e), _x = e => t => typeof t === e, { isArray: Nf } = Array, Yp = _x("undefined"); function Vle(e) { return e !== null && !Yp(e) && e.constructor !== null && !Yp(e.constructor) && du(e.constructor.isBuffer) && e.constructor.isBuffer(e) } const K5 = pl("ArrayBuffer"); function Ule(e) { let t; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && K5(e.buffer), t } const jle = _x("string"), du = _x("function"), H5 = _x("number"), fE = e => e !== null && typeof e == "object", Kle = e => e === !0 || e === !1, Yg = e => { if (dE(e) !== "object") return !1; const t = cE(e); return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e) }, Hle = pl("Date"), Wle = pl("File"), Gle = pl("Blob"), qle = pl("FileList"), Zle = e => fE(e) && du(e.pipe), Xle = e => { const t = "[object FormData]"; return e && (typeof FormData == "function" && e instanceof FormData || j5.call(e) === t || du(e.toString) && e.toString() === t) }, Yle = pl("URLSearchParams"), Qle = e => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function km(e, t, { allOwnKeys: n = !1 } = {}) { if (e === null || typeof e > "u") return; let r, i; if (typeof e != "object" && (e = [e]), Nf(e)) for (r = 0, i = e.length; r < i; r++)t.call(null, e[r], r, e); else { const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), c = s.length; let o; for (r = 0; r < c; r++)o = s[r], t.call(null, e[o], o, e) } } function W5(e, t) { t = t.toLowerCase(); const n = Object.keys(e); let r = n.length, i; for (; r-- > 0;)if (i = n[r], t === i.toLowerCase()) return i; return null } const G5 = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), q5 = e => !Yp(e) && e !== G5; function TC() { const { caseless: e } = q5(this) && this || {}, t = {}, n = (r, i) => { const s = e && W5(t, i) || i; Yg(t[s]) && Yg(r) ? t[s] = TC(t[s], r) : Yg(r) ? t[s] = TC({}, r) : Nf(r) ? t[s] = r.slice() : t[s] = r }; for (let r = 0, i = arguments.length; r < i; r++)arguments[r] && km(arguments[r], n); return t } const Jle = (e, t, n, { allOwnKeys: r } = {}) => (km(t, (i, s) => { n && du(i) ? e[s] = U5(i, n) : e[s] = i }, { allOwnKeys: r }), e), eue = e => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), tue = (e, t, n, r) => { e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", { value: t.prototype }), n && Object.assign(e.prototype, n) }, nue = (e, t, n, r) => { let i, s, c; const o = {}; if (t = t || {}, e == null) return t; do { for (i = Object.getOwnPropertyNames(e), s = i.length; s-- > 0;)c = i[s], (!r || r(c, e, t)) && !o[c] && (t[c] = e[c], o[c] = !0); e = n !== !1 && cE(e) } while (e && (!n || n(e, t)) && e !== Object.prototype); return t }, rue = (e, t, n) => { e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length; const r = e.indexOf(t, n); return r !== -1 && r === n }, iue = e => { if (!e) return null; if (Nf(e)) return e; let t = e.length; if (!H5(t)) return null; const n = new Array(t); for (; t-- > 0;)n[t] = e[t]; return n }, oue = (e => t => e && t instanceof e)(typeof Uint8Array < "u" && cE(Uint8Array)), aue = (e, t) => { const r = (e && e[Symbol.iterator]).call(e); let i; for (; (i = r.next()) && !i.done;) { const s = i.value; t.call(e, s[0], s[1]) } }, sue = (e, t) => { let n; const r = []; for (; (n = e.exec(t)) !== null;)r.push(n); return r }, lue = pl("HTMLFormElement"), uue = e => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function (n, r, i) { return r.toUpperCase() + i }), K3 = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), cue = pl("RegExp"), Z5 = (e, t) => { const n = Object.getOwnPropertyDescriptors(e), r = {}; km(n, (i, s) => { t(i, s, e) !== !1 && (r[s] = i) }), Object.defineProperties(e, r) }, due = e => { Z5(e, (t, n) => { if (du(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1) return !1; const r = e[n]; if (!!du(r)) { if (t.enumerable = !1, "writable" in t) { t.writable = !1; return } t.set || (t.set = () => { throw Error("Can not rewrite read-only method '" + n + "'") }) } }) }, fue = (e, t) => { const n = {}, r = i => { i.forEach(s => { n[s] = !0 }) }; return Nf(e) ? r(e) : r(String(e).split(t)), n }, hue = () => { }, pue = (e, t) => (e = +e, Number.isFinite(e) ? e : t), eb = "abcdefghijklmnopqrstuvwxyz", H3 = "0123456789", X5 = { DIGIT: H3, ALPHA: eb, ALPHA_DIGIT: eb + eb.toUpperCase() + H3 }, mue = (e = 16, t = X5.ALPHA_DIGIT) => { let n = ""; const { length: r } = t; for (; e--;)n += t[Math.random() * r | 0]; return n }; function vue(e) { return !!(e && du(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]) } const gue = e => { const t = new Array(10), n = (r, i) => { if (fE(r)) { if (t.indexOf(r) >= 0) return; if (!("toJSON" in r)) { t[i] = r; const s = Nf(r) ? [] : {}; return km(r, (c, o) => { const f = n(c, i + 1); !Yp(f) && (s[o] = f) }), t[i] = void 0, s } } return r }; return n(e, 0) }, Nt = { isArray: Nf, isArrayBuffer: K5, isBuffer: Vle, isFormData: Xle, isArrayBufferView: Ule, isString: jle, isNumber: H5, isBoolean: Kle, isObject: fE, isPlainObject: Yg, isUndefined: Yp, isDate: Hle, isFile: Wle, isBlob: Gle, isRegExp: cue, isFunction: du, isStream: Zle, isURLSearchParams: Yle, isTypedArray: oue, isFileList: qle, forEach: km, merge: TC, extend: Jle, trim: Qle, stripBOM: eue, inherits: tue, toFlatObject: nue, kindOf: dE, kindOfTest: pl, endsWith: rue, toArray: iue, forEachEntry: aue, matchAll: sue, isHTMLForm: lue, hasOwnProperty: K3, hasOwnProp: K3, reduceDescriptors: Z5, freezeMethods: due, toObjectSet: fue, toCamelCase: uue, noop: hue, toFiniteNumber: pue, findKey: W5, global: G5, isContextDefined: q5, ALPHABET: X5, generateString: mue, isSpecCompliantForm: vue, toJSONObject: gue }; function pr(e, t, n, r, i) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), i && (this.response = i) } Nt.inherits(pr, Error, { toJSON: function () { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: Nt.toJSONObject(this.config), code: this.code, status: this.response && this.response.status ? this.response.status : null } } }); const Y5 = pr.prototype, Q5 = {};["ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED", "ERR_NOT_SUPPORT", "ERR_INVALID_URL"].forEach(e => { Q5[e] = { value: e } }); Object.defineProperties(pr, Q5); Object.defineProperty(Y5, "isAxiosError", { value: !0 }); pr.from = (e, t, n, r, i, s) => { const c = Object.create(Y5); return Nt.toFlatObject(e, c, function (f) { return f !== Error.prototype }, o => o !== "isAxiosError"), pr.call(c, e.message, t, n, r, i), c.cause = e, c.name = e.name, s && Object.assign(c, s), c }; const yue = null; function kC(e) { return Nt.isPlainObject(e) || Nt.isArray(e) } function J5(e) { return Nt.endsWith(e, "[]") ? e.slice(0, -2) : e } function W3(e, t, n) { return e ? e.concat(t).map(function (i, s) { return i = J5(i), !n && s ? "[" + i + "]" : i }).join(n ? "." : "") : t } function xue(e) { return Nt.isArray(e) && !e.some(kC) } const _ue = Nt.toFlatObject(Nt, {}, null, function (t) { return /^is[A-Z]/.test(t) }); function bx(e, t, n) { if (!Nt.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData, n = Nt.toFlatObject(n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function (A, N) { return !Nt.isUndefined(N[A]) }); const r = n.metaTokens, i = n.visitor || v, s = n.dots, c = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && Nt.isSpecCompliantForm(t); if (!Nt.isFunction(i)) throw new TypeError("visitor must be a function"); function p(k) { if (k === null) return ""; if (Nt.isDate(k)) return k.toISOString(); if (!f && Nt.isBlob(k)) throw new pr("Blob is not supported. Use a Buffer instead."); return Nt.isArrayBuffer(k) || Nt.isTypedArray(k) ? f && typeof Blob == "function" ? new Blob([k]) : Buffer.from(k) : k } function v(k, A, N) { let R = k; if (k && !N && typeof k == "object") { if (Nt.endsWith(A, "{}")) A = r ? A : A.slice(0, -2), k = JSON.stringify(k); else if (Nt.isArray(k) && xue(k) || (Nt.isFileList(k) || Nt.endsWith(A, "[]")) && (R = Nt.toArray(k))) return A = J5(A), R.forEach(function (O, z) { !(Nt.isUndefined(O) || O === null) && t.append(c === !0 ? W3([A], z, s) : c === null ? A : A + "[]", p(O)) }), !1 } return kC(k) ? !0 : (t.append(W3(N, A, s), p(k)), !1) } const y = [], w = Object.assign(_ue, { defaultVisitor: v, convertValue: p, isVisitable: kC }); function P(k, A) { if (!Nt.isUndefined(k)) { if (y.indexOf(k) !== -1) throw Error("Circular reference detected in " + A.join(".")); y.push(k), Nt.forEach(k, function (R, M) { (!(Nt.isUndefined(R) || R === null) && i.call(t, R, Nt.isString(M) ? M.trim() : M, A, w)) === !0 && P(R, A ? A.concat(M) : [M]) }), y.pop() } } if (!Nt.isObject(e)) throw new TypeError("data must be an object"); return P(e), t } function G3(e) { const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function (r) { return t[r] }) } function hE(e, t) { this._pairs = [], e && bx(e, this, t) } const e6 = hE.prototype; e6.append = function (t, n) { this._pairs.push([t, n]) }; e6.toString = function (t) { const n = t ? function (r) { return t.call(this, r, G3) } : G3; return this._pairs.map(function (i) { return n(i[0]) + "=" + n(i[1]) }, "").join("&") }; function bue(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]") } function t6(e, t, n) { if (!t) return e; const r = n && n.encode || bue, i = n && n.serialize; let s; if (i ? s = i(t, n) : s = Nt.isURLSearchParams(t) ? t.toString() : new hE(t, n).toString(r), s) { const c = e.indexOf("#"); c !== -1 && (e = e.slice(0, c)), e += (e.indexOf("?") === -1 ? "?" : "&") + s } return e } class wue { constructor() { this.handlers = [] } use(t, n, r) { return this.handlers.push({ fulfilled: t, rejected: n, synchronous: r ? r.synchronous : !1, runWhen: r ? r.runWhen : null }), this.handlers.length - 1 } eject(t) { this.handlers[t] && (this.handlers[t] = null) } clear() { this.handlers && (this.handlers = []) } forEach(t) { Nt.forEach(this.handlers, function (r) { r !== null && t(r) }) } } const q3 = wue, n6 = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Cue = typeof URLSearchParams < "u" ? URLSearchParams : hE, Sue = typeof FormData < "u" ? FormData : null, Eue = (() => { let e; return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u" })(), Pue = (() => typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), fs = { isBrowser: !0, classes: { URLSearchParams: Cue, FormData: Sue, Blob }, isStandardBrowserEnv: Eue, isStandardBrowserWebWorkerEnv: Pue, protocols: ["http", "https", "file", "blob", "url", "data"] }; function Tue(e, t) { return bx(e, new fs.classes.URLSearchParams, Object.assign({ visitor: function (n, r, i, s) { return fs.isNode && Nt.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments) } }, t)) } function kue(e) { return Nt.matchAll(/\w+|\[(\w*)]/g, e).map(t => t[0] === "[]" ? "" : t[1] || t[0]) } function Iue(e) { const t = {}, n = Object.keys(e); let r; const i = n.length; let s; for (r = 0; r < i; r++)s = n[r], t[s] = e[s]; return t } function r6(e) { function t(n, r, i, s) { let c = n[s++]; const o = Number.isFinite(+c), f = s >= n.length; return c = !c && Nt.isArray(i) ? i.length : c, f ? (Nt.hasOwnProp(i, c) ? i[c] = [i[c], r] : i[c] = r, !o) : ((!i[c] || !Nt.isObject(i[c])) && (i[c] = []), t(n, r, i[c], s) && Nt.isArray(i[c]) && (i[c] = Iue(i[c])), !o) } if (Nt.isFormData(e) && Nt.isFunction(e.entries)) { const n = {}; return Nt.forEachEntry(e, (r, i) => { t(kue(r), i, n, 0) }), n } return null } const Rue = { "Content-Type": void 0 }; function Mue(e, t, n) { if (Nt.isString(e)) try { return (t || JSON.parse)(e), Nt.trim(e) } catch (r) { if (r.name !== "SyntaxError") throw r } return (n || JSON.stringify)(e) } const wx = { transitional: n6, adapter: ["xhr", "http"], transformRequest: [function (t, n) { const r = n.getContentType() || "", i = r.indexOf("application/json") > -1, s = Nt.isObject(t); if (s && Nt.isHTMLForm(t) && (t = new FormData(t)), Nt.isFormData(t)) return i && i ? JSON.stringify(r6(t)) : t; if (Nt.isArrayBuffer(t) || Nt.isBuffer(t) || Nt.isStream(t) || Nt.isFile(t) || Nt.isBlob(t)) return t; if (Nt.isArrayBufferView(t)) return t.buffer; if (Nt.isURLSearchParams(t)) return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); let o; if (s) { if (r.indexOf("application/x-www-form-urlencoded") > -1) return Tue(t, this.formSerializer).toString(); if ((o = Nt.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { const f = this.env && this.env.FormData; return bx(o ? { "files[]": t } : t, f && new f, this.formSerializer) } } return s || i ? (n.setContentType("application/json", !1), Mue(t)) : t }], transformResponse: [function (t) { const n = this.transitional || wx.transitional, r = n && n.forcedJSONParsing, i = this.responseType === "json"; if (t && Nt.isString(t) && (r && !this.responseType || i)) { const c = !(n && n.silentJSONParsing) && i; try { return JSON.parse(t) } catch (o) { if (c) throw o.name === "SyntaxError" ? pr.from(o, pr.ERR_BAD_RESPONSE, this, null, this.response) : o } } return t }], timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: fs.classes.FormData, Blob: fs.classes.Blob }, validateStatus: function (t) { return t >= 200 && t < 300 }, headers: { common: { Accept: "application/json, text/plain, */*" } } }; Nt.forEach(["delete", "get", "head"], function (t) { wx.headers[t] = {} }); Nt.forEach(["post", "put", "patch"], function (t) { wx.headers[t] = Nt.merge(Rue) }); const pE = wx, Aue = Nt.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]), Nue = e => {
|
|
|
const t = {}; let n, r, i; return e && e.split(`
|
|
|
`).forEach(function (c) { i = c.indexOf(":"), n = c.substring(0, i).trim().toLowerCase(), r = c.substring(i + 1).trim(), !(!n || t[n] && Aue[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r) }), t
|
|
|
}, Z3 = Symbol("internals"); function jh(e) { return e && String(e).trim().toLowerCase() } function Qg(e) { return e === !1 || e == null ? e : Nt.isArray(e) ? e.map(Qg) : String(e) } function Oue(e) { const t = Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let r; for (; r = n.exec(e);)t[r[1]] = r[2]; return t } function Due(e) { return /^[-_a-zA-Z]+$/.test(e.trim()) } function tb(e, t, n, r, i) { if (Nt.isFunction(r)) return r.call(this, t, n); if (i && (t = n), !!Nt.isString(t)) { if (Nt.isString(r)) return t.indexOf(r) !== -1; if (Nt.isRegExp(r)) return r.test(t) } } function Lue(e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r) } function zue(e, t) { const n = Nt.toCamelCase(" " + t);["get", "set", "has"].forEach(r => { Object.defineProperty(e, r + n, { value: function (i, s, c) { return this[r].call(this, t, i, s, c) }, configurable: !0 }) }) } class Cx {
|
|
|
constructor(t) { t && this.set(t) } set(t, n, r) { const i = this; function s(o, f, p) { const v = jh(f); if (!v) throw new Error("header name must be a non-empty string"); const y = Nt.findKey(i, v); (!y || i[y] === void 0 || p === !0 || p === void 0 && i[y] !== !1) && (i[y || f] = Qg(o)) } const c = (o, f) => Nt.forEach(o, (p, v) => s(p, v, f)); return Nt.isPlainObject(t) || t instanceof this.constructor ? c(t, n) : Nt.isString(t) && (t = t.trim()) && !Due(t) ? c(Nue(t), n) : t != null && s(n, t, r), this } get(t, n) { if (t = jh(t), t) { const r = Nt.findKey(this, t); if (r) { const i = this[r]; if (!n) return i; if (n === !0) return Oue(i); if (Nt.isFunction(n)) return n.call(this, i, r); if (Nt.isRegExp(n)) return n.exec(i); throw new TypeError("parser must be boolean|regexp|function") } } } has(t, n) { if (t = jh(t), t) { const r = Nt.findKey(this, t); return !!(r && this[r] !== void 0 && (!n || tb(this, this[r], r, n))) } return !1 } delete(t, n) { const r = this; let i = !1; function s(c) { if (c = jh(c), c) { const o = Nt.findKey(r, c); o && (!n || tb(r, r[o], o, n)) && (delete r[o], i = !0) } } return Nt.isArray(t) ? t.forEach(s) : s(t), i } clear(t) { const n = Object.keys(this); let r = n.length, i = !1; for (; r--;) { const s = n[r]; (!t || tb(this, this[s], s, t, !0)) && (delete this[s], i = !0) } return i } normalize(t) { const n = this, r = {}; return Nt.forEach(this, (i, s) => { const c = Nt.findKey(r, s); if (c) { n[c] = Qg(i), delete n[s]; return } const o = t ? Lue(s) : String(s).trim(); o !== s && delete n[s], n[o] = Qg(i), r[o] = !0 }), this } concat(...t) { return this.constructor.concat(this, ...t) } toJSON(t) { const n = Object.create(null); return Nt.forEach(this, (r, i) => { r != null && r !== !1 && (n[i] = t && Nt.isArray(r) ? r.join(", ") : r) }), n } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator]() } toString() {
|
|
|
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
|
|
`)
|
|
|
} get [Symbol.toStringTag]() { return "AxiosHeaders" } static from(t) { return t instanceof this ? t : new this(t) } static concat(t, ...n) { const r = new this(t); return n.forEach(i => r.set(i)), r } static accessor(t) { const r = (this[Z3] = this[Z3] = { accessors: {} }).accessors, i = this.prototype; function s(c) { const o = jh(c); r[o] || (zue(i, c), r[o] = !0) } return Nt.isArray(t) ? t.forEach(s) : s(t), this }
|
|
|
} Cx.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); Nt.freezeMethods(Cx.prototype); Nt.freezeMethods(Cx); const Js = Cx; function nb(e, t) { const n = this || pE, r = t || n, i = Js.from(r.headers); let s = r.data; return Nt.forEach(e, function (o) { s = o.call(n, s, i.normalize(), t ? t.status : void 0) }), i.normalize(), s } function i6(e) { return !!(e && e.__CANCEL__) } function Im(e, t, n) { pr.call(this, e == null ? "canceled" : e, pr.ERR_CANCELED, t, n), this.name = "CanceledError" } Nt.inherits(Im, pr, { __CANCEL__: !0 }); function Fue(e, t, n) { const r = n.config.validateStatus; !n.status || !r || r(n.status) ? e(n) : t(new pr("Request failed with status code " + n.status, [pr.ERR_BAD_REQUEST, pr.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n)) } const $ue = fs.isStandardBrowserEnv ? function () { return { write: function (n, r, i, s, c, o) { const f = []; f.push(n + "=" + encodeURIComponent(r)), Nt.isNumber(i) && f.push("expires=" + new Date(i).toGMTString()), Nt.isString(s) && f.push("path=" + s), Nt.isString(c) && f.push("domain=" + c), o === !0 && f.push("secure"), document.cookie = f.join("; ") }, read: function (n) { const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)")); return r ? decodeURIComponent(r[3]) : null }, remove: function (n) { this.write(n, "", Date.now() - 864e5) } } }() : function () { return { write: function () { }, read: function () { return null }, remove: function () { } } }(); function Bue(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e) } function Vue(e, t) { return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e } function o6(e, t) { return e && !Bue(t) ? Vue(e, t) : t } const Uue = fs.isStandardBrowserEnv ? function () { const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a"); let r; function i(s) { let c = s; return t && (n.setAttribute("href", c), c = n.href), n.setAttribute("href", c), { href: n.href, protocol: n.protocol ? n.protocol.replace(/:$/, "") : "", host: n.host, search: n.search ? n.search.replace(/^\?/, "") : "", hash: n.hash ? n.hash.replace(/^#/, "") : "", hostname: n.hostname, port: n.port, pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname } } return r = i(window.location.href), function (c) { const o = Nt.isString(c) ? i(c) : c; return o.protocol === r.protocol && o.host === r.host } }() : function () { return function () { return !0 } }(); function jue(e) { const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return t && t[1] || "" } function Kue(e, t) { e = e || 10; const n = new Array(e), r = new Array(e); let i = 0, s = 0, c; return t = t !== void 0 ? t : 1e3, function (f) { const p = Date.now(), v = r[s]; c || (c = p), n[i] = f, r[i] = p; let y = s, w = 0; for (; y !== i;)w += n[y++], y = y % e; if (i = (i + 1) % e, i === s && (s = (s + 1) % e), p - c < t) return; const P = v && p - v; return P ? Math.round(w * 1e3 / P) : void 0 } } function X3(e, t) { let n = 0; const r = Kue(50, 250); return i => { const s = i.loaded, c = i.lengthComputable ? i.total : void 0, o = s - n, f = r(o), p = s <= c; n = s; const v = { loaded: s, total: c, progress: c ? s / c : void 0, bytes: o, rate: f || void 0, estimated: f && c && p ? (c - s) / f : void 0, event: i }; v[t ? "download" : "upload"] = !0, e(v) } } const Hue = typeof XMLHttpRequest < "u", Wue = Hue && function (e) { return new Promise(function (n, r) { let i = e.data; const s = Js.from(e.headers).normalize(), c = e.responseType; let o; function f() { e.cancelToken && e.cancelToken.unsubscribe(o), e.signal && e.signal.removeEventListener("abort", o) } Nt.isFormData(i) && (fs.isStandardBrowserEnv || fs.isStandardBrowserWebWorkerEnv) && s.setContentType(!1); let p = new XMLHttpRequest; if (e.auth) { const P = e.auth.username || "", k = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : ""; s.set("Authorization", "Basic " + btoa(P + ":" + k)) } const v = o6(e.baseURL, e.url); p.open(e.method.toUpperCase(), t6(v, e.params, e.paramsSerializer), !0), p.timeout = e.timeout; function y() { if (!p) return; const P = Js.from("getAllResponseHeaders" in p && p.getAllResponseHeaders()), A = { data: !c || c === "text" || c === "json" ? p.responseText : p.response, status: p.status, statusText: p.statusText, headers: P, config: e, request: p }; Fue(function (R) { n(R), f() }, function (R) { r(R), f() }, A), p = null } if ("onloadend" in p ? p.onloadend = y : p.onreadystatechange = function () { !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(y) }, p.onabort = function () { !p || (r(new pr("Request aborted", pr.ECONNABORTED, e, p)), p = null) }, p.onerror = function () { r(new pr("Network Error", pr.ERR_NETWORK, e, p)), p = null }, p.ontimeout = function () { let k = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded"; const A = e.transitional || n6; e.timeoutErrorMessage && (k = e.timeoutErrorMessage), r(new pr(k, A.clarifyTimeoutError ? pr.ETIMEDOUT : pr.ECONNABORTED, e, p)), p = null }, fs.isStandardBrowserEnv) { const P = (e.withCredentials || Uue(v)) && e.xsrfCookieName && $ue.read(e.xsrfCookieName); P && s.set(e.xsrfHeaderName, P) } i === void 0 && s.setContentType(null), "setRequestHeader" in p && Nt.forEach(s.toJSON(), function (k, A) { p.setRequestHeader(A, k) }), Nt.isUndefined(e.withCredentials) || (p.withCredentials = !!e.withCredentials), c && c !== "json" && (p.responseType = e.responseType), typeof e.onDownloadProgress == "function" && p.addEventListener("progress", X3(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && p.upload && p.upload.addEventListener("progress", X3(e.onUploadProgress)), (e.cancelToken || e.signal) && (o = P => { !p || (r(!P || P.type ? new Im(null, e, p) : P), p.abort(), p = null) }, e.cancelToken && e.cancelToken.subscribe(o), e.signal && (e.signal.aborted ? o() : e.signal.addEventListener("abort", o))); const w = jue(v); if (w && fs.protocols.indexOf(w) === -1) { r(new pr("Unsupported protocol " + w + ":", pr.ERR_BAD_REQUEST, e)); return } p.send(i || null) }) }, Jg = { http: yue, xhr: Wue }; Nt.forEach(Jg, (e, t) => { if (e) { try { Object.defineProperty(e, "name", { value: t }) } catch { } Object.defineProperty(e, "adapterName", { value: t }) } }); const Gue = { getAdapter: e => { e = Nt.isArray(e) ? e : [e]; const { length: t } = e; let n, r; for (let i = 0; i < t && (n = e[i], !(r = Nt.isString(n) ? Jg[n.toLowerCase()] : n)); i++); if (!r) throw r === !1 ? new pr(`Adapter ${n} is not supported by the environment`, "ERR_NOT_SUPPORT") : new Error(Nt.hasOwnProp(Jg, n) ? `Adapter '${n}' is not available in the build` : `Unknown adapter '${n}'`); if (!Nt.isFunction(r)) throw new TypeError("adapter is not a function"); return r }, adapters: Jg }; function rb(e) { if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new Im(null, e) } function Y3(e) { return rb(e), e.headers = Js.from(e.headers), e.data = nb.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Gue.getAdapter(e.adapter || pE.adapter)(e).then(function (r) { return rb(e), r.data = nb.call(e, e.transformResponse, r), r.headers = Js.from(r.headers), r }, function (r) { return i6(r) || (rb(e), r && r.response && (r.response.data = nb.call(e, e.transformResponse, r.response), r.response.headers = Js.from(r.response.headers))), Promise.reject(r) }) } const Q3 = e => e instanceof Js ? e.toJSON() : e; function cf(e, t) { t = t || {}; const n = {}; function r(p, v, y) { return Nt.isPlainObject(p) && Nt.isPlainObject(v) ? Nt.merge.call({ caseless: y }, p, v) : Nt.isPlainObject(v) ? Nt.merge({}, v) : Nt.isArray(v) ? v.slice() : v } function i(p, v, y) { if (Nt.isUndefined(v)) { if (!Nt.isUndefined(p)) return r(void 0, p, y) } else return r(p, v, y) } function s(p, v) { if (!Nt.isUndefined(v)) return r(void 0, v) } function c(p, v) { if (Nt.isUndefined(v)) { if (!Nt.isUndefined(p)) return r(void 0, p) } else return r(void 0, v) } function o(p, v, y) { if (y in t) return r(p, v); if (y in e) return r(void 0, p) } const f = { url: s, method: s, data: s, baseURL: c, transformRequest: c, transformResponse: c, paramsSerializer: c, timeout: c, timeoutMessage: c, withCredentials: c, adapter: c, responseType: c, xsrfCookieName: c, xsrfHeaderName: c, onUploadProgress: c, onDownloadProgress: c, decompress: c, maxContentLength: c, maxBodyLength: c, beforeRedirect: c, transport: c, httpAgent: c, httpsAgent: c, cancelToken: c, socketPath: c, responseEncoding: c, validateStatus: o, headers: (p, v) => i(Q3(p), Q3(v), !0) }; return Nt.forEach(Object.keys(e).concat(Object.keys(t)), function (v) { const y = f[v] || i, w = y(e[v], t[v], v); Nt.isUndefined(w) && y !== o || (n[v] = w) }), n } const a6 = "1.3.3", mE = {};["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => { mE[e] = function (r) { return typeof r === e || "a" + (t < 1 ? "n " : " ") + e } }); const J3 = {}; mE.transitional = function (t, n, r) { function i(s, c) { return "[Axios v" + a6 + "] Transitional option '" + s + "'" + c + (r ? ". " + r : "") } return (s, c, o) => { if (t === !1) throw new pr(i(c, " has been removed" + (n ? " in " + n : "")), pr.ERR_DEPRECATED); return n && !J3[c] && (J3[c] = !0, console.warn(i(c, " has been deprecated since v" + n + " and will be removed in the near future"))), t ? t(s, c, o) : !0 } }; function que(e, t, n) { if (typeof e != "object") throw new pr("options must be an object", pr.ERR_BAD_OPTION_VALUE); const r = Object.keys(e); let i = r.length; for (; i-- > 0;) { const s = r[i], c = t[s]; if (c) { const o = e[s], f = o === void 0 || c(o, s, e); if (f !== !0) throw new pr("option " + s + " must be " + f, pr.ERR_BAD_OPTION_VALUE); continue } if (n !== !0) throw new pr("Unknown option " + s, pr.ERR_BAD_OPTION) } } const IC = { assertOptions: que, validators: mE }, Dl = IC.validators; class e0 { constructor(t) { this.defaults = t, this.interceptors = { request: new q3, response: new q3 } } request(t, n) { typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = cf(this.defaults, n); const { transitional: r, paramsSerializer: i, headers: s } = n; r !== void 0 && IC.assertOptions(r, { silentJSONParsing: Dl.transitional(Dl.boolean), forcedJSONParsing: Dl.transitional(Dl.boolean), clarifyTimeoutError: Dl.transitional(Dl.boolean) }, !1), i !== void 0 && IC.assertOptions(i, { encode: Dl.function, serialize: Dl.function }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase(); let c; c = s && Nt.merge(s.common, s[n.method]), c && Nt.forEach(["delete", "get", "head", "post", "put", "patch", "common"], k => { delete s[k] }), n.headers = Js.concat(c, s); const o = []; let f = !0; this.interceptors.request.forEach(function (A) { typeof A.runWhen == "function" && A.runWhen(n) === !1 || (f = f && A.synchronous, o.unshift(A.fulfilled, A.rejected)) }); const p = []; this.interceptors.response.forEach(function (A) { p.push(A.fulfilled, A.rejected) }); let v, y = 0, w; if (!f) { const k = [Y3.bind(this), void 0]; for (k.unshift.apply(k, o), k.push.apply(k, p), w = k.length, v = Promise.resolve(n); y < w;)v = v.then(k[y++], k[y++]); return v } w = o.length; let P = n; for (y = 0; y < w;) { const k = o[y++], A = o[y++]; try { P = k(P) } catch (N) { A.call(this, N); break } } try { v = Y3.call(this, P) } catch (k) { return Promise.reject(k) } for (y = 0, w = p.length; y < w;)v = v.then(p[y++], p[y++]); return v } getUri(t) { t = cf(this.defaults, t); const n = o6(t.baseURL, t.url); return t6(n, t.params, t.paramsSerializer) } } Nt.forEach(["delete", "get", "head", "options"], function (t) { e0.prototype[t] = function (n, r) { return this.request(cf(r || {}, { method: t, url: n, data: (r || {}).data })) } }); Nt.forEach(["post", "put", "patch"], function (t) { function n(r) { return function (s, c, o) { return this.request(cf(o || {}, { method: t, headers: r ? { "Content-Type": "multipart/form-data" } : {}, url: s, data: c })) } } e0.prototype[t] = n(), e0.prototype[t + "Form"] = n(!0) }); const ey = e0; class vE { constructor(t) { if (typeof t != "function") throw new TypeError("executor must be a function."); let n; this.promise = new Promise(function (s) { n = s }); const r = this; this.promise.then(i => { if (!r._listeners) return; let s = r._listeners.length; for (; s-- > 0;)r._listeners[s](i); r._listeners = null }), this.promise.then = i => { let s; const c = new Promise(o => { r.subscribe(o), s = o }).then(i); return c.cancel = function () { r.unsubscribe(s) }, c }, t(function (s, c, o) { r.reason || (r.reason = new Im(s, c, o), n(r.reason)) }) } throwIfRequested() { if (this.reason) throw this.reason } subscribe(t) { if (this.reason) { t(this.reason); return } this._listeners ? this._listeners.push(t) : this._listeners = [t] } unsubscribe(t) { if (!this._listeners) return; const n = this._listeners.indexOf(t); n !== -1 && this._listeners.splice(n, 1) } static source() { let t; return { token: new vE(function (i) { t = i }), cancel: t } } } const Zue = vE; function Xue(e) { return function (n) { return e.apply(null, n) } } function Yue(e) { return Nt.isObject(e) && e.isAxiosError === !0 } const RC = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511 }; Object.entries(RC).forEach(([e, t]) => { RC[t] = e }); const Que = RC; function s6(e) { const t = new ey(e), n = U5(ey.prototype.request, t); return Nt.extend(n, ey.prototype, t, { allOwnKeys: !0 }), Nt.extend(n, t, null, { allOwnKeys: !0 }), n.create = function (i) { return s6(cf(e, i)) }, n } const Ai = s6(pE); Ai.Axios = ey; Ai.CanceledError = Im; Ai.CancelToken = Zue; Ai.isCancel = i6; Ai.VERSION = a6; Ai.toFormData = bx; Ai.AxiosError = pr; Ai.Cancel = Ai.CanceledError; Ai.all = function (t) { return Promise.all(t) }; Ai.spread = Xue; Ai.isAxiosError = Yue; Ai.mergeConfig = cf; Ai.AxiosHeaders = Js; Ai.formToJSON = e => r6(Nt.isHTMLForm(e) ? new FormData(e) : e); Ai.HttpStatusCode = Que; Ai.default = Ai; const Jue = Ai; class Of { constructor() { this.listeners = [], this.subscribe = this.subscribe.bind(this) } subscribe(t) { return this.listeners.push(t), this.onSubscribe(), () => { this.listeners = this.listeners.filter(n => n !== t), this.onUnsubscribe() } } hasListeners() { return this.listeners.length > 0 } onSubscribe() { } onUnsubscribe() { } } const Qp = typeof window > "u" || "Deno" in window; function ma() { } function ece(e, t) { return typeof e == "function" ? e(t) : e } function MC(e) { return typeof e == "number" && e >= 0 && e !== 1 / 0 } function l6(e, t) { return Math.max(e + (t || 0) - Date.now(), 0) } function Jh(e, t, n) { return Rm(e) ? typeof t == "function" ? { ...n, queryKey: e, queryFn: t } : { ...t, queryKey: e } : e } function tce(e, t, n) { return Rm(e) ? typeof t == "function" ? { ...n, mutationKey: e, mutationFn: t } : { ...t, mutationKey: e } : typeof e == "function" ? { ...t, mutationFn: e } : { ...e } } function Ul(e, t, n) { return Rm(e) ? [{ ...t, queryKey: e }, n] : [e || {}, t] } function eR(e, t) { const { type: n = "all", exact: r, fetchStatus: i, predicate: s, queryKey: c, stale: o } = e; if (Rm(c)) { if (r) { if (t.queryHash !== gE(c, t.options)) return !1 } else if (!t0(t.queryKey, c)) return !1 } if (n !== "all") { const f = t.isActive(); if (n === "active" && !f || n === "inactive" && f) return !1 } return !(typeof o == "boolean" && t.isStale() !== o || typeof i < "u" && i !== t.state.fetchStatus || s && !s(t)) } function tR(e, t) { const { exact: n, fetching: r, predicate: i, mutationKey: s } = e; if (Rm(s)) { if (!t.options.mutationKey) return !1; if (n) { if (lc(t.options.mutationKey) !== lc(s)) return !1 } else if (!t0(t.options.mutationKey, s)) return !1 } return !(typeof r == "boolean" && t.state.status === "loading" !== r || i && !i(t)) } function gE(e, t) { return ((t == null ? void 0 : t.queryKeyHashFn) || lc)(e) } function lc(e) { return JSON.stringify(e, (t, n) => NC(n) ? Object.keys(n).sort().reduce((r, i) => (r[i] = n[i], r), {}) : n) } function t0(e, t) { return u6(e, t) } function u6(e, t) { return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some(n => !u6(e[n], t[n])) : !1 } function c6(e, t) { if (e === t) return e; const n = nR(e) && nR(t); if (n || NC(e) && NC(t)) { const r = n ? e.length : Object.keys(e).length, i = n ? t : Object.keys(t), s = i.length, c = n ? [] : {}; let o = 0; for (let f = 0; f < s; f++) { const p = n ? f : i[f]; c[p] = c6(e[p], t[p]), c[p] === e[p] && o++ } return r === s && o === r ? e : c } return t } function AC(e, t) { if (e && !t || t && !e) return !1; for (const n in e) if (e[n] !== t[n]) return !1; return !0 } function nR(e) { return Array.isArray(e) && e.length === Object.keys(e).length } function NC(e) { if (!rR(e)) return !1; const t = e.constructor; if (typeof t > "u") return !0; const n = t.prototype; return !(!rR(n) || !n.hasOwnProperty("isPrototypeOf")) } function rR(e) { return Object.prototype.toString.call(e) === "[object Object]" } function Rm(e) { return Array.isArray(e) } function d6(e) { return new Promise(t => { setTimeout(t, e) }) } function iR(e) { d6(0).then(e) } function nce() { if (typeof AbortController == "function") return new AbortController } function OC(e, t, n) { return n.isDataEqual != null && n.isDataEqual(e, t) ? e : typeof n.structuralSharing == "function" ? n.structuralSharing(e, t) : n.structuralSharing !== !1 ? c6(e, t) : t } class rce extends Of { constructor() { super(), this.setup = t => { if (!Qp && window.addEventListener) { const n = () => t(); return window.addEventListener("visibilitychange", n, !1), window.addEventListener("focus", n, !1), () => { window.removeEventListener("visibilitychange", n), window.removeEventListener("focus", n) } } } } onSubscribe() { this.cleanup || this.setEventListener(this.setup) } onUnsubscribe() { if (!this.hasListeners()) { var t; (t = this.cleanup) == null || t.call(this), this.cleanup = void 0 } } setEventListener(t) { var n; this.setup = t, (n = this.cleanup) == null || n.call(this), this.cleanup = t(r => { typeof r == "boolean" ? this.setFocused(r) : this.onFocus() }) } setFocused(t) { this.focused = t, t && this.onFocus() } onFocus() { this.listeners.forEach(t => { t() }) } isFocused() { return typeof this.focused == "boolean" ? this.focused : typeof document > "u" ? !0 : [void 0, "visible", "prerender"].includes(document.visibilityState) } } const n0 = new rce; class ice extends Of { constructor() { super(), this.setup = t => { if (!Qp && window.addEventListener) { const n = () => t(); return window.addEventListener("online", n, !1), window.addEventListener("offline", n, !1), () => { window.removeEventListener("online", n), window.removeEventListener("offline", n) } } } } onSubscribe() { this.cleanup || this.setEventListener(this.setup) } onUnsubscribe() { if (!this.hasListeners()) { var t; (t = this.cleanup) == null || t.call(this), this.cleanup = void 0 } } setEventListener(t) { var n; this.setup = t, (n = this.cleanup) == null || n.call(this), this.cleanup = t(r => { typeof r == "boolean" ? this.setOnline(r) : this.onOnline() }) } setOnline(t) { this.online = t, t && this.onOnline() } onOnline() { this.listeners.forEach(t => { t() }) } isOnline() { return typeof this.online == "boolean" ? this.online : typeof navigator > "u" || typeof navigator.onLine > "u" ? !0 : navigator.onLine } } const r0 = new ice; function oce(e) { return Math.min(1e3 * 2 ** e, 3e4) } function Sx(e) { return (e != null ? e : "online") === "online" ? r0.isOnline() : !0 } class f6 { constructor(t) { this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent } } function ty(e) { return e instanceof f6 } function h6(e) { let t = !1, n = 0, r = !1, i, s, c; const o = new Promise((N, R) => { s = N, c = R }), f = N => { r || (P(new f6(N)), e.abort == null || e.abort()) }, p = () => { t = !0 }, v = () => { t = !1 }, y = () => !n0.isFocused() || e.networkMode !== "always" && !r0.isOnline(), w = N => { r || (r = !0, e.onSuccess == null || e.onSuccess(N), i == null || i(), s(N)) }, P = N => { r || (r = !0, e.onError == null || e.onError(N), i == null || i(), c(N)) }, k = () => new Promise(N => { i = R => { const M = r || !y(); return M && N(R), M }, e.onPause == null || e.onPause() }).then(() => { i = void 0, r || e.onContinue == null || e.onContinue() }), A = () => { if (r) return; let N; try { N = e.fn() } catch (R) { N = Promise.reject(R) } Promise.resolve(N).then(w).catch(R => { var M, O; if (r) return; const z = (M = e.retry) != null ? M : 3, B = (O = e.retryDelay) != null ? O : oce, V = typeof B == "function" ? B(n, R) : B, G = z === !0 || typeof z == "number" && n < z || typeof z == "function" && z(n, R); if (t || !G) { P(R); return } n++, e.onFail == null || e.onFail(n, R), d6(V).then(() => { if (y()) return k() }).then(() => { t ? P(R) : A() }) }) }; return Sx(e.networkMode) ? A() : k().then(A), { promise: o, cancel: f, continue: () => (i == null ? void 0 : i()) ? o : Promise.resolve(), cancelRetry: p, continueRetry: v } } const yE = console; function ace() { let e = [], t = 0, n = v => { v() }, r = v => { v() }; const i = v => { let y; t++; try { y = v() } finally { t--, t || o() } return y }, s = v => { t ? e.push(v) : iR(() => { n(v) }) }, c = v => (...y) => { s(() => { v(...y) }) }, o = () => { const v = e; e = [], v.length && iR(() => { r(() => { v.forEach(y => { n(y) }) }) }) }; return { batch: i, batchCalls: c, schedule: s, setNotifyFunction: v => { n = v }, setBatchNotifyFunction: v => { r = v } } } const ai = ace(); class p6 { destroy() { this.clearGcTimeout() } scheduleGc() { this.clearGcTimeout(), MC(this.cacheTime) && (this.gcTimeout = setTimeout(() => { this.optionalRemove() }, this.cacheTime)) } updateCacheTime(t) { this.cacheTime = Math.max(this.cacheTime || 0, t != null ? t : Qp ? 1 / 0 : 5 * 60 * 1e3) } clearGcTimeout() { this.gcTimeout && (clearTimeout(this.gcTimeout), this.gcTimeout = void 0) } } class sce extends p6 { constructor(t) { super(), this.abortSignalConsumed = !1, this.defaultOptions = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.cache = t.cache, this.logger = t.logger || yE, this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.initialState = t.state || lce(this.options), this.state = this.initialState, this.scheduleGc() } get meta() { return this.options.meta } setOptions(t) { this.options = { ...this.defaultOptions, ...t }, this.updateCacheTime(this.options.cacheTime) } optionalRemove() { !this.observers.length && this.state.fetchStatus === "idle" && this.cache.remove(this) } setData(t, n) { const r = OC(this.state.data, t, this.options); return this.dispatch({ data: r, type: "success", dataUpdatedAt: n == null ? void 0 : n.updatedAt, manual: n == null ? void 0 : n.manual }), r } setState(t, n) { this.dispatch({ type: "setState", state: t, setStateOptions: n }) } cancel(t) { var n; const r = this.promise; return (n = this.retryer) == null || n.cancel(t), r ? r.then(ma).catch(ma) : Promise.resolve() } destroy() { super.destroy(), this.cancel({ silent: !0 }) } reset() { this.destroy(), this.setState(this.initialState) } isActive() { return this.observers.some(t => t.options.enabled !== !1) } isDisabled() { return this.getObserversCount() > 0 && !this.isActive() } isStale() { return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(t => t.getCurrentResult().isStale) } isStaleByTime(t = 0) { return this.state.isInvalidated || !this.state.dataUpdatedAt || !l6(this.state.dataUpdatedAt, t) } onFocus() { var t; const n = this.observers.find(r => r.shouldFetchOnWindowFocus()); n && n.refetch({ cancelRefetch: !1 }), (t = this.retryer) == null || t.continue() } onOnline() { var t; const n = this.observers.find(r => r.shouldFetchOnReconnect()); n && n.refetch({ cancelRefetch: !1 }), (t = this.retryer) == null || t.continue() } addObserver(t) { this.observers.indexOf(t) === -1 && (this.observers.push(t), this.clearGcTimeout(), this.cache.notify({ type: "observerAdded", query: this, observer: t })) } removeObserver(t) { this.observers.indexOf(t) !== -1 && (this.observers = this.observers.filter(n => n !== t), this.observers.length || (this.retryer && (this.abortSignalConsumed ? this.retryer.cancel({ revert: !0 }) : this.retryer.cancelRetry()), this.scheduleGc()), this.cache.notify({ type: "observerRemoved", query: this, observer: t })) } getObserversCount() { return this.observers.length } invalidate() { this.state.isInvalidated || this.dispatch({ type: "invalidate" }) } fetch(t, n) { var r, i; if (this.state.fetchStatus !== "idle") { if (this.state.dataUpdatedAt && n != null && n.cancelRefetch) this.cancel({ silent: !0 }); else if (this.promise) { var s; return (s = this.retryer) == null || s.continueRetry(), this.promise } } if (t && this.setOptions(t), !this.options.queryFn) { const P = this.observers.find(k => k.options.queryFn); P && this.setOptions(P.options) } Array.isArray(this.options.queryKey); const c = nce(), o = { queryKey: this.queryKey, pageParam: void 0, meta: this.meta }, f = P => { Object.defineProperty(P, "signal", { enumerable: !0, get: () => { if (c) return this.abortSignalConsumed = !0, c.signal } }) }; f(o); const p = () => this.options.queryFn ? (this.abortSignalConsumed = !1, this.options.queryFn(o)) : Promise.reject("Missing queryFn"), v = { fetchOptions: n, options: this.options, queryKey: this.queryKey, state: this.state, fetchFn: p }; if (f(v), (r = this.options.behavior) == null || r.onFetch(v), this.revertState = this.state, this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((i = v.fetchOptions) == null ? void 0 : i.meta)) { var y; this.dispatch({ type: "fetch", meta: (y = v.fetchOptions) == null ? void 0 : y.meta }) } const w = P => { if (ty(P) && P.silent || this.dispatch({ type: "error", error: P }), !ty(P)) { var k, A; (k = (A = this.cache.config).onError) == null || k.call(A, P, this) } this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1 }; return this.retryer = h6({ fn: v.fetchFn, abort: c == null ? void 0 : c.abort.bind(c), onSuccess: P => { var k, A; if (typeof P > "u") { w(new Error("undefined")); return } this.setData(P), (k = (A = this.cache.config).onSuccess) == null || k.call(A, P, this), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1 }, onError: w, onFail: (P, k) => { this.dispatch({ type: "failed", failureCount: P, error: k }) }, onPause: () => { this.dispatch({ type: "pause" }) }, onContinue: () => { this.dispatch({ type: "continue" }) }, retry: v.options.retry, retryDelay: v.options.retryDelay, networkMode: v.options.networkMode }), this.promise = this.retryer.promise, this.promise } dispatch(t) { const n = r => { var i, s; switch (t.type) { case "failed": return { ...r, fetchFailureCount: t.failureCount, fetchFailureReason: t.error }; case "pause": return { ...r, fetchStatus: "paused" }; case "continue": return { ...r, fetchStatus: "fetching" }; case "fetch": return { ...r, fetchFailureCount: 0, fetchFailureReason: null, fetchMeta: (i = t.meta) != null ? i : null, fetchStatus: Sx(this.options.networkMode) ? "fetching" : "paused", ...!r.dataUpdatedAt && { error: null, status: "loading" } }; case "success": return { ...r, data: t.data, dataUpdateCount: r.dataUpdateCount + 1, dataUpdatedAt: (s = t.dataUpdatedAt) != null ? s : Date.now(), error: null, isInvalidated: !1, status: "success", ...!t.manual && { fetchStatus: "idle", fetchFailureCount: 0, fetchFailureReason: null } }; case "error": const c = t.error; return ty(c) && c.revert && this.revertState ? { ...this.revertState } : { ...r, error: c, errorUpdateCount: r.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: r.fetchFailureCount + 1, fetchFailureReason: c, fetchStatus: "idle", status: "error" }; case "invalidate": return { ...r, isInvalidated: !0 }; case "setState": return { ...r, ...t.state } } }; this.state = n(this.state), ai.batch(() => { this.observers.forEach(r => { r.onQueryUpdate(t) }), this.cache.notify({ query: this, type: "updated", action: t }) }) } } function lce(e) { const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = typeof t < "u", r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0; return { data: t, dataUpdateCount: 0, dataUpdatedAt: n ? r != null ? r : Date.now() : 0, error: null, errorUpdateCount: 0, errorUpdatedAt: 0, fetchFailureCount: 0, fetchFailureReason: null, fetchMeta: null, isInvalidated: !1, status: n ? "success" : "loading", fetchStatus: "idle" } } class uce extends Of { constructor(t) { super(), this.config = t || {}, this.queries = [], this.queriesMap = {} } build(t, n, r) { var i; const s = n.queryKey, c = (i = n.queryHash) != null ? i : gE(s, n); let o = this.get(c); return o || (o = new sce({ cache: this, logger: t.getLogger(), queryKey: s, queryHash: c, options: t.defaultQueryOptions(n), state: r, defaultOptions: t.getQueryDefaults(s) }), this.add(o)), o } add(t) { this.queriesMap[t.queryHash] || (this.queriesMap[t.queryHash] = t, this.queries.push(t), this.notify({ type: "added", query: t })) } remove(t) { const n = this.queriesMap[t.queryHash]; n && (t.destroy(), this.queries = this.queries.filter(r => r !== t), n === t && delete this.queriesMap[t.queryHash], this.notify({ type: "removed", query: t })) } clear() { ai.batch(() => { this.queries.forEach(t => { this.remove(t) }) }) } get(t) { return this.queriesMap[t] } getAll() { return this.queries } find(t, n) { const [r] = Ul(t, n); return typeof r.exact > "u" && (r.exact = !0), this.queries.find(i => eR(r, i)) } findAll(t, n) { const [r] = Ul(t, n); return Object.keys(r).length > 0 ? this.queries.filter(i => eR(r, i)) : this.queries } notify(t) { ai.batch(() => { this.listeners.forEach(n => { n(t) }) }) } onFocus() { ai.batch(() => { this.queries.forEach(t => { t.onFocus() }) }) } onOnline() { ai.batch(() => { this.queries.forEach(t => { t.onOnline() }) }) } } class cce extends p6 { constructor(t) { super(), this.options = { ...t.defaultOptions, ...t.options }, this.mutationId = t.mutationId, this.mutationCache = t.mutationCache, this.logger = t.logger || yE, this.observers = [], this.state = t.state || m6(), this.updateCacheTime(this.options.cacheTime), this.scheduleGc() } get meta() { return this.options.meta } setState(t) { this.dispatch({ type: "setState", state: t }) } addObserver(t) { this.observers.indexOf(t) === -1 && (this.observers.push(t), this.clearGcTimeout(), this.mutationCache.notify({ type: "observerAdded", mutation: this, observer: t })) } removeObserver(t) { this.observers = this.observers.filter(n => n !== t), this.scheduleGc(), this.mutationCache.notify({ type: "observerRemoved", mutation: this, observer: t }) } optionalRemove() { this.observers.length || (this.state.status === "loading" ? this.scheduleGc() : this.mutationCache.remove(this)) } continue() { var t, n; return (t = (n = this.retryer) == null ? void 0 : n.continue()) != null ? t : this.execute() } async execute() { const t = () => { var O; return this.retryer = h6({ fn: () => this.options.mutationFn ? this.options.mutationFn(this.state.variables) : Promise.reject("No mutationFn found"), onFail: (z, B) => { this.dispatch({ type: "failed", failureCount: z, error: B }) }, onPause: () => { this.dispatch({ type: "pause" }) }, onContinue: () => { this.dispatch({ type: "continue" }) }, retry: (O = this.options.retry) != null ? O : 0, retryDelay: this.options.retryDelay, networkMode: this.options.networkMode }), this.retryer.promise }, n = this.state.status === "loading"; try { var r, i, s, c, o, f; if (!n) { var p, v, y, w; this.dispatch({ type: "loading", variables: this.options.variables }), await ((p = (v = this.mutationCache.config).onMutate) == null ? void 0 : p.call(v, this.state.variables, this)); const z = await ((y = (w = this.options).onMutate) == null ? void 0 : y.call(w, this.state.variables)); z !== this.state.context && this.dispatch({ type: "loading", context: z, variables: this.state.variables }) } const O = await t(); return await ((r = (i = this.mutationCache.config).onSuccess) == null ? void 0 : r.call(i, O, this.state.variables, this.state.context, this)), await ((s = (c = this.options).onSuccess) == null ? void 0 : s.call(c, O, this.state.variables, this.state.context)), await ((o = (f = this.options).onSettled) == null ? void 0 : o.call(f, O, null, this.state.variables, this.state.context)), this.dispatch({ type: "success", data: O }), O } catch (O) { try { var P, k, A, N, R, M; throw await ((P = (k = this.mutationCache.config).onError) == null ? void 0 : P.call(k, O, this.state.variables, this.state.context, this)), await ((A = (N = this.options).onError) == null ? void 0 : A.call(N, O, this.state.variables, this.state.context)), await ((R = (M = this.options).onSettled) == null ? void 0 : R.call(M, void 0, O, this.state.variables, this.state.context)), O } finally { this.dispatch({ type: "error", error: O }) } } } dispatch(t) { const n = r => { switch (t.type) { case "failed": return { ...r, failureCount: t.failureCount, failureReason: t.error }; case "pause": return { ...r, isPaused: !0 }; case "continue": return { ...r, isPaused: !1 }; case "loading": return { ...r, context: t.context, data: void 0, failureCount: 0, failureReason: null, error: null, isPaused: !Sx(this.options.networkMode), status: "loading", variables: t.variables }; case "success": return { ...r, data: t.data, failureCount: 0, failureReason: null, error: null, status: "success", isPaused: !1 }; case "error": return { ...r, data: void 0, error: t.error, failureCount: r.failureCount + 1, failureReason: t.error, isPaused: !1, status: "error" }; case "setState": return { ...r, ...t.state } } }; this.state = n(this.state), ai.batch(() => { this.observers.forEach(r => { r.onMutationUpdate(t) }), this.mutationCache.notify({ mutation: this, type: "updated", action: t }) }) } } function m6() { return { context: void 0, data: void 0, error: null, failureCount: 0, failureReason: null, isPaused: !1, status: "idle", variables: void 0 } } class dce extends Of { constructor(t) { super(), this.config = t || {}, this.mutations = [], this.mutationId = 0 } build(t, n, r) { const i = new cce({ mutationCache: this, logger: t.getLogger(), mutationId: ++this.mutationId, options: t.defaultMutationOptions(n), state: r, defaultOptions: n.mutationKey ? t.getMutationDefaults(n.mutationKey) : void 0 }); return this.add(i), i } add(t) { this.mutations.push(t), this.notify({ type: "added", mutation: t }) } remove(t) { this.mutations = this.mutations.filter(n => n !== t), this.notify({ type: "removed", mutation: t }) } clear() { ai.batch(() => { this.mutations.forEach(t => { this.remove(t) }) }) } getAll() { return this.mutations } find(t) { return typeof t.exact > "u" && (t.exact = !0), this.mutations.find(n => tR(t, n)) } findAll(t) { return this.mutations.filter(n => tR(t, n)) } notify(t) { ai.batch(() => { this.listeners.forEach(n => { n(t) }) }) } resumePausedMutations() { var t; return this.resuming = ((t = this.resuming) != null ? t : Promise.resolve()).then(() => { const n = this.mutations.filter(r => r.state.isPaused); return ai.batch(() => n.reduce((r, i) => r.then(() => i.continue().catch(ma)), Promise.resolve())) }).then(() => { this.resuming = void 0 }), this.resuming } } function fce() { return { onFetch: e => { e.fetchFn = () => { var t, n, r, i, s, c; const o = (t = e.fetchOptions) == null || (n = t.meta) == null ? void 0 : n.refetchPage, f = (r = e.fetchOptions) == null || (i = r.meta) == null ? void 0 : i.fetchMore, p = f == null ? void 0 : f.pageParam, v = (f == null ? void 0 : f.direction) === "forward", y = (f == null ? void 0 : f.direction) === "backward", w = ((s = e.state.data) == null ? void 0 : s.pages) || [], P = ((c = e.state.data) == null ? void 0 : c.pageParams) || []; let k = P, A = !1; const N = V => { Object.defineProperty(V, "signal", { enumerable: !0, get: () => { var G; if ((G = e.signal) != null && G.aborted) A = !0; else { var j; (j = e.signal) == null || j.addEventListener("abort", () => { A = !0 }) } return e.signal } }) }, R = e.options.queryFn || (() => Promise.reject("Missing queryFn")), M = (V, G, j, X) => (k = X ? [G, ...k] : [...k, G], X ? [j, ...V] : [...V, j]), O = (V, G, j, X) => { if (A) return Promise.reject("Cancelled"); if (typeof j > "u" && !G && V.length) return Promise.resolve(V); const Y = { queryKey: e.queryKey, pageParam: j, meta: e.options.meta }; N(Y); const se = R(Y); return Promise.resolve(se).then(Z => M(V, j, Z, X)) }; let z; if (!w.length) z = O([]); else if (v) { const V = typeof p < "u", G = V ? p : oR(e.options, w); z = O(w, V, G) } else if (y) { const V = typeof p < "u", G = V ? p : hce(e.options, w); z = O(w, V, G, !0) } else { k = []; const V = typeof e.options.getNextPageParam > "u"; z = (o && w[0] ? o(w[0], 0, w) : !0) ? O([], V, P[0]) : Promise.resolve(M([], P[0], w[0])); for (let j = 1; j < w.length; j++)z = z.then(X => { if (o && w[j] ? o(w[j], j, w) : !0) { const se = V ? P[j] : oR(e.options, X); return O(X, V, se) } return Promise.resolve(M(X, P[j], w[j])) }) } return z.then(V => ({ pages: V, pageParams: k })) } } } } function oR(e, t) { return e.getNextPageParam == null ? void 0 : e.getNextPageParam(t[t.length - 1], t) } function hce(e, t) { return e.getPreviousPageParam == null ? void 0 : e.getPreviousPageParam(t[0], t) } class pce { constructor(t = {}) { this.queryCache = t.queryCache || new uce, this.mutationCache = t.mutationCache || new dce, this.logger = t.logger || yE, this.defaultOptions = t.defaultOptions || {}, this.queryDefaults = [], this.mutationDefaults = [], this.mountCount = 0 } mount() { this.mountCount++, this.mountCount === 1 && (this.unsubscribeFocus = n0.subscribe(() => { n0.isFocused() && (this.resumePausedMutations(), this.queryCache.onFocus()) }), this.unsubscribeOnline = r0.subscribe(() => { r0.isOnline() && (this.resumePausedMutations(), this.queryCache.onOnline()) })) } unmount() { var t, n; this.mountCount--, this.mountCount === 0 && ((t = this.unsubscribeFocus) == null || t.call(this), this.unsubscribeFocus = void 0, (n = this.unsubscribeOnline) == null || n.call(this), this.unsubscribeOnline = void 0) } isFetching(t, n) { const [r] = Ul(t, n); return r.fetchStatus = "fetching", this.queryCache.findAll(r).length } isMutating(t) { return this.mutationCache.findAll({ ...t, fetching: !0 }).length } getQueryData(t, n) { var r; return (r = this.queryCache.find(t, n)) == null ? void 0 : r.state.data } ensureQueryData(t, n, r) { const i = Jh(t, n, r), s = this.getQueryData(i.queryKey); return s ? Promise.resolve(s) : this.fetchQuery(i) } getQueriesData(t) { return this.getQueryCache().findAll(t).map(({ queryKey: n, state: r }) => { const i = r.data; return [n, i] }) } setQueryData(t, n, r) { const i = this.queryCache.find(t), s = i == null ? void 0 : i.state.data, c = ece(n, s); if (typeof c > "u") return; const o = Jh(t), f = this.defaultQueryOptions(o); return this.queryCache.build(this, f).setData(c, { ...r, manual: !0 }) } setQueriesData(t, n, r) { return ai.batch(() => this.getQueryCache().findAll(t).map(({ queryKey: i }) => [i, this.setQueryData(i, n, r)])) } getQueryState(t, n) { var r; return (r = this.queryCache.find(t, n)) == null ? void 0 : r.state } removeQueries(t, n) { const [r] = Ul(t, n), i = this.queryCache; ai.batch(() => { i.findAll(r).forEach(s => { i.remove(s) }) }) } resetQueries(t, n, r) { const [i, s] = Ul(t, n, r), c = this.queryCache, o = { type: "active", ...i }; return ai.batch(() => (c.findAll(i).forEach(f => { f.reset() }), this.refetchQueries(o, s))) } cancelQueries(t, n, r) { const [i, s = {}] = Ul(t, n, r); typeof s.revert > "u" && (s.revert = !0); const c = ai.batch(() => this.queryCache.findAll(i).map(o => o.cancel(s))); return Promise.all(c).then(ma).catch(ma) } invalidateQueries(t, n, r) { const [i, s] = Ul(t, n, r); return ai.batch(() => { var c, o; if (this.queryCache.findAll(i).forEach(p => { p.invalidate() }), i.refetchType === "none") return Promise.resolve(); const f = { ...i, type: (c = (o = i.refetchType) != null ? o : i.type) != null ? c : "active" }; return this.refetchQueries(f, s) }) } refetchQueries(t, n, r) { const [i, s] = Ul(t, n, r), c = ai.batch(() => this.queryCache.findAll(i).filter(f => !f.isDisabled()).map(f => { var p; return f.fetch(void 0, { ...s, cancelRefetch: (p = s == null ? void 0 : s.cancelRefetch) != null ? p : !0, meta: { refetchPage: i.refetchPage } }) })); let o = Promise.all(c).then(ma); return s != null && s.throwOnError || (o = o.catch(ma)), o } fetchQuery(t, n, r) { const i = Jh(t, n, r), s = this.defaultQueryOptions(i); typeof s.retry > "u" && (s.retry = !1); const c = this.queryCache.build(this, s); return c.isStaleByTime(s.staleTime) ? c.fetch(s) : Promise.resolve(c.state.data) } prefetchQuery(t, n, r) { return this.fetchQuery(t, n, r).then(ma).catch(ma) } fetchInfiniteQuery(t, n, r) { const i = Jh(t, n, r); return i.behavior = fce(), this.fetchQuery(i) } prefetchInfiniteQuery(t, n, r) { return this.fetchInfiniteQuery(t, n, r).then(ma).catch(ma) } resumePausedMutations() { return this.mutationCache.resumePausedMutations() } getQueryCache() { return this.queryCache } getMutationCache() { return this.mutationCache } getLogger() { return this.logger } getDefaultOptions() { return this.defaultOptions } setDefaultOptions(t) { this.defaultOptions = t } setQueryDefaults(t, n) { const r = this.queryDefaults.find(i => lc(t) === lc(i.queryKey)); r ? r.defaultOptions = n : this.queryDefaults.push({ queryKey: t, defaultOptions: n }) } getQueryDefaults(t) { if (!t) return; const n = this.queryDefaults.find(r => t0(t, r.queryKey)); return n == null ? void 0 : n.defaultOptions } setMutationDefaults(t, n) { const r = this.mutationDefaults.find(i => lc(t) === lc(i.mutationKey)); r ? r.defaultOptions = n : this.mutationDefaults.push({ mutationKey: t, defaultOptions: n }) } getMutationDefaults(t) { if (!t) return; const n = this.mutationDefaults.find(r => t0(t, r.mutationKey)); return n == null ? void 0 : n.defaultOptions } defaultQueryOptions(t) { if (t != null && t._defaulted) return t; const n = { ...this.defaultOptions.queries, ...this.getQueryDefaults(t == null ? void 0 : t.queryKey), ...t, _defaulted: !0 }; return !n.queryHash && n.queryKey && (n.queryHash = gE(n.queryKey, n)), typeof n.refetchOnReconnect > "u" && (n.refetchOnReconnect = n.networkMode !== "always"), typeof n.useErrorBoundary > "u" && (n.useErrorBoundary = !!n.suspense), n } defaultMutationOptions(t) { return t != null && t._defaulted ? t : { ...this.defaultOptions.mutations, ...this.getMutationDefaults(t == null ? void 0 : t.mutationKey), ...t, _defaulted: !0 } } clear() { this.queryCache.clear(), this.mutationCache.clear() } } class mce extends Of { constructor(t, n) { super(), this.client = t, this.options = n, this.trackedProps = new Set, this.selectError = null, this.bindMethods(), this.setOptions(n) } bindMethods() { this.remove = this.remove.bind(this), this.refetch = this.refetch.bind(this) } onSubscribe() { this.listeners.length === 1 && (this.currentQuery.addObserver(this), aR(this.currentQuery, this.options) && this.executeFetch(), this.updateTimers()) } onUnsubscribe() { this.listeners.length || this.destroy() } shouldFetchOnReconnect() { return DC(this.currentQuery, this.options, this.options.refetchOnReconnect) } shouldFetchOnWindowFocus() { return DC(this.currentQuery, this.options, this.options.refetchOnWindowFocus) } destroy() { this.listeners = [], this.clearStaleTimeout(), this.clearRefetchInterval(), this.currentQuery.removeObserver(this) } setOptions(t, n) { const r = this.options, i = this.currentQuery; if (this.options = this.client.defaultQueryOptions(t), AC(r, this.options) || this.client.getQueryCache().notify({ type: "observerOptionsUpdated", query: this.currentQuery, observer: this }), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean") throw new Error("Expected enabled to be a boolean"); this.options.queryKey || (this.options.queryKey = r.queryKey), this.updateQuery(); const s = this.hasListeners(); s && sR(this.currentQuery, i, this.options, r) && this.executeFetch(), this.updateResult(n), s && (this.currentQuery !== i || this.options.enabled !== r.enabled || this.options.staleTime !== r.staleTime) && this.updateStaleTimeout(); const c = this.computeRefetchInterval(); s && (this.currentQuery !== i || this.options.enabled !== r.enabled || c !== this.currentRefetchInterval) && this.updateRefetchInterval(c) } getOptimisticResult(t) { const n = this.client.getQueryCache().build(this.client, t); return this.createResult(n, t) } getCurrentResult() { return this.currentResult } trackResult(t) { const n = {}; return Object.keys(t).forEach(r => { Object.defineProperty(n, r, { configurable: !1, enumerable: !0, get: () => (this.trackedProps.add(r), t[r]) }) }), n } getCurrentQuery() { return this.currentQuery } remove() { this.client.getQueryCache().remove(this.currentQuery) } refetch({ refetchPage: t, ...n } = {}) { return this.fetch({ ...n, meta: { refetchPage: t } }) } fetchOptimistic(t) { const n = this.client.defaultQueryOptions(t), r = this.client.getQueryCache().build(this.client, n); return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, n)) } fetch(t) { var n; return this.executeFetch({ ...t, cancelRefetch: (n = t.cancelRefetch) != null ? n : !0 }).then(() => (this.updateResult(), this.currentResult)) } executeFetch(t) { this.updateQuery(); let n = this.currentQuery.fetch(this.options, t); return t != null && t.throwOnError || (n = n.catch(ma)), n } updateStaleTimeout() { if (this.clearStaleTimeout(), Qp || this.currentResult.isStale || !MC(this.options.staleTime)) return; const n = l6(this.currentResult.dataUpdatedAt, this.options.staleTime) + 1; this.staleTimeoutId = setTimeout(() => { this.currentResult.isStale || this.updateResult() }, n) } computeRefetchInterval() { var t; return typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (t = this.options.refetchInterval) != null ? t : !1 } updateRefetchInterval(t) { this.clearRefetchInterval(), this.currentRefetchInterval = t, !(Qp || this.options.enabled === !1 || !MC(this.currentRefetchInterval) || this.currentRefetchInterval === 0) && (this.refetchIntervalId = setInterval(() => { (this.options.refetchIntervalInBackground || n0.isFocused()) && this.executeFetch() }, this.currentRefetchInterval)) } updateTimers() { this.updateStaleTimeout(), this.updateRefetchInterval(this.computeRefetchInterval()) } clearStaleTimeout() { this.staleTimeoutId && (clearTimeout(this.staleTimeoutId), this.staleTimeoutId = void 0) } clearRefetchInterval() { this.refetchIntervalId && (clearInterval(this.refetchIntervalId), this.refetchIntervalId = void 0) } createResult(t, n) { const r = this.currentQuery, i = this.options, s = this.currentResult, c = this.currentResultState, o = this.currentResultOptions, f = t !== r, p = f ? t.state : this.currentQueryInitialState, v = f ? this.currentResult : this.previousQueryResult, { state: y } = t; let { dataUpdatedAt: w, error: P, errorUpdatedAt: k, fetchStatus: A, status: N } = y, R = !1, M = !1, O; if (n._optimisticResults) { const j = this.hasListeners(), X = !j && aR(t, n), Y = j && sR(t, r, n, i); (X || Y) && (A = Sx(t.options.networkMode) ? "fetching" : "paused", w || (N = "loading")), n._optimisticResults === "isRestoring" && (A = "idle") } if (n.keepPreviousData && !y.dataUpdatedAt && v != null && v.isSuccess && N !== "error") O = v.data, w = v.dataUpdatedAt, N = v.status, R = !0; else if (n.select && typeof y.data < "u") if (s && y.data === (c == null ? void 0 : c.data) && n.select === this.selectFn) O = this.selectResult; else try { this.selectFn = n.select, O = n.select(y.data), O = OC(s == null ? void 0 : s.data, O, n), this.selectResult = O, this.selectError = null } catch (j) { this.selectError = j } else O = y.data; if (typeof n.placeholderData < "u" && typeof O > "u" && N === "loading") { let j; if (s != null && s.isPlaceholderData && n.placeholderData === (o == null ? void 0 : o.placeholderData)) j = s.data; else if (j = typeof n.placeholderData == "function" ? n.placeholderData() : n.placeholderData, n.select && typeof j < "u") try { j = n.select(j), this.selectError = null } catch (X) { this.selectError = X } typeof j < "u" && (N = "success", O = OC(s == null ? void 0 : s.data, j, n), M = !0) } this.selectError && (P = this.selectError, O = this.selectResult, k = Date.now(), N = "error"); const z = A === "fetching", B = N === "loading", V = N === "error"; return { status: N, fetchStatus: A, isLoading: B, isSuccess: N === "success", isError: V, isInitialLoading: B && z, data: O, dataUpdatedAt: w, error: P, errorUpdatedAt: k, failureCount: y.fetchFailureCount, failureReason: y.fetchFailureReason, errorUpdateCount: y.errorUpdateCount, isFetched: y.dataUpdateCount > 0 || y.errorUpdateCount > 0, isFetchedAfterMount: y.dataUpdateCount > p.dataUpdateCount || y.errorUpdateCount > p.errorUpdateCount, isFetching: z, isRefetching: z && !B, isLoadingError: V && y.dataUpdatedAt === 0, isPaused: A === "paused", isPlaceholderData: M, isPreviousData: R, isRefetchError: V && y.dataUpdatedAt !== 0, isStale: xE(t, n), refetch: this.refetch, remove: this.remove } } updateResult(t) { const n = this.currentResult, r = this.createResult(this.currentQuery, this.options); if (this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options, AC(r, n)) return; this.currentResult = r; const i = { cache: !0 }, s = () => { if (!n) return !0; const { notifyOnChangeProps: c } = this.options; if (c === "all" || !c && !this.trackedProps.size) return !0; const o = new Set(c != null ? c : this.trackedProps); return this.options.useErrorBoundary && o.add("error"), Object.keys(this.currentResult).some(f => { const p = f; return this.currentResult[p] !== n[p] && o.has(p) }) }; (t == null ? void 0 : t.listeners) !== !1 && s() && (i.listeners = !0), this.notify({ ...i, ...t }) } updateQuery() { const t = this.client.getQueryCache().build(this.client, this.options); if (t === this.currentQuery) return; const n = this.currentQuery; this.currentQuery = t, this.currentQueryInitialState = t.state, this.previousQueryResult = this.currentResult, this.hasListeners() && (n == null || n.removeObserver(this), t.addObserver(this)) } onQueryUpdate(t) { const n = {}; t.type === "success" ? n.onSuccess = !t.manual : t.type === "error" && !ty(t.error) && (n.onError = !0), this.updateResult(n), this.hasListeners() && this.updateTimers() } notify(t) { ai.batch(() => { if (t.onSuccess) { var n, r, i, s; (n = (r = this.options).onSuccess) == null || n.call(r, this.currentResult.data), (i = (s = this.options).onSettled) == null || i.call(s, this.currentResult.data, null) } else if (t.onError) { var c, o, f, p; (c = (o = this.options).onError) == null || c.call(o, this.currentResult.error), (f = (p = this.options).onSettled) == null || f.call(p, void 0, this.currentResult.error) } t.listeners && this.listeners.forEach(v => { v(this.currentResult) }), t.cache && this.client.getQueryCache().notify({ query: this.currentQuery, type: "observerResultsUpdated" }) }) } } function vce(e, t) { return t.enabled !== !1 && !e.state.dataUpdatedAt && !(e.state.status === "error" && t.retryOnMount === !1) } function aR(e, t) { return vce(e, t) || e.state.dataUpdatedAt > 0 && DC(e, t, t.refetchOnMount) } function DC(e, t, n) { if (t.enabled !== !1) { const r = typeof n == "function" ? n(e) : n; return r === "always" || r !== !1 && xE(e, t) } return !1 } function sR(e, t, n, r) { return n.enabled !== !1 && (e !== t || r.enabled === !1) && (!n.suspense || e.state.status !== "error") && xE(e, n) } function xE(e, t) { return e.isStaleByTime(t.staleTime) } class gce extends Of { constructor(t, n) { super(), this.client = t, this.setOptions(n), this.bindMethods(), this.updateResult() } bindMethods() { this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this) } setOptions(t) { const n = this.options; this.options = this.client.defaultMutationOptions(t), AC(n, this.options) || this.client.getMutationCache().notify({ type: "observerOptionsUpdated", mutation: this.currentMutation, observer: this }) } onUnsubscribe() { if (!this.listeners.length) { var t; (t = this.currentMutation) == null || t.removeObserver(this) } } onMutationUpdate(t) { this.updateResult(); const n = { listeners: !0 }; t.type === "success" ? n.onSuccess = !0 : t.type === "error" && (n.onError = !0), this.notify(n) } getCurrentResult() { return this.currentResult } reset() { this.currentMutation = void 0, this.updateResult(), this.notify({ listeners: !0 }) } mutate(t, n) { return this.mutateOptions = n, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, { ...this.options, variables: typeof t < "u" ? t : this.options.variables }), this.currentMutation.addObserver(this), this.currentMutation.execute() } updateResult() { const t = this.currentMutation ? this.currentMutation.state : m6(), n = { ...t, isLoading: t.status === "loading", isSuccess: t.status === "success", isError: t.status === "error", isIdle: t.status === "idle", mutate: this.mutate, reset: this.reset }; this.currentResult = n } notify(t) { ai.batch(() => { if (this.mutateOptions && this.hasListeners()) { if (t.onSuccess) { var n, r, i, s; (n = (r = this.mutateOptions).onSuccess) == null || n.call(r, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (i = (s = this.mutateOptions).onSettled) == null || i.call(s, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context) } else if (t.onError) { var c, o, f, p; (c = (o = this.mutateOptions).onError) == null || c.call(o, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (f = (p = this.mutateOptions).onSettled) == null || f.call(p, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context) } } t.listeners && this.listeners.forEach(v => { v(this.currentResult) }) }) } } const v6 = k0.exports.useSyncExternalStore, lR = C.exports.createContext(void 0), g6 = C.exports.createContext(!1); function y6(e, t) { return e || (t && typeof window < "u" ? (window.ReactQueryClientContext || (window.ReactQueryClientContext = lR), window.ReactQueryClientContext) : lR) } const Oc = ({ context: e } = {}) => { const t = C.exports.useContext(y6(e, C.exports.useContext(g6))); if (!t) throw new Error("No QueryClient set, use QueryClientProvider to set one"); return t }, yce = ({ client: e, children: t, context: n, contextSharing: r = !1 }) => { C.exports.useEffect(() => (e.mount(), () => { e.unmount() }), [e]); const i = y6(n, r); return I(g6.Provider, { value: !n && r, children: I(i.Provider, { value: e, children: t }) }) }, x6 = C.exports.createContext(!1), xce = () => C.exports.useContext(x6); x6.Provider; function _ce() { let e = !1; return { clearReset: () => { e = !1 }, reset: () => { e = !0 }, isReset: () => e } } const bce = C.exports.createContext(_ce()), wce = () => C.exports.useContext(bce); function _6(e, t) { return typeof e == "function" ? e(...t) : !!e } const Cce = (e, t) => { (e.suspense || e.useErrorBoundary) && (t.isReset() || (e.retryOnMount = !1)) }, Sce = e => { C.exports.useEffect(() => { e.clearReset() }, [e]) }, Ece = ({ result: e, errorResetBoundary: t, useErrorBoundary: n, query: r }) => e.isError && !t.isReset() && !e.isFetching && _6(n, [e.error, r]), Pce = e => { e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3) }, Tce = (e, t) => e.isLoading && e.isFetching && !t, kce = (e, t, n) => (e == null ? void 0 : e.suspense) && Tce(t, n), Ice = (e, t, n) => t.fetchOptimistic(e).then(({ data: r }) => { e.onSuccess == null || e.onSuccess(r), e.onSettled == null || e.onSettled(r, null) }).catch(r => { n.clearReset(), e.onError == null || e.onError(r), e.onSettled == null || e.onSettled(void 0, r) }); function Rce(e, t) { const n = Oc({ context: e.context }), r = xce(), i = wce(), s = n.defaultQueryOptions(e); s._optimisticResults = r ? "isRestoring" : "optimistic", s.onError && (s.onError = ai.batchCalls(s.onError)), s.onSuccess && (s.onSuccess = ai.batchCalls(s.onSuccess)), s.onSettled && (s.onSettled = ai.batchCalls(s.onSettled)), Pce(s), Cce(s, i), Sce(i); const [c] = C.exports.useState(() => new t(n, s)), o = c.getOptimisticResult(s); if (v6(C.exports.useCallback(f => r ? () => { } : c.subscribe(ai.batchCalls(f)), [c, r]), () => c.getCurrentResult(), () => c.getCurrentResult()), C.exports.useEffect(() => { c.setOptions(s, { listeners: !1 }) }, [s, c]), kce(s, o, r)) throw Ice(s, c, i); if (Ece({ result: o, errorResetBoundary: i, useErrorBoundary: s.useErrorBoundary, query: c.getCurrentQuery() })) throw o.error; return s.notifyOnChangeProps ? o : c.trackResult(o) } function ao(e, t, n) { const r = Jh(e, t, n); return Rce(r, mce) } function b6(e, t, n) { const r = tce(e, t, n), i = Oc({ context: r.context }), [s] = C.exports.useState(() => new gce(i, r)); C.exports.useEffect(() => { s.setOptions(r) }, [s, r]); const c = v6(C.exports.useCallback(f => s.subscribe(ai.batchCalls(f)), [s]), () => s.getCurrentResult(), () => s.getCurrentResult()), o = C.exports.useCallback((f, p) => { s.mutate(f, p).catch(Mce) }, [s]); if (c.error && _6(s.options.useErrorBoundary, [c.error])) throw c.error; return { ...c, mutate: o, mutateAsync: c.mutate } } function Mce() { } const gn = { initial: "initial", "initial-match": "initial-match-points", "initial-unmatch": "initial-unmatch-points", approve: "approve-points", working: "working-points", workingBackground: "working-points-bg", filteredWorking: "filtered-working-points", filteredWorkingBackground: "filtered-working-points-bg", cancelled: "cancelled-points", atd: "atd", pvz: "pvz", other: "other" }, Gn = { pending: "Pending", onApproval: "Installation", working: "Working", cancelled: "Cancelled" }, uc = { [Gn.pending]: "\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E", [Gn.onApproval]: "\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430", [Gn.working]: "\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442", [Gn.cancelled]: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D" }, _E = { kiosk: "\u0413\u043E\u0440\u043E\u0434\u0441\u043A\u043E\u0439 \u043A\u0438\u043E\u0441\u043A", mfc: "\u041C\u0424\u0426", library: "\u0411\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430", sport: "\u0421\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442", retail: "\u0420\u0438\u0442\u0435\u0439\u043B", residential: "\u041F\u043E\u0434\u044A\u0435\u0437\u0434 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430", dk: "\u0414\u043E\u043C \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B/\u041A\u043B\u0443\u0431" }, Ace = "\u0424\u0438\u043B\u044C\u0442\u0440 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D - \u0431\u044B\u043B\u043E \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435", Ur = { PENDING: "INITIAL", ON_APPROVAL: "ON_APPROVAL", WORKING: "WORKING" }, Nce = { [Ur.PENDING]: [gn.initial, gn.working, gn.cancelled], [Ur.ON_APPROVAL]: [gn.approve, gn.working, gn.cancelled], [Ur.WORKING]: [gn.filteredWorking] }, uR = e => { let t; const n = new Set, r = (f, p) => { const v = typeof f == "function" ? f(t) : f; if (!Object.is(v, t)) { const y = t; t = (p != null ? p : typeof v != "object") ? v : Object.assign({}, t, v), n.forEach(w => w(t, y)) } }, i = () => t, o = { setState: r, getState: i, subscribe: f => (n.add(f), () => n.delete(f)), destroy: () => { var f; ((f = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 }) == null ? void 0 : f.MODE) !== "production" && console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."), n.clear() } }; return t = e(r, i, o), o }, Oce = e => e ? uR(e) : uR; var w6 = { exports: {} }, C6 = {};/**
|
|
|
* @license React
|
|
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
|
*
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
*
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
*/var Ex = C.exports, Dce = k0.exports; function Lce(e, t) { return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t } var zce = typeof Object.is == "function" ? Object.is : Lce, Fce = Dce.useSyncExternalStore, $ce = Ex.useRef, Bce = Ex.useEffect, Vce = Ex.useMemo, Uce = Ex.useDebugValue; C6.useSyncExternalStoreWithSelector = function (e, t, n, r, i) { var s = $ce(null); if (s.current === null) { var c = { hasValue: !1, value: null }; s.current = c } else c = s.current; s = Vce(function () { function f(P) { if (!p) { if (p = !0, v = P, P = r(P), i !== void 0 && c.hasValue) { var k = c.value; if (i(k, P)) return y = k } return y = P } if (k = y, zce(v, P)) return k; var A = r(P); return i !== void 0 && i(k, A) ? k : (v = P, y = A) } var p = !1, v, y, w = n === void 0 ? null : n; return [function () { return f(t()) }, w === null ? void 0 : function () { return f(w()) }] }, [t, n, r, i]); var o = Fce(e, s[0], s[1]); return Bce(function () { c.hasValue = !0, c.value = o }, [o]), Uce(o), o }; (function (e) { e.exports = C6 })(w6); const jce = GC(w6.exports), { useSyncExternalStoreWithSelector: Kce } = jce; function Hce(e, t = e.getState, n) { const r = Kce(e.subscribe, e.getState, e.getServerState || e.getState, t, n); return C.exports.useDebugValue(r), r } const cR = e => { var t; ((t = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 }) == null ? void 0 : t.MODE) !== "production" && typeof e != "function" && console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."); const n = typeof e == "function" ? Oce(e) : e, r = (i, s) => Hce(n, i, s); return Object.assign(r, n), r }, bs = e => e ? cR(e) : cR; function ya(e) { for (var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)n[r - 1] = arguments[r]; throw Error("[Immer] minified error nr: " + e + (n.length ? " " + n.map(function (i) { return "'" + i + "'" }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf") } function df(e) { return !!e && !!e[wr] } function ll(e) { var t; return !!e && (function (n) { if (!n || typeof n != "object") return !1; var r = Object.getPrototypeOf(n); if (r === null) return !0; var i = Object.hasOwnProperty.call(r, "constructor") && r.constructor; return i === Object || typeof i == "function" && Function.toString.call(i) === tde }(e) || Array.isArray(e) || !!e[gR] || !!(!((t = e.constructor) === null || t === void 0) && t[gR]) || bE(e) || wE(e)) } function ff(e, t, n) { n === void 0 && (n = !1), Df(e) === 0 ? (n ? Object.keys : TE)(e).forEach(function (r) { n && typeof r == "symbol" || t(r, e[r], e) }) : e.forEach(function (r, i) { return t(i, r, e) }) } function Df(e) { var t = e[wr]; return t ? t.i > 3 ? t.i - 4 : t.i : Array.isArray(e) ? 1 : bE(e) ? 2 : wE(e) ? 3 : 0 } function LC(e, t) { return Df(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t) } function Wce(e, t) { return Df(e) === 2 ? e.get(t) : e[t] } function S6(e, t, n) { var r = Df(e); r === 2 ? e.set(t, n) : r === 3 ? e.add(n) : e[t] = n } function Gce(e, t) { return e === t ? e !== 0 || 1 / e == 1 / t : e != e && t != t } function bE(e) { return Jce && e instanceof Map } function wE(e) { return ede && e instanceof Set } function zi(e) { return e.o || e.t } function CE(e) { if (Array.isArray(e)) return Array.prototype.slice.call(e); var t = nde(e); delete t[wr]; for (var n = TE(t), r = 0; r < n.length; r++) { var i = n[r], s = t[i]; s.writable === !1 && (s.writable = !0, s.configurable = !0), (s.get || s.set) && (t[i] = { configurable: !0, writable: !0, enumerable: s.enumerable, value: e[i] }) } return Object.create(Object.getPrototypeOf(e), t) } function SE(e, t) { return t === void 0 && (t = !1), EE(e) || df(e) || !ll(e) || (Df(e) > 1 && (e.set = e.add = e.clear = e.delete = qce), Object.freeze(e), t && ff(e, function (n, r) { return SE(r, !0) }, !0)), e } function qce() { ya(2) } function EE(e) { return e == null || typeof e != "object" || Object.isFrozen(e) } function gs(e) { var t = FC[e]; return t || ya(18, e), t } function Zce(e, t) { FC[e] || (FC[e] = t) } function i0() { return em } function ib(e, t) { t && (gs("Patches"), e.u = [], e.s = [], e.v = t) } function o0(e) { zC(e), e.p.forEach(Xce), e.p = null } function zC(e) { e === em && (em = e.l) } function dR(e) { return em = { p: [], l: em, h: e, m: !0, _: 0 } } function Xce(e) { var t = e[wr]; t.i === 0 || t.i === 1 ? t.j() : t.O = !0 } function ob(e, t) { t._ = t.p.length; var n = t.p[0], r = e !== void 0 && e !== n; return t.h.g || gs("ES5").S(t, e, r), r ? (n[wr].P && (o0(t), ya(4)), ll(e) && (e = a0(t, e), t.l || s0(t, e)), t.u && gs("Patches").M(n[wr].t, e, t.u, t.s)) : e = a0(t, n, []), o0(t), t.u && t.v(t.u, t.s), e !== E6 ? e : void 0 } function a0(e, t, n) { if (EE(t)) return t; var r = t[wr]; if (!r) return ff(t, function (o, f) { return fR(e, r, t, o, f, n) }, !0), t; if (r.A !== e) return t; if (!r.P) return s0(e, r.t, !0), r.t; if (!r.I) { r.I = !0, r.A._--; var i = r.i === 4 || r.i === 5 ? r.o = CE(r.k) : r.o, s = i, c = !1; r.i === 3 && (s = new Set(i), i.clear(), c = !0), ff(s, function (o, f) { return fR(e, r, i, o, f, n, c) }), s0(e, i, !1), n && e.u && gs("Patches").N(r, n, e.u, e.s) } return r.o } function fR(e, t, n, r, i, s, c) { if (df(i)) { var o = a0(e, i, s && t && t.i !== 3 && !LC(t.R, r) ? s.concat(r) : void 0); if (S6(n, r, o), !df(o)) return; e.m = !1 } else c && n.add(i); if (ll(i) && !EE(i)) { if (!e.h.D && e._ < 1) return; a0(e, i), t && t.A.l || s0(e, i) } } function s0(e, t, n) { n === void 0 && (n = !1), !e.l && e.h.D && e.m && SE(t, n) } function ab(e, t) { var n = e[wr]; return (n ? zi(n) : e)[t] } function hR(e, t) { if (t in e) for (var n = Object.getPrototypeOf(e); n;) { var r = Object.getOwnPropertyDescriptor(n, t); if (r) return r; n = Object.getPrototypeOf(n) } } function Hs(e) { e.P || (e.P = !0, e.l && Hs(e.l)) } function sb(e) { e.o || (e.o = CE(e.t)) } function Jp(e, t, n) { var r = bE(t) ? gs("MapSet").F(t, n) : wE(t) ? gs("MapSet").T(t, n) : e.g ? function (i, s) { var c = Array.isArray(i), o = { i: c ? 1 : 0, A: s ? s.A : i0(), P: !1, I: !1, R: {}, l: s, t: i, k: null, o: null, j: null, C: !1 }, f = o, p = $C; c && (f = [o], p = ep); var v = Proxy.revocable(f, p), y = v.revoke, w = v.proxy; return o.k = w, o.j = y, w }(t, n) : gs("ES5").J(t, n); return (n ? n.A : i0()).p.push(r), r } function Yce(e) { return df(e) || ya(22, e), function t(n) { if (!ll(n)) return n; var r, i = n[wr], s = Df(n); if (i) { if (!i.P && (i.i < 4 || !gs("ES5").K(i))) return i.t; i.I = !0, r = pR(n, s), i.I = !1 } else r = pR(n, s); return ff(r, function (c, o) { i && Wce(i.t, c) === o || S6(r, c, t(o)) }), s === 3 ? new Set(r) : r }(e) } function pR(e, t) { switch (t) { case 2: return new Map(e); case 3: return Array.from(e) }return CE(e) } function Qce() { function e(o, f) { function p() { this.constructor = o } i(o, f), o.prototype = (p.prototype = f.prototype, new p) } function t(o) { o.o || (o.R = new Map, o.o = new Map(o.t)) } function n(o) { o.o || (o.o = new Set, o.t.forEach(function (f) { if (ll(f)) { var p = Jp(o.A.h, f, o); o.p.set(f, p), o.o.add(p) } else o.o.add(f) })) } function r(o) { o.O && ya(3, JSON.stringify(zi(o))) } var i = function (o, f) { return (i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (p, v) { p.__proto__ = v } || function (p, v) { for (var y in v) v.hasOwnProperty(y) && (p[y] = v[y]) })(o, f) }, s = function () { function o(p, v) { return this[wr] = { i: 2, l: v, A: v ? v.A : i0(), P: !1, I: !1, o: void 0, R: void 0, t: p, k: this, C: !1, O: !1 }, this } e(o, Map); var f = o.prototype; return Object.defineProperty(f, "size", { get: function () { return zi(this[wr]).size } }), f.has = function (p) { return zi(this[wr]).has(p) }, f.set = function (p, v) { var y = this[wr]; return r(y), zi(y).has(p) && zi(y).get(p) === v || (t(y), Hs(y), y.R.set(p, !0), y.o.set(p, v), y.R.set(p, !0)), this }, f.delete = function (p) { if (!this.has(p)) return !1; var v = this[wr]; return r(v), t(v), Hs(v), v.t.has(p) ? v.R.set(p, !1) : v.R.delete(p), v.o.delete(p), !0 }, f.clear = function () { var p = this[wr]; r(p), zi(p).size && (t(p), Hs(p), p.R = new Map, ff(p.t, function (v) { p.R.set(v, !1) }), p.o.clear()) }, f.forEach = function (p, v) { var y = this; zi(this[wr]).forEach(function (w, P) { p.call(v, y.get(P), P, y) }) }, f.get = function (p) { var v = this[wr]; r(v); var y = zi(v).get(p); if (v.I || !ll(y) || y !== v.t.get(p)) return y; var w = Jp(v.A.h, y, v); return t(v), v.o.set(p, w), w }, f.keys = function () { return zi(this[wr]).keys() }, f.values = function () { var p, v = this, y = this.keys(); return (p = {})[Eg] = function () { return v.values() }, p.next = function () { var w = y.next(); return w.done ? w : { done: !1, value: v.get(w.value) } }, p }, f.entries = function () { var p, v = this, y = this.keys(); return (p = {})[Eg] = function () { return v.entries() }, p.next = function () { var w = y.next(); if (w.done) return w; var P = v.get(w.value); return { done: !1, value: [w.value, P] } }, p }, f[Eg] = function () { return this.entries() }, o }(), c = function () { function o(p, v) { return this[wr] = { i: 3, l: v, A: v ? v.A : i0(), P: !1, I: !1, o: void 0, t: p, k: this, p: new Map, O: !1, C: !1 }, this } e(o, Set); var f = o.prototype; return Object.defineProperty(f, "size", { get: function () { return zi(this[wr]).size } }), f.has = function (p) { var v = this[wr]; return r(v), v.o ? !!v.o.has(p) || !(!v.p.has(p) || !v.o.has(v.p.get(p))) : v.t.has(p) }, f.add = function (p) { var v = this[wr]; return r(v), this.has(p) || (n(v), Hs(v), v.o.add(p)), this }, f.delete = function (p) { if (!this.has(p)) return !1; var v = this[wr]; return r(v), n(v), Hs(v), v.o.delete(p) || !!v.p.has(p) && v.o.delete(v.p.get(p)) }, f.clear = function () { var p = this[wr]; r(p), zi(p).size && (n(p), Hs(p), p.o.clear()) }, f.values = function () { var p = this[wr]; return r(p), n(p), p.o.values() }, f.entries = function () { var p = this[wr]; return r(p), n(p), p.o.entries() }, f.keys = function () { return this.values() }, f[Eg] = function () { return this.values() }, f.forEach = function (p, v) { for (var y = this.values(), w = y.next(); !w.done;)p.call(v, w.value, w.value, this), w = y.next() }, o }(); Zce("MapSet", { F: function (o, f) { return new s(o, f) }, T: function (o, f) { return new c(o, f) } }) } var mR, em, PE = typeof Symbol < "u" && typeof Symbol("x") == "symbol", Jce = typeof Map < "u", ede = typeof Set < "u", vR = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", E6 = PE ? Symbol.for("immer-nothing") : ((mR = {})["immer-nothing"] = !0, mR), gR = PE ? Symbol.for("immer-draftable") : "__$immer_draftable", wr = PE ? Symbol.for("immer-state") : "__$immer_state", Eg = typeof Symbol < "u" && Symbol.iterator || "@@iterator", tde = "" + Object.prototype.constructor, TE = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function (e) { return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)) } : Object.getOwnPropertyNames, nde = Object.getOwnPropertyDescriptors || function (e) { var t = {}; return TE(e).forEach(function (n) { t[n] = Object.getOwnPropertyDescriptor(e, n) }), t }, FC = {}, $C = { get: function (e, t) { if (t === wr) return e; var n = zi(e); if (!LC(n, t)) return function (i, s, c) { var o, f = hR(s, c); return f ? "value" in f ? f.value : (o = f.get) === null || o === void 0 ? void 0 : o.call(i.k) : void 0 }(e, n, t); var r = n[t]; return e.I || !ll(r) ? r : r === ab(e.t, t) ? (sb(e), e.o[t] = Jp(e.A.h, r, e)) : r }, has: function (e, t) { return t in zi(e) }, ownKeys: function (e) { return Reflect.ownKeys(zi(e)) }, set: function (e, t, n) { var r = hR(zi(e), t); if (r != null && r.set) return r.set.call(e.k, n), !0; if (!e.P) { var i = ab(zi(e), t), s = i == null ? void 0 : i[wr]; if (s && s.t === n) return e.o[t] = n, e.R[t] = !1, !0; if (Gce(n, i) && (n !== void 0 || LC(e.t, t))) return !0; sb(e), Hs(e) } return e.o[t] === n && (n !== void 0 || t in e.o) || Number.isNaN(n) && Number.isNaN(e.o[t]) || (e.o[t] = n, e.R[t] = !0), !0 }, deleteProperty: function (e, t) { return ab(e.t, t) !== void 0 || t in e.t ? (e.R[t] = !1, sb(e), Hs(e)) : delete e.R[t], e.o && delete e.o[t], !0 }, getOwnPropertyDescriptor: function (e, t) { var n = zi(e), r = Reflect.getOwnPropertyDescriptor(n, t); return r && { writable: !0, configurable: e.i !== 1 || t !== "length", enumerable: r.enumerable, value: n[t] } }, defineProperty: function () { ya(11) }, getPrototypeOf: function (e) { return Object.getPrototypeOf(e.t) }, setPrototypeOf: function () { ya(12) } }, ep = {}; ff($C, function (e, t) { ep[e] = function () { return arguments[0] = arguments[0][0], t.apply(this, arguments) } }), ep.deleteProperty = function (e, t) { return ep.set.call(this, e, t, void 0) }, ep.set = function (e, t, n) { return $C.set.call(this, e[0], t, n, e[0]) }; var rde = function () { function e(n) { var r = this; this.g = vR, this.D = !0, this.produce = function (i, s, c) { if (typeof i == "function" && typeof s != "function") { var o = s; s = i; var f = r; return function (A) { var N = this; A === void 0 && (A = o); for (var R = arguments.length, M = Array(R > 1 ? R - 1 : 0), O = 1; O < R; O++)M[O - 1] = arguments[O]; return f.produce(A, function (z) { var B; return (B = s).call.apply(B, [N, z].concat(M)) }) } } var p; if (typeof s != "function" && ya(6), c !== void 0 && typeof c != "function" && ya(7), ll(i)) { var v = dR(r), y = Jp(r, i, void 0), w = !0; try { p = s(y), w = !1 } finally { w ? o0(v) : zC(v) } return typeof Promise < "u" && p instanceof Promise ? p.then(function (A) { return ib(v, c), ob(A, v) }, function (A) { throw o0(v), A }) : (ib(v, c), ob(p, v)) } if (!i || typeof i != "object") { if ((p = s(i)) === void 0 && (p = i), p === E6 && (p = void 0), r.D && SE(p, !0), c) { var P = [], k = []; gs("Patches").M(i, p, P, k), c(P, k) } return p } ya(21, i) }, this.produceWithPatches = function (i, s) { if (typeof i == "function") return function (p) { for (var v = arguments.length, y = Array(v > 1 ? v - 1 : 0), w = 1; w < v; w++)y[w - 1] = arguments[w]; return r.produceWithPatches(p, function (P) { return i.apply(void 0, [P].concat(y)) }) }; var c, o, f = r.produce(i, s, function (p, v) { c = p, o = v }); return typeof Promise < "u" && f instanceof Promise ? f.then(function (p) { return [p, c, o] }) : [f, c, o] }, typeof (n == null ? void 0 : n.useProxies) == "boolean" && this.setUseProxies(n.useProxies), typeof (n == null ? void 0 : n.autoFreeze) == "boolean" && this.setAutoFreeze(n.autoFreeze) } var t = e.prototype; return t.createDraft = function (n) { ll(n) || ya(8), df(n) && (n = Yce(n)); var r = dR(this), i = Jp(this, n, void 0); return i[wr].C = !0, zC(r), i }, t.finishDraft = function (n, r) { var i = n && n[wr], s = i.A; return ib(s, r), ob(void 0, s) }, t.setAutoFreeze = function (n) { this.D = n }, t.setUseProxies = function (n) { n && !vR && ya(20), this.g = n }, t.applyPatches = function (n, r) { var i; for (i = r.length - 1; i >= 0; i--) { var s = r[i]; if (s.path.length === 0 && s.op === "replace") { n = s.value; break } } i > -1 && (r = r.slice(i + 1)); var c = gs("Patches").$; return df(n) ? c(n, r) : this.produce(n, function (o) { return c(o, r) }) }, e }(), ea = new rde, ide = ea.produce; ea.produceWithPatches.bind(ea); ea.setAutoFreeze.bind(ea); ea.setUseProxies.bind(ea); ea.applyPatches.bind(ea); ea.createDraft.bind(ea); ea.finishDraft.bind(ea); const ode = e => (t, n, r) => (r.setState = (i, s, ...c) => { const o = typeof i == "function" ? ide(i) : i; return t(o, s, ...c) }, e(r.setState, n, r)), ws = ode, ade = { included: new Set([]), excluded: new Set([]) }, sde = e => ({ selection: ade, include: t => { e(n => { const { excluded: r } = n.selection; r.has(t) ? n.selection.excluded.delete(t) : n.selection.included.add(t) }) }, exclude: t => { e(n => { const { included: r } = n.selection; r.has(t) ? n.selection.included.delete(t) : n.selection.excluded.add(t) }) }, reset: () => e(t => { t.selection.included.clear(), t.selection.excluded.clear() }) }), ml = bs(ws(sde)), lde = () => { const { selection: e } = ml(); return C.exports.useMemo(() => e.included.size || e.excluded.size, [e]) }; function ude(e) { let t; try { t = e() } catch { return } return { getItem: r => { var i; const s = o => o === null ? null : JSON.parse(o), c = (i = t.getItem(r)) != null ? i : null; return c instanceof Promise ? c.then(s) : s(c) }, setItem: (r, i) => t.setItem(r, JSON.stringify(i)), removeItem: r => t.removeItem(r) } } const tm = e => t => { try { const n = e(t); return n instanceof Promise ? n : { then(r) { return tm(r)(n) }, catch(r) { return this } } } catch (n) { return { then(r) { return this }, catch(r) { return tm(r)(n) } } } }, cde = (e, t) => (n, r, i) => { let s = { getStorage: () => localStorage, serialize: JSON.stringify, deserialize: JSON.parse, partialize: N => N, version: 0, merge: (N, R) => ({ ...R, ...N }), ...t }, c = !1; const o = new Set, f = new Set; let p; try { p = s.getStorage() } catch { } if (!p) return e((...N) => { console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`), n(...N) }, r, i); const v = tm(s.serialize), y = () => { const N = s.partialize({ ...r() }); let R; const M = v({ state: N, version: s.version }).then(O => p.setItem(s.name, O)).catch(O => { R = O }); if (R) throw R; return M }, w = i.setState; i.setState = (N, R) => { w(N, R), y() }; const P = e((...N) => { n(...N), y() }, r, i); let k; const A = () => { var N; if (!p) return; c = !1, o.forEach(M => M(r())); const R = ((N = s.onRehydrateStorage) == null ? void 0 : N.call(s, r())) || void 0; return tm(p.getItem.bind(p))(s.name).then(M => { if (M) return s.deserialize(M) }).then(M => { if (M) if (typeof M.version == "number" && M.version !== s.version) { if (s.migrate) return s.migrate(M.state, M.version); console.error("State loaded from storage couldn't be migrated since no migrate function was provided") } else return M.state }).then(M => { var O; return k = s.merge(M, (O = r()) != null ? O : P), n(k, !0), y() }).then(() => { R == null || R(k, void 0), c = !0, f.forEach(M => M(k)) }).catch(M => { R == null || R(void 0, M) }) }; return i.persist = { setOptions: N => { s = { ...s, ...N }, N.getStorage && (p = N.getStorage()) }, clearStorage: () => { p == null || p.removeItem(s.name) }, getOptions: () => s, rehydrate: () => A(), hasHydrated: () => c, onHydrate: N => (o.add(N), () => { o.delete(N) }), onFinishHydration: N => (f.add(N), () => { f.delete(N) }) }, A(), k || P }, dde = (e, t) => (n, r, i) => { let s = { storage: ude(() => localStorage), partialize: A => A, version: 0, merge: (A, N) => ({ ...N, ...A }), ...t }, c = !1; const o = new Set, f = new Set; let p = s.storage; if (!p) return e((...A) => { console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`), n(...A) }, r, i); const v = () => { const A = s.partialize({ ...r() }); return p.setItem(s.name, { state: A, version: s.version }) }, y = i.setState; i.setState = (A, N) => { y(A, N), v() }; const w = e((...A) => { n(...A), v() }, r, i); let P; const k = () => { var A; if (!p) return; c = !1, o.forEach(R => R(r())); const N = ((A = s.onRehydrateStorage) == null ? void 0 : A.call(s, r())) || void 0; return tm(p.getItem.bind(p))(s.name).then(R => { if (R) if (typeof R.version == "number" && R.version !== s.version) { if (s.migrate) return s.migrate(R.state, R.version); console.error("State loaded from storage couldn't be migrated since no migrate function was provided") } else return R.state }).then(R => { var M; return P = s.merge(R, (M = r()) != null ? M : w), n(P, !0), v() }).then(() => { N == null || N(P, void 0), c = !0, f.forEach(R => R(P)) }).catch(R => { N == null || N(void 0, R) }) }; return i.persist = { setOptions: A => { s = { ...s, ...A }, A.storage && (p = A.storage) }, clearStorage: () => { p == null || p.removeItem(s.name) }, getOptions: () => s, rehydrate: () => k(), hasHydrated: () => c, onHydrate: A => (o.add(A), () => { o.delete(A) }), onFinishHydration: A => (f.add(A), () => { f.delete(A) }) }, k(), P || w }, fde = (e, t) => { var n; return "getStorage" in t || "serialize" in t || "deserialize" in t ? (((n = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 }) == null ? void 0 : n.MODE) !== "production" && console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."), cde(e, t)) : dde(e, t) }, Mm = fde, xp = { prediction: [0, 0], categories: [], region: null }, hde = e => ({ filters: xp, setPrediction: t => { e(n => { n.filters.prediction = t }) }, setCategories: t => e(n => { n.filters.categories = t }), setRegion: t => e(n => { n.filters.region = t }), clear: t => e(n => { if (!t) return n.filters = xp, n; n.filters = { ...xp, prediction: t.prediction } }) }), Cs = bs(Mm(ws(hde), { name: "postnet/pending-filters" })), _p = "https://postnet-dev.selftech.ru", Co = Jue.create({ baseURL: `${_p}/`, withCredentials: !0, xsrfHeaderName: "X-CSRFToken", xsrfCookieName: "csrftoken" }), P6 = (e, t) => { const n = e || new URLSearchParams; return t && (t.type === "ao" && n.append("district[]", t.id), t.type === "rayon" && n.append("area[]", t.id)), n }, Lf = async (e, t) => { const n = P6(e, t), { data: r } = await Co.get(`https://postamates.spatialsystems.ru/api/placement_points?${n.toString()}`); return r }, kE = async (e, t) => { const n = P6(e, t), { data: r } = await Co.get(`https://postamates.spatialsystems.ru/api/placement_points/to_excel?${n.toString()}`, { responseType: "arraybuffer" }); return r }, pde = () => ao(["all-initial-count"], async () => { const e = new URLSearchParams({ page: 1, page_size: 1, "status[]": [Gn.pending] }); return await Lf(e) }, { select: e => e.count }), mde = () => { const { filters: e } = Cs(), { prediction: t, categories: n, region: r } = e, { selection: { included: i } } = ml(), s = [...i]; return ao(["filtered-points", e, s], async () => { const c = new URLSearchParams({ page: 1, page_size: 1, "prediction_current[]": t, "status[]": [Gn.pending], "categories[]": n, "included[]": s }); return await Lf(c, r) }, { select: c => c.count, keepPreviousData: !0 }) }, vde = () => ao(["permissions"], async () => { var t; const { data: e } = await Co.get("https://postamates.spatialsystems.ru/api/me"); return (t = e == null ? void 0 : e.groups) != null && t.includes("\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440") ? "editor" : "viewer" }), Am = () => { const { data: e } = vde(); return e === "editor" }, T6 = () => b6({ mutationFn: e => Co.put(`https://postamates.spatialsystems.ru/api/placement_points/update_postamat_id?${e.toString()}`) }), k6 = _f(!0), IE = _f(!1), RE = gV(IE, "setAuth", (e, t) => { e.set(t) }); async function gde() { try { await Co.get("/accounts/profile/"), RE(!0) } catch { console.log("Not authorized") } finally { k6.set(!1) } } gde(); class yde extends Error { constructor(n) { super(""); uP(this, "errors"); this.name = "DjangoValidationError"; const r = []; for (const i in n) r.push({ name: i, errors: n[i] }); this.errors = r } } const BC = _f(!1), VC = _f(""), xde = "\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0439\u0442\u0438 \u0441 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u043C\u0438 \u0443\u0447\u0435\u0442\u043D\u044B\u043C\u0438 \u0434\u0430\u043D\u043D\u044B\u043C\u0438."; async function _de(e) { var n, r, i, s; BC.set(!0), VC.set(""); try { const { data: c } = await Co.post("accounts/login/", e); return RE(!0), c } catch (c) { var t = xde; throw (r = (n = c.response) == null ? void 0 : n.data) != null && r.detail && (t = (s = (i = c.response) == null ? void 0 : i.data) == null ? void 0 : s.detail, VC.set(t)), new yde(c.response.data) } finally { BC.set(!1) } } _f(!1); _f(""); function bde() { const e = Bp(VC), t = Bp(BC), n = r => { _de(r) }; return Qe(xL, { direction: "vertical", style: { width: "320px" }, children: [e.length > 0 ? I(v2, { type: "error", showIcon: !0, closable: !0, description: e }) : null, I(P5.Title, { level: 4, children: "\u0412\u0445\u043E\u0434" }), Qe(sc, { disabled: t, name: "basic", layout: "vertical", onFinish: n, autoComplete: "off", children: [I(sc.Item, { label: "\u041B\u043E\u0433\u0438\u043D", name: "login", rules: [{ required: !0, message: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435" }], children: I(Xy, { prefix: I(Ble, { className: "site-form-item-icon" }), placeholder: "\u043B\u043E\u0433\u0438\u043D" }) }), I(sc.Item, { label: "\u041F\u0430\u0440\u043E\u043B\u044C", name: "password", rules: [{ required: !0, message: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435" }], children: I(Xy, { prefix: I(Ole, { className: "site-form-item-icon" }), type: "password", placeholder: "\u043F\u0430\u0440\u043E\u043B\u044C" }) }), I(sc.Item, { children: I(gr, { block: !0, type: "primary", htmlType: "submit", children: "\u0412\u043E\u0439\u0442\u0438" }) })] })] }) } function wde() { return Bp(IE) ? I(WS, { to: "/", replace: !0 }) : I("main", { className: "w-screen h-screen flex items-center justify-center", children: I(bde, {}) }) } const Cde = e => { const t = C.exports.useRef(e), n = C.exports.useRef(), r = C.exports.useRef(!1), i = C.exports.useRef(!1), [, s] = C.exports.useState(0); r.current && (i.current = !0), C.exports.useEffect(() => (r.current || (n.current = t.current(), r.current = !0), s(c => c + 1), () => { !i.current || n.current && n.current() }), []) }; function Sde() { const [e] = pV(), [t, n] = C.exports.useState(!1); return Cde(() => { async function r() { try { await Co.post("accounts/verify-registration/", { user_id: e.get("user_id"), timestamp: e.get("timestamp"), signature: e.get("signature") }) } finally { n(!0) } } r() }), t ? I(WS, { to: "/" }) : I("div", { children: "Verifying..." }) } function Ede(e) { const t = Bp(IE); return Bp(k6) ? I(Pf, { className: "user-info-loader" }) : t ? I(An, { children: e.children }) : I(WS, { to: "/signin", replace: !0 }) } var I6 = { exports: {} }; (function (e, t) {
|
|
|
(function (n, r) { e.exports = r() })(Gs, function () {
|
|
|
var n, r, i; function s(o, f) { if (!n) n = f; else if (!r) r = f; else { var p = "var sharedChunk = {}; (" + n + ")(sharedChunk); (" + r + ")(sharedChunk);", v = {}; n(v), i = f(v), typeof window < "u" && (i.workerUrl = window.URL.createObjectURL(new Blob([p], { type: "text/javascript" }))) } } s(["exports"], function (o) {
|
|
|
var f = p; function p(u, a, d, m) { this.cx = 3 * u, this.bx = 3 * (d - u) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * a, this.by = 3 * (m - a) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = u, this.p1y = a, this.p2x = d, this.p2y = m } function v(u, a, d, m) { const _ = new f(u, a, d, m); return function (S) { return _.solve(S) } } p.prototype = { sampleCurveX: function (u) { return ((this.ax * u + this.bx) * u + this.cx) * u }, sampleCurveY: function (u) { return ((this.ay * u + this.by) * u + this.cy) * u }, sampleCurveDerivativeX: function (u) { return (3 * this.ax * u + 2 * this.bx) * u + this.cx }, solveCurveX: function (u, a) { if (a === void 0 && (a = 1e-6), u < 0) return 0; if (u > 1) return 1; for (var d = u, m = 0; m < 8; m++) { var _ = this.sampleCurveX(d) - u; if (Math.abs(_) < a) return d; var S = this.sampleCurveDerivativeX(d); if (Math.abs(S) < 1e-6) break; d -= _ / S } var T = 0, L = 1; for (d = u, m = 0; m < 20 && (_ = this.sampleCurveX(d), !(Math.abs(_ - u) < a)); m++)u > _ ? T = d : L = d, d = .5 * (L - T) + T; return d }, solve: function (u, a) { return this.sampleCurveY(this.solveCurveX(u, a)) } }; const y = v(.25, .1, .25, 1); function w(u, a, d) { return Math.min(d, Math.max(a, u)) } function P(u, a, d) { const m = d - a, _ = ((u - a) % m + m) % m + a; return _ === a ? d : _ } function k(u, ...a) { for (const d of a) for (const m in d) u[m] = d[m]; return u } let A = 1; function N(u, a) { u.forEach(d => { a[d] && (a[d] = a[d].bind(a)) }) } function R(u, a, d) { const m = {}; for (const _ in u) m[_] = a.call(d || this, u[_], _, u); return m } function M(u, a, d) { const m = {}; for (const _ in u) a.call(d || this, u[_], _, u) && (m[_] = u[_]); return m } function O(u) { return Array.isArray(u) ? u.map(O) : typeof u == "object" && u ? R(u, O) : u } const z = {}; function B(u) { z[u] || (typeof console < "u" && console.warn(u), z[u] = !0) } function V(u, a, d) { return (d.y - u.y) * (a.x - u.x) > (a.y - u.y) * (d.x - u.x) } function G(u) { let a = 0; for (let d, m, _ = 0, S = u.length, T = S - 1; _ < S; T = _++)d = u[_], m = u[T], a += (m.x - d.x) * (d.y + m.y); return a } function j() { return typeof WorkerGlobalScope < "u" && typeof self < "u" && self instanceof WorkerGlobalScope } function X(u) { const a = {}; if (u.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, (d, m, _, S) => { const T = _ || S; return a[m] = !T || T.toLowerCase(), "" }), a["max-age"]) { const d = parseInt(a["max-age"], 10); isNaN(d) ? delete a["max-age"] : a["max-age"] = d } return a } let Y, se, ee = null; function Z(u) { if (ee == null) { const a = u.navigator ? u.navigator.userAgent : null; ee = !!u.safari || !(!a || !(/\b(iPad|iPhone|iPod)\b/.test(a) || a.match("Safari") && !a.match("Chrome"))) } return ee } function J(u) { return typeof ImageBitmap < "u" && u instanceof ImageBitmap } const ve = { now: typeof performance < "u" && performance && performance.now ? performance.now.bind(performance) : Date.now.bind(Date), frame(u) { const a = requestAnimationFrame(u); return { cancel: () => cancelAnimationFrame(a) } }, getImageData(u, a = 0) { const d = window.document.createElement("canvas"), m = d.getContext("2d"); if (!m) throw new Error("failed to create canvas 2d context"); return d.width = u.width, d.height = u.height, m.drawImage(u, 0, 0, u.width, u.height), m.getImageData(-a, -a, u.width + 2 * a, u.height + 2 * a) }, resolveURL: u => (Y || (Y = document.createElement("a")), Y.href = u, Y.href), hardwareConcurrency: typeof navigator < "u" && navigator.hardwareConcurrency || 4, get prefersReducedMotion() { return !!matchMedia && (se == null && (se = matchMedia("(prefers-reduced-motion: reduce)")), se.matches) } }; var ie = ce; function ce(u, a) { this.x = u, this.y = a } ce.prototype = { clone: function () { return new ce(this.x, this.y) }, add: function (u) { return this.clone()._add(u) }, sub: function (u) { return this.clone()._sub(u) }, multByPoint: function (u) { return this.clone()._multByPoint(u) }, divByPoint: function (u) { return this.clone()._divByPoint(u) }, mult: function (u) { return this.clone()._mult(u) }, div: function (u) { return this.clone()._div(u) }, rotate: function (u) { return this.clone()._rotate(u) }, rotateAround: function (u, a) { return this.clone()._rotateAround(u, a) }, matMult: function (u) { return this.clone()._matMult(u) }, unit: function () { return this.clone()._unit() }, perp: function () { return this.clone()._perp() }, round: function () { return this.clone()._round() }, mag: function () { return Math.sqrt(this.x * this.x + this.y * this.y) }, equals: function (u) { return this.x === u.x && this.y === u.y }, dist: function (u) { return Math.sqrt(this.distSqr(u)) }, distSqr: function (u) { var a = u.x - this.x, d = u.y - this.y; return a * a + d * d }, angle: function () { return Math.atan2(this.y, this.x) }, angleTo: function (u) { return Math.atan2(this.y - u.y, this.x - u.x) }, angleWith: function (u) { return this.angleWithSep(u.x, u.y) }, angleWithSep: function (u, a) { return Math.atan2(this.x * a - this.y * u, this.x * u + this.y * a) }, _matMult: function (u) { var a = u[2] * this.x + u[3] * this.y; return this.x = u[0] * this.x + u[1] * this.y, this.y = a, this }, _add: function (u) { return this.x += u.x, this.y += u.y, this }, _sub: function (u) { return this.x -= u.x, this.y -= u.y, this }, _mult: function (u) { return this.x *= u, this.y *= u, this }, _div: function (u) { return this.x /= u, this.y /= u, this }, _multByPoint: function (u) { return this.x *= u.x, this.y *= u.y, this }, _divByPoint: function (u) { return this.x /= u.x, this.y /= u.y, this }, _unit: function () { return this._div(this.mag()), this }, _perp: function () { var u = this.y; return this.y = this.x, this.x = -u, this }, _rotate: function (u) { var a = Math.cos(u), d = Math.sin(u), m = d * this.x + a * this.y; return this.x = a * this.x - d * this.y, this.y = m, this }, _rotateAround: function (u, a) { var d = Math.cos(u), m = Math.sin(u), _ = a.y + m * (this.x - a.x) + d * (this.y - a.y); return this.x = a.x + d * (this.x - a.x) - m * (this.y - a.y), this.y = _, this }, _round: function () { return this.x = Math.round(this.x), this.y = Math.round(this.y), this } }, ce.convert = function (u) { return u instanceof ce ? u : Array.isArray(u) ? new ce(u[0], u[1]) : u }; const oe = { MAX_PARALLEL_IMAGE_REQUESTS: 16, REGISTERED_PROTOCOLS: {} }, ye = "mapbox-tiles"; let Ie, Te, Pe = 500, De = 50; function Re() { typeof caches > "u" || Ie || (Ie = caches.open(ye)) } let ke = 1 / 0; const Oe = { supported: !1, testSupport: function (u) { !Ue && He && (st ? ft(u) : $e = u) } }; let $e, He, Ue = !1, st = !1; function ft(u) { const a = u.createTexture(); u.bindTexture(u.TEXTURE_2D, a); try { if (u.texImage2D(u.TEXTURE_2D, 0, u.RGBA, u.RGBA, u.UNSIGNED_BYTE, He), u.isContextLost()) return; Oe.supported = !0 } catch { } u.deleteTexture(a), Ue = !0 } typeof document < "u" && (He = document.createElement("img"), He.onload = function () { $e && ft($e), $e = null, st = !0 }, He.onerror = function () { Ue = !0, $e = null }, He.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="); const It = { Unknown: "Unknown", Style: "Style", Source: "Source", Tile: "Tile", Glyphs: "Glyphs", SpriteImage: "SpriteImage", SpriteJSON: "SpriteJSON", Image: "Image" }; typeof Object.freeze == "function" && Object.freeze(It); class We extends Error { constructor(a, d, m, _) { super(`AJAXError: ${d} (${a}): ${m}`), this.status = a, this.statusText = d, this.url = m, this.body = _ } } const Pt = j() ? () => self.worker && self.worker.referrer : () => (window.location.protocol === "blob:" ? window.parent : window).location.href; function pt(u, a) { const d = new AbortController, m = new Request(u.url, { method: u.method || "GET", body: u.body, credentials: u.credentials, headers: u.headers, referrer: Pt(), signal: d.signal }); let _ = !1, S = !1; return u.type === "json" && m.headers.set("Accept", "application/json"), ((T, L, F) => { if (S) return; const K = Date.now(); fetch(m).then(Q => Q.ok ? ((ne, ue, he) => { (u.type === "arrayBuffer" ? ne.arrayBuffer() : u.type === "json" ? ne.json() : ne.text()).then(pe => { S || (ue && he && function (Ne, Ae, Ye) { if (Re(), !Ie) return; const lt = { status: Ae.status, statusText: Ae.statusText, headers: new Headers }; Ae.headers.forEach((it, kt) => lt.headers.set(kt, it)); const Ke = X(Ae.headers.get("Cache-Control") || ""); Ke["no-store"] || (Ke["max-age"] && lt.headers.set("Expires", new Date(Ye + 1e3 * Ke["max-age"]).toUTCString()), new Date(lt.headers.get("Expires")).getTime() - Ye < 42e4 || function (it, kt) { if (Te === void 0) try { new Response(new ReadableStream), Te = !0 } catch { Te = !1 } Te ? kt(it.body) : it.blob().then(kt) }(Ae, it => { const kt = new Response(it, lt); Re(), Ie && Ie.then(Tt => Tt.put(function (hn) { const vn = hn.indexOf("?"); return vn < 0 ? hn : hn.slice(0, vn) }(Ne.url), kt)).catch(Tt => B(Tt.message)) })) }(m, ue, he), _ = !0, a(null, pe, ne.headers.get("Cache-Control"), ne.headers.get("Expires"))) }).catch(pe => { S || a(new Error(pe.message)) }) })(Q, null, K) : Q.blob().then(ne => a(new We(Q.status, Q.statusText, u.url, ne)))).catch(Q => { Q.code !== 20 && a(new Error(Q.message)) }) })(), { cancel: () => { S = !0, _ || d.abort() } } } const Rt = function (u, a) { if (/:\/\//.test(u.url) && !/^https?:|^file:/.test(u.url)) { if (j() && self.worker && self.worker.actor) return self.worker.actor.send("getResource", u, a); if (!j()) { const m = u.url.substring(0, u.url.indexOf("://")); return (oe.REGISTERED_PROTOCOLS[m] || pt)(u, a) } } if (!(/^file:/.test(d = u.url) || /^file:/.test(Pt()) && !/^\w+:/.test(d))) { if (fetch && Request && AbortController && Object.prototype.hasOwnProperty.call(Request.prototype, "signal")) return pt(u, a); if (j() && self.worker && self.worker.actor) return self.worker.actor.send("getResource", u, a, void 0, !0) } var d; return function (m, _) { const S = new XMLHttpRequest; S.open(m.method || "GET", m.url, !0), m.type === "arrayBuffer" && (S.responseType = "arraybuffer"); for (const T in m.headers) S.setRequestHeader(T, m.headers[T]); return m.type === "json" && (S.responseType = "text", S.setRequestHeader("Accept", "application/json")), S.withCredentials = m.credentials === "include", S.onerror = () => { _(new Error(S.statusText)) }, S.onload = () => { if ((S.status >= 200 && S.status < 300 || S.status === 0) && S.response !== null) { let T = S.response; if (m.type === "json") try { T = JSON.parse(S.response) } catch (L) { return _(L) } _(null, T, S.getResponseHeader("Cache-Control"), S.getResponseHeader("Expires")) } else { const T = new Blob([S.response], { type: S.getResponseHeader("Content-Type") }); _(new We(S.status, S.statusText, m.url, T)) } }, S.send(m.body), { cancel: () => S.abort() } }(u, a) }, yt = function (u, a) { return Rt(k(u, { type: "arrayBuffer" }), a) }; function Mt(u) { const a = window.document.createElement("a"); return a.href = u, a.protocol === window.document.location.protocol && a.host === window.document.location.host } const ut = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; let dt, ct; dt = [], ct = 0; const rt = function (u, a) { if (Oe.supported && (u.headers || (u.headers = {}), u.headers.accept = "image/webp,*/*"), ct >= oe.MAX_PARALLEL_IMAGE_REQUESTS) { const S = { requestParameters: u, callback: a, cancelled: !1, cancel() { this.cancelled = !0 } }; return dt.push(S), S } ct++; let d = !1; const m = () => { if (!d) for (d = !0, ct--; dt.length && ct < oe.MAX_PARALLEL_IMAGE_REQUESTS;) { const S = dt.shift(), { requestParameters: T, callback: L, cancelled: F } = S; F || (S.cancel = rt(T, L).cancel) } }, _ = yt(u, (S, T, L, F) => { m(), S ? a(S) : T && function (K, Q) { typeof createImageBitmap == "function" ? function (ne, ue) { const he = new Blob([new Uint8Array(ne)], { type: "image/png" }); createImageBitmap(he).then(pe => { ue(null, pe) }).catch(pe => { ue(new Error(`Could not load image because of ${pe.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)) }) }(K, Q) : function (ne, ue) { const he = new Image; he.onload = () => { ue(null, he), URL.revokeObjectURL(he.src), he.onload = null, window.requestAnimationFrame(() => { he.src = ut }) }, he.onerror = () => ue(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")); const pe = new Blob([new Uint8Array(ne)], { type: "image/png" }); he.src = ne.byteLength ? URL.createObjectURL(pe) : ut }(K, Q) }(T, (K, Q) => { K != null ? a(K) : Q != null && a(null, Q, { cacheControl: L, expires: F }) }) }); return { cancel: () => { _.cancel(), m() } } }; function ht(u, a, d) { d[u] && d[u].indexOf(a) !== -1 || (d[u] = d[u] || [], d[u].push(a)) } function bt(u, a, d) { if (d && d[u]) { const m = d[u].indexOf(a); m !== -1 && d[u].splice(m, 1) } } class Wt { constructor(a, d = {}) { k(this, d), this.type = a } } class Ut extends Wt { constructor(a, d = {}) { super("error", k({ error: a }, d)) } } class Jt { on(a, d) { return this._listeners = this._listeners || {}, ht(a, d, this._listeners), this } off(a, d) { return bt(a, d, this._listeners), bt(a, d, this._oneTimeListeners), this } once(a, d) { return this._oneTimeListeners = this._oneTimeListeners || {}, ht(a, d, this._oneTimeListeners), this } fire(a, d) { typeof a == "string" && (a = new Wt(a, d || {})); const m = a.type; if (this.listens(m)) { a.target = this; const _ = this._listeners && this._listeners[m] ? this._listeners[m].slice() : []; for (const L of _) L.call(this, a); const S = this._oneTimeListeners && this._oneTimeListeners[m] ? this._oneTimeListeners[m].slice() : []; for (const L of S) bt(m, L, this._oneTimeListeners), L.call(this, a); const T = this._eventedParent; T && (k(a, typeof this._eventedParentData == "function" ? this._eventedParentData() : this._eventedParentData), T.fire(a)) } else a instanceof Ut && console.error(a.error); return this } listens(a) { return this._listeners && this._listeners[a] && this._listeners[a].length > 0 || this._oneTimeListeners && this._oneTimeListeners[a] && this._oneTimeListeners[a].length > 0 || this._eventedParent && this._eventedParent.listens(a) } setEventedParent(a, d) { return this._eventedParent = a, this._eventedParentData = d, this } } var Fe = { $version: 8, $root: { version: { required: !0, type: "enum", values: [8] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, terrain: { type: "terrain" }, sources: { required: !0, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: !0, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], source_vector: { type: { required: !0, type: "enum", values: { vector: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, attribution: { type: "string" }, promoteId: { type: "promoteId" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster: { type: { required: !0, type: "enum", values: { raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, attribution: { type: "string" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster_dem: { type: { required: !0, type: "enum", values: { "raster-dem": {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, attribution: { type: "string" }, encoding: { type: "enum", values: { terrarium: {}, mapbox: {} }, default: "mapbox" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_geojson: { type: { required: !0, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, attribution: { type: "string" }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, filter: { type: "*" }, tolerance: { type: "number", default: .375 }, cluster: { type: "boolean", default: !1 }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" }, clusterMinPoints: { type: "number" }, clusterProperties: { type: "*" }, lineMetrics: { type: "boolean", default: !1 }, generateId: { type: "boolean", default: !1 }, promoteId: { type: "promoteId" } }, source_video: { type: { required: !0, type: "enum", values: { video: {} } }, urls: { required: !0, type: "array", value: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: !0, type: "enum", values: { image: {} } }, url: { required: !0, type: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, layer: { id: { type: "string", required: !0 }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, heatmap: {}, "fill-extrusion": {}, raster: {}, hillshade: {}, background: {} }, required: !0 }, metadata: { type: "*" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" } }, layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_fill: { "fill-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_circle: { "circle-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_heatmap: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_line: { "line-cap": { type: "enum", values: { butt: {}, round: {}, square: {} }, default: "butt", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-join": { type: "enum", values: { bevel: {}, round: {}, miter: {} }, default: "miter", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { type: "number", default: 2, requires: [{ "line-join": "miter" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { type: "number", default: 1.05, requires: [{ "line-join": "round" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_symbol: { "symbol-placement": { type: "enum", values: { point: {}, line: {}, "line-center": {} }, default: "point", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, units: "pixels", requires: [{ "symbol-placement": "line" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { type: "boolean", default: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { type: "enum", values: { auto: {}, "viewport-y": {}, source: {} }, default: "auto", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { type: "boolean", default: !1, requires: ["icon-image", { "!": "icon-overlap" }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-overlap": { type: "enum", values: { never: {}, always: {}, cooperative: {} }, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { type: "boolean", default: !1, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { type: "boolean", default: !1, requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-size": { type: "number", default: 1, minimum: 0, units: "factor of the original icon size", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { type: "enum", values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [0, 0, 0, 0], units: "pixels", requires: ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-image": { type: "resolvedImage", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { type: "padding", default: [2], units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-keep-upright": { type: "boolean", default: !1, requires: ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { type: "array", value: "number", length: 2, default: [0, 0], requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, "viewport-glyph": {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-field": { type: "formatted", default: "", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { type: "array", value: "string", default: ["Open Sans Regular", "Arial Unicode MS Regular"], requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { type: "number", default: 1.2, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-letter-spacing": { type: "number", default: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { type: "enum", values: { auto: {}, left: {}, center: {}, right: {} }, default: "center", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { type: "number", units: "ems", default: 0, requires: ["text-field"], "property-type": "data-driven", expression: { interpolated: !0, parameters: ["zoom", "feature"] } }, "text-variable-anchor": { type: "array", value: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["text-field", { "!": "text-variable-anchor" }], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { type: "number", default: 45, units: "degrees", requires: ["text-field", { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { type: "array", value: "enum", values: { horizontal: {}, vertical: {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { type: "boolean", default: !0, requires: ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-transform": { type: "enum", values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { type: "array", value: "number", units: "ems", length: 2, default: [0, 0], requires: ["text-field", { "!": "text-radial-offset" }], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { type: "boolean", default: !1, requires: ["text-field", { "!": "text-overlap" }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-overlap": { type: "enum", values: { never: {}, always: {}, cooperative: {} }, requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-ignore-placement": { type: "boolean", default: !1, requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-optional": { type: "boolean", default: !1, requires: ["text-field", "icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_raster: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_hillshade: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, filter: { type: "array", value: "*" }, filter_operator: { type: "enum", values: { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, in: {}, "!in": {}, all: {}, any: {}, none: {}, has: {}, "!has": {}, within: {} } }, geometry_type: { type: "enum", values: { Point: {}, LineString: {}, Polygon: {} } }, function: { expression: { type: "expression" }, stops: { type: "array", value: "function_stop" }, base: { type: "number", default: 1, minimum: 0 }, property: { type: "string", default: "$zoom" }, type: { type: "enum", values: { identity: {}, exponential: {}, interval: {}, categorical: {} }, default: "exponential" }, colorSpace: { type: "enum", values: { rgb: {}, lab: {}, hcl: {} }, default: "rgb" }, default: { type: "*", required: !1 } }, function_stop: { type: "array", minimum: 0, maximum: 24, value: ["number", "color"], length: 2 }, expression: { type: "array", value: "*", minimum: 1 }, light: { anchor: { type: "enum", default: "viewport", values: { map: {}, viewport: {} }, "property-type": "data-constant", transition: !1, expression: { interpolated: !1, parameters: ["zoom"] } }, position: { type: "array", default: [1.15, 210, 30], length: 3, value: "number", "property-type": "data-constant", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] } }, color: { type: "color", "property-type": "data-constant", default: "#ffffff", expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 }, intensity: { type: "number", "property-type": "data-constant", default: .5, minimum: 0, maximum: 1, expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 } }, terrain: { source: { type: "string", required: !0 }, exaggeration: { type: "number", minimum: 0, default: 1 }, elevationOffset: { type: "number", default: 450 } }, paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"], paint_fill: { "fill-antialias": { type: "boolean", default: !0, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "fill-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-outline-color": { type: "color", transition: !0, requires: [{ "!": "fill-pattern" }, { "fill-antialias": !0 }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "fill-extrusion-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-extrusion-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "fill-extrusion-height": { type: "number", default: 0, minimum: 0, units: "meters", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-base": { type: "number", default: 0, minimum: 0, units: "meters", transition: !0, requires: ["fill-extrusion-height"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-vertical-gradient": { type: "boolean", default: !0, transition: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_line: { "line-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "line-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["line-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-width": { type: "number", default: 1, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-gap-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-offset": { type: "number", default: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-dasharray": { type: "array", value: "number", minimum: 0, transition: !0, units: "line widths", requires: [{ "!": "line-pattern" }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "cross-faded" }, "line-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-gradient": { type: "color", transition: !1, requires: [{ "!": "line-dasharray" }, { "!": "line-pattern" }, { source: "geojson", has: { lineMetrics: !0 } }], expression: { interpolated: !0, parameters: ["line-progress"] }, "property-type": "color-ramp" } }, paint_circle: { "circle-radius": { type: "number", default: 5, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-blur": { type: "number", default: 0, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["circle-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-scale": { type: "enum", values: { map: {}, viewport: {} }, default: "map", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-alignment": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-stroke-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" } }, paint_heatmap: { "heatmap-radius": { type: "number", default: 30, minimum: 1, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-weight": { type: "number", default: 1, minimum: 0, transition: !1, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-intensity": { type: "number", default: 1, minimum: 0, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "heatmap-color": { type: "color", default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"], transition: !1, expression: { interpolated: !0, parameters: ["heatmap-density"] }, "property-type": "color-ramp" }, "heatmap-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_symbol: { "icon-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-color": { type: "color", default: "#000000", transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["icon-image", "icon-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-color": { type: "color", default: "#000000", transition: !0, overridable: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["text-field", "text-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_raster: { "raster-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-hue-rotate": { type: "number", default: 0, period: 360, transition: !0, units: "degrees", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-min": { type: "number", default: 0, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-max": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-saturation": { type: "number", default: 0, minimum: -1, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-contrast": { type: "number", default: 0, minimum: -1, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-resampling": { type: "enum", values: { linear: {}, nearest: {} }, default: "linear", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-fade-duration": { type: "number", default: 300, minimum: 0, transition: !1, units: "milliseconds", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_hillshade: { "hillshade-illumination-direction": { type: "number", default: 335, minimum: 0, maximum: 359, transition: !1, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-illumination-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-exaggeration": { type: "number", default: .5, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-shadow-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-highlight-color": { type: "color", default: "#FFFFFF", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-accent-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_background: { "background-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "background-pattern" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "background-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "cross-faded" }, "background-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, transition: { duration: { type: "number", default: 300, minimum: 0, units: "milliseconds" }, delay: { type: "number", default: 0, minimum: 0, units: "milliseconds" } }, "property-type": { "data-driven": { type: "property-type" }, "cross-faded": { type: "property-type" }, "cross-faded-data-driven": { type: "property-type" }, "color-ramp": { type: "property-type" }, "data-constant": { type: "property-type" }, constant: { type: "property-type" } }, promoteId: { "*": { type: "string" } } }; class Ge { constructor(a, d, m, _) { this.message = (a ? `${a}: ` : "") + m, _ && (this.identifier = _), d != null && d.__line__ && (this.line = d.__line__) } } function Zt(u) { const a = u.value; return a ? [new Ge(u.key, a, "constants have been deprecated as of v8")] : [] } function cn(u, ...a) { for (const d of a) for (const m in d) u[m] = d[m]; return u } function jt(u) { return u instanceof Number || u instanceof String || u instanceof Boolean ? u.valueOf() : u } function Kt(u) { if (Array.isArray(u)) return u.map(Kt); if (u instanceof Object && !(u instanceof Number || u instanceof String || u instanceof Boolean)) { const a = {}; for (const d in u) a[d] = Kt(u[d]); return a } return jt(u) } class nn extends Error { constructor(a, d) { super(d), this.message = d, this.key = a } } class Cn { constructor(a, d = []) { this.parent = a, this.bindings = {}; for (const [m, _] of d) this.bindings[m] = _ } concat(a) { return new Cn(this, a) } get(a) { if (this.bindings[a]) return this.bindings[a]; if (this.parent) return this.parent.get(a); throw new Error(`${a} not found in scope.`) } has(a) { return !!this.bindings[a] || !!this.parent && this.parent.has(a) } } const Nn = { kind: "null" }, wt = { kind: "number" }, qt = { kind: "string" }, At = { kind: "boolean" }, Xt = { kind: "color" }, en = { kind: "object" }, gt = { kind: "value" }, yn = { kind: "collator" }, Sn = { kind: "formatted" }, dn = { kind: "padding" }, zt = { kind: "resolvedImage" }; function ot(u, a) { return { kind: "array", itemType: u, N: a } } function mt(u) { if (u.kind === "array") { const a = mt(u.itemType); return typeof u.N == "number" ? `array<${a}, ${u.N}>` : u.itemType.kind === "value" ? "array" : `array<${a}>` } return u.kind } const Dt = [Nn, wt, qt, At, Xt, Sn, en, ot(gt), dn, zt]; function Bt(u, a) { if (a.kind === "error") return null; if (u.kind === "array") { if (a.kind === "array" && (a.N === 0 && a.itemType.kind === "value" || !Bt(u.itemType, a.itemType)) && (typeof u.N != "number" || u.N === a.N)) return null } else { if (u.kind === a.kind) return null; if (u.kind === "value") { for (const d of Dt) if (!Bt(d, a)) return null } } return `Expected ${mt(u)} but found ${mt(a)} instead.` } function pn(u, a) { return a.some(d => d.kind === u.kind) } function On(u, a) { return a.some(d => d === "null" ? u === null : d === "array" ? Array.isArray(u) : d === "object" ? u && !Array.isArray(u) && typeof u == "object" : d === typeof u) } var Zn, Xn = { transparent: [0, 0, 0, 0], aliceblue: [240, 248, 255, 1], antiquewhite: [250, 235, 215, 1], aqua: [0, 255, 255, 1], aquamarine: [127, 255, 212, 1], azure: [240, 255, 255, 1], beige: [245, 245, 220, 1], bisque: [255, 228, 196, 1], black: [0, 0, 0, 1], blanchedalmond: [255, 235, 205, 1], blue: [0, 0, 255, 1], blueviolet: [138, 43, 226, 1], brown: [165, 42, 42, 1], burlywood: [222, 184, 135, 1], cadetblue: [95, 158, 160, 1], chartreuse: [127, 255, 0, 1], chocolate: [210, 105, 30, 1], coral: [255, 127, 80, 1], cornflowerblue: [100, 149, 237, 1], cornsilk: [255, 248, 220, 1], crimson: [220, 20, 60, 1], cyan: [0, 255, 255, 1], darkblue: [0, 0, 139, 1], darkcyan: [0, 139, 139, 1], darkgoldenrod: [184, 134, 11, 1], darkgray: [169, 169, 169, 1], darkgreen: [0, 100, 0, 1], darkgrey: [169, 169, 169, 1], darkkhaki: [189, 183, 107, 1], darkmagenta: [139, 0, 139, 1], darkolivegreen: [85, 107, 47, 1], darkorange: [255, 140, 0, 1], darkorchid: [153, 50, 204, 1], darkred: [139, 0, 0, 1], darksalmon: [233, 150, 122, 1], darkseagreen: [143, 188, 143, 1], darkslateblue: [72, 61, 139, 1], darkslategray: [47, 79, 79, 1], darkslategrey: [47, 79, 79, 1], darkturquoise: [0, 206, 209, 1], darkviolet: [148, 0, 211, 1], deeppink: [255, 20, 147, 1], deepskyblue: [0, 191, 255, 1], dimgray: [105, 105, 105, 1], dimgrey: [105, 105, 105, 1], dodgerblue: [30, 144, 255, 1], firebrick: [178, 34, 34, 1], floralwhite: [255, 250, 240, 1], forestgreen: [34, 139, 34, 1], fuchsia: [255, 0, 255, 1], gainsboro: [220, 220, 220, 1], ghostwhite: [248, 248, 255, 1], gold: [255, 215, 0, 1], goldenrod: [218, 165, 32, 1], gray: [128, 128, 128, 1], green: [0, 128, 0, 1], greenyellow: [173, 255, 47, 1], grey: [128, 128, 128, 1], honeydew: [240, 255, 240, 1], hotpink: [255, 105, 180, 1], indianred: [205, 92, 92, 1], indigo: [75, 0, 130, 1], ivory: [255, 255, 240, 1], khaki: [240, 230, 140, 1], lavender: [230, 230, 250, 1], lavenderblush: [255, 240, 245, 1], lawngreen: [124, 252, 0, 1], lemonchiffon: [255, 250, 205, 1], lightblue: [173, 216, 230, 1], lightcoral: [240, 128, 128, 1], lightcyan: [224, 255, 255, 1], lightgoldenrodyellow: [250, 250, 210, 1], lightgray: [211, 211, 211, 1], lightgreen: [144, 238, 144, 1], lightgrey: [211, 211, 211, 1], lightpink: [255, 182, 193, 1], lightsalmon: [255, 160, 122, 1], lightseagreen: [32, 178, 170, 1], lightskyblue: [135, 206, 250, 1], lightslategray: [119, 136, 153, 1], lightslategrey: [119, 136, 153, 1], lightsteelblue: [176, 196, 222, 1], lightyellow: [255, 255, 224, 1], lime: [0, 255, 0, 1], limegreen: [50, 205, 50, 1], linen: [250, 240, 230, 1], magenta: [255, 0, 255, 1], maroon: [128, 0, 0, 1], mediumaquamarine: [102, 205, 170, 1], mediumblue: [0, 0, 205, 1], mediumorchid: [186, 85, 211, 1], mediumpurple: [147, 112, 219, 1], mediumseagreen: [60, 179, 113, 1], mediumslateblue: [123, 104, 238, 1], mediumspringgreen: [0, 250, 154, 1], mediumturquoise: [72, 209, 204, 1], mediumvioletred: [199, 21, 133, 1], midnightblue: [25, 25, 112, 1], mintcream: [245, 255, 250, 1], mistyrose: [255, 228, 225, 1], moccasin: [255, 228, 181, 1], navajowhite: [255, 222, 173, 1], navy: [0, 0, 128, 1], oldlace: [253, 245, 230, 1], olive: [128, 128, 0, 1], olivedrab: [107, 142, 35, 1], orange: [255, 165, 0, 1], orangered: [255, 69, 0, 1], orchid: [218, 112, 214, 1], palegoldenrod: [238, 232, 170, 1], palegreen: [152, 251, 152, 1], paleturquoise: [175, 238, 238, 1], palevioletred: [219, 112, 147, 1], papayawhip: [255, 239, 213, 1], peachpuff: [255, 218, 185, 1], peru: [205, 133, 63, 1], pink: [255, 192, 203, 1], plum: [221, 160, 221, 1], powderblue: [176, 224, 230, 1], purple: [128, 0, 128, 1], rebeccapurple: [102, 51, 153, 1], red: [255, 0, 0, 1], rosybrown: [188, 143, 143, 1], royalblue: [65, 105, 225, 1], saddlebrown: [139, 69, 19, 1], salmon: [250, 128, 114, 1], sandybrown: [244, 164, 96, 1], seagreen: [46, 139, 87, 1], seashell: [255, 245, 238, 1], sienna: [160, 82, 45, 1], silver: [192, 192, 192, 1], skyblue: [135, 206, 235, 1], slateblue: [106, 90, 205, 1], slategray: [112, 128, 144, 1], slategrey: [112, 128, 144, 1], snow: [255, 250, 250, 1], springgreen: [0, 255, 127, 1], steelblue: [70, 130, 180, 1], tan: [210, 180, 140, 1], teal: [0, 128, 128, 1], thistle: [216, 191, 216, 1], tomato: [255, 99, 71, 1], turquoise: [64, 224, 208, 1], violet: [238, 130, 238, 1], wheat: [245, 222, 179, 1], white: [255, 255, 255, 1], whitesmoke: [245, 245, 245, 1], yellow: [255, 255, 0, 1], yellowgreen: [154, 205, 50, 1] }; function me(u) { return (u = Math.round(u)) < 0 ? 0 : u > 255 ? 255 : u } function H(u) { return me(u[u.length - 1] === "%" ? parseFloat(u) / 100 * 255 : parseInt(u)) } function q(u) { return (a = u[u.length - 1] === "%" ? parseFloat(u) / 100 : parseFloat(u)) < 0 ? 0 : a > 1 ? 1 : a; var a } function de(u, a, d) { return d < 0 ? d += 1 : d > 1 && (d -= 1), 6 * d < 1 ? u + (a - u) * d * 6 : 2 * d < 1 ? a : 3 * d < 2 ? u + (a - u) * (2 / 3 - d) * 6 : u } try { Zn = {}.parseCSSColor = function (u) { var a, d = u.replace(/ /g, "").toLowerCase(); if (d in Xn) return Xn[d].slice(); if (d[0] === "#") return d.length === 4 ? (a = parseInt(d.substr(1), 16)) >= 0 && a <= 4095 ? [(3840 & a) >> 4 | (3840 & a) >> 8, 240 & a | (240 & a) >> 4, 15 & a | (15 & a) << 4, 1] : null : d.length === 7 && (a = parseInt(d.substr(1), 16)) >= 0 && a <= 16777215 ? [(16711680 & a) >> 16, (65280 & a) >> 8, 255 & a, 1] : null; var m = d.indexOf("("), _ = d.indexOf(")"); if (m !== -1 && _ + 1 === d.length) { var S = d.substr(0, m), T = d.substr(m + 1, _ - (m + 1)).split(","), L = 1; switch (S) { case "rgba": if (T.length !== 4) return null; L = q(T.pop()); case "rgb": return T.length !== 3 ? null : [H(T[0]), H(T[1]), H(T[2]), L]; case "hsla": if (T.length !== 4) return null; L = q(T.pop()); case "hsl": if (T.length !== 3) return null; var F = (parseFloat(T[0]) % 360 + 360) % 360 / 360, K = q(T[1]), Q = q(T[2]), ne = Q <= .5 ? Q * (K + 1) : Q + K - Q * K, ue = 2 * Q - ne; return [me(255 * de(ue, ne, F + 1 / 3)), me(255 * de(ue, ne, F)), me(255 * de(ue, ne, F - 1 / 3)), L]; default: return null } } return null } } catch { } class le { constructor(a, d, m, _ = 1) { this.r = a, this.g = d, this.b = m, this.a = _ } static parse(a) { if (!a) return; if (a instanceof le) return a; if (typeof a != "string") return; const d = Zn(a); return d ? new le(d[0] / 255 * d[3], d[1] / 255 * d[3], d[2] / 255 * d[3], d[3]) : void 0 } toString() { const [a, d, m, _] = this.toArray(); return `rgba(${Math.round(a)},${Math.round(d)},${Math.round(m)},${_})` } toArray() { const { r: a, g: d, b: m, a: _ } = this; return _ === 0 ? [0, 0, 0, 0] : [255 * a / _, 255 * d / _, 255 * m / _, _] } } le.black = new le(0, 0, 0, 1), le.white = new le(1, 1, 1, 1), le.transparent = new le(0, 0, 0, 0), le.red = new le(1, 0, 0, 1); class xe { constructor(a, d, m) { this.sensitivity = a ? d ? "variant" : "case" : d ? "accent" : "base", this.locale = m, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" }) } compare(a, d) { return this.collator.compare(a, d) } resolvedLocale() { return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale } } class Ee { constructor(a, d, m, _, S) { this.text = a, this.image = d, this.scale = m, this.fontStack = _, this.textColor = S } } class be { constructor(a) { this.sections = a } static fromString(a) { return new be([new Ee(a, null, null, null, null)]) } isEmpty() { return this.sections.length === 0 || !this.sections.some(a => a.text.length !== 0 || a.image && a.image.name.length !== 0) } static factory(a) { return a instanceof be ? a : be.fromString(a) } toString() { return this.sections.length === 0 ? "" : this.sections.map(a => a.text).join("") } } class Ce { constructor(a) { this.values = a.slice() } static parse(a) { if (a instanceof Ce) return a; if (typeof a == "number") return new Ce([a, a, a, a]); if (Array.isArray(a) && !(a.length < 1 || a.length > 4)) { for (const d of a) if (typeof d != "number") return; switch (a.length) { case 1: a = [a[0], a[0], a[0], a[0]]; break; case 2: a = [a[0], a[1], a[0], a[1]]; break; case 3: a = [a[0], a[1], a[2], a[1]] }return new Ce(a) } } toString() { return JSON.stringify(this.values) } } class Le { constructor(a) { this.name = a.name, this.available = a.available } toString() { return this.name } static fromString(a) { return a ? new Le({ name: a, available: !1 }) : null } } function qe(u, a, d, m) { return typeof u == "number" && u >= 0 && u <= 255 && typeof a == "number" && a >= 0 && a <= 255 && typeof d == "number" && d >= 0 && d <= 255 ? m === void 0 || typeof m == "number" && m >= 0 && m <= 1 ? null : `Invalid rgba value [${[u, a, d, m].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${(typeof m == "number" ? [u, a, d, m] : [u, a, d]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.` } function Ze(u) { if (u === null || typeof u == "string" || typeof u == "boolean" || typeof u == "number" || u instanceof le || u instanceof xe || u instanceof be || u instanceof Ce || u instanceof Le) return !0; if (Array.isArray(u)) { for (const a of u) if (!Ze(a)) return !1; return !0 } if (typeof u == "object") { for (const a in u) if (!Ze(u[a])) return !1; return !0 } return !1 } function Ve(u) { if (u === null) return Nn; if (typeof u == "string") return qt; if (typeof u == "boolean") return At; if (typeof u == "number") return wt; if (u instanceof le) return Xt; if (u instanceof xe) return yn; if (u instanceof be) return Sn; if (u instanceof Ce) return dn; if (u instanceof Le) return zt; if (Array.isArray(u)) { const a = u.length; let d; for (const m of u) { const _ = Ve(m); if (d) { if (d === _) continue; d = gt; break } d = _ } return ot(d || gt, a) } return en } function Lt(u) { const a = typeof u; return u === null ? "" : a === "string" || a === "number" || a === "boolean" ? String(u) : u instanceof le || u instanceof be || u instanceof Ce || u instanceof Le ? u.toString() : JSON.stringify(u) } class Ct { constructor(a, d) { this.type = a, this.value = d } static parse(a, d) { if (a.length !== 2) return d.error(`'literal' expression requires exactly one argument, but found ${a.length - 1} instead.`); if (!Ze(a[1])) return d.error("invalid value"); const m = a[1]; let _ = Ve(m); const S = d.expectedType; return _.kind !== "array" || _.N !== 0 || !S || S.kind !== "array" || typeof S.N == "number" && S.N !== 0 || (_ = S), new Ct(_, m) } evaluate() { return this.value } eachChild() { } outputDefined() { return !0 } } class Je { constructor(a) { this.name = "ExpressionEvaluationError", this.message = a } toJSON() { return this.message } } const Ot = { string: qt, number: wt, boolean: At, object: en }; class Vt { constructor(a, d) { this.type = a, this.args = d } static parse(a, d) { if (a.length < 2) return d.error("Expected at least one argument."); let m, _ = 1; const S = a[0]; if (S === "array") { let L, F; if (a.length > 2) { const K = a[1]; if (typeof K != "string" || !(K in Ot) || K === "object") return d.error('The item type argument of "array" must be one of string, number, boolean', 1); L = Ot[K], _++ } else L = gt; if (a.length > 3) { if (a[2] !== null && (typeof a[2] != "number" || a[2] < 0 || a[2] !== Math.floor(a[2]))) return d.error('The length argument to "array" must be a positive integer literal', 2); F = a[2], _++ } m = ot(L, F) } else { if (!Ot[S]) throw new Error(`Types doesn't contain name = ${S}`); m = Ot[S] } const T = []; for (; _ < a.length; _++) { const L = d.parse(a[_], _, gt); if (!L) return null; T.push(L) } return new Vt(m, T) } evaluate(a) { for (let d = 0; d < this.args.length; d++) { const m = this.args[d].evaluate(a); if (!Bt(this.type, Ve(m))) return m; if (d === this.args.length - 1) throw new Je(`Expected value to be of type ${mt(this.type)}, but found ${mt(Ve(m))} instead.`) } throw new Error } eachChild(a) { this.args.forEach(a) } outputDefined() { return this.args.every(a => a.outputDefined()) } } const bn = { "to-boolean": At, "to-color": Xt, "to-number": wt, "to-string": qt }; class un { constructor(a, d) { this.type = a, this.args = d } static parse(a, d) { if (a.length < 2) return d.error("Expected at least one argument."); const m = a[0]; if (!bn[m]) throw new Error(`Can't parse ${m} as it is not part of the known types`); if ((m === "to-boolean" || m === "to-string") && a.length !== 2) return d.error("Expected one argument."); const _ = bn[m], S = []; for (let T = 1; T < a.length; T++) { const L = d.parse(a[T], T, gt); if (!L) return null; S.push(L) } return new un(_, S) } evaluate(a) { if (this.type.kind === "boolean") return Boolean(this.args[0].evaluate(a)); if (this.type.kind === "color") { let d, m; for (const _ of this.args) { if (d = _.evaluate(a), m = null, d instanceof le) return d; if (typeof d == "string") { const S = a.parseColor(d); if (S) return S } else if (Array.isArray(d) && (m = d.length < 3 || d.length > 4 ? `Invalid rbga value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.` : qe(d[0], d[1], d[2], d[3]), !m)) return new le(d[0] / 255, d[1] / 255, d[2] / 255, d[3]) } throw new Je(m || `Could not parse color from value '${typeof d == "string" ? d : JSON.stringify(d)}'`) } if (this.type.kind === "padding") { let d; for (const m of this.args) { d = m.evaluate(a); const _ = Ce.parse(d); if (_) return _ } throw new Je(`Could not parse padding from value '${typeof d == "string" ? d : JSON.stringify(d)}'`) } if (this.type.kind === "number") { let d = null; for (const m of this.args) { if (d = m.evaluate(a), d === null) return 0; const _ = Number(d); if (!isNaN(_)) return _ } throw new Je(`Could not convert ${JSON.stringify(d)} to number.`) } return this.type.kind === "formatted" ? be.fromString(Lt(this.args[0].evaluate(a))) : this.type.kind === "resolvedImage" ? Le.fromString(Lt(this.args[0].evaluate(a))) : Lt(this.args[0].evaluate(a)) } eachChild(a) { this.args.forEach(a) } outputDefined() { return this.args.every(a => a.outputDefined()) } } const wn = ["Unknown", "Point", "LineString", "Polygon"]; class Vn { constructor() { this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null } id() { return this.feature && "id" in this.feature ? this.feature.id : null } geometryType() { return this.feature ? typeof this.feature.type == "number" ? wn[this.feature.type] : this.feature.type : null } geometry() { return this.feature && "geometry" in this.feature ? this.feature.geometry : null } canonicalID() { return this.canonical } properties() { return this.feature && this.feature.properties || {} } parseColor(a) { let d = this._parseColorCache[a]; return d || (d = this._parseColorCache[a] = le.parse(a)), d } } class rr { constructor(a, d, m, _) { this.name = a, this.type = d, this._evaluate = m, this.args = _ } evaluate(a) { return this._evaluate(a, this.args) } eachChild(a) { this.args.forEach(a) } outputDefined() { return !1 } static parse(a, d) { const m = a[0], _ = rr.definitions[m]; if (!_) return d.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`, 0); const S = Array.isArray(_) ? _[0] : _.type, T = Array.isArray(_) ? [[_[1], _[2]]] : _.overloads, L = T.filter(([K]) => !Array.isArray(K) || K.length === a.length - 1); let F = null; for (const [K, Q] of L) { F = new Xa(d.registry, d.path, null, d.scope); const ne = []; let ue = !1; for (let he = 1; he < a.length; he++) { const pe = a[he], Ne = Array.isArray(K) ? K[he - 1] : K.type, Ae = F.parse(pe, 1 + ne.length, Ne); if (!Ae) { ue = !0; break } ne.push(Ae) } if (!ue) if (Array.isArray(K) && K.length !== ne.length) F.error(`Expected ${K.length} arguments, but found ${ne.length} instead.`); else { for (let he = 0; he < ne.length; he++) { const pe = Array.isArray(K) ? K[he] : K.type, Ne = ne[he]; F.concat(he + 1).checkSubtype(pe, Ne.type) } if (F.errors.length === 0) return new rr(m, S, Q, ne) } } if (L.length === 1) d.errors.push(...F.errors); else { const K = (L.length ? L : T).map(([ne]) => { return ue = ne, Array.isArray(ue) ? `(${ue.map(mt).join(", ")})` : `(${mt(ue.type)}...)`; var ue }).join(" | "), Q = []; for (let ne = 1; ne < a.length; ne++) { const ue = d.parse(a[ne], 1 + Q.length); if (!ue) return null; Q.push(mt(ue.type)) } d.error(`Expected arguments of type ${K}, but found (${Q.join(", ")}) instead.`) } return null } static register(a, d) { rr.definitions = d; for (const m in d) a[m] = rr } } class $r { constructor(a, d, m) { this.type = yn, this.locale = m, this.caseSensitive = a, this.diacriticSensitive = d } static parse(a, d) { if (a.length !== 2) return d.error("Expected one argument."); const m = a[1]; if (typeof m != "object" || Array.isArray(m)) return d.error("Collator options argument must be an object."); const _ = d.parse(m["case-sensitive"] !== void 0 && m["case-sensitive"], 1, At); if (!_) return null; const S = d.parse(m["diacritic-sensitive"] !== void 0 && m["diacritic-sensitive"], 1, At); if (!S) return null; let T = null; return m.locale && (T = d.parse(m.locale, 1, qt), !T) ? null : new $r(_, S, T) } evaluate(a) { return new xe(this.caseSensitive.evaluate(a), this.diacriticSensitive.evaluate(a), this.locale ? this.locale.evaluate(a) : null) } eachChild(a) { a(this.caseSensitive), a(this.diacriticSensitive), this.locale && a(this.locale) } outputDefined() { return !1 } } const sr = 8192; function Mr(u, a) { u[0] = Math.min(u[0], a[0]), u[1] = Math.min(u[1], a[1]), u[2] = Math.max(u[2], a[0]), u[3] = Math.max(u[3], a[1]) } function Mn(u, a) { return !(u[0] <= a[0] || u[2] >= a[2] || u[1] <= a[1] || u[3] >= a[3]) } function kn(u, a) { const d = (180 + u[0]) / 360, m = (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + u[1] * Math.PI / 360))) / 360, _ = Math.pow(2, a.z); return [Math.round(d * _ * sr), Math.round(m * _ * sr)] } function Dn(u, a, d) { const m = u[0] - a[0], _ = u[1] - a[1], S = u[0] - d[0], T = u[1] - d[1]; return m * T - S * _ == 0 && m * S <= 0 && _ * T <= 0 } function Gr(u, a) { let d = !1; for (let T = 0, L = a.length; T < L; T++) { const F = a[T]; for (let K = 0, Q = F.length; K < Q - 1; K++) { if (Dn(u, F[K], F[K + 1])) return !1; (_ = F[K])[1] > (m = u)[1] != (S = F[K + 1])[1] > m[1] && m[0] < (S[0] - _[0]) * (m[1] - _[1]) / (S[1] - _[1]) + _[0] && (d = !d) } } var m, _, S; return d } function yr(u, a) { for (let d = 0; d < a.length; d++)if (Gr(u, a[d])) return !0; return !1 } function Kn(u, a, d, m) { const _ = m[0] - d[0], S = m[1] - d[1], T = (u[0] - d[0]) * S - _ * (u[1] - d[1]), L = (a[0] - d[0]) * S - _ * (a[1] - d[1]); return T > 0 && L < 0 || T < 0 && L > 0 } function $n(u, a, d) { for (const K of d) for (let Q = 0; Q < K.length - 1; ++Q)if ((L = [(T = K[Q + 1])[0] - (S = K[Q])[0], T[1] - S[1]])[0] * (F = [(_ = a)[0] - (m = u)[0], _[1] - m[1]])[1] - L[1] * F[0] != 0 && Kn(m, _, S, T) && Kn(S, T, m, _)) return !0; var m, _, S, T, L, F; return !1 } function Jn(u, a) { for (let d = 0; d < u.length; ++d)if (!Gr(u[d], a)) return !1; for (let d = 0; d < u.length - 1; ++d)if ($n(u[d], u[d + 1], a)) return !1; return !0 } function br(u, a) { for (let d = 0; d < a.length; d++)if (Jn(u, a[d])) return !0; return !1 } function Cr(u, a, d) { const m = []; for (let _ = 0; _ < u.length; _++) { const S = []; for (let T = 0; T < u[_].length; T++) { const L = kn(u[_][T], d); Mr(a, L), S.push(L) } m.push(S) } return m } function Br(u, a, d) { const m = []; for (let _ = 0; _ < u.length; _++) { const S = Cr(u[_], a, d); m.push(S) } return m } function so(u, a, d, m) { if (u[0] < d[0] || u[0] > d[2]) { const _ = .5 * m; let S = u[0] - d[0] > _ ? -m : d[0] - u[0] > _ ? m : 0; S === 0 && (S = u[0] - d[2] > _ ? -m : d[2] - u[0] > _ ? m : 0), u[0] += S } Mr(a, u) } function gl(u, a, d, m) { const _ = Math.pow(2, m.z) * sr, S = [m.x * sr, m.y * sr], T = []; for (const L of u) for (const F of L) { const K = [F.x + S[0], F.y + S[1]]; so(K, a, d, _), T.push(K) } return T } function Bc(u, a, d, m) { const _ = Math.pow(2, m.z) * sr, S = [m.x * sr, m.y * sr], T = []; for (const F of u) { const K = []; for (const Q of F) { const ne = [Q.x + S[0], Q.y + S[1]]; Mr(a, ne), K.push(ne) } T.push(K) } if (a[2] - a[0] <= _ / 2) { (L = a)[0] = L[1] = 1 / 0, L[2] = L[3] = -1 / 0; for (const F of T) for (const K of F) so(K, a, d, _) } var L; return T } class Ea { constructor(a, d) { this.type = At, this.geojson = a, this.geometries = d } static parse(a, d) { if (a.length !== 2) return d.error(`'within' expression requires exactly one argument, but found ${a.length - 1} instead.`); if (Ze(a[1])) { const m = a[1]; if (m.type === "FeatureCollection") for (let _ = 0; _ < m.features.length; ++_) { const S = m.features[_].geometry.type; if (S === "Polygon" || S === "MultiPolygon") return new Ea(m, m.features[_].geometry) } else if (m.type === "Feature") { const _ = m.geometry.type; if (_ === "Polygon" || _ === "MultiPolygon") return new Ea(m, m.geometry) } else if (m.type === "Polygon" || m.type === "MultiPolygon") return new Ea(m, m) } return d.error("'within' expression requires valid geojson object that contains polygon geometry type.") } evaluate(a) { if (a.geometry() != null && a.canonicalID() != null) { if (a.geometryType() === "Point") return function (d, m) { const _ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], S = [1 / 0, 1 / 0, -1 / 0, -1 / 0], T = d.canonicalID(); if (m.type === "Polygon") { const L = Cr(m.coordinates, S, T), F = gl(d.geometry(), _, S, T); if (!Mn(_, S)) return !1; for (const K of F) if (!Gr(K, L)) return !1 } if (m.type === "MultiPolygon") { const L = Br(m.coordinates, S, T), F = gl(d.geometry(), _, S, T); if (!Mn(_, S)) return !1; for (const K of F) if (!yr(K, L)) return !1 } return !0 }(a, this.geometries); if (a.geometryType() === "LineString") return function (d, m) { const _ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], S = [1 / 0, 1 / 0, -1 / 0, -1 / 0], T = d.canonicalID(); if (m.type === "Polygon") { const L = Cr(m.coordinates, S, T), F = Bc(d.geometry(), _, S, T); if (!Mn(_, S)) return !1; for (const K of F) if (!Jn(K, L)) return !1 } if (m.type === "MultiPolygon") { const L = Br(m.coordinates, S, T), F = Bc(d.geometry(), _, S, T); if (!Mn(_, S)) return !1; for (const K of F) if (!br(K, L)) return !1 } return !0 }(a, this.geometries) } return !1 } eachChild() { } outputDefined() { return !0 } } function Bn(u) { if (u instanceof rr && (u.name === "get" && u.args.length === 1 || u.name === "feature-state" || u.name === "has" && u.args.length === 1 || u.name === "properties" || u.name === "geometry-type" || u.name === "id" || /^filter-/.test(u.name)) || u instanceof Ea) return !1; let a = !0; return u.eachChild(d => { a && !Bn(d) && (a = !1) }), a } function Yn(u) { if (u instanceof rr && u.name === "feature-state") return !1; let a = !0; return u.eachChild(d => { a && !Yn(d) && (a = !1) }), a } function Ar(u, a) { if (u instanceof rr && a.indexOf(u.name) >= 0) return !1; let d = !0; return u.eachChild(m => { d && !Ar(m, a) && (d = !1) }), d } class Ei { constructor(a, d) { this.type = d.type, this.name = a, this.boundExpression = d } static parse(a, d) { if (a.length !== 2 || typeof a[1] != "string") return d.error("'var' expression requires exactly one string literal argument."); const m = a[1]; return d.scope.has(m) ? new Ei(m, d.scope.get(m)) : d.error(`Unknown variable "${m}". Make sure "${m}" has been bound in an enclosing "let" expression before using it.`, 1) } evaluate(a) { return this.boundExpression.evaluate(a) } eachChild() { } outputDefined() { return !1 } } class Xa { constructor(a, d = [], m, _ = new Cn, S = []) { this.registry = a, this.path = d, this.key = d.map(T => `[${T}]`).join(""), this.scope = _, this.errors = S, this.expectedType = m } parse(a, d, m, _, S = {}) { return d ? this.concat(d, m, _)._parse(a, S) : this._parse(a, S) } _parse(a, d) { function m(_, S, T) { return T === "assert" ? new Vt(S, [_]) : T === "coerce" ? new un(S, [_]) : _ } if (a !== null && typeof a != "string" && typeof a != "boolean" && typeof a != "number" || (a = ["literal", a]), Array.isArray(a)) { if (a.length === 0) return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].'); const _ = a[0]; if (typeof _ != "string") return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`, 0), null; const S = this.registry[_]; if (S) { let T = S.parse(a, this); if (!T) return null; if (this.expectedType) { const L = this.expectedType, F = T.type; if (L.kind !== "string" && L.kind !== "number" && L.kind !== "boolean" && L.kind !== "object" && L.kind !== "array" || F.kind !== "value") if (L.kind !== "color" && L.kind !== "formatted" && L.kind !== "resolvedImage" || F.kind !== "value" && F.kind !== "string") if (L.kind !== "padding" || F.kind !== "value" && F.kind !== "number" && F.kind !== "array") { if (this.checkSubtype(L, F)) return null } else T = m(T, L, d.typeAnnotation || "coerce"); else T = m(T, L, d.typeAnnotation || "coerce"); else T = m(T, L, d.typeAnnotation || "assert") } if (!(T instanceof Ct) && T.type.kind !== "resolvedImage" && To(T)) { const L = new Vn; try { T = new Ct(T.type, T.evaluate(L)) } catch (F) { return this.error(F.message), null } } return T } return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`, 0) } return this.error(a === void 0 ? "'undefined' value invalid. Use null instead." : typeof a == "object" ? 'Bare objects invalid. Use ["literal", {...}] instead.' : `Expected an array, but found ${typeof a} instead.`) } concat(a, d, m) { const _ = typeof a == "number" ? this.path.concat(a) : this.path, S = m ? this.scope.concat(m) : this.scope; return new Xa(this.registry, _, d || null, S, this.errors) } error(a, ...d) { const m = `${this.key}${d.map(_ => `[${_}]`).join("")}`; this.errors.push(new nn(m, a)) } checkSubtype(a, d) { const m = Bt(a, d); return m && this.error(m), m } } function To(u) { if (u instanceof Ei) return To(u.boundExpression); if (u instanceof rr && u.name === "error" || u instanceof $r || u instanceof Ea) return !1; const a = u instanceof un || u instanceof Vt; let d = !0; return u.eachChild(m => { d = a ? d && To(m) : d && m instanceof Ct }), !!d && Bn(u) && Ar(u, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"]) } function Es(u, a) { const d = u.length - 1; let m, _, S = 0, T = d, L = 0; for (; S <= T;)if (L = Math.floor((S + T) / 2), m = u[L], _ = u[L + 1], m <= a) { if (L === d || a < _) return L; S = L + 1 } else { if (!(m > a)) throw new Je("Input is not a number."); T = L - 1 } return 0 } class Pa { constructor(a, d, m) { this.type = a, this.input = d, this.labels = [], this.outputs = []; for (const [_, S] of m) this.labels.push(_), this.outputs.push(S) } static parse(a, d) { if (a.length - 1 < 4) return d.error(`Expected at least 4 arguments, but found only ${a.length - 1}.`); if ((a.length - 1) % 2 != 0) return d.error("Expected an even number of arguments."); const m = d.parse(a[1], 1, wt); if (!m) return null; const _ = []; let S = null; d.expectedType && d.expectedType.kind !== "value" && (S = d.expectedType); for (let T = 1; T < a.length; T += 2) { const L = T === 1 ? -1 / 0 : a[T], F = a[T + 1], K = T, Q = T + 1; if (typeof L != "number") return d.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', K); if (_.length && _[_.length - 1][0] >= L) return d.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', K); const ne = d.parse(F, Q, S); if (!ne) return null; S = S || ne.type, _.push([L, ne]) } return new Pa(S, m, _) } evaluate(a) { const d = this.labels, m = this.outputs; if (d.length === 1) return m[0].evaluate(a); const _ = this.input.evaluate(a); if (_ <= d[0]) return m[0].evaluate(a); const S = d.length; return _ >= d[S - 1] ? m[S - 1].evaluate(a) : m[Es(d, _)].evaluate(a) } eachChild(a) { a(this.input); for (const d of this.outputs) a(d) } outputDefined() { return this.outputs.every(a => a.outputDefined()) } } function xr(u, a, d) { return u * (1 - d) + a * d } var Ta = Object.freeze({ __proto__: null, number: xr, color: function (u, a, d) { return new le(xr(u.r, a.r, d), xr(u.g, a.g, d), xr(u.b, a.b, d), xr(u.a, a.a, d)) }, array: function (u, a, d) { return u.map((m, _) => xr(m, a[_], d)) }, padding: function (u, a, d) { const m = u.values, _ = a.values; return new Ce([xr(m[0], _[0], d), xr(m[1], _[1], d), xr(m[2], _[2], d), xr(m[3], _[3], d)]) } }); const Lm = .95047, zm = 1.08883, Ff = 4 / 29, Vc = 6 / 29, Fm = 3 * Vc * Vc, Rx = Math.PI / 180, Mx = 180 / Math.PI; function $f(u) { return u > .008856451679035631 ? Math.pow(u, 1 / 3) : u / Fm + Ff } function Bf(u) { return u > Vc ? u * u * u : Fm * (u - Ff) } function Vf(u) { return 255 * (u <= .0031308 ? 12.92 * u : 1.055 * Math.pow(u, 1 / 2.4) - .055) } function Uf(u) { return (u /= 255) <= .04045 ? u / 12.92 : Math.pow((u + .055) / 1.055, 2.4) } function lr(u) { const a = Uf(u.r), d = Uf(u.g), m = Uf(u.b), _ = $f((.4124564 * a + .3575761 * d + .1804375 * m) / Lm), S = $f((.2126729 * a + .7151522 * d + .072175 * m) / 1); return { l: 116 * S - 16, a: 500 * (_ - S), b: 200 * (S - $f((.0193339 * a + .119192 * d + .9503041 * m) / zm)), alpha: u.a } } function $m(u) { let a = (u.l + 16) / 116, d = isNaN(u.a) ? a : a + u.a / 500, m = isNaN(u.b) ? a : a - u.b / 200; return a = 1 * Bf(a), d = Lm * Bf(d), m = zm * Bf(m), new le(Vf(3.2404542 * d - 1.5371385 * a - .4985314 * m), Vf(-.969266 * d + 1.8760108 * a + .041556 * m), Vf(.0556434 * d - .2040259 * a + 1.0572252 * m), u.alpha) } function Ax(u, a, d) { const m = a - u; return u + d * (m > 180 || m < -180 ? m - 360 * Math.round(m / 360) : m) } const bu = { forward: lr, reverse: $m, interpolate: function (u, a, d) { return { l: xr(u.l, a.l, d), a: xr(u.a, a.a, d), b: xr(u.b, a.b, d), alpha: xr(u.alpha, a.alpha, d) } } }, wu = { forward: function (u) { const { l: a, a: d, b: m } = lr(u), _ = Math.atan2(m, d) * Mx; return { h: _ < 0 ? _ + 360 : _, c: Math.sqrt(d * d + m * m), l: a, alpha: u.a } }, reverse: function (u) { const a = u.h * Rx, d = u.c; return $m({ l: u.l, a: Math.cos(a) * d, b: Math.sin(a) * d, alpha: u.alpha }) }, interpolate: function (u, a, d) { return { h: Ax(u.h, a.h, d), c: xr(u.c, a.c, d), l: xr(u.l, a.l, d), alpha: xr(u.alpha, a.alpha, d) } } }; var Bm = Object.freeze({ __proto__: null, lab: bu, hcl: wu }); class lo { constructor(a, d, m, _, S) { this.type = a, this.operator = d, this.interpolation = m, this.input = _, this.labels = [], this.outputs = []; for (const [T, L] of S) this.labels.push(T), this.outputs.push(L) } static interpolationFactor(a, d, m, _) { let S = 0; if (a.name === "exponential") S = jf(d, a.base, m, _); else if (a.name === "linear") S = jf(d, 1, m, _); else if (a.name === "cubic-bezier") { const T = a.controlPoints; S = new f(T[0], T[1], T[2], T[3]).solve(jf(d, 1, m, _)) } return S } static parse(a, d) { let [m, _, S, ...T] = a; if (!Array.isArray(_) || _.length === 0) return d.error("Expected an interpolation type expression.", 1); if (_[0] === "linear") _ = { name: "linear" }; else if (_[0] === "exponential") { const K = _[1]; if (typeof K != "number") return d.error("Exponential interpolation requires a numeric base.", 1, 1); _ = { name: "exponential", base: K } } else { if (_[0] !== "cubic-bezier") return d.error(`Unknown interpolation type ${String(_[0])}`, 1, 0); { const K = _.slice(1); if (K.length !== 4 || K.some(Q => typeof Q != "number" || Q < 0 || Q > 1)) return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1); _ = { name: "cubic-bezier", controlPoints: K } } } if (a.length - 1 < 4) return d.error(`Expected at least 4 arguments, but found only ${a.length - 1}.`); if ((a.length - 1) % 2 != 0) return d.error("Expected an even number of arguments."); if (S = d.parse(S, 2, wt), !S) return null; const L = []; let F = null; m === "interpolate-hcl" || m === "interpolate-lab" ? F = Xt : d.expectedType && d.expectedType.kind !== "value" && (F = d.expectedType); for (let K = 0; K < T.length; K += 2) { const Q = T[K], ne = T[K + 1], ue = K + 3, he = K + 4; if (typeof Q != "number") return d.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', ue); if (L.length && L[L.length - 1][0] >= Q) return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', ue); const pe = d.parse(ne, he, F); if (!pe) return null; F = F || pe.type, L.push([Q, pe]) } return F.kind === "number" || F.kind === "color" || F.kind === "padding" || F.kind === "array" && F.itemType.kind === "number" && typeof F.N == "number" ? new lo(F, m, _, S, L) : d.error(`Type ${mt(F)} is not interpolatable.`) } evaluate(a) { const d = this.labels, m = this.outputs; if (d.length === 1) return m[0].evaluate(a); const _ = this.input.evaluate(a); if (_ <= d[0]) return m[0].evaluate(a); const S = d.length; if (_ >= d[S - 1]) return m[S - 1].evaluate(a); const T = Es(d, _), L = lo.interpolationFactor(this.interpolation, _, d[T], d[T + 1]), F = m[T].evaluate(a), K = m[T + 1].evaluate(a); return this.operator === "interpolate" ? Ta[this.type.kind.toLowerCase()](F, K, L) : this.operator === "interpolate-hcl" ? wu.reverse(wu.interpolate(wu.forward(F), wu.forward(K), L)) : bu.reverse(bu.interpolate(bu.forward(F), bu.forward(K), L)) } eachChild(a) { a(this.input); for (const d of this.outputs) a(d) } outputDefined() { return this.outputs.every(a => a.outputDefined()) } } function jf(u, a, d, m) { const _ = m - d, S = u - d; return _ === 0 ? 0 : a === 1 ? S / _ : (Math.pow(a, S) - 1) / (Math.pow(a, _) - 1) } class Uc { constructor(a, d) { this.type = a, this.args = d } static parse(a, d) { if (a.length < 2) return d.error("Expectected at least one argument."); let m = null; const _ = d.expectedType; _ && _.kind !== "value" && (m = _); const S = []; for (const L of a.slice(1)) { const F = d.parse(L, 1 + S.length, m, void 0, { typeAnnotation: "omit" }); if (!F) return null; m = m || F.type, S.push(F) } if (!m) throw new Error("No output type"); const T = _ && S.some(L => Bt(_, L.type)); return new Uc(T ? gt : m, S) } evaluate(a) { let d, m = null, _ = 0; for (const S of this.args) if (_++, m = S.evaluate(a), m && m instanceof Le && !m.available && (d || (d = m.name), m = null, _ === this.args.length && (m = d)), m !== null) break; return m } eachChild(a) { this.args.forEach(a) } outputDefined() { return this.args.every(a => a.outputDefined()) } } class jc { constructor(a, d) { this.type = d.type, this.bindings = [].concat(a), this.result = d } evaluate(a) { return this.result.evaluate(a) } eachChild(a) { for (const d of this.bindings) a(d[1]); a(this.result) } static parse(a, d) { if (a.length < 4) return d.error(`Expected at least 3 arguments, but found ${a.length - 1} instead.`); const m = []; for (let S = 1; S < a.length - 1; S += 2) { const T = a[S]; if (typeof T != "string") return d.error(`Expected string, but found ${typeof T} instead.`, S); if (/[^a-zA-Z0-9_]/.test(T)) return d.error("Variable names must contain only alphanumeric characters or '_'.", S); const L = d.parse(a[S + 1], S + 1); if (!L) return null; m.push([T, L]) } const _ = d.parse(a[a.length - 1], a.length - 1, d.expectedType, m); return _ ? new jc(m, _) : null } outputDefined() { return this.result.outputDefined() } } class Kf { constructor(a, d, m) { this.type = a, this.index = d, this.input = m } static parse(a, d) { if (a.length !== 3) return d.error(`Expected 2 arguments, but found ${a.length - 1} instead.`); const m = d.parse(a[1], 1, wt), _ = d.parse(a[2], 2, ot(d.expectedType || gt)); return m && _ ? new Kf(_.type.itemType, m, _) : null } evaluate(a) { const d = this.index.evaluate(a), m = this.input.evaluate(a); if (d < 0) throw new Je(`Array index out of bounds: ${d} < 0.`); if (d >= m.length) throw new Je(`Array index out of bounds: ${d} > ${m.length - 1}.`); if (d !== Math.floor(d)) throw new Je(`Array index must be an integer, but found ${d} instead.`); return m[d] } eachChild(a) { a(this.index), a(this.input) } outputDefined() { return !1 } } class Hf { constructor(a, d) { this.type = At, this.needle = a, this.haystack = d } static parse(a, d) { if (a.length !== 3) return d.error(`Expected 2 arguments, but found ${a.length - 1} instead.`); const m = d.parse(a[1], 1, gt), _ = d.parse(a[2], 2, gt); return m && _ ? pn(m.type, [At, qt, wt, Nn, gt]) ? new Hf(m, _) : d.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(m.type)} instead`) : null } evaluate(a) { const d = this.needle.evaluate(a), m = this.haystack.evaluate(a); if (!m) return !1; if (!On(d, ["boolean", "string", "number", "null"])) throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(d))} instead.`); if (!On(m, ["string", "array"])) throw new Je(`Expected second argument to be of type array or string, but found ${mt(Ve(m))} instead.`); return m.indexOf(d) >= 0 } eachChild(a) { a(this.needle), a(this.haystack) } outputDefined() { return !0 } } class Kc { constructor(a, d, m) { this.type = wt, this.needle = a, this.haystack = d, this.fromIndex = m } static parse(a, d) { if (a.length <= 2 || a.length >= 5) return d.error(`Expected 3 or 4 arguments, but found ${a.length - 1} instead.`); const m = d.parse(a[1], 1, gt), _ = d.parse(a[2], 2, gt); if (!m || !_) return null; if (!pn(m.type, [At, qt, wt, Nn, gt])) return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(m.type)} instead`); if (a.length === 4) { const S = d.parse(a[3], 3, wt); return S ? new Kc(m, _, S) : null } return new Kc(m, _) } evaluate(a) { const d = this.needle.evaluate(a), m = this.haystack.evaluate(a); if (!On(d, ["boolean", "string", "number", "null"])) throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Ve(d))} instead.`); if (!On(m, ["string", "array"])) throw new Je(`Expected second argument to be of type array or string, but found ${mt(Ve(m))} instead.`); if (this.fromIndex) { const _ = this.fromIndex.evaluate(a); return m.indexOf(d, _) } return m.indexOf(d) } eachChild(a) { a(this.needle), a(this.haystack), this.fromIndex && a(this.fromIndex) } outputDefined() { return !1 } } class Wf { constructor(a, d, m, _, S, T) { this.inputType = a, this.type = d, this.input = m, this.cases = _, this.outputs = S, this.otherwise = T } static parse(a, d) { if (a.length < 5) return d.error(`Expected at least 4 arguments, but found only ${a.length - 1}.`); if (a.length % 2 != 1) return d.error("Expected an even number of arguments."); let m, _; d.expectedType && d.expectedType.kind !== "value" && (_ = d.expectedType); const S = {}, T = []; for (let K = 2; K < a.length - 1; K += 2) { let Q = a[K]; const ne = a[K + 1]; Array.isArray(Q) || (Q = [Q]); const ue = d.concat(K); if (Q.length === 0) return ue.error("Expected at least one branch label."); for (const pe of Q) { if (typeof pe != "number" && typeof pe != "string") return ue.error("Branch labels must be numbers or strings."); if (typeof pe == "number" && Math.abs(pe) > Number.MAX_SAFE_INTEGER) return ue.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`); if (typeof pe == "number" && Math.floor(pe) !== pe) return ue.error("Numeric branch labels must be integer values."); if (m) { if (ue.checkSubtype(m, Ve(pe))) return null } else m = Ve(pe); if (S[String(pe)] !== void 0) return ue.error("Branch labels must be unique."); S[String(pe)] = T.length } const he = d.parse(ne, K, _); if (!he) return null; _ = _ || he.type, T.push(he) } const L = d.parse(a[1], 1, gt); if (!L) return null; const F = d.parse(a[a.length - 1], a.length - 1, _); return F ? L.type.kind !== "value" && d.concat(1).checkSubtype(m, L.type) ? null : new Wf(m, _, L, S, T, F) : null } evaluate(a) { const d = this.input.evaluate(a); return (Ve(d) === this.inputType && this.outputs[this.cases[d]] || this.otherwise).evaluate(a) } eachChild(a) { a(this.input), this.outputs.forEach(a), a(this.otherwise) } outputDefined() { return this.outputs.every(a => a.outputDefined()) && this.otherwise.outputDefined() } } class Gf { constructor(a, d, m) { this.type = a, this.branches = d, this.otherwise = m } static parse(a, d) { if (a.length < 4) return d.error(`Expected at least 3 arguments, but found only ${a.length - 1}.`); if (a.length % 2 != 0) return d.error("Expected an odd number of arguments."); let m; d.expectedType && d.expectedType.kind !== "value" && (m = d.expectedType); const _ = []; for (let T = 1; T < a.length - 1; T += 2) { const L = d.parse(a[T], T, At); if (!L) return null; const F = d.parse(a[T + 1], T + 1, m); if (!F) return null; _.push([L, F]), m = m || F.type } const S = d.parse(a[a.length - 1], a.length - 1, m); if (!S) return null; if (!m) throw new Error("Can't infer output type"); return new Gf(m, _, S) } evaluate(a) { for (const [d, m] of this.branches) if (d.evaluate(a)) return m.evaluate(a); return this.otherwise.evaluate(a) } eachChild(a) { for (const [d, m] of this.branches) a(d), a(m); a(this.otherwise) } outputDefined() { return this.branches.every(([a, d]) => d.outputDefined()) && this.otherwise.outputDefined() } } class Hc { constructor(a, d, m, _) { this.type = a, this.input = d, this.beginIndex = m, this.endIndex = _ } static parse(a, d) { if (a.length <= 2 || a.length >= 5) return d.error(`Expected 3 or 4 arguments, but found ${a.length - 1} instead.`); const m = d.parse(a[1], 1, gt), _ = d.parse(a[2], 2, wt); if (!m || !_) return null; if (!pn(m.type, [ot(gt), qt, gt])) return d.error(`Expected first argument to be of type array or string, but found ${mt(m.type)} instead`); if (a.length === 4) { const S = d.parse(a[3], 3, wt); return S ? new Hc(m.type, m, _, S) : null } return new Hc(m.type, m, _) } evaluate(a) { const d = this.input.evaluate(a), m = this.beginIndex.evaluate(a); if (!On(d, ["string", "array"])) throw new Je(`Expected first argument to be of type array or string, but found ${mt(Ve(d))} instead.`); if (this.endIndex) { const _ = this.endIndex.evaluate(a); return d.slice(m, _) } return d.slice(m) } eachChild(a) { a(this.input), a(this.beginIndex), this.endIndex && a(this.endIndex) } outputDefined() { return !1 } } function Vm(u, a) { return u === "==" || u === "!=" ? a.kind === "boolean" || a.kind === "string" || a.kind === "number" || a.kind === "null" || a.kind === "value" : a.kind === "string" || a.kind === "number" || a.kind === "value" } function Um(u, a, d, m) { return m.compare(a, d) === 0 } function yl(u, a, d) { const m = u !== "==" && u !== "!="; return class R6 { constructor(S, T, L) { this.type = At, this.lhs = S, this.rhs = T, this.collator = L, this.hasUntypedArgument = S.type.kind === "value" || T.type.kind === "value" } static parse(S, T) { if (S.length !== 3 && S.length !== 4) return T.error("Expected two or three arguments."); const L = S[0]; let F = T.parse(S[1], 1, gt); if (!F) return null; if (!Vm(L, F.type)) return T.concat(1).error(`"${L}" comparisons are not supported for type '${mt(F.type)}'.`); let K = T.parse(S[2], 2, gt); if (!K) return null; if (!Vm(L, K.type)) return T.concat(2).error(`"${L}" comparisons are not supported for type '${mt(K.type)}'.`); if (F.type.kind !== K.type.kind && F.type.kind !== "value" && K.type.kind !== "value") return T.error(`Cannot compare types '${mt(F.type)}' and '${mt(K.type)}'.`); m && (F.type.kind === "value" && K.type.kind !== "value" ? F = new Vt(K.type, [F]) : F.type.kind !== "value" && K.type.kind === "value" && (K = new Vt(F.type, [K]))); let Q = null; if (S.length === 4) { if (F.type.kind !== "string" && K.type.kind !== "string" && F.type.kind !== "value" && K.type.kind !== "value") return T.error("Cannot use collator to compare non-string types."); if (Q = T.parse(S[3], 3, yn), !Q) return null } return new R6(F, K, Q) } evaluate(S) { const T = this.lhs.evaluate(S), L = this.rhs.evaluate(S); if (m && this.hasUntypedArgument) { const F = Ve(T), K = Ve(L); if (F.kind !== K.kind || F.kind !== "string" && F.kind !== "number") throw new Je(`Expected arguments for "${u}" to be (string, string) or (number, number), but found (${F.kind}, ${K.kind}) instead.`) } if (this.collator && !m && this.hasUntypedArgument) { const F = Ve(T), K = Ve(L); if (F.kind !== "string" || K.kind !== "string") return a(S, T, L) } return this.collator ? d(S, T, L, this.collator.evaluate(S)) : a(S, T, L) } eachChild(S) { S(this.lhs), S(this.rhs), this.collator && S(this.collator) } outputDefined() { return !0 } } } const Nx = yl("==", function (u, a, d) { return a === d }, Um), Ox = yl("!=", function (u, a, d) { return a !== d }, function (u, a, d, m) { return !Um(0, a, d, m) }), Dx = yl("<", function (u, a, d) { return a < d }, function (u, a, d, m) { return m.compare(a, d) < 0 }), Lx = yl(">", function (u, a, d) { return a > d }, function (u, a, d, m) { return m.compare(a, d) > 0 }), zx = yl("<=", function (u, a, d) { return a <= d }, function (u, a, d, m) { return m.compare(a, d) <= 0 }), Fx = yl(">=", function (u, a, d) { return a >= d }, function (u, a, d, m) { return m.compare(a, d) >= 0 }); class qf { constructor(a, d, m, _, S) { this.type = qt, this.number = a, this.locale = d, this.currency = m, this.minFractionDigits = _, this.maxFractionDigits = S } static parse(a, d) { if (a.length !== 3) return d.error("Expected two arguments."); const m = d.parse(a[1], 1, wt); if (!m) return null; const _ = a[2]; if (typeof _ != "object" || Array.isArray(_)) return d.error("NumberFormat options argument must be an object."); let S = null; if (_.locale && (S = d.parse(_.locale, 1, qt), !S)) return null; let T = null; if (_.currency && (T = d.parse(_.currency, 1, qt), !T)) return null; let L = null; if (_["min-fraction-digits"] && (L = d.parse(_["min-fraction-digits"], 1, wt), !L)) return null; let F = null; return _["max-fraction-digits"] && (F = d.parse(_["max-fraction-digits"], 1, wt), !F) ? null : new qf(m, S, T, L, F) } evaluate(a) { return new Intl.NumberFormat(this.locale ? this.locale.evaluate(a) : [], { style: this.currency ? "currency" : "decimal", currency: this.currency ? this.currency.evaluate(a) : void 0, minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(a) : void 0, maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(a) : void 0 }).format(this.number.evaluate(a)) } eachChild(a) { a(this.number), this.locale && a(this.locale), this.currency && a(this.currency), this.minFractionDigits && a(this.minFractionDigits), this.maxFractionDigits && a(this.maxFractionDigits) } outputDefined() { return !1 } } class Wc { constructor(a) { this.type = Sn, this.sections = a } static parse(a, d) { if (a.length < 2) return d.error("Expected at least one argument."); const m = a[1]; if (!Array.isArray(m) && typeof m == "object") return d.error("First argument must be an image or text section."); const _ = []; let S = !1; for (let T = 1; T <= a.length - 1; ++T) { const L = a[T]; if (S && typeof L == "object" && !Array.isArray(L)) { S = !1; let F = null; if (L["font-scale"] && (F = d.parse(L["font-scale"], 1, wt), !F)) return null; let K = null; if (L["text-font"] && (K = d.parse(L["text-font"], 1, ot(qt)), !K)) return null; let Q = null; if (L["text-color"] && (Q = d.parse(L["text-color"], 1, Xt), !Q)) return null; const ne = _[_.length - 1]; ne.scale = F, ne.font = K, ne.textColor = Q } else { const F = d.parse(a[T], 1, gt); if (!F) return null; const K = F.type.kind; if (K !== "string" && K !== "value" && K !== "null" && K !== "resolvedImage") return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'."); S = !0, _.push({ content: F, scale: null, font: null, textColor: null }) } } return new Wc(_) } evaluate(a) { return new be(this.sections.map(d => { const m = d.content.evaluate(a); return Ve(m) === zt ? new Ee("", m, null, null, null) : new Ee(Lt(m), null, d.scale ? d.scale.evaluate(a) : null, d.font ? d.font.evaluate(a).join(",") : null, d.textColor ? d.textColor.evaluate(a) : null) })) } eachChild(a) { for (const d of this.sections) a(d.content), d.scale && a(d.scale), d.font && a(d.font), d.textColor && a(d.textColor) } outputDefined() { return !1 } } class Zf { constructor(a) { this.type = zt, this.input = a } static parse(a, d) { if (a.length !== 2) return d.error("Expected two arguments."); const m = d.parse(a[1], 1, qt); return m ? new Zf(m) : d.error("No image name provided.") } evaluate(a) { const d = this.input.evaluate(a), m = Le.fromString(d); return m && a.availableImages && (m.available = a.availableImages.indexOf(d) > -1), m } eachChild(a) { a(this.input) } outputDefined() { return !1 } } class Xf { constructor(a) { this.type = wt, this.input = a } static parse(a, d) { if (a.length !== 2) return d.error(`Expected 1 argument, but found ${a.length - 1} instead.`); const m = d.parse(a[1], 1); return m ? m.type.kind !== "array" && m.type.kind !== "string" && m.type.kind !== "value" ? d.error(`Expected argument of type string or array, but found ${mt(m.type)} instead.`) : new Xf(m) : null } evaluate(a) { const d = this.input.evaluate(a); if (typeof d == "string" || Array.isArray(d)) return d.length; throw new Je(`Expected value to be of type string or array, but found ${mt(Ve(d))} instead.`) } eachChild(a) { a(this.input) } outputDefined() { return !1 } } const xl = { "==": Nx, "!=": Ox, ">": Lx, "<": Dx, ">=": Fx, "<=": zx, array: Vt, at: Kf, boolean: Vt, case: Gf, coalesce: Uc, collator: $r, format: Wc, image: Zf, in: Hf, "index-of": Kc, interpolate: lo, "interpolate-hcl": lo, "interpolate-lab": lo, length: Xf, let: jc, literal: Ct, match: Wf, number: Vt, "number-format": qf, object: Vt, slice: Hc, step: Pa, string: Vt, "to-boolean": un, "to-color": un, "to-number": un, "to-string": un, var: Ei, within: Ea }; function jm(u, [a, d, m, _]) { a = a.evaluate(u), d = d.evaluate(u), m = m.evaluate(u); const S = _ ? _.evaluate(u) : 1, T = qe(a, d, m, S); if (T) throw new Je(T); return new le(a / 255 * S, d / 255 * S, m / 255 * S, S) } function Km(u, a) { return u in a } function Gc(u, a) { const d = a[u]; return d === void 0 ? null : d } function Ps(u) { return { type: u } } function Hm(u) { return { result: "success", value: u } } function _l(u) { return { result: "error", value: u } } function Tr(u) { return u["property-type"] === "data-driven" || u["property-type"] === "cross-faded-data-driven" } function Wm(u) { return !!u.expression && u.expression.parameters.indexOf("zoom") > -1 } function Qn(u) { return !!u.expression && u.expression.interpolated } function ur(u) { return u instanceof Number ? "number" : u instanceof String ? "string" : u instanceof Boolean ? "boolean" : Array.isArray(u) ? "array" : u === null ? "null" : typeof u } function Sr(u) { return typeof u == "object" && u !== null && !Array.isArray(u) } function Nr(u) { return u } function Cu(u, a) { const d = a.type === "color", m = u.stops && typeof u.stops[0][0] == "object", _ = m || !(m || u.property !== void 0), S = u.type || (Qn(a) ? "exponential" : "interval"); if (d || a.type === "padding") { const K = d ? le.parse : Ce.parse; (u = cn({}, u)).stops && (u.stops = u.stops.map(Q => [Q[0], K(Q[1])])), u.default = K(u.default ? u.default : a.default) } if (u.colorSpace && u.colorSpace !== "rgb" && !Bm[u.colorSpace]) throw new Error(`Unknown color space: ${u.colorSpace}`); let T, L, F; if (S === "exponential") T = Gm; else if (S === "interval") T = Bx; else if (S === "categorical") { T = $x, L = Object.create(null); for (const K of u.stops) L[K[0]] = K[1]; F = typeof u.stops[0][0] } else { if (S !== "identity") throw new Error(`Unknown function type "${S}"`); T = Vx } if (m) { const K = {}, Q = []; for (let he = 0; he < u.stops.length; he++) { const pe = u.stops[he], Ne = pe[0].zoom; K[Ne] === void 0 && (K[Ne] = { zoom: Ne, type: u.type, property: u.property, default: u.default, stops: [] }, Q.push(Ne)), K[Ne].stops.push([pe[0].value, pe[1]]) } const ne = []; for (const he of Q) ne.push([K[he].zoom, Cu(K[he], a)]); const ue = { name: "linear" }; return { kind: "composite", interpolationType: ue, interpolationFactor: lo.interpolationFactor.bind(void 0, ue), zoomStops: ne.map(he => he[0]), evaluate: ({ zoom: he }, pe) => Gm({ stops: ne, base: u.base }, a, he).evaluate(he, pe) } } if (_) { const K = S === "exponential" ? { name: "exponential", base: u.base !== void 0 ? u.base : 1 } : null; return { kind: "camera", interpolationType: K, interpolationFactor: lo.interpolationFactor.bind(void 0, K), zoomStops: u.stops.map(Q => Q[0]), evaluate: ({ zoom: Q }) => T(u, a, Q, L, F) } } return { kind: "source", evaluate(K, Q) { const ne = Q && Q.properties ? Q.properties[u.property] : void 0; return ne === void 0 ? bl(u.default, a.default) : T(u, a, ne, L, F) } } } function bl(u, a, d) { return u !== void 0 ? u : a !== void 0 ? a : d !== void 0 ? d : void 0 } function $x(u, a, d, m, _) { return bl(typeof d === _ ? m[d] : void 0, u.default, a.default) } function Bx(u, a, d) { if (ur(d) !== "number") return bl(u.default, a.default); const m = u.stops.length; if (m === 1 || d <= u.stops[0][0]) return u.stops[0][1]; if (d >= u.stops[m - 1][0]) return u.stops[m - 1][1]; const _ = Es(u.stops.map(S => S[0]), d); return u.stops[_][1] } function Gm(u, a, d) { const m = u.base !== void 0 ? u.base : 1; if (ur(d) !== "number") return bl(u.default, a.default); const _ = u.stops.length; if (_ === 1 || d <= u.stops[0][0]) return u.stops[0][1]; if (d >= u.stops[_ - 1][0]) return u.stops[_ - 1][1]; const S = Es(u.stops.map(Q => Q[0]), d), T = function (Q, ne, ue, he) { const pe = he - ue, Ne = Q - ue; return pe === 0 ? 0 : ne === 1 ? Ne / pe : (Math.pow(ne, Ne) - 1) / (Math.pow(ne, pe) - 1) }(d, m, u.stops[S][0], u.stops[S + 1][0]), L = u.stops[S][1], F = u.stops[S + 1][1]; let K = Ta[a.type] || Nr; if (u.colorSpace && u.colorSpace !== "rgb") { const Q = Bm[u.colorSpace]; K = (ne, ue) => Q.reverse(Q.interpolate(Q.forward(ne), Q.forward(ue), T)) } return typeof L.evaluate == "function" ? { evaluate(...Q) { const ne = L.evaluate.apply(void 0, Q), ue = F.evaluate.apply(void 0, Q); if (ne !== void 0 && ue !== void 0) return K(ne, ue, T) } } : K(L, F, T) } function Vx(u, a, d) { switch (a.type) { case "color": d = le.parse(d); break; case "formatted": d = be.fromString(d.toString()); break; case "resolvedImage": d = Le.fromString(d.toString()); break; case "padding": d = Ce.parse(d); break; default: ur(d) === a.type || a.type === "enum" && a.values[d] || (d = void 0) }return bl(d, u.default, a.default) } rr.register(xl, { error: [{ kind: "error" }, [qt], (u, [a]) => { throw new Je(a.evaluate(u)) }], typeof: [qt, [gt], (u, [a]) => mt(Ve(a.evaluate(u)))], "to-rgba": [ot(wt, 4), [Xt], (u, [a]) => a.evaluate(u).toArray()], rgb: [Xt, [wt, wt, wt], jm], rgba: [Xt, [wt, wt, wt, wt], jm], has: { type: At, overloads: [[[qt], (u, [a]) => Km(a.evaluate(u), u.properties())], [[qt, en], (u, [a, d]) => Km(a.evaluate(u), d.evaluate(u))]] }, get: { type: gt, overloads: [[[qt], (u, [a]) => Gc(a.evaluate(u), u.properties())], [[qt, en], (u, [a, d]) => Gc(a.evaluate(u), d.evaluate(u))]] }, "feature-state": [gt, [qt], (u, [a]) => Gc(a.evaluate(u), u.featureState || {})], properties: [en, [], u => u.properties()], "geometry-type": [qt, [], u => u.geometryType()], id: [gt, [], u => u.id()], zoom: [wt, [], u => u.globals.zoom], "heatmap-density": [wt, [], u => u.globals.heatmapDensity || 0], "line-progress": [wt, [], u => u.globals.lineProgress || 0], accumulated: [gt, [], u => u.globals.accumulated === void 0 ? null : u.globals.accumulated], "+": [wt, Ps(wt), (u, a) => { let d = 0; for (const m of a) d += m.evaluate(u); return d }], "*": [wt, Ps(wt), (u, a) => { let d = 1; for (const m of a) d *= m.evaluate(u); return d }], "-": { type: wt, overloads: [[[wt, wt], (u, [a, d]) => a.evaluate(u) - d.evaluate(u)], [[wt], (u, [a]) => -a.evaluate(u)]] }, "/": [wt, [wt, wt], (u, [a, d]) => a.evaluate(u) / d.evaluate(u)], "%": [wt, [wt, wt], (u, [a, d]) => a.evaluate(u) % d.evaluate(u)], ln2: [wt, [], () => Math.LN2], pi: [wt, [], () => Math.PI], e: [wt, [], () => Math.E], "^": [wt, [wt, wt], (u, [a, d]) => Math.pow(a.evaluate(u), d.evaluate(u))], sqrt: [wt, [wt], (u, [a]) => Math.sqrt(a.evaluate(u))], log10: [wt, [wt], (u, [a]) => Math.log(a.evaluate(u)) / Math.LN10], ln: [wt, [wt], (u, [a]) => Math.log(a.evaluate(u))], log2: [wt, [wt], (u, [a]) => Math.log(a.evaluate(u)) / Math.LN2], sin: [wt, [wt], (u, [a]) => Math.sin(a.evaluate(u))], cos: [wt, [wt], (u, [a]) => Math.cos(a.evaluate(u))], tan: [wt, [wt], (u, [a]) => Math.tan(a.evaluate(u))], asin: [wt, [wt], (u, [a]) => Math.asin(a.evaluate(u))], acos: [wt, [wt], (u, [a]) => Math.acos(a.evaluate(u))], atan: [wt, [wt], (u, [a]) => Math.atan(a.evaluate(u))], min: [wt, Ps(wt), (u, a) => Math.min(...a.map(d => d.evaluate(u)))], max: [wt, Ps(wt), (u, a) => Math.max(...a.map(d => d.evaluate(u)))], abs: [wt, [wt], (u, [a]) => Math.abs(a.evaluate(u))], round: [wt, [wt], (u, [a]) => { const d = a.evaluate(u); return d < 0 ? -Math.round(-d) : Math.round(d) }], floor: [wt, [wt], (u, [a]) => Math.floor(a.evaluate(u))], ceil: [wt, [wt], (u, [a]) => Math.ceil(a.evaluate(u))], "filter-==": [At, [qt, gt], (u, [a, d]) => u.properties()[a.value] === d.value], "filter-id-==": [At, [gt], (u, [a]) => u.id() === a.value], "filter-type-==": [At, [qt], (u, [a]) => u.geometryType() === a.value], "filter-<": [At, [qt, gt], (u, [a, d]) => { const m = u.properties()[a.value], _ = d.value; return typeof m == typeof _ && m < _ }], "filter-id-<": [At, [gt], (u, [a]) => { const d = u.id(), m = a.value; return typeof d == typeof m && d < m }], "filter->": [At, [qt, gt], (u, [a, d]) => { const m = u.properties()[a.value], _ = d.value; return typeof m == typeof _ && m > _ }], "filter-id->": [At, [gt], (u, [a]) => { const d = u.id(), m = a.value; return typeof d == typeof m && d > m }], "filter-<=": [At, [qt, gt], (u, [a, d]) => { const m = u.properties()[a.value], _ = d.value; return typeof m == typeof _ && m <= _ }], "filter-id-<=": [At, [gt], (u, [a]) => { const d = u.id(), m = a.value; return typeof d == typeof m && d <= m }], "filter->=": [At, [qt, gt], (u, [a, d]) => { const m = u.properties()[a.value], _ = d.value; return typeof m == typeof _ && m >= _ }], "filter-id->=": [At, [gt], (u, [a]) => { const d = u.id(), m = a.value; return typeof d == typeof m && d >= m }], "filter-has": [At, [gt], (u, [a]) => a.value in u.properties()], "filter-has-id": [At, [], u => u.id() !== null && u.id() !== void 0], "filter-type-in": [At, [ot(qt)], (u, [a]) => a.value.indexOf(u.geometryType()) >= 0], "filter-id-in": [At, [ot(gt)], (u, [a]) => a.value.indexOf(u.id()) >= 0], "filter-in-small": [At, [qt, ot(gt)], (u, [a, d]) => d.value.indexOf(u.properties()[a.value]) >= 0], "filter-in-large": [At, [qt, ot(gt)], (u, [a, d]) => function (m, _, S, T) { for (; S <= T;) { const L = S + T >> 1; if (_[L] === m) return !0; _[L] > m ? T = L - 1 : S = L + 1 } return !1 }(u.properties()[a.value], d.value, 0, d.value.length - 1)], all: { type: At, overloads: [[[At, At], (u, [a, d]) => a.evaluate(u) && d.evaluate(u)], [Ps(At), (u, a) => { for (const d of a) if (!d.evaluate(u)) return !1; return !0 }]] }, any: { type: At, overloads: [[[At, At], (u, [a, d]) => a.evaluate(u) || d.evaluate(u)], [Ps(At), (u, a) => { for (const d of a) if (d.evaluate(u)) return !0; return !1 }]] }, "!": [At, [At], (u, [a]) => !a.evaluate(u)], "is-supported-script": [At, [qt], (u, [a]) => { const d = u.globals && u.globals.isSupportedScript; return !d || d(a.evaluate(u)) }], upcase: [qt, [qt], (u, [a]) => a.evaluate(u).toUpperCase()], downcase: [qt, [qt], (u, [a]) => a.evaluate(u).toLowerCase()], concat: [qt, Ps(gt), (u, a) => a.map(d => Lt(d.evaluate(u))).join("")], "resolved-locale": [qt, [yn], (u, [a]) => a.evaluate(u).resolvedLocale()] }); class qc { constructor(a, d) { this.expression = a, this._warningHistory = {}, this._evaluator = new Vn, this._defaultValue = d ? function (m) { return m.type === "color" && Sr(m.default) ? new le(0, 0, 0, 0) : m.type === "color" ? le.parse(m.default) || null : m.type === "padding" ? Ce.parse(m.default) || null : m.default === void 0 ? null : m.default }(d) : null, this._enumValues = d && d.type === "enum" ? d.values : null } evaluateWithoutErrorHandling(a, d, m, _, S, T) { return this._evaluator.globals = a, this._evaluator.feature = d, this._evaluator.featureState = m, this._evaluator.canonical = _, this._evaluator.availableImages = S || null, this._evaluator.formattedSection = T, this.expression.evaluate(this._evaluator) } evaluate(a, d, m, _, S, T) { this._evaluator.globals = a, this._evaluator.feature = d || null, this._evaluator.featureState = m || null, this._evaluator.canonical = _, this._evaluator.availableImages = S || null, this._evaluator.formattedSection = T || null; try { const L = this.expression.evaluate(this._evaluator); if (L == null || typeof L == "number" && L != L) return this._defaultValue; if (this._enumValues && !(L in this._enumValues)) throw new Je(`Expected value to be one of ${Object.keys(this._enumValues).map(F => JSON.stringify(F)).join(", ")}, but found ${JSON.stringify(L)} instead.`); return L } catch (L) { return this._warningHistory[L.message] || (this._warningHistory[L.message] = !0, typeof console < "u" && console.warn(L.message)), this._defaultValue } } } function Su(u) { return Array.isArray(u) && u.length > 0 && typeof u[0] == "string" && u[0] in xl } function Eu(u, a) { const d = new Xa(xl, [], a ? function (_) { const S = { color: Xt, string: qt, number: wt, enum: qt, boolean: At, formatted: Sn, padding: dn, resolvedImage: zt }; return _.type === "array" ? ot(S[_.value] || gt, _.length) : S[_.type] }(a) : void 0), m = d.parse(u, void 0, void 0, void 0, a && a.type === "string" ? { typeAnnotation: "coerce" } : void 0); return m ? Hm(new qc(m, a)) : _l(d.errors) } class Pu { constructor(a, d) { this.kind = a, this._styleExpression = d, this.isStateDependent = a !== "constant" && !Yn(d.expression) } evaluateWithoutErrorHandling(a, d, m, _, S, T) { return this._styleExpression.evaluateWithoutErrorHandling(a, d, m, _, S, T) } evaluate(a, d, m, _, S, T) { return this._styleExpression.evaluate(a, d, m, _, S, T) } } class Yf { constructor(a, d, m, _) { this.kind = a, this.zoomStops = m, this._styleExpression = d, this.isStateDependent = a !== "camera" && !Yn(d.expression), this.interpolationType = _ } evaluateWithoutErrorHandling(a, d, m, _, S, T) { return this._styleExpression.evaluateWithoutErrorHandling(a, d, m, _, S, T) } evaluate(a, d, m, _, S, T) { return this._styleExpression.evaluate(a, d, m, _, S, T) } interpolationFactor(a, d, m) { return this.interpolationType ? lo.interpolationFactor(this.interpolationType, a, d, m) : 0 } } function qm(u, a) { const d = Eu(u, a); if (d.result === "error") return d; const m = d.value.expression, _ = Bn(m); if (!_ && !Tr(a)) return _l([new nn("", "data expressions not supported")]); const S = Ar(m, ["zoom"]); if (!S && !Wm(a)) return _l([new nn("", "zoom expressions not supported")]); const T = Xc(m); return T || S ? T instanceof nn ? _l([T]) : T instanceof lo && !Qn(a) ? _l([new nn("", '"interpolate" expressions cannot be used with this property')]) : Hm(T ? new Yf(_ ? "camera" : "composite", d.value, T.labels, T instanceof lo ? T.interpolation : void 0) : new Pu(_ ? "constant" : "source", d.value)) : _l([new nn("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]) } class Zc { constructor(a, d) { this._parameters = a, this._specification = d, cn(this, Cu(this._parameters, this._specification)) } static deserialize(a) { return new Zc(a._parameters, a._specification) } static serialize(a) { return { _parameters: a._parameters, _specification: a._specification } } } function Xc(u) { let a = null; if (u instanceof jc) a = Xc(u.result); else if (u instanceof Uc) { for (const d of u.args) if (a = Xc(d), a) break } else (u instanceof Pa || u instanceof lo) && u.input instanceof rr && u.input.name === "zoom" && (a = u); return a instanceof nn || u.eachChild(d => { const m = Xc(d); m instanceof nn ? a = m : !a && m ? a = new nn("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : a && m && a !== m && (a = new nn("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.')) }), a } function Bo(u) { const a = u.key, d = u.value, m = u.valueSpec || {}, _ = u.objectElementValidators || {}, S = u.style, T = u.styleSpec; let L = []; const F = ur(d); if (F !== "object") return [new Ge(a, d, `object expected, ${F} found`)]; for (const K in d) { const Q = K.split(".")[0], ne = m[Q] || m["*"]; let ue; if (_[Q]) ue = _[Q]; else if (m[Q]) ue = co; else if (_["*"]) ue = _["*"]; else { if (!m["*"]) { L.push(new Ge(a, d[K], `unknown property "${K}"`)); continue } ue = co } L = L.concat(ue({ key: (a && `${a}.`) + K, value: d[K], valueSpec: ne, style: S, styleSpec: T, object: d, objectKey: K }, d)) } for (const K in m) _[K] || m[K].required && m[K].default === void 0 && d[K] === void 0 && L.push(new Ge(a, d, `missing required property "${K}"`)); return L } function Zm(u) { const a = u.value, d = u.valueSpec, m = u.style, _ = u.styleSpec, S = u.key, T = u.arrayElementValidator || co; if (ur(a) !== "array") return [new Ge(S, a, `array expected, ${ur(a)} found`)]; if (d.length && a.length !== d.length) return [new Ge(S, a, `array length ${d.length} expected, length ${a.length} found`)]; if (d["min-length"] && a.length < d["min-length"]) return [new Ge(S, a, `array length at least ${d["min-length"]} expected, length ${a.length} found`)]; let L = { type: d.value, values: d.values }; _.$version < 7 && (L.function = d.function), ur(d.value) === "object" && (L = d.value); let F = []; for (let K = 0; K < a.length; K++)F = F.concat(T({ array: a, arrayIndex: K, value: a[K], valueSpec: L, style: m, styleSpec: _, key: `${S}[${K}]` })); return F } function Qf(u) { const a = u.key, d = u.value, m = u.valueSpec; let _ = ur(d); return _ === "number" && d != d && (_ = "NaN"), _ !== "number" ? [new Ge(a, d, `number expected, ${_} found`)] : "minimum" in m && d < m.minimum ? [new Ge(a, d, `${d} is less than the minimum value ${m.minimum}`)] : "maximum" in m && d > m.maximum ? [new Ge(a, d, `${d} is greater than the maximum value ${m.maximum}`)] : [] } function Xm(u) { const a = u.valueSpec, d = jt(u.value.type); let m, _, S, T = {}; const L = d !== "categorical" && u.value.property === void 0, F = !L, K = ur(u.value.stops) === "array" && ur(u.value.stops[0]) === "array" && ur(u.value.stops[0][0]) === "object", Q = Bo({ key: u.key, value: u.value, valueSpec: u.styleSpec.function, style: u.style, styleSpec: u.styleSpec, objectElementValidators: { stops: function (he) { if (d === "identity") return [new Ge(he.key, he.value, 'identity function may not have a "stops" property')]; let pe = []; const Ne = he.value; return pe = pe.concat(Zm({ key: he.key, value: Ne, valueSpec: he.valueSpec, style: he.style, styleSpec: he.styleSpec, arrayElementValidator: ne })), ur(Ne) === "array" && Ne.length === 0 && pe.push(new Ge(he.key, Ne, "array must have at least one stop")), pe }, default: function (he) { return co({ key: he.key, value: he.value, valueSpec: a, style: he.style, styleSpec: he.styleSpec }) } } }); return d === "identity" && L && Q.push(new Ge(u.key, u.value, 'missing required property "property"')), d === "identity" || u.value.stops || Q.push(new Ge(u.key, u.value, 'missing required property "stops"')), d === "exponential" && u.valueSpec.expression && !Qn(u.valueSpec) && Q.push(new Ge(u.key, u.value, "exponential functions not supported")), u.styleSpec.$version >= 8 && (F && !Tr(u.valueSpec) ? Q.push(new Ge(u.key, u.value, "property functions not supported")) : L && !Wm(u.valueSpec) && Q.push(new Ge(u.key, u.value, "zoom functions not supported"))), d !== "categorical" && !K || u.value.property !== void 0 || Q.push(new Ge(u.key, u.value, '"property" property is required')), Q; function ne(he) { let pe = []; const Ne = he.value, Ae = he.key; if (ur(Ne) !== "array") return [new Ge(Ae, Ne, `array expected, ${ur(Ne)} found`)]; if (Ne.length !== 2) return [new Ge(Ae, Ne, `array length 2 expected, length ${Ne.length} found`)]; if (K) { if (ur(Ne[0]) !== "object") return [new Ge(Ae, Ne, `object expected, ${ur(Ne[0])} found`)]; if (Ne[0].zoom === void 0) return [new Ge(Ae, Ne, "object stop key must have zoom")]; if (Ne[0].value === void 0) return [new Ge(Ae, Ne, "object stop key must have value")]; if (S && S > jt(Ne[0].zoom)) return [new Ge(Ae, Ne[0].zoom, "stop zoom values must appear in ascending order")]; jt(Ne[0].zoom) !== S && (S = jt(Ne[0].zoom), _ = void 0, T = {}), pe = pe.concat(Bo({ key: `${Ae}[0]`, value: Ne[0], valueSpec: { zoom: {} }, style: he.style, styleSpec: he.styleSpec, objectElementValidators: { zoom: Qf, value: ue } })) } else pe = pe.concat(ue({ key: `${Ae}[0]`, value: Ne[0], valueSpec: {}, style: he.style, styleSpec: he.styleSpec }, Ne)); return Su(Kt(Ne[1])) ? pe.concat([new Ge(`${Ae}[1]`, Ne[1], "expressions are not allowed in function stops.")]) : pe.concat(co({ key: `${Ae}[1]`, value: Ne[1], valueSpec: a, style: he.style, styleSpec: he.styleSpec })) } function ue(he, pe) { const Ne = ur(he.value), Ae = jt(he.value), Ye = he.value !== null ? he.value : pe; if (m) { if (Ne !== m) return [new Ge(he.key, Ye, `${Ne} stop domain type must match previous stop domain type ${m}`)] } else m = Ne; if (Ne !== "number" && Ne !== "string" && Ne !== "boolean") return [new Ge(he.key, Ye, "stop domain value must be a number, string, or boolean")]; if (Ne !== "number" && d !== "categorical") { let lt = `number expected, ${Ne} found`; return Tr(a) && d === void 0 && (lt += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new Ge(he.key, Ye, lt)] } return d !== "categorical" || Ne !== "number" || isFinite(Ae) && Math.floor(Ae) === Ae ? d !== "categorical" && Ne === "number" && _ !== void 0 && Ae < _ ? [new Ge(he.key, Ye, "stop domain values must appear in ascending order")] : (_ = Ae, d === "categorical" && Ae in T ? [new Ge(he.key, Ye, "stop domain values must be unique")] : (T[Ae] = !0, [])) : [new Ge(he.key, Ye, `integer expected, found ${Ae}`)] } } function Ts(u) { const a = (u.expressionContext === "property" ? qm : Eu)(Kt(u.value), u.valueSpec); if (a.result === "error") return a.value.map(m => new Ge(`${u.key}${m.key}`, u.value, m.message)); const d = a.value.expression || a.value._styleExpression.expression; if (u.expressionContext === "property" && u.propertyKey === "text-font" && !d.outputDefined()) return [new Ge(u.key, u.value, `Invalid data expression for "${u.propertyKey}". Output values must be contained as literals within the expression.`)]; if (u.expressionContext === "property" && u.propertyType === "layout" && !Yn(d)) return [new Ge(u.key, u.value, '"feature-state" data expressions are not supported with layout properties.')]; if (u.expressionContext === "filter" && !Yn(d)) return [new Ge(u.key, u.value, '"feature-state" data expressions are not supported with filters.')]; if (u.expressionContext && u.expressionContext.indexOf("cluster") === 0) { if (!Ar(d, ["zoom", "feature-state"])) return [new Ge(u.key, u.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')]; if (u.expressionContext === "cluster-initial" && !Bn(d)) return [new Ge(u.key, u.value, "Feature data expressions are not supported with initial expression part of cluster properties.")] } return [] } function Tu(u) { const a = u.key, d = u.value, m = u.valueSpec, _ = []; return Array.isArray(m.values) ? m.values.indexOf(jt(d)) === -1 && _.push(new Ge(a, d, `expected one of [${m.values.join(", ")}], ${JSON.stringify(d)} found`)) : Object.keys(m.values).indexOf(jt(d)) === -1 && _.push(new Ge(a, d, `expected one of [${Object.keys(m.values).join(", ")}], ${JSON.stringify(d)} found`)), _ } function wl(u) { if (u === !0 || u === !1) return !0; if (!Array.isArray(u) || u.length === 0) return !1; switch (u[0]) { case "has": return u.length >= 2 && u[1] !== "$id" && u[1] !== "$type"; case "in": return u.length >= 3 && (typeof u[1] != "string" || Array.isArray(u[2])); case "!in": case "!has": case "none": return !1; case "==": case "!=": case ">": case ">=": case "<": case "<=": return u.length !== 3 || Array.isArray(u[1]) || Array.isArray(u[2]); case "any": case "all": for (const a of u.slice(1)) if (!wl(a) && typeof a != "boolean") return !1; return !0; default: return !0 } } const Ux = { type: "boolean", default: !1, transition: !1, "property-type": "data-driven", expression: { interpolated: !1, parameters: ["zoom", "feature"] } }; function Yc(u) { if (u == null) return { filter: () => !0, needGeometry: !1 }; wl(u) || (u = ku(u)); const a = Eu(u, Ux); if (a.result === "error") throw new Error(a.value.map(d => `${d.key}: ${d.message}`).join(", ")); return { filter: (d, m, _) => a.value.evaluate(d, m, {}, _), needGeometry: Qm(u) } } function Ym(u, a) { return u < a ? -1 : u > a ? 1 : 0 } function Qm(u) { if (!Array.isArray(u)) return !1; if (u[0] === "within") return !0; for (let a = 1; a < u.length; a++)if (Qm(u[a])) return !0; return !1 } function ku(u) { if (!u) return !0; const a = u[0]; return u.length <= 1 ? a !== "any" : a === "==" ? Jf(u[1], u[2], "==") : a === "!=" ? Cl(Jf(u[1], u[2], "==")) : a === "<" || a === ">" || a === "<=" || a === ">=" ? Jf(u[1], u[2], a) : a === "any" ? (d = u.slice(1), ["any"].concat(d.map(ku))) : a === "all" ? ["all"].concat(u.slice(1).map(ku)) : a === "none" ? ["all"].concat(u.slice(1).map(ku).map(Cl)) : a === "in" ? Qc(u[1], u.slice(2)) : a === "!in" ? Cl(Qc(u[1], u.slice(2))) : a === "has" ? Iu(u[1]) : a === "!has" ? Cl(Iu(u[1])) : a !== "within" || u; var d } function Jf(u, a, d) { switch (u) { case "$type": return [`filter-type-${d}`, a]; case "$id": return [`filter-id-${d}`, a]; default: return [`filter-${d}`, u, a] } } function Qc(u, a) { if (a.length === 0) return !1; switch (u) { case "$type": return ["filter-type-in", ["literal", a]]; case "$id": return ["filter-id-in", ["literal", a]]; default: return a.length > 200 && !a.some(d => typeof d != typeof a[0]) ? ["filter-in-large", u, ["literal", a.sort(Ym)]] : ["filter-in-small", u, ["literal", a]] } } function Iu(u) { switch (u) { case "$type": return !0; case "$id": return ["filter-has-id"]; default: return ["filter-has", u] } } function Cl(u) { return ["!", u] } function Ru(u) { return wl(Kt(u.value)) ? Ts(cn({}, u, { expressionContext: "filter", valueSpec: { value: "boolean" } })) : Jm(u) } function Jm(u) { const a = u.value, d = u.key; if (ur(a) !== "array") return [new Ge(d, a, `array expected, ${ur(a)} found`)]; const m = u.styleSpec; let _, S = []; if (a.length < 1) return [new Ge(d, a, "filter array must have at least 1 element")]; switch (S = S.concat(Tu({ key: `${d}[0]`, value: a[0], valueSpec: m.filter_operator, style: u.style, styleSpec: u.styleSpec })), jt(a[0])) { case "<": case "<=": case ">": case ">=": a.length >= 2 && jt(a[1]) === "$type" && S.push(new Ge(d, a, `"$type" cannot be use with operator "${a[0]}"`)); case "==": case "!=": a.length !== 3 && S.push(new Ge(d, a, `filter array for operator "${a[0]}" must have 3 elements`)); case "in": case "!in": a.length >= 2 && (_ = ur(a[1]), _ !== "string" && S.push(new Ge(`${d}[1]`, a[1], `string expected, ${_} found`))); for (let T = 2; T < a.length; T++)_ = ur(a[T]), jt(a[1]) === "$type" ? S = S.concat(Tu({ key: `${d}[${T}]`, value: a[T], valueSpec: m.geometry_type, style: u.style, styleSpec: u.styleSpec })) : _ !== "string" && _ !== "number" && _ !== "boolean" && S.push(new Ge(`${d}[${T}]`, a[T], `string, number, or boolean expected, ${_} found`)); break; case "any": case "all": case "none": for (let T = 1; T < a.length; T++)S = S.concat(Jm({ key: `${d}[${T}]`, value: a[T], style: u.style, styleSpec: u.styleSpec })); break; case "has": case "!has": _ = ur(a[1]), a.length !== 2 ? S.push(new Ge(d, a, `filter array for "${a[0]}" operator must have 2 elements`)) : _ !== "string" && S.push(new Ge(`${d}[1]`, a[1], `string expected, ${_} found`)); break; case "within": _ = ur(a[1]), a.length !== 2 ? S.push(new Ge(d, a, `filter array for "${a[0]}" operator must have 2 elements`)) : _ !== "object" && S.push(new Ge(`${d}[1]`, a[1], `object expected, ${_} found`)) }return S } function Mu(u, a) {
|
|
|
const d = u.key, m = u.style, _ = u.styleSpec, S = u.value, T = u.objectKey, L = _[`${a}_${u.layerType}`]; if (!L) return []; const F = T.match(/^(.*)-transition$/); if (a === "paint" && F && L[F[1]] && L[F[1]].transition) return co({ key: d, value: S, valueSpec: _.transition, style: m, styleSpec: _ }); const K = u.valueSpec || L[T]; if (!K) return [new Ge(d, S, `unknown property "${T}"`)]; let Q; if (ur(S) === "string" && Tr(K) && !K.tokens && (Q = /^{([^}]+)}$/.exec(S))) return [new Ge(d, S, `"${T}" does not support interpolation syntax
|
|
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Q[1])} }\`.`)]; const ne = []; return u.layerType === "symbol" && (T === "text-field" && m && !m.glyphs && ne.push(new Ge(d, S, 'use of "text-field" requires a style "glyphs" property')), T === "text-font" && Sr(Kt(S)) && jt(S.type) === "identity" && ne.push(new Ge(d, S, '"text-font" does not support identity functions'))), ne.concat(co({ key: u.key, value: S, valueSpec: K, style: m, styleSpec: _, expressionContext: "property", propertyType: a, propertyKey: T }))
|
|
|
} function ev(u) { return Mu(u, "paint") } function tv(u) { return Mu(u, "layout") } function nv(u) { let a = []; const d = u.value, m = u.key, _ = u.style, S = u.styleSpec; d.type || d.ref || a.push(new Ge(m, d, 'either "type" or "ref" is required')); let T = jt(d.type); const L = jt(d.ref); if (d.id) { const F = jt(d.id); for (let K = 0; K < u.arrayIndex; K++) { const Q = _.layers[K]; jt(Q.id) === F && a.push(new Ge(m, d.id, `duplicate layer id "${d.id}", previously used at line ${Q.id.__line__}`)) } } if ("ref" in d) { let F;["type", "source", "source-layer", "filter", "layout"].forEach(K => { K in d && a.push(new Ge(m, d[K], `"${K}" is prohibited for ref layers`)) }), _.layers.forEach(K => { jt(K.id) === L && (F = K) }), F ? F.ref ? a.push(new Ge(m, d.ref, "ref cannot reference another ref layer")) : T = jt(F.type) : a.push(new Ge(m, d.ref, `ref layer "${L}" not found`)) } else if (T !== "background") if (d.source) { const F = _.sources && _.sources[d.source], K = F && jt(F.type); F ? K === "vector" && T === "raster" ? a.push(new Ge(m, d.source, `layer "${d.id}" requires a raster source`)) : K === "raster" && T !== "raster" ? a.push(new Ge(m, d.source, `layer "${d.id}" requires a vector source`)) : K !== "vector" || d["source-layer"] ? K === "raster-dem" && T !== "hillshade" ? a.push(new Ge(m, d.source, "raster-dem source can only be used with layer type 'hillshade'.")) : T !== "line" || !d.paint || !d.paint["line-gradient"] || K === "geojson" && F.lineMetrics || a.push(new Ge(m, d, `layer "${d.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)) : a.push(new Ge(m, d, `layer "${d.id}" must specify a "source-layer"`)) : a.push(new Ge(m, d.source, `source "${d.source}" not found`)) } else a.push(new Ge(m, d, 'missing required property "source"')); return a = a.concat(Bo({ key: m, value: d, valueSpec: S.layer, style: u.style, styleSpec: u.styleSpec, objectElementValidators: { "*": () => [], type: () => co({ key: `${m}.type`, value: d.type, valueSpec: S.layer.type, style: u.style, styleSpec: u.styleSpec, object: d, objectKey: "type" }), filter: Ru, layout: F => Bo({ layer: d, key: F.key, value: F.value, style: F.style, styleSpec: F.styleSpec, objectElementValidators: { "*": K => tv(cn({ layerType: T }, K)) } }), paint: F => Bo({ layer: d, key: F.key, value: F.value, style: F.style, styleSpec: F.styleSpec, objectElementValidators: { "*": K => ev(cn({ layerType: T }, K)) } }) } })), a } function Sl(u) { const a = u.value, d = u.key, m = ur(a); return m !== "string" ? [new Ge(d, a, `string expected, ${m} found`)] : [] } const rv = { promoteId: function ({ key: u, value: a }) { if (ur(a) === "string") return Sl({ key: u, value: a }); { const d = []; for (const m in a) d.push(...Sl({ key: `${u}.${m}`, value: a[m] })); return d } } }; function Au(u) { const a = u.value, d = u.key, m = u.styleSpec, _ = u.style; if (!a.type) return [new Ge(d, a, '"type" is required')]; const S = jt(a.type); let T; switch (S) { case "vector": case "raster": case "raster-dem": return T = Bo({ key: d, value: a, valueSpec: m[`source_${S.replace("-", "_")}`], style: u.style, styleSpec: m, objectElementValidators: rv }), T; case "geojson": if (T = Bo({ key: d, value: a, valueSpec: m.source_geojson, style: _, styleSpec: m, objectElementValidators: rv }), a.cluster) for (const L in a.clusterProperties) { const [F, K] = a.clusterProperties[L], Q = typeof F == "string" ? [F, ["accumulated"], ["get", L]] : F; T.push(...Ts({ key: `${d}.${L}.map`, value: K, expressionContext: "cluster-map" })), T.push(...Ts({ key: `${d}.${L}.reduce`, value: Q, expressionContext: "cluster-reduce" })) } return T; case "video": return Bo({ key: d, value: a, valueSpec: m.source_video, style: _, styleSpec: m }); case "image": return Bo({ key: d, value: a, valueSpec: m.source_image, style: _, styleSpec: m }); case "canvas": return [new Ge(d, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")]; default: return Tu({ key: `${d}.type`, value: a.type, valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }, style: _, styleSpec: m }) } } function Nu(u) { const a = u.value, d = u.styleSpec, m = d.light, _ = u.style; let S = []; const T = ur(a); if (a === void 0) return S; if (T !== "object") return S = S.concat([new Ge("light", a, `object expected, ${T} found`)]), S; for (const L in a) { const F = L.match(/^(.*)-transition$/); S = S.concat(F && m[F[1]] && m[F[1]].transition ? co({ key: L, value: a[L], valueSpec: d.transition, style: _, styleSpec: d }) : m[L] ? co({ key: L, value: a[L], valueSpec: m[L], style: _, styleSpec: d }) : [new Ge(L, a[L], `unknown property "${L}"`)]) } return S } function uo(u) { const a = u.value, d = u.styleSpec, m = d.terrain, _ = u.style; let S = []; const T = ur(a); if (a === void 0) return S; if (T !== "object") return S = S.concat([new Ge("terrain", a, `object expected, ${T} found`)]), S; for (const L in a) S = S.concat(m[L] ? co({ key: L, value: a[L], valueSpec: m[L], style: _, styleSpec: d }) : [new Ge(L, a[L], `unknown property "${L}"`)]); return S } const Ou = { "*": () => [], array: Zm, boolean: function (u) { const a = u.value, d = u.key, m = ur(a); return m !== "boolean" ? [new Ge(d, a, `boolean expected, ${m} found`)] : [] }, number: Qf, color: function (u) { const a = u.key, d = u.value, m = ur(d); return m !== "string" ? [new Ge(a, d, `color expected, ${m} found`)] : Zn(d) === null ? [new Ge(a, d, `color expected, "${d}" found`)] : [] }, constants: Zt, enum: Tu, filter: Ru, function: Xm, layer: nv, object: Bo, source: Au, light: Nu, terrain: uo, string: Sl, formatted: function (u) { return Sl(u).length === 0 ? [] : Ts(u) }, resolvedImage: function (u) { return Sl(u).length === 0 ? [] : Ts(u) }, padding: function (u) { const a = u.key, d = u.value; if (ur(d) === "array") { if (d.length < 1 || d.length > 4) return [new Ge(a, d, `padding requires 1 to 4 values; ${d.length} values found`)]; const m = { type: "number" }; let _ = []; for (let S = 0; S < d.length; S++)_ = _.concat(co({ key: `${a}[${S}]`, value: d[S], valueSpec: m })); return _ } return Qf({ key: a, value: d, valueSpec: {} }) } }; function co(u) { const a = u.value, d = u.valueSpec, m = u.styleSpec; return d.expression && Sr(jt(a)) ? Xm(u) : d.expression && Su(Kt(a)) ? Ts(u) : d.type && Ou[d.type] ? Ou[d.type](u) : Bo(cn({}, u, { valueSpec: d.type ? m[d.type] : d })) } function jx(u) { const a = u.value, d = u.key, m = Sl(u); return m.length || (a.indexOf("{fontstack}") === -1 && m.push(new Ge(d, a, '"glyphs" url must include a "{fontstack}" token')), a.indexOf("{range}") === -1 && m.push(new Ge(d, a, '"glyphs" url must include a "{range}" token'))), m } function Ya(u, a = Fe) { let d = []; return d = d.concat(co({ key: "", value: u, valueSpec: a.$root, styleSpec: a, style: u, objectElementValidators: { glyphs: jx, "*": () => [] } })), u.constants && (d = d.concat(Zt({ key: "constants", value: u.constants, style: u, styleSpec: a }))), iv(d) } function iv(u) { return [].concat(u).sort((a, d) => a.line - d.line) } function ka(u) { return function (...a) { return iv(u.apply(this, a)) } } Ya.source = ka(Au), Ya.light = ka(Nu), Ya.terrain = ka(uo), Ya.layer = ka(nv), Ya.filter = ka(Ru), Ya.paintProperty = ka(ev), Ya.layoutProperty = ka(tv); const Du = Ya, eh = Du.light, Kx = Du.paintProperty, Hx = Du.layoutProperty; function Jc(u, a) { let d = !1; if (a && a.length) for (const m of a) u.fire(new Ut(new Error(m.message))), d = !0; return d } class Lu { constructor(a, d, m) { const _ = this.cells = []; if (a instanceof ArrayBuffer) { this.arrayBuffer = a; const T = new Int32Array(this.arrayBuffer); a = T[0], this.d = (d = T[1]) + 2 * (m = T[2]); for (let F = 0; F < this.d * this.d; F++) { const K = T[3 + F], Q = T[3 + F + 1]; _.push(K === Q ? null : T.subarray(K, Q)) } const L = T[3 + _.length + 1]; this.keys = T.subarray(T[3 + _.length], L), this.bboxes = T.subarray(L), this.insert = this._insertReadonly } else { this.d = d + 2 * m; for (let T = 0; T < this.d * this.d; T++)_.push([]); this.keys = [], this.bboxes = [] } this.n = d, this.extent = a, this.padding = m, this.scale = d / a, this.uid = 0; const S = m / d * a; this.min = -S, this.max = a + S } insert(a, d, m, _, S) { this._forEachCell(d, m, _, S, this._insertCell, this.uid++, void 0, void 0), this.keys.push(a), this.bboxes.push(d), this.bboxes.push(m), this.bboxes.push(_), this.bboxes.push(S) } _insertReadonly() { throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.") } _insertCell(a, d, m, _, S, T) { this.cells[S].push(T) } query(a, d, m, _, S) { const T = this.min, L = this.max; if (a <= T && d <= T && L <= m && L <= _ && !S) return Array.prototype.slice.call(this.keys); { const F = []; return this._forEachCell(a, d, m, _, this._queryCell, F, {}, S), F } } _queryCell(a, d, m, _, S, T, L, F) { const K = this.cells[S]; if (K !== null) { const Q = this.keys, ne = this.bboxes; for (let ue = 0; ue < K.length; ue++) { const he = K[ue]; if (L[he] === void 0) { const pe = 4 * he; (F ? F(ne[pe + 0], ne[pe + 1], ne[pe + 2], ne[pe + 3]) : a <= ne[pe + 2] && d <= ne[pe + 3] && m >= ne[pe + 0] && _ >= ne[pe + 1]) ? (L[he] = !0, T.push(Q[he])) : L[he] = !1 } } } } _forEachCell(a, d, m, _, S, T, L, F) { const K = this._convertToCellCoord(a), Q = this._convertToCellCoord(d), ne = this._convertToCellCoord(m), ue = this._convertToCellCoord(_); for (let he = K; he <= ne; he++)for (let pe = Q; pe <= ue; pe++) { const Ne = this.d * pe + he; if ((!F || F(this._convertFromCellCoord(he), this._convertFromCellCoord(pe), this._convertFromCellCoord(he + 1), this._convertFromCellCoord(pe + 1))) && S.call(this, a, d, m, _, Ne, T, L, F)) return } } _convertFromCellCoord(a) { return (a - this.padding) / this.scale } _convertToCellCoord(a) { return Math.max(0, Math.min(this.d - 1, Math.floor(a * this.scale) + this.padding)) } toArrayBuffer() { if (this.arrayBuffer) return this.arrayBuffer; const a = this.cells, d = 3 + this.cells.length + 1 + 1; let m = 0; for (let T = 0; T < this.cells.length; T++)m += this.cells[T].length; const _ = new Int32Array(d + m + this.keys.length + this.bboxes.length); _[0] = this.extent, _[1] = this.n, _[2] = this.padding; let S = d; for (let T = 0; T < a.length; T++) { const L = a[T]; _[3 + T] = S, _.set(L, S), S += L.length } return _[3 + a.length] = S, _.set(this.keys, S), S += this.keys.length, _[3 + a.length + 1] = S, _.set(this.bboxes, S), S += this.bboxes.length, _.buffer } static serialize(a, d) { const m = a.toArrayBuffer(); return d && d.push(m), { buffer: m } } static deserialize(a) { return new Lu(a.buffer) } } const Ia = {}; function mn(u, a, d = {}) { if (Ia[u]) throw new Error(`${u} is already registered.`); Object.defineProperty(a, "_classRegistryKey", { value: u, writeable: !1 }), Ia[u] = { klass: a, omit: d.omit || [], shallow: d.shallow || [] } } mn("Object", Object), mn("TransferableGridIndex", Lu), mn("Color", le), mn("Error", Error), mn("AJAXError", We), mn("ResolvedImage", Le), mn("StylePropertyFunction", Zc), mn("StyleExpression", qc, { omit: ["_evaluator"] }), mn("ZoomDependentExpression", Yf), mn("ZoomConstantExpression", Pu), mn("CompoundExpression", rr, { omit: ["_evaluate"] }); for (const u in xl) xl[u]._classRegistryKey || mn(`Expression_${u}`, xl[u]); function ov(u) { return u && typeof ArrayBuffer < "u" && (u instanceof ArrayBuffer || u.constructor && u.constructor.name === "ArrayBuffer") } function ks(u, a) { if (u == null || typeof u == "boolean" || typeof u == "number" || typeof u == "string" || u instanceof Boolean || u instanceof Number || u instanceof String || u instanceof Date || u instanceof RegExp || u instanceof Blob) return u; if (ov(u) || J(u)) return a && a.push(u), u; if (ArrayBuffer.isView(u)) { const d = u; return a && a.push(d.buffer), d } if (u instanceof ImageData) return a && a.push(u.data.buffer), u; if (Array.isArray(u)) { const d = []; for (const m of u) d.push(ks(m, a)); return d } if (typeof u == "object") { const d = u.constructor, m = d._classRegistryKey; if (!m) throw new Error("can't serialize object of unregistered class"); if (!Ia[m]) throw new Error(`${m} is not registered.`); const _ = d.serialize ? d.serialize(u, a) : {}; if (d.serialize) { if (a && _ === a[a.length - 1]) throw new Error("statically serialized object won't survive transfer of $name property") } else { for (const S in u) { if (!u.hasOwnProperty(S) || Ia[m].omit.indexOf(S) >= 0) continue; const T = u[S]; _[S] = Ia[m].shallow.indexOf(S) >= 0 ? T : ks(T, a) } u instanceof Error && (_.message = u.message) } if (_.$name) throw new Error("$name property is reserved for worker serialization logic."); return m !== "Object" && (_.$name = m), _ } throw new Error("can't serialize object of type " + typeof u) } function Qa(u) { if (u == null || typeof u == "boolean" || typeof u == "number" || typeof u == "string" || u instanceof Boolean || u instanceof Number || u instanceof String || u instanceof Date || u instanceof RegExp || u instanceof Blob || ov(u) || J(u) || ArrayBuffer.isView(u) || u instanceof ImageData) return u; if (Array.isArray(u)) return u.map(Qa); if (typeof u == "object") { const a = u.$name || "Object"; if (!Ia[a]) throw new Error(`can't deserialize unregistered class ${a}`); const { klass: d } = Ia[a]; if (!d) throw new Error(`can't deserialize unregistered class ${a}`); if (d.deserialize) return d.deserialize(u); const m = Object.create(d.prototype); for (const _ of Object.keys(u)) { if (_ === "$name") continue; const S = u[_]; m[_] = Ia[a].shallow.indexOf(_) >= 0 ? S : Qa(S) } return m } throw new Error("can't deserialize object of type " + typeof u) } class th { constructor() { this.first = !0 } update(a, d) { const m = Math.floor(a); return this.first ? (this.first = !1, this.lastIntegerZoom = m, this.lastIntegerZoomTime = 0, this.lastZoom = a, this.lastFloorZoom = m, !0) : (this.lastFloorZoom > m ? (this.lastIntegerZoom = m + 1, this.lastIntegerZoomTime = d) : this.lastFloorZoom < m && (this.lastIntegerZoom = m, this.lastIntegerZoomTime = d), a !== this.lastZoom && (this.lastZoom = a, this.lastFloorZoom = m, !0)) } } const rn = { "Latin-1 Supplement": u => u >= 128 && u <= 255, Arabic: u => u >= 1536 && u <= 1791, "Arabic Supplement": u => u >= 1872 && u <= 1919, "Arabic Extended-A": u => u >= 2208 && u <= 2303, "Hangul Jamo": u => u >= 4352 && u <= 4607, "Unified Canadian Aboriginal Syllabics": u => u >= 5120 && u <= 5759, Khmer: u => u >= 6016 && u <= 6143, "Unified Canadian Aboriginal Syllabics Extended": u => u >= 6320 && u <= 6399, "General Punctuation": u => u >= 8192 && u <= 8303, "Letterlike Symbols": u => u >= 8448 && u <= 8527, "Number Forms": u => u >= 8528 && u <= 8591, "Miscellaneous Technical": u => u >= 8960 && u <= 9215, "Control Pictures": u => u >= 9216 && u <= 9279, "Optical Character Recognition": u => u >= 9280 && u <= 9311, "Enclosed Alphanumerics": u => u >= 9312 && u <= 9471, "Geometric Shapes": u => u >= 9632 && u <= 9727, "Miscellaneous Symbols": u => u >= 9728 && u <= 9983, "Miscellaneous Symbols and Arrows": u => u >= 11008 && u <= 11263, "CJK Radicals Supplement": u => u >= 11904 && u <= 12031, "Kangxi Radicals": u => u >= 12032 && u <= 12255, "Ideographic Description Characters": u => u >= 12272 && u <= 12287, "CJK Symbols and Punctuation": u => u >= 12288 && u <= 12351, Hiragana: u => u >= 12352 && u <= 12447, Katakana: u => u >= 12448 && u <= 12543, Bopomofo: u => u >= 12544 && u <= 12591, "Hangul Compatibility Jamo": u => u >= 12592 && u <= 12687, Kanbun: u => u >= 12688 && u <= 12703, "Bopomofo Extended": u => u >= 12704 && u <= 12735, "CJK Strokes": u => u >= 12736 && u <= 12783, "Katakana Phonetic Extensions": u => u >= 12784 && u <= 12799, "Enclosed CJK Letters and Months": u => u >= 12800 && u <= 13055, "CJK Compatibility": u => u >= 13056 && u <= 13311, "CJK Unified Ideographs Extension A": u => u >= 13312 && u <= 19903, "Yijing Hexagram Symbols": u => u >= 19904 && u <= 19967, "CJK Unified Ideographs": u => u >= 19968 && u <= 40959, "Yi Syllables": u => u >= 40960 && u <= 42127, "Yi Radicals": u => u >= 42128 && u <= 42191, "Hangul Jamo Extended-A": u => u >= 43360 && u <= 43391, "Hangul Syllables": u => u >= 44032 && u <= 55215, "Hangul Jamo Extended-B": u => u >= 55216 && u <= 55295, "Private Use Area": u => u >= 57344 && u <= 63743, "CJK Compatibility Ideographs": u => u >= 63744 && u <= 64255, "Arabic Presentation Forms-A": u => u >= 64336 && u <= 65023, "Vertical Forms": u => u >= 65040 && u <= 65055, "CJK Compatibility Forms": u => u >= 65072 && u <= 65103, "Small Form Variants": u => u >= 65104 && u <= 65135, "Arabic Presentation Forms-B": u => u >= 65136 && u <= 65279, "Halfwidth and Fullwidth Forms": u => u >= 65280 && u <= 65519 }; function ed(u) { for (const a of u) if (rh(a.charCodeAt(0))) return !0; return !1 } function Wx(u) { for (const a of u) if (!nh(a.charCodeAt(0))) return !1; return !0 } function nh(u) { return !(rn.Arabic(u) || rn["Arabic Supplement"](u) || rn["Arabic Extended-A"](u) || rn["Arabic Presentation Forms-A"](u) || rn["Arabic Presentation Forms-B"](u)) } function rh(u) { return !(u !== 746 && u !== 747 && (u < 4352 || !(rn["Bopomofo Extended"](u) || rn.Bopomofo(u) || rn["CJK Compatibility Forms"](u) && !(u >= 65097 && u <= 65103) || rn["CJK Compatibility Ideographs"](u) || rn["CJK Compatibility"](u) || rn["CJK Radicals Supplement"](u) || rn["CJK Strokes"](u) || !(!rn["CJK Symbols and Punctuation"](u) || u >= 12296 && u <= 12305 || u >= 12308 && u <= 12319 || u === 12336) || rn["CJK Unified Ideographs Extension A"](u) || rn["CJK Unified Ideographs"](u) || rn["Enclosed CJK Letters and Months"](u) || rn["Hangul Compatibility Jamo"](u) || rn["Hangul Jamo Extended-A"](u) || rn["Hangul Jamo Extended-B"](u) || rn["Hangul Jamo"](u) || rn["Hangul Syllables"](u) || rn.Hiragana(u) || rn["Ideographic Description Characters"](u) || rn.Kanbun(u) || rn["Kangxi Radicals"](u) || rn["Katakana Phonetic Extensions"](u) || rn.Katakana(u) && u !== 12540 || !(!rn["Halfwidth and Fullwidth Forms"](u) || u === 65288 || u === 65289 || u === 65293 || u >= 65306 && u <= 65310 || u === 65339 || u === 65341 || u === 65343 || u >= 65371 && u <= 65503 || u === 65507 || u >= 65512 && u <= 65519) || !(!rn["Small Form Variants"](u) || u >= 65112 && u <= 65118 || u >= 65123 && u <= 65126) || rn["Unified Canadian Aboriginal Syllabics"](u) || rn["Unified Canadian Aboriginal Syllabics Extended"](u) || rn["Vertical Forms"](u) || rn["Yijing Hexagram Symbols"](u) || rn["Yi Syllables"](u) || rn["Yi Radicals"](u)))) } function av(u) { return !(rh(u) || function (a) { return !!(rn["Latin-1 Supplement"](a) && (a === 167 || a === 169 || a === 174 || a === 177 || a === 188 || a === 189 || a === 190 || a === 215 || a === 247) || rn["General Punctuation"](a) && (a === 8214 || a === 8224 || a === 8225 || a === 8240 || a === 8241 || a === 8251 || a === 8252 || a === 8258 || a === 8263 || a === 8264 || a === 8265 || a === 8273) || rn["Letterlike Symbols"](a) || rn["Number Forms"](a) || rn["Miscellaneous Technical"](a) && (a >= 8960 && a <= 8967 || a >= 8972 && a <= 8991 || a >= 8996 && a <= 9e3 || a === 9003 || a >= 9085 && a <= 9114 || a >= 9150 && a <= 9165 || a === 9167 || a >= 9169 && a <= 9179 || a >= 9186 && a <= 9215) || rn["Control Pictures"](a) && a !== 9251 || rn["Optical Character Recognition"](a) || rn["Enclosed Alphanumerics"](a) || rn["Geometric Shapes"](a) || rn["Miscellaneous Symbols"](a) && !(a >= 9754 && a <= 9759) || rn["Miscellaneous Symbols and Arrows"](a) && (a >= 11026 && a <= 11055 || a >= 11088 && a <= 11097 || a >= 11192 && a <= 11243) || rn["CJK Symbols and Punctuation"](a) || rn.Katakana(a) || rn["Private Use Area"](a) || rn["CJK Compatibility Forms"](a) || rn["Small Form Variants"](a) || rn["Halfwidth and Fullwidth Forms"](a) || a === 8734 || a === 8756 || a === 8757 || a >= 9984 && a <= 10087 || a >= 10102 && a <= 10131 || a === 65532 || a === 65533) }(u)) } function sv(u) { return u >= 1424 && u <= 2303 || rn["Arabic Presentation Forms-A"](u) || rn["Arabic Presentation Forms-B"](u) } function Gx(u, a) { return !(!a && sv(u) || u >= 2304 && u <= 3583 || u >= 3840 && u <= 4255 || rn.Khmer(u)) } function lv(u) { for (const a of u) if (sv(a.charCodeAt(0))) return !0; return !1 } const ih = "deferred", oh = "loading", ah = "loaded"; let sh = null, Xi = "unavailable", Ja = null; const uv = function (u) { u && typeof u == "string" && u.indexOf("NetworkError") > -1 && (Xi = "error"), sh && sh(u) }; function El() { lh.fire(new Wt("pluginStateChange", { pluginStatus: Xi, pluginURL: Ja })) } const lh = new Jt, zu = function () { return Xi }, cv = function () { if (Xi !== ih || !Ja) throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified"); Xi = oh, El(), Ja && yt({ url: Ja }, u => { u ? uv(u) : (Xi = ah, El()) }) }, ko = { applyArabicShaping: null, processBidirectionalText: null, processStyledBidirectionalText: null, isLoaded: () => Xi === ah || ko.applyArabicShaping != null, isLoading: () => Xi === oh, setState(u) { if (!j()) throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context"); Xi = u.pluginStatus, Ja = u.pluginURL }, isParsed() { if (!j()) throw new Error("rtl-text-plugin is only parsed on the worker-threads"); return ko.applyArabicShaping != null && ko.processBidirectionalText != null && ko.processStyledBidirectionalText != null }, getPluginURL() { if (!j()) throw new Error("rtl-text-plugin url can only be queried from the worker threads"); return Ja } }; class Or { constructor(a, d) { this.zoom = a, d ? (this.now = d.now, this.fadeDuration = d.fadeDuration, this.zoomHistory = d.zoomHistory, this.transition = d.transition) : (this.now = 0, this.fadeDuration = 0, this.zoomHistory = new th, this.transition = {}) } isSupportedScript(a) { return function (d, m) { for (const _ of d) if (!Gx(_.charCodeAt(0), m)) return !1; return !0 }(a, ko.isLoaded()) } crossFadingFactor() { return this.fadeDuration === 0 ? 1 : Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1) } getCrossfadeParameters() { const a = this.zoom, d = a - Math.floor(a), m = this.crossFadingFactor(); return a > this.zoomHistory.lastIntegerZoom ? { fromScale: 2, toScale: 1, t: d + (1 - d) * m } : { fromScale: .5, toScale: 1, t: 1 - (1 - m) * d } } } class Fu { constructor(a, d) { this.property = a, this.value = d, this.expression = function (m, _) { if (Sr(m)) return new Zc(m, _); if (Su(m)) { const S = qm(m, _); if (S.result === "error") throw new Error(S.value.map(T => `${T.key}: ${T.message}`).join(", ")); return S.value } { let S = m; return _.type === "color" && typeof m == "string" ? S = le.parse(m) : _.type !== "padding" || typeof m != "number" && !Array.isArray(m) || (S = Ce.parse(m)), { kind: "constant", evaluate: () => S } } }(d === void 0 ? a.specification.default : d, a.specification) } isDataDriven() { return this.expression.kind === "source" || this.expression.kind === "composite" } possiblyEvaluate(a, d, m) { return this.property.possiblyEvaluate(this, a, d, m) } } class td { constructor(a) { this.property = a, this.value = new Fu(a, void 0) } transitioned(a, d) { return new fv(this.property, this.value, d, k({}, a.transition, this.transition), a.now) } untransitioned() { return new fv(this.property, this.value, null, {}, 0) } } class dv { constructor(a) { this._properties = a, this._values = Object.create(a.defaultTransitionablePropertyValues) } getValue(a) { return O(this._values[a].value.value) } setValue(a, d) { Object.prototype.hasOwnProperty.call(this._values, a) || (this._values[a] = new td(this._values[a].property)), this._values[a].value = new Fu(this._values[a].property, d === null ? void 0 : O(d)) } getTransition(a) { return O(this._values[a].transition) } setTransition(a, d) { Object.prototype.hasOwnProperty.call(this._values, a) || (this._values[a] = new td(this._values[a].property)), this._values[a].transition = O(d) || void 0 } serialize() { const a = {}; for (const d of Object.keys(this._values)) { const m = this.getValue(d); m !== void 0 && (a[d] = m); const _ = this.getTransition(d); _ !== void 0 && (a[`${d}-transition`] = _) } return a } transitioned(a, d) { const m = new hv(this._properties); for (const _ of Object.keys(this._values)) m._values[_] = this._values[_].transitioned(a, d._values[_]); return m } untransitioned() { const a = new hv(this._properties); for (const d of Object.keys(this._values)) a._values[d] = this._values[d].untransitioned(); return a } } class fv { constructor(a, d, m, _, S) { this.property = a, this.value = d, this.begin = S + _.delay || 0, this.end = this.begin + _.duration || 0, a.specification.transition && (_.delay || _.duration) && (this.prior = m) } possiblyEvaluate(a, d, m) { const _ = a.now || 0, S = this.value.possiblyEvaluate(a, d, m), T = this.prior; if (T) { if (_ > this.end) return this.prior = null, S; if (this.value.isDataDriven()) return this.prior = null, S; if (_ < this.begin) return T.possiblyEvaluate(a, d, m); { const L = (_ - this.begin) / (this.end - this.begin); return this.property.interpolate(T.possiblyEvaluate(a, d, m), S, function (F) { if (F <= 0) return 0; if (F >= 1) return 1; const K = F * F, Q = K * F; return 4 * (F < .5 ? Q : 3 * (F - K) + Q - .75) }(L)) } } return S } } class hv { constructor(a) { this._properties = a, this._values = Object.create(a.defaultTransitioningPropertyValues) } possiblyEvaluate(a, d, m) { const _ = new $u(this._properties); for (const S of Object.keys(this._values)) _._values[S] = this._values[S].possiblyEvaluate(a, d, m); return _ } hasTransition() { for (const a of Object.keys(this._values)) if (this._values[a].prior) return !0; return !1 } } class qx { constructor(a) { this._properties = a, this._values = Object.create(a.defaultPropertyValues) } getValue(a) { return O(this._values[a].value) } setValue(a, d) { this._values[a] = new Fu(this._values[a].property, d === null ? void 0 : O(d)) } serialize() { const a = {}; for (const d of Object.keys(this._values)) { const m = this.getValue(d); m !== void 0 && (a[d] = m) } return a } possiblyEvaluate(a, d, m) { const _ = new $u(this._properties); for (const S of Object.keys(this._values)) _._values[S] = this._values[S].possiblyEvaluate(a, d, m); return _ } } class oa { constructor(a, d, m) { this.property = a, this.value = d, this.parameters = m } isConstant() { return this.value.kind === "constant" } constantOr(a) { return this.value.kind === "constant" ? this.value.value : a } evaluate(a, d, m, _) { return this.property.evaluate(this.value, this.parameters, a, d, m, _) } } class $u { constructor(a) { this._properties = a, this._values = Object.create(a.defaultPossiblyEvaluatedValues) } get(a) { return this._values[a] } } class xn { constructor(a) { this.specification = a } possiblyEvaluate(a, d) { if (a.isDataDriven()) throw new Error("Value should not be data driven"); return a.expression.evaluate(d) } interpolate(a, d, m) { const _ = Ta[this.specification.type]; return _ ? _(a, d, m) : a } } class In { constructor(a, d) { this.specification = a, this.overrides = d } possiblyEvaluate(a, d, m, _) { return new oa(this, a.expression.kind === "constant" || a.expression.kind === "camera" ? { kind: "constant", value: a.expression.evaluate(d, null, {}, m, _) } : a.expression, d) } interpolate(a, d, m) { if (a.value.kind !== "constant" || d.value.kind !== "constant") return a; if (a.value.value === void 0 || d.value.value === void 0) return new oa(this, { kind: "constant", value: void 0 }, a.parameters); const _ = Ta[this.specification.type]; return _ ? new oa(this, { kind: "constant", value: _(a.value.value, d.value.value, m) }, a.parameters) : a } evaluate(a, d, m, _, S, T) { return a.kind === "constant" ? a.value : a.evaluate(d, m, _, S, T) } } class Pl extends In { possiblyEvaluate(a, d, m, _) { if (a.value === void 0) return new oa(this, { kind: "constant", value: void 0 }, d); if (a.expression.kind === "constant") { const S = a.expression.evaluate(d, null, {}, m, _), T = a.property.specification.type === "resolvedImage" && typeof S != "string" ? S.name : S, L = this._calculate(T, T, T, d); return new oa(this, { kind: "constant", value: L }, d) } if (a.expression.kind === "camera") { const S = this._calculate(a.expression.evaluate({ zoom: d.zoom - 1 }), a.expression.evaluate({ zoom: d.zoom }), a.expression.evaluate({ zoom: d.zoom + 1 }), d); return new oa(this, { kind: "constant", value: S }, d) } return new oa(this, a.expression, d) } evaluate(a, d, m, _, S, T) { if (a.kind === "source") { const L = a.evaluate(d, m, _, S, T); return this._calculate(L, L, L, d) } return a.kind === "composite" ? this._calculate(a.evaluate({ zoom: Math.floor(d.zoom) - 1 }, m, _), a.evaluate({ zoom: Math.floor(d.zoom) }, m, _), a.evaluate({ zoom: Math.floor(d.zoom) + 1 }, m, _), d) : a.value } _calculate(a, d, m, _) { return _.zoom > _.zoomHistory.lastIntegerZoom ? { from: a, to: d } : { from: m, to: d } } interpolate(a) { return a } } class uh { constructor(a) { this.specification = a } possiblyEvaluate(a, d, m, _) { if (a.value !== void 0) { if (a.expression.kind === "constant") { const S = a.expression.evaluate(d, null, {}, m, _); return this._calculate(S, S, S, d) } return this._calculate(a.expression.evaluate(new Or(Math.floor(d.zoom - 1), d)), a.expression.evaluate(new Or(Math.floor(d.zoom), d)), a.expression.evaluate(new Or(Math.floor(d.zoom + 1), d)), d) } } _calculate(a, d, m, _) { return _.zoom > _.zoomHistory.lastIntegerZoom ? { from: a, to: d } : { from: m, to: d } } interpolate(a) { return a } } class es { constructor(a) { this.specification = a } possiblyEvaluate(a, d, m, _) { return !!a.expression.evaluate(d, null, {}, m, _) } interpolate() { return !1 } } class Pi { constructor(a) { this.properties = a, this.defaultPropertyValues = {}, this.defaultTransitionablePropertyValues = {}, this.defaultTransitioningPropertyValues = {}, this.defaultPossiblyEvaluatedValues = {}, this.overridableProperties = []; for (const d in a) { const m = a[d]; m.specification.overridable && this.overridableProperties.push(d); const _ = this.defaultPropertyValues[d] = new Fu(m, void 0), S = this.defaultTransitionablePropertyValues[d] = new td(m); this.defaultTransitioningPropertyValues[d] = S.untransitioned(), this.defaultPossiblyEvaluatedValues[d] = _.possiblyEvaluate({}) } } } mn("DataDrivenProperty", In), mn("DataConstantProperty", xn), mn("CrossFadedDataDrivenProperty", Pl), mn("CrossFadedProperty", uh), mn("ColorRampProperty", es); const ts = "-transition"; class aa extends Jt { constructor(a, d) { if (super(), this.id = a.id, this.type = a.type, this._featureFilter = { filter: () => !0, needGeometry: !1 }, a.type !== "custom" && (this.metadata = a.metadata, this.minzoom = a.minzoom, this.maxzoom = a.maxzoom, a.type !== "background" && (this.source = a.source, this.sourceLayer = a["source-layer"], this.filter = a.filter), d.layout && (this._unevaluatedLayout = new qx(d.layout)), d.paint)) { this._transitionablePaint = new dv(d.paint); for (const m in a.paint) this.setPaintProperty(m, a.paint[m], { validate: !1 }); for (const m in a.layout) this.setLayoutProperty(m, a.layout[m], { validate: !1 }); this._transitioningPaint = this._transitionablePaint.untransitioned(), this.paint = new $u(d.paint) } } getCrossfadeParameters() { return this._crossfadeParameters } getLayoutProperty(a) { return a === "visibility" ? this.visibility : this._unevaluatedLayout.getValue(a) } setLayoutProperty(a, d, m = {}) { d != null && this._validate(Hx, `layers.${this.id}.layout.${a}`, a, d, m) || (a !== "visibility" ? this._unevaluatedLayout.setValue(a, d) : this.visibility = d) } getPaintProperty(a) { return a.endsWith(ts) ? this._transitionablePaint.getTransition(a.slice(0, -ts.length)) : this._transitionablePaint.getValue(a) } setPaintProperty(a, d, m = {}) { if (d != null && this._validate(Kx, `layers.${this.id}.paint.${a}`, a, d, m)) return !1; if (a.endsWith(ts)) return this._transitionablePaint.setTransition(a.slice(0, -ts.length), d || void 0), !1; { const _ = this._transitionablePaint._values[a], S = _.property.specification["property-type"] === "cross-faded-data-driven", T = _.value.isDataDriven(), L = _.value; this._transitionablePaint.setValue(a, d), this._handleSpecialPaintPropertyUpdate(a); const F = this._transitionablePaint._values[a].value; return F.isDataDriven() || T || S || this._handleOverridablePaintPropertyUpdate(a, L, F) } } _handleSpecialPaintPropertyUpdate(a) { } _handleOverridablePaintPropertyUpdate(a, d, m) { return !1 } isHidden(a) { return !!(this.minzoom && a < this.minzoom) || !!(this.maxzoom && a >= this.maxzoom) || this.visibility === "none" } updateTransitions(a) { this._transitioningPaint = this._transitionablePaint.transitioned(a, this._transitioningPaint) } hasTransition() { return this._transitioningPaint.hasTransition() } recalculate(a, d) { a.getCrossfadeParameters && (this._crossfadeParameters = a.getCrossfadeParameters()), this._unevaluatedLayout && (this.layout = this._unevaluatedLayout.possiblyEvaluate(a, void 0, d)), this.paint = this._transitioningPaint.possiblyEvaluate(a, void 0, d) } serialize() { const a = { id: this.id, type: this.type, source: this.source, "source-layer": this.sourceLayer, metadata: this.metadata, minzoom: this.minzoom, maxzoom: this.maxzoom, filter: this.filter, layout: this._unevaluatedLayout && this._unevaluatedLayout.serialize(), paint: this._transitionablePaint && this._transitionablePaint.serialize() }; return this.visibility && (a.layout = a.layout || {}, a.layout.visibility = this.visibility), M(a, (d, m) => !(d === void 0 || m === "layout" && !Object.keys(d).length || m === "paint" && !Object.keys(d).length)) } _validate(a, d, m, _, S = {}) { return (!S || S.validate !== !1) && Jc(this, a.call(Du, { key: d, layerType: this.type, objectKey: m, value: _, styleSpec: Fe, style: { glyphs: !0, sprite: !0 } })) } is3D() { return !1 } isTileClipped() { return !1 } hasOffscreenPass() { return !1 } resize() { } isStateDependent() { for (const a in this.paint._values) { const d = this.paint.get(a); if (d instanceof oa && Tr(d.property.specification) && (d.value.kind === "source" || d.value.kind === "composite") && d.value.isStateDependent) return !0 } return !1 } } const pv = { Int8: Int8Array, Uint8: Uint8Array, Int16: Int16Array, Uint16: Uint16Array, Int32: Int32Array, Uint32: Uint32Array, Float32: Float32Array }; class ns { constructor(a, d) { this._structArray = a, this._pos1 = d * this.size, this._pos2 = this._pos1 / 2, this._pos4 = this._pos1 / 4, this._pos8 = this._pos1 / 8 } } class qr { constructor() { this.isTransferred = !1, this.capacity = -1, this.resize(0) } static serialize(a, d) { return a._trim(), d && (a.isTransferred = !0, d.push(a.arrayBuffer)), { length: a.length, arrayBuffer: a.arrayBuffer } } static deserialize(a) { const d = Object.create(this.prototype); return d.arrayBuffer = a.arrayBuffer, d.length = a.length, d.capacity = a.arrayBuffer.byteLength / d.bytesPerElement, d._refreshViews(), d } _trim() { this.length !== this.capacity && (this.capacity = this.length, this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), this._refreshViews()) } clear() { this.length = 0 } resize(a) { this.reserve(a), this.length = a } reserve(a) { if (a > this.capacity) { this.capacity = Math.max(a, Math.floor(5 * this.capacity), 128), this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement); const d = this.uint8; this._refreshViews(), d && this.uint8.set(d) } } _refreshViews() { throw new Error("_refreshViews() must be implemented by each concrete StructArray layout") } } function ni(u, a = 1) { let d = 0, m = 0; return { members: u.map(_ => { const S = pv[_.type].BYTES_PER_ELEMENT, T = d = ch(d, Math.max(a, S)), L = _.components || 1; return m = Math.max(m, S), d += S * L, { name: _.name, type: _.type, components: L, offset: T } }), size: ch(d, Math.max(m, a)), alignment: a } } function ch(u, a) { return Math.ceil(u / a) * a } class Is extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d) { const m = this.length; return this.resize(m + 1), this.emplace(m, a, d) } emplace(a, d, m) { const _ = 2 * a; return this.int16[_ + 0] = d, this.int16[_ + 1] = m, a } } Is.prototype.bytesPerElement = 4, mn("StructArrayLayout2i4", Is); class x extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m, _) { const S = this.length; return this.resize(S + 1), this.emplace(S, a, d, m, _) } emplace(a, d, m, _, S) { const T = 4 * a; return this.int16[T + 0] = d, this.int16[T + 1] = m, this.int16[T + 2] = _, this.int16[T + 3] = S, a } } x.prototype.bytesPerElement = 8, mn("StructArrayLayout4i8", x); class l extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T) { const L = this.length; return this.resize(L + 1), this.emplace(L, a, d, m, _, S, T) } emplace(a, d, m, _, S, T, L) { const F = 6 * a; return this.int16[F + 0] = d, this.int16[F + 1] = m, this.int16[F + 2] = _, this.int16[F + 3] = S, this.int16[F + 4] = T, this.int16[F + 5] = L, a } } l.prototype.bytesPerElement = 12, mn("StructArrayLayout2i4i12", l); class h extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T) { const L = this.length; return this.resize(L + 1), this.emplace(L, a, d, m, _, S, T) } emplace(a, d, m, _, S, T, L) { const F = 4 * a, K = 8 * a; return this.int16[F + 0] = d, this.int16[F + 1] = m, this.uint8[K + 4] = _, this.uint8[K + 5] = S, this.uint8[K + 6] = T, this.uint8[K + 7] = L, a } } h.prototype.bytesPerElement = 8, mn("StructArrayLayout2i4ub8", h); class g extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d) { const m = this.length; return this.resize(m + 1), this.emplace(m, a, d) } emplace(a, d, m) { const _ = 2 * a; return this.float32[_ + 0] = d, this.float32[_ + 1] = m, a } } g.prototype.bytesPerElement = 8, mn("StructArrayLayout2f8", g); class b extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T, L, F, K, Q) { const ne = this.length; return this.resize(ne + 1), this.emplace(ne, a, d, m, _, S, T, L, F, K, Q) } emplace(a, d, m, _, S, T, L, F, K, Q, ne) { const ue = 10 * a; return this.uint16[ue + 0] = d, this.uint16[ue + 1] = m, this.uint16[ue + 2] = _, this.uint16[ue + 3] = S, this.uint16[ue + 4] = T, this.uint16[ue + 5] = L, this.uint16[ue + 6] = F, this.uint16[ue + 7] = K, this.uint16[ue + 8] = Q, this.uint16[ue + 9] = ne, a } } b.prototype.bytesPerElement = 20, mn("StructArrayLayout10ui20", b); class E extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T, L, F, K, Q, ne, ue) { const he = this.length; return this.resize(he + 1), this.emplace(he, a, d, m, _, S, T, L, F, K, Q, ne, ue) } emplace(a, d, m, _, S, T, L, F, K, Q, ne, ue, he) { const pe = 12 * a; return this.int16[pe + 0] = d, this.int16[pe + 1] = m, this.int16[pe + 2] = _, this.int16[pe + 3] = S, this.uint16[pe + 4] = T, this.uint16[pe + 5] = L, this.uint16[pe + 6] = F, this.uint16[pe + 7] = K, this.int16[pe + 8] = Q, this.int16[pe + 9] = ne, this.int16[pe + 10] = ue, this.int16[pe + 11] = he, a } } E.prototype.bytesPerElement = 24, mn("StructArrayLayout4i4ui4i24", E); class D extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d, m) { const _ = this.length; return this.resize(_ + 1), this.emplace(_, a, d, m) } emplace(a, d, m, _) { const S = 3 * a; return this.float32[S + 0] = d, this.float32[S + 1] = m, this.float32[S + 2] = _, a } } D.prototype.bytesPerElement = 12, mn("StructArrayLayout3f12", D); class $ extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer) } emplaceBack(a) { const d = this.length; return this.resize(d + 1), this.emplace(d, a) } emplace(a, d) { return this.uint32[1 * a + 0] = d, a } } $.prototype.bytesPerElement = 4, mn("StructArrayLayout1ul4", $); class U extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T, L, F, K) { const Q = this.length; return this.resize(Q + 1), this.emplace(Q, a, d, m, _, S, T, L, F, K) } emplace(a, d, m, _, S, T, L, F, K, Q) { const ne = 10 * a, ue = 5 * a; return this.int16[ne + 0] = d, this.int16[ne + 1] = m, this.int16[ne + 2] = _, this.int16[ne + 3] = S, this.int16[ne + 4] = T, this.int16[ne + 5] = L, this.uint32[ue + 3] = F, this.uint16[ne + 8] = K, this.uint16[ne + 9] = Q, a } } U.prototype.bytesPerElement = 20, mn("StructArrayLayout6i1ul2ui20", U); class W extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T) { const L = this.length; return this.resize(L + 1), this.emplace(L, a, d, m, _, S, T) } emplace(a, d, m, _, S, T, L) { const F = 6 * a; return this.int16[F + 0] = d, this.int16[F + 1] = m, this.int16[F + 2] = _, this.int16[F + 3] = S, this.int16[F + 4] = T, this.int16[F + 5] = L, a } } W.prototype.bytesPerElement = 12, mn("StructArrayLayout2i2i2i12", W); class te extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S) { const T = this.length; return this.resize(T + 1), this.emplace(T, a, d, m, _, S) } emplace(a, d, m, _, S, T) { const L = 4 * a, F = 8 * a; return this.float32[L + 0] = d, this.float32[L + 1] = m, this.float32[L + 2] = _, this.int16[F + 6] = S, this.int16[F + 7] = T, a } } te.prototype.bytesPerElement = 16, mn("StructArrayLayout2f1f2i16", te); class ae extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d, m, _) { const S = this.length; return this.resize(S + 1), this.emplace(S, a, d, m, _) } emplace(a, d, m, _, S) { const T = 12 * a, L = 3 * a; return this.uint8[T + 0] = d, this.uint8[T + 1] = m, this.float32[L + 1] = _, this.float32[L + 2] = S, a } } ae.prototype.bytesPerElement = 12, mn("StructArrayLayout2ub2f12", ae); class fe extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d, m) { const _ = this.length; return this.resize(_ + 1), this.emplace(_, a, d, m) } emplace(a, d, m, _) { const S = 3 * a; return this.uint16[S + 0] = d, this.uint16[S + 1] = m, this.uint16[S + 2] = _, a } } fe.prototype.bytesPerElement = 6, mn("StructArrayLayout3ui6", fe); class Se extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye) { const lt = this.length; return this.resize(lt + 1), this.emplace(lt, a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye) } emplace(a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye, lt) { const Ke = 24 * a, it = 12 * a, kt = 48 * a; return this.int16[Ke + 0] = d, this.int16[Ke + 1] = m, this.uint16[Ke + 2] = _, this.uint16[Ke + 3] = S, this.uint32[it + 2] = T, this.uint32[it + 3] = L, this.uint32[it + 4] = F, this.uint16[Ke + 10] = K, this.uint16[Ke + 11] = Q, this.uint16[Ke + 12] = ne, this.float32[it + 7] = ue, this.float32[it + 8] = he, this.uint8[kt + 36] = pe, this.uint8[kt + 37] = Ne, this.uint8[kt + 38] = Ae, this.uint32[it + 10] = Ye, this.int16[Ke + 22] = lt, a } } Se.prototype.bytesPerElement = 48, mn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48", Se); class _e extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye, lt, Ke, it, kt, Tt, hn, vn, on, Qt, Gt, an) { const tn = this.length; return this.resize(tn + 1), this.emplace(tn, a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye, lt, Ke, it, kt, Tt, hn, vn, on, Qt, Gt, an) } emplace(a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne, Ae, Ye, lt, Ke, it, kt, Tt, hn, vn, on, Qt, Gt, an, tn) { const $t = 34 * a, Tn = 17 * a; return this.int16[$t + 0] = d, this.int16[$t + 1] = m, this.int16[$t + 2] = _, this.int16[$t + 3] = S, this.int16[$t + 4] = T, this.int16[$t + 5] = L, this.int16[$t + 6] = F, this.int16[$t + 7] = K, this.uint16[$t + 8] = Q, this.uint16[$t + 9] = ne, this.uint16[$t + 10] = ue, this.uint16[$t + 11] = he, this.uint16[$t + 12] = pe, this.uint16[$t + 13] = Ne, this.uint16[$t + 14] = Ae, this.uint16[$t + 15] = Ye, this.uint16[$t + 16] = lt, this.uint16[$t + 17] = Ke, this.uint16[$t + 18] = it, this.uint16[$t + 19] = kt, this.uint16[$t + 20] = Tt, this.uint16[$t + 21] = hn, this.uint16[$t + 22] = vn, this.uint32[Tn + 12] = on, this.float32[Tn + 13] = Qt, this.float32[Tn + 14] = Gt, this.float32[Tn + 15] = an, this.float32[Tn + 16] = tn, a } } _e.prototype.bytesPerElement = 68, mn("StructArrayLayout8i15ui1ul4f68", _e); class we extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a) { const d = this.length; return this.resize(d + 1), this.emplace(d, a) } emplace(a, d) { return this.float32[1 * a + 0] = d, a } } we.prototype.bytesPerElement = 4, mn("StructArrayLayout1f4", we); class Be extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer) } emplaceBack(a, d, m) { const _ = this.length; return this.resize(_ + 1), this.emplace(_, a, d, m) } emplace(a, d, m, _) { const S = 3 * a; return this.int16[S + 0] = d, this.int16[S + 1] = m, this.int16[S + 2] = _, a } } Be.prototype.bytesPerElement = 6, mn("StructArrayLayout3i6", Be); class je extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d, m) { const _ = this.length; return this.resize(_ + 1), this.emplace(_, a, d, m) } emplace(a, d, m, _) { const S = 4 * a; return this.uint32[2 * a + 0] = d, this.uint16[S + 2] = m, this.uint16[S + 3] = _, a } } je.prototype.bytesPerElement = 8, mn("StructArrayLayout1ul2ui8", je); class et extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a, d) { const m = this.length; return this.resize(m + 1), this.emplace(m, a, d) } emplace(a, d, m) { const _ = 2 * a; return this.uint16[_ + 0] = d, this.uint16[_ + 1] = m, a } } et.prototype.bytesPerElement = 4, mn("StructArrayLayout2ui4", et); class Me extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer) } emplaceBack(a) { const d = this.length; return this.resize(d + 1), this.emplace(d, a) } emplace(a, d) { return this.uint16[1 * a + 0] = d, a } } Me.prototype.bytesPerElement = 2, mn("StructArrayLayout1ui2", Me); class at extends qr { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer) } emplaceBack(a, d, m, _) { const S = this.length; return this.resize(S + 1), this.emplace(S, a, d, m, _) } emplace(a, d, m, _, S) { const T = 4 * a; return this.float32[T + 0] = d, this.float32[T + 1] = m, this.float32[T + 2] = _, this.float32[T + 3] = S, a } } at.prototype.bytesPerElement = 16, mn("StructArrayLayout4f16", at); class nt extends ns { get anchorPointX() { return this._structArray.int16[this._pos2 + 0] } get anchorPointY() { return this._structArray.int16[this._pos2 + 1] } get x1() { return this._structArray.int16[this._pos2 + 2] } get y1() { return this._structArray.int16[this._pos2 + 3] } get x2() { return this._structArray.int16[this._pos2 + 4] } get y2() { return this._structArray.int16[this._pos2 + 5] } get featureIndex() { return this._structArray.uint32[this._pos4 + 3] } get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 8] } get bucketIndex() { return this._structArray.uint16[this._pos2 + 9] } get anchorPoint() { return new ie(this.anchorPointX, this.anchorPointY) } } nt.prototype.size = 20; class xt extends U { get(a) { return new nt(this, a) } } mn("CollisionBoxArray", xt); class _t extends ns { get anchorX() { return this._structArray.int16[this._pos2 + 0] } get anchorY() { return this._structArray.int16[this._pos2 + 1] } get glyphStartIndex() { return this._structArray.uint16[this._pos2 + 2] } get numGlyphs() { return this._structArray.uint16[this._pos2 + 3] } get vertexStartIndex() { return this._structArray.uint32[this._pos4 + 2] } get lineStartIndex() { return this._structArray.uint32[this._pos4 + 3] } get lineLength() { return this._structArray.uint32[this._pos4 + 4] } get segment() { return this._structArray.uint16[this._pos2 + 10] } get lowerSize() { return this._structArray.uint16[this._pos2 + 11] } get upperSize() { return this._structArray.uint16[this._pos2 + 12] } get lineOffsetX() { return this._structArray.float32[this._pos4 + 7] } get lineOffsetY() { return this._structArray.float32[this._pos4 + 8] } get writingMode() { return this._structArray.uint8[this._pos1 + 36] } get placedOrientation() { return this._structArray.uint8[this._pos1 + 37] } set placedOrientation(a) { this._structArray.uint8[this._pos1 + 37] = a } get hidden() { return this._structArray.uint8[this._pos1 + 38] } set hidden(a) { this._structArray.uint8[this._pos1 + 38] = a } get crossTileID() { return this._structArray.uint32[this._pos4 + 10] } set crossTileID(a) { this._structArray.uint32[this._pos4 + 10] = a } get associatedIconIndex() { return this._structArray.int16[this._pos2 + 22] } } _t.prototype.size = 48; class Ft extends Se { get(a) { return new _t(this, a) } } mn("PlacedSymbolArray", Ft); class vt extends ns { get anchorX() { return this._structArray.int16[this._pos2 + 0] } get anchorY() { return this._structArray.int16[this._pos2 + 1] } get rightJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 2] } get centerJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 3] } get leftJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 4] } get verticalPlacedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 5] } get placedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 6] } get verticalPlacedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 7] } get key() { return this._structArray.uint16[this._pos2 + 8] } get textBoxStartIndex() { return this._structArray.uint16[this._pos2 + 9] } get textBoxEndIndex() { return this._structArray.uint16[this._pos2 + 10] } get verticalTextBoxStartIndex() { return this._structArray.uint16[this._pos2 + 11] } get verticalTextBoxEndIndex() { return this._structArray.uint16[this._pos2 + 12] } get iconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 13] } get iconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 14] } get verticalIconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 15] } get verticalIconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 16] } get featureIndex() { return this._structArray.uint16[this._pos2 + 17] } get numHorizontalGlyphVertices() { return this._structArray.uint16[this._pos2 + 18] } get numVerticalGlyphVertices() { return this._structArray.uint16[this._pos2 + 19] } get numIconVertices() { return this._structArray.uint16[this._pos2 + 20] } get numVerticalIconVertices() { return this._structArray.uint16[this._pos2 + 21] } get useRuntimeCollisionCircles() { return this._structArray.uint16[this._pos2 + 22] } get crossTileID() { return this._structArray.uint32[this._pos4 + 12] } set crossTileID(a) { this._structArray.uint32[this._pos4 + 12] = a } get textBoxScale() { return this._structArray.float32[this._pos4 + 13] } get textOffset0() { return this._structArray.float32[this._pos4 + 14] } get textOffset1() { return this._structArray.float32[this._pos4 + 15] } get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 16] } } vt.prototype.size = 68; class sn extends _e { get(a) { return new vt(this, a) } } mn("SymbolInstanceArray", sn); class Yt extends we { getoffsetX(a) { return this.float32[1 * a + 0] } } mn("GlyphOffsetArray", Yt); class fn extends Be { getx(a) { return this.int16[3 * a + 0] } gety(a) { return this.int16[3 * a + 1] } gettileUnitDistanceFromAnchor(a) { return this.int16[3 * a + 2] } } mn("SymbolLineVertexArray", fn); class Fn extends ns { get featureIndex() { return this._structArray.uint32[this._pos4 + 0] } get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2] } get bucketIndex() { return this._structArray.uint16[this._pos2 + 3] } } Fn.prototype.size = 8; class Un extends je { get(a) { return new Fn(this, a) } } mn("FeatureIndexArray", Un); class Pn extends Is { } class fr extends Is { } class hr extends Is { } class er extends l { } class ir extends h { } class vr extends g { } class gi extends b { } class sa extends E { } class Vo extends D { } class la extends $ { } class rs extends W { } class Io extends ae { } class Yi extends fe { } class Ra extends et { } const nd = ni([{ name: "a_pos", components: 2, type: "Int16" }], 4), { members: di } = nd; class Wn { constructor(a = []) { this.segments = a } prepareSegment(a, d, m, _) { let S = this.segments[this.segments.length - 1]; return a > Wn.MAX_VERTEX_ARRAY_LENGTH && B(`Max vertices per segment is ${Wn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${a}`), (!S || S.vertexLength + a > Wn.MAX_VERTEX_ARRAY_LENGTH || S.sortKey !== _) && (S = { vertexOffset: d.length, primitiveOffset: m.length, vertexLength: 0, primitiveLength: 0 }, _ !== void 0 && (S.sortKey = _), this.segments.push(S)), S } get() { return this.segments } destroy() { for (const a of this.segments) for (const d in a.vaos) a.vaos[d].destroy() } static simpleSegment(a, d, m, _) { return new Wn([{ vertexOffset: a, primitiveOffset: d, vertexLength: m, primitiveLength: _, vaos: {}, sortKey: 0 }]) } } function dr(u, a) { return 256 * (u = w(Math.floor(u), 0, 255)) + w(Math.floor(a), 0, 255) } Wn.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, mn("SegmentVector", Wn); const yi = ni([{ name: "a_pattern_from", components: 4, type: "Uint16" }, { name: "a_pattern_to", components: 4, type: "Uint16" }, { name: "a_pixel_ratio_from", components: 1, type: "Uint16" }, { name: "a_pixel_ratio_to", components: 1, type: "Uint16" }]); var xi = { exports: {} }, Dr = { exports: {} }; Dr.exports = function (u, a) { var d, m, _, S, T, L, F, K; for (m = u.length - (d = 3 & u.length), _ = a, T = 3432918353, L = 461845907, K = 0; K < m;)F = 255 & u.charCodeAt(K) | (255 & u.charCodeAt(++K)) << 8 | (255 & u.charCodeAt(++K)) << 16 | (255 & u.charCodeAt(++K)) << 24, ++K, _ = 27492 + (65535 & (S = 5 * (65535 & (_ = (_ ^= F = (65535 & (F = (F = (65535 & F) * T + (((F >>> 16) * T & 65535) << 16) & 4294967295) << 15 | F >>> 17)) * L + (((F >>> 16) * L & 65535) << 16) & 4294967295) << 13 | _ >>> 19)) + ((5 * (_ >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (S >>> 16) & 65535) << 16); switch (F = 0, d) { case 3: F ^= (255 & u.charCodeAt(K + 2)) << 16; case 2: F ^= (255 & u.charCodeAt(K + 1)) << 8; case 1: _ ^= F = (65535 & (F = (F = (65535 & (F ^= 255 & u.charCodeAt(K))) * T + (((F >>> 16) * T & 65535) << 16) & 4294967295) << 15 | F >>> 17)) * L + (((F >>> 16) * L & 65535) << 16) & 4294967295 }return _ ^= u.length, _ = 2246822507 * (65535 & (_ ^= _ >>> 16)) + ((2246822507 * (_ >>> 16) & 65535) << 16) & 4294967295, _ = 3266489909 * (65535 & (_ ^= _ >>> 13)) + ((3266489909 * (_ >>> 16) & 65535) << 16) & 4294967295, (_ ^= _ >>> 16) >>> 0 }; var Ro = { exports: {} }; Ro.exports = function (u, a) { for (var d, m = u.length, _ = a ^ m, S = 0; m >= 4;)d = 1540483477 * (65535 & (d = 255 & u.charCodeAt(S) | (255 & u.charCodeAt(++S)) << 8 | (255 & u.charCodeAt(++S)) << 16 | (255 & u.charCodeAt(++S)) << 24)) + ((1540483477 * (d >>> 16) & 65535) << 16), _ = 1540483477 * (65535 & _) + ((1540483477 * (_ >>> 16) & 65535) << 16) ^ (d = 1540483477 * (65535 & (d ^= d >>> 24)) + ((1540483477 * (d >>> 16) & 65535) << 16)), m -= 4, ++S; switch (m) { case 3: _ ^= (255 & u.charCodeAt(S + 2)) << 16; case 2: _ ^= (255 & u.charCodeAt(S + 1)) << 8; case 1: _ = 1540483477 * (65535 & (_ ^= 255 & u.charCodeAt(S))) + ((1540483477 * (_ >>> 16) & 65535) << 16) }return _ = 1540483477 * (65535 & (_ ^= _ >>> 13)) + ((1540483477 * (_ >>> 16) & 65535) << 16), (_ ^= _ >>> 15) >>> 0 }; var Rs = Dr.exports, dh = Ro.exports; xi.exports = Rs, xi.exports.murmur3 = Rs, xi.exports.murmur2 = dh; class Tl { constructor() { this.ids = [], this.positions = [], this.indexed = !1 } add(a, d, m, _) { this.ids.push(mv(a)), this.positions.push(d, m, _) } getPositions(a) { if (!this.indexed) throw new Error("Trying to get index, but feature positions are not indexed"); const d = mv(a); let m = 0, _ = this.ids.length - 1; for (; m < _;) { const T = m + _ >> 1; this.ids[T] >= d ? _ = T : m = T + 1 } const S = []; for (; this.ids[m] === d;)S.push({ index: this.positions[3 * m], start: this.positions[3 * m + 1], end: this.positions[3 * m + 2] }), m++; return S } static serialize(a, d) { const m = new Float64Array(a.ids), _ = new Uint32Array(a.positions); return fh(m, _, 0, m.length - 1), d && d.push(m.buffer, _.buffer), { ids: m, positions: _ } } static deserialize(a) { const d = new Tl; return d.ids = a.ids, d.positions = a.positions, d.indexed = !0, d } } function mv(u) { const a = +u; return !isNaN(a) && a <= Number.MAX_SAFE_INTEGER ? a : xi.exports(String(u)) } function fh(u, a, d, m) { for (; d < m;) { const _ = u[d + m >> 1]; let S = d - 1, T = m + 1; for (; ;) { do S++; while (u[S] < _); do T--; while (u[T] > _); if (S >= T) break; is(u, S, T), is(a, 3 * S, 3 * T), is(a, 3 * S + 1, 3 * T + 1), is(a, 3 * S + 2, 3 * T + 2) } T - d < m - T ? (fh(u, a, d, T), d = T + 1) : (fh(u, a, T + 1, m), m = T) } } function is(u, a, d) { const m = u[a]; u[a] = u[d], u[d] = m } mn("FeaturePositionMap", Tl); class Ms { constructor(a, d) { this.gl = a.gl, this.location = d } } class As extends Ms { constructor(a, d) { super(a, d), this.current = 0 } set(a) { this.current !== a && (this.current = a, this.gl.uniform1f(this.location, a)) } } class rd extends Ms { constructor(a, d) { super(a, d), this.current = [0, 0, 0, 0] } set(a) { a[0] === this.current[0] && a[1] === this.current[1] && a[2] === this.current[2] && a[3] === this.current[3] || (this.current = a, this.gl.uniform4f(this.location, a[0], a[1], a[2], a[3])) } } class VE extends Ms { constructor(a, d) { super(a, d), this.current = le.transparent } set(a) { a.r === this.current.r && a.g === this.current.g && a.b === this.current.b && a.a === this.current.a || (this.current = a, this.gl.uniform4f(this.location, a.r, a.g, a.b, a.a)) } } const rF = new Float32Array(16); function Zx(u) { return [dr(255 * u.r, 255 * u.g), dr(255 * u.b, 255 * u.a)] } class hh { constructor(a, d, m) { this.value = a, this.uniformNames = d.map(_ => `u_${_}`), this.type = m } setUniform(a, d, m) { a.set(m.constantOr(this.value)) } getBinding(a, d, m) { return this.type === "color" ? new VE(a, d) : new As(a, d) } } class id { constructor(a, d) { this.uniformNames = d.map(m => `u_${m}`), this.patternFrom = null, this.patternTo = null, this.pixelRatioFrom = 1, this.pixelRatioTo = 1 } setConstantPatternPositions(a, d) { this.pixelRatioFrom = d.pixelRatio, this.pixelRatioTo = a.pixelRatio, this.patternFrom = d.tlbr, this.patternTo = a.tlbr } setUniform(a, d, m, _) { const S = _ === "u_pattern_to" ? this.patternTo : _ === "u_pattern_from" ? this.patternFrom : _ === "u_pixel_ratio_to" ? this.pixelRatioTo : _ === "u_pixel_ratio_from" ? this.pixelRatioFrom : null; S && a.set(S) } getBinding(a, d, m) { return m.substr(0, 9) === "u_pattern" ? new rd(a, d) : new As(a, d) } } class Ns { constructor(a, d, m, _) { this.expression = a, this.type = m, this.maxValue = 0, this.paintVertexAttributes = d.map(S => ({ name: `a_${S}`, type: "Float32", components: m === "color" ? 2 : 1, offset: 0 })), this.paintVertexArray = new _ } populatePaintArray(a, d, m, _, S) { const T = this.paintVertexArray.length, L = this.expression.evaluate(new Or(0), d, {}, _, [], S); this.paintVertexArray.resize(a), this._setPaintValue(T, a, L) } updatePaintArray(a, d, m, _) { const S = this.expression.evaluate({ zoom: 0 }, m, _); this._setPaintValue(a, d, S) } _setPaintValue(a, d, m) { if (this.type === "color") { const _ = Zx(m); for (let S = a; S < d; S++)this.paintVertexArray.emplace(S, _[0], _[1]) } else { for (let _ = a; _ < d; _++)this.paintVertexArray.emplace(_, m); this.maxValue = Math.max(this.maxValue, Math.abs(m)) } } upload(a) { this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = a.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)) } destroy() { this.paintVertexBuffer && this.paintVertexBuffer.destroy() } } class Ma { constructor(a, d, m, _, S, T) { this.expression = a, this.uniformNames = d.map(L => `u_${L}_t`), this.type = m, this.useIntegerZoom = _, this.zoom = S, this.maxValue = 0, this.paintVertexAttributes = d.map(L => ({ name: `a_${L}`, type: "Float32", components: m === "color" ? 4 : 2, offset: 0 })), this.paintVertexArray = new T } populatePaintArray(a, d, m, _, S) { const T = this.expression.evaluate(new Or(this.zoom), d, {}, _, [], S), L = this.expression.evaluate(new Or(this.zoom + 1), d, {}, _, [], S), F = this.paintVertexArray.length; this.paintVertexArray.resize(a), this._setPaintValue(F, a, T, L) } updatePaintArray(a, d, m, _) { const S = this.expression.evaluate({ zoom: this.zoom }, m, _), T = this.expression.evaluate({ zoom: this.zoom + 1 }, m, _); this._setPaintValue(a, d, S, T) } _setPaintValue(a, d, m, _) { if (this.type === "color") { const S = Zx(m), T = Zx(_); for (let L = a; L < d; L++)this.paintVertexArray.emplace(L, S[0], S[1], T[0], T[1]) } else { for (let S = a; S < d; S++)this.paintVertexArray.emplace(S, m, _); this.maxValue = Math.max(this.maxValue, Math.abs(m), Math.abs(_)) } } upload(a) { this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = a.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)) } destroy() { this.paintVertexBuffer && this.paintVertexBuffer.destroy() } setUniform(a, d) { const m = this.useIntegerZoom ? Math.floor(d.zoom) : d.zoom, _ = w(this.expression.interpolationFactor(m, this.zoom, this.zoom + 1), 0, 1); a.set(_) } getBinding(a, d, m) { return new As(a, d) } } class kl { constructor(a, d, m, _, S, T) { this.expression = a, this.type = d, this.useIntegerZoom = m, this.zoom = _, this.layerId = T, this.zoomInPaintVertexArray = new S, this.zoomOutPaintVertexArray = new S } populatePaintArray(a, d, m) { const _ = this.zoomInPaintVertexArray.length; this.zoomInPaintVertexArray.resize(a), this.zoomOutPaintVertexArray.resize(a), this._setPaintValues(_, a, d.patterns && d.patterns[this.layerId], m) } updatePaintArray(a, d, m, _, S) { this._setPaintValues(a, d, m.patterns && m.patterns[this.layerId], S) } _setPaintValues(a, d, m, _) { if (!_ || !m) return; const { min: S, mid: T, max: L } = m, F = _[S], K = _[T], Q = _[L]; if (F && K && Q) for (let ne = a; ne < d; ne++)this.zoomInPaintVertexArray.emplace(ne, K.tl[0], K.tl[1], K.br[0], K.br[1], F.tl[0], F.tl[1], F.br[0], F.br[1], K.pixelRatio, F.pixelRatio), this.zoomOutPaintVertexArray.emplace(ne, K.tl[0], K.tl[1], K.br[0], K.br[1], Q.tl[0], Q.tl[1], Q.br[0], Q.br[1], K.pixelRatio, Q.pixelRatio) } upload(a) { this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer && (this.zoomInPaintVertexBuffer = a.createVertexBuffer(this.zoomInPaintVertexArray, yi.members, this.expression.isStateDependent), this.zoomOutPaintVertexBuffer = a.createVertexBuffer(this.zoomOutPaintVertexArray, yi.members, this.expression.isStateDependent)) } destroy() { this.zoomOutPaintVertexBuffer && this.zoomOutPaintVertexBuffer.destroy(), this.zoomInPaintVertexBuffer && this.zoomInPaintVertexBuffer.destroy() } } class UE { constructor(a, d, m) { this.binders = {}, this._buffers = []; const _ = []; for (const S in a.paint._values) { if (!m(S)) continue; const T = a.paint.get(S); if (!(T instanceof oa && Tr(T.property.specification))) continue; const L = iF(S, a.type), F = T.value, K = T.property.specification.type, Q = T.property.useIntegerZoom, ne = T.property.specification["property-type"], ue = ne === "cross-faded" || ne === "cross-faded-data-driven"; if (F.kind === "constant") this.binders[S] = ue ? new id(F.value, L) : new hh(F.value, L, K), _.push(`/u_${S}`); else if (F.kind === "source" || ue) { const he = jE(S, K, "source"); this.binders[S] = ue ? new kl(F, K, Q, d, he, a.id) : new Ns(F, L, K, he), _.push(`/a_${S}`) } else { const he = jE(S, K, "composite"); this.binders[S] = new Ma(F, L, K, Q, d, he), _.push(`/z_${S}`) } } this.cacheKey = _.sort().join("") } getMaxValue(a) { const d = this.binders[a]; return d instanceof Ns || d instanceof Ma ? d.maxValue : 0 } populatePaintArrays(a, d, m, _, S) { for (const T in this.binders) { const L = this.binders[T]; (L instanceof Ns || L instanceof Ma || L instanceof kl) && L.populatePaintArray(a, d, m, _, S) } } setConstantPatternPositions(a, d) { for (const m in this.binders) { const _ = this.binders[m]; _ instanceof id && _.setConstantPatternPositions(a, d) } } updatePaintArrays(a, d, m, _, S) { let T = !1; for (const L in a) { const F = d.getPositions(L); for (const K of F) { const Q = m.feature(K.index); for (const ne in this.binders) { const ue = this.binders[ne]; if ((ue instanceof Ns || ue instanceof Ma || ue instanceof kl) && ue.expression.isStateDependent === !0) { const he = _.paint.get(ne); ue.expression = he.value, ue.updatePaintArray(K.start, K.end, Q, a[L], S), T = !0 } } } } return T } defines() { const a = []; for (const d in this.binders) { const m = this.binders[d]; (m instanceof hh || m instanceof id) && a.push(...m.uniformNames.map(_ => `#define HAS_UNIFORM_${_}`)) } return a } getBinderAttributes() { const a = []; for (const d in this.binders) { const m = this.binders[d]; if (m instanceof Ns || m instanceof Ma) for (let _ = 0; _ < m.paintVertexAttributes.length; _++)a.push(m.paintVertexAttributes[_].name); else if (m instanceof kl) for (let _ = 0; _ < yi.members.length; _++)a.push(yi.members[_].name) } return a } getBinderUniforms() { const a = []; for (const d in this.binders) { const m = this.binders[d]; if (m instanceof hh || m instanceof id || m instanceof Ma) for (const _ of m.uniformNames) a.push(_) } return a } getPaintVertexBuffers() { return this._buffers } getUniforms(a, d) { const m = []; for (const _ in this.binders) { const S = this.binders[_]; if (S instanceof hh || S instanceof id || S instanceof Ma) { for (const T of S.uniformNames) if (d[T]) { const L = S.getBinding(a, d[T], T); m.push({ name: T, property: _, binding: L }) } } } return m } setUniforms(a, d, m, _) { for (const { name: S, property: T, binding: L } of d) this.binders[T].setUniform(L, _, m.get(T), S) } updatePaintBuffers(a) { this._buffers = []; for (const d in this.binders) { const m = this.binders[d]; if (a && m instanceof kl) { const _ = a.fromScale === 2 ? m.zoomInPaintVertexBuffer : m.zoomOutPaintVertexBuffer; _ && this._buffers.push(_) } else (m instanceof Ns || m instanceof Ma) && m.paintVertexBuffer && this._buffers.push(m.paintVertexBuffer) } } upload(a) { for (const d in this.binders) { const m = this.binders[d]; (m instanceof Ns || m instanceof Ma || m instanceof kl) && m.upload(a) } this.updatePaintBuffers() } destroy() { for (const a in this.binders) { const d = this.binders[a]; (d instanceof Ns || d instanceof Ma || d instanceof kl) && d.destroy() } } } class Bu { constructor(a, d, m = () => !0) { this.programConfigurations = {}; for (const _ of a) this.programConfigurations[_.id] = new UE(_, d, m); this.needsUpload = !1, this._featureMap = new Tl, this._bufferOffset = 0 } populatePaintArrays(a, d, m, _, S, T) { for (const L in this.programConfigurations) this.programConfigurations[L].populatePaintArrays(a, d, _, S, T); d.id !== void 0 && this._featureMap.add(d.id, m, this._bufferOffset, a), this._bufferOffset = a, this.needsUpload = !0 } updatePaintArrays(a, d, m, _) { for (const S of m) this.needsUpload = this.programConfigurations[S.id].updatePaintArrays(a, this._featureMap, d, S, _) || this.needsUpload } get(a) { return this.programConfigurations[a] } upload(a) { if (this.needsUpload) { for (const d in this.programConfigurations) this.programConfigurations[d].upload(a); this.needsUpload = !1 } } destroy() { for (const a in this.programConfigurations) this.programConfigurations[a].destroy() } } function iF(u, a) { return { "text-opacity": ["opacity"], "icon-opacity": ["opacity"], "text-color": ["fill_color"], "icon-color": ["fill_color"], "text-halo-color": ["halo_color"], "icon-halo-color": ["halo_color"], "text-halo-blur": ["halo_blur"], "icon-halo-blur": ["halo_blur"], "text-halo-width": ["halo_width"], "icon-halo-width": ["halo_width"], "line-gap-width": ["gapwidth"], "line-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-extrusion-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"] }[u] || [u.replace(`${a}-`, "").replace(/-/g, "_")] } function jE(u, a, d) { const m = { color: { source: g, composite: at }, number: { source: we, composite: g } }, _ = function (S) { return { "line-pattern": { source: gi, composite: gi }, "fill-pattern": { source: gi, composite: gi }, "fill-extrusion-pattern": { source: gi, composite: gi } }[S] }(u); return _ && _[d] || m[a][d] } mn("ConstantBinder", hh), mn("CrossFadedConstantBinder", id), mn("SourceExpressionBinder", Ns), mn("CrossFadedCompositeBinder", kl), mn("CompositeExpressionBinder", Ma), mn("ProgramConfiguration", UE, { omit: ["_buffers"] }), mn("ProgramConfigurationSet", Bu); var fi = 8192; const Xx = Math.pow(2, 14) - 1, KE = -Xx - 1; function Vu(u) { const a = fi / u.extent, d = u.loadGeometry(); for (let m = 0; m < d.length; m++) { const _ = d[m]; for (let S = 0; S < _.length; S++) { const T = _[S], L = Math.round(T.x * a), F = Math.round(T.y * a); T.x = w(L, KE, Xx), T.y = w(F, KE, Xx), (L < T.x || L > T.x + 1 || F < T.y || F > T.y + 1) && B("Geometry exceeds allowed extent, reduce your vector tile buffer size") } } return d } function Uu(u, a) { return { type: u.type, id: u.id, properties: u.properties, geometry: a ? Vu(u) : [] } } function vv(u, a, d, m, _) { u.emplaceBack(2 * a + (m + 1) / 2, 2 * d + (_ + 1) / 2) } class Yx { constructor(a) { this.zoom = a.zoom, this.overscaling = a.overscaling, this.layers = a.layers, this.layerIds = this.layers.map(d => d.id), this.index = a.index, this.hasPattern = !1, this.layoutVertexArray = new fr, this.indexArray = new Yi, this.segments = new Wn, this.programConfigurations = new Bu(a.layers, a.zoom), this.stateDependentLayerIds = this.layers.filter(d => d.isStateDependent()).map(d => d.id) } populate(a, d, m) { const _ = this.layers[0], S = []; let T = null, L = !1; _.type === "circle" && (T = _.layout.get("circle-sort-key"), L = !T.isConstant()); for (const { feature: F, id: K, index: Q, sourceLayerIndex: ne } of a) { const ue = this.layers[0]._featureFilter.needGeometry, he = Uu(F, ue); if (!this.layers[0]._featureFilter.filter(new Or(this.zoom), he, m)) continue; const pe = L ? T.evaluate(he, {}, m) : void 0, Ne = { id: K, properties: F.properties, type: F.type, sourceLayerIndex: ne, index: Q, geometry: ue ? he.geometry : Vu(F), patterns: {}, sortKey: pe }; S.push(Ne) } L && S.sort((F, K) => F.sortKey - K.sortKey); for (const F of S) { const { geometry: K, index: Q, sourceLayerIndex: ne } = F, ue = a[Q].feature; this.addFeature(F, K, Q, m), d.featureIndex.insert(ue, K, Q, ne, this.index) } } update(a, d, m) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(a, d, this.stateDependentLayers, m) } isEmpty() { return this.layoutVertexArray.length === 0 } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(a) { this.uploaded || (this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, di), this.indexBuffer = a.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(a), this.uploaded = !0 } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy()) } addFeature(a, d, m, _) { for (const S of d) for (const T of S) { const L = T.x, F = T.y; if (L < 0 || L >= fi || F < 0 || F >= fi) continue; const K = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, a.sortKey), Q = K.vertexLength; vv(this.layoutVertexArray, L, F, -1, -1), vv(this.layoutVertexArray, L, F, 1, -1), vv(this.layoutVertexArray, L, F, 1, 1), vv(this.layoutVertexArray, L, F, -1, 1), this.indexArray.emplaceBack(Q, Q + 1, Q + 2), this.indexArray.emplaceBack(Q, Q + 3, Q + 2), K.vertexLength += 4, K.primitiveLength += 2 } this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, a, m, {}, _) } } function HE(u, a) { for (let d = 0; d < u.length; d++)if (od(a, u[d])) return !0; for (let d = 0; d < a.length; d++)if (od(u, a[d])) return !0; return !!Qx(u, a) } function oF(u, a, d) { return !!od(u, a) || !!Jx(a, u, d) } function WE(u, a) { if (u.length === 1) return qE(a, u[0]); for (let d = 0; d < a.length; d++) { const m = a[d]; for (let _ = 0; _ < m.length; _++)if (od(u, m[_])) return !0 } for (let d = 0; d < u.length; d++)if (qE(a, u[d])) return !0; for (let d = 0; d < a.length; d++)if (Qx(u, a[d])) return !0; return !1 } function aF(u, a, d) { if (u.length > 1) { if (Qx(u, a)) return !0; for (let m = 0; m < a.length; m++)if (Jx(a[m], u, d)) return !0 } for (let m = 0; m < u.length; m++)if (Jx(u[m], a, d)) return !0; return !1 } function Qx(u, a) { if (u.length === 0 || a.length === 0) return !1; for (let d = 0; d < u.length - 1; d++) { const m = u[d], _ = u[d + 1]; for (let S = 0; S < a.length - 1; S++)if (sF(m, _, a[S], a[S + 1])) return !0 } return !1 } function sF(u, a, d, m) { return V(u, d, m) !== V(a, d, m) && V(u, a, d) !== V(u, a, m) } function Jx(u, a, d) { const m = d * d; if (a.length === 1) return u.distSqr(a[0]) < m; for (let _ = 1; _ < a.length; _++)if (GE(u, a[_ - 1], a[_]) < m) return !0; return !1 } function GE(u, a, d) { const m = a.distSqr(d); if (m === 0) return u.distSqr(a); const _ = ((u.x - a.x) * (d.x - a.x) + (u.y - a.y) * (d.y - a.y)) / m; return u.distSqr(_ < 0 ? a : _ > 1 ? d : d.sub(a)._mult(_)._add(a)) } function qE(u, a) { let d, m, _, S = !1; for (let T = 0; T < u.length; T++) { d = u[T]; for (let L = 0, F = d.length - 1; L < d.length; F = L++)m = d[L], _ = d[F], m.y > a.y != _.y > a.y && a.x < (_.x - m.x) * (a.y - m.y) / (_.y - m.y) + m.x && (S = !S) } return S } function od(u, a) { let d = !1; for (let m = 0, _ = u.length - 1; m < u.length; _ = m++) { const S = u[m], T = u[_]; S.y > a.y != T.y > a.y && a.x < (T.x - S.x) * (a.y - S.y) / (T.y - S.y) + S.x && (d = !d) } return d } function lF(u, a, d) { const m = d[0], _ = d[2]; if (u.x < m.x && a.x < m.x || u.x > _.x && a.x > _.x || u.y < m.y && a.y < m.y || u.y > _.y && a.y > _.y) return !1; const S = V(u, a, d[0]); return S !== V(u, a, d[1]) || S !== V(u, a, d[2]) || S !== V(u, a, d[3]) } function ph(u, a, d) { const m = a.paint.get(u).value; return m.kind === "constant" ? m.value : d.programConfigurations.get(a.id).getMaxValue(u) } function gv(u) { return Math.sqrt(u[0] * u[0] + u[1] * u[1]) } function yv(u, a, d, m, _) { if (!a[0] && !a[1]) return u; const S = ie.convert(a)._mult(_); d === "viewport" && S._rotate(-m); const T = []; for (let L = 0; L < u.length; L++)T.push(u[L].sub(S)); return T } mn("CircleBucket", Yx, { omit: ["layers"] }); const uF = new Pi({ "circle-sort-key": new In(Fe.layout_circle["circle-sort-key"]) }); var cF = { paint: new Pi({ "circle-radius": new In(Fe.paint_circle["circle-radius"]), "circle-color": new In(Fe.paint_circle["circle-color"]), "circle-blur": new In(Fe.paint_circle["circle-blur"]), "circle-opacity": new In(Fe.paint_circle["circle-opacity"]), "circle-translate": new xn(Fe.paint_circle["circle-translate"]), "circle-translate-anchor": new xn(Fe.paint_circle["circle-translate-anchor"]), "circle-pitch-scale": new xn(Fe.paint_circle["circle-pitch-scale"]), "circle-pitch-alignment": new xn(Fe.paint_circle["circle-pitch-alignment"]), "circle-stroke-width": new In(Fe.paint_circle["circle-stroke-width"]), "circle-stroke-color": new In(Fe.paint_circle["circle-stroke-color"]), "circle-stroke-opacity": new In(Fe.paint_circle["circle-stroke-opacity"]) }), layout: uF }, Qi = 1e-6, Ji = typeof Float32Array < "u" ? Float32Array : Array; function ZE() { var u = new Ji(9); return Ji != Float32Array && (u[1] = 0, u[2] = 0, u[3] = 0, u[5] = 0, u[6] = 0, u[7] = 0), u[0] = 1, u[4] = 1, u[8] = 1, u } function e_(u) { return u[0] = 1, u[1] = 0, u[2] = 0, u[3] = 0, u[4] = 0, u[5] = 1, u[6] = 0, u[7] = 0, u[8] = 0, u[9] = 0, u[10] = 1, u[11] = 0, u[12] = 0, u[13] = 0, u[14] = 0, u[15] = 1, u } function XE(u, a, d) { var m = a[0], _ = a[1], S = a[2], T = a[3], L = a[4], F = a[5], K = a[6], Q = a[7], ne = a[8], ue = a[9], he = a[10], pe = a[11], Ne = a[12], Ae = a[13], Ye = a[14], lt = a[15], Ke = d[0], it = d[1], kt = d[2], Tt = d[3]; return u[0] = Ke * m + it * L + kt * ne + Tt * Ne, u[1] = Ke * _ + it * F + kt * ue + Tt * Ae, u[2] = Ke * S + it * K + kt * he + Tt * Ye, u[3] = Ke * T + it * Q + kt * pe + Tt * lt, u[4] = (Ke = d[4]) * m + (it = d[5]) * L + (kt = d[6]) * ne + (Tt = d[7]) * Ne, u[5] = Ke * _ + it * F + kt * ue + Tt * Ae, u[6] = Ke * S + it * K + kt * he + Tt * Ye, u[7] = Ke * T + it * Q + kt * pe + Tt * lt, u[8] = (Ke = d[8]) * m + (it = d[9]) * L + (kt = d[10]) * ne + (Tt = d[11]) * Ne, u[9] = Ke * _ + it * F + kt * ue + Tt * Ae, u[10] = Ke * S + it * K + kt * he + Tt * Ye, u[11] = Ke * T + it * Q + kt * pe + Tt * lt, u[12] = (Ke = d[12]) * m + (it = d[13]) * L + (kt = d[14]) * ne + (Tt = d[15]) * Ne, u[13] = Ke * _ + it * F + kt * ue + Tt * Ae, u[14] = Ke * S + it * K + kt * he + Tt * Ye, u[15] = Ke * T + it * Q + kt * pe + Tt * lt, u } Math.hypot || (Math.hypot = function () { for (var u = 0, a = arguments.length; a--;)u += arguments[a] * arguments[a]; return Math.sqrt(u) }); var mh, dF = XE; function YE() { var u = new Ji(3); return Ji != Float32Array && (u[0] = 0, u[1] = 0, u[2] = 0), u } function QE(u, a, d) { var m = new Ji(3); return m[0] = u, m[1] = a, m[2] = d, m } function xv(u, a, d) { var m = a[0], _ = a[1], S = a[2], T = a[3]; return u[0] = d[0] * m + d[4] * _ + d[8] * S + d[12] * T, u[1] = d[1] * m + d[5] * _ + d[9] * S + d[13] * T, u[2] = d[2] * m + d[6] * _ + d[10] * S + d[14] * T, u[3] = d[3] * m + d[7] * _ + d[11] * S + d[15] * T, u } function JE() { var u = new Ji(4); return Ji != Float32Array && (u[0] = 0, u[1] = 0, u[2] = 0), u[3] = 1, u } function e4(u, a) { const d = xv([], [u.x, u.y, 0, 1], a); return new ie(d[0] / d[3], d[1] / d[3]) } YE(), mh = new Ji(4), Ji != Float32Array && (mh[0] = 0, mh[1] = 0, mh[2] = 0, mh[3] = 0), YE(), QE(1, 0, 0), QE(0, 1, 0), JE(), JE(), ZE(), function () { var u; u = new Ji(2), Ji != Float32Array && (u[0] = 0, u[1] = 0) }(); class t4 extends Yx { } mn("HeatmapBucket", t4, { omit: ["layers"] }); var fF = { paint: new Pi({ "heatmap-radius": new In(Fe.paint_heatmap["heatmap-radius"]), "heatmap-weight": new In(Fe.paint_heatmap["heatmap-weight"]), "heatmap-intensity": new xn(Fe.paint_heatmap["heatmap-intensity"]), "heatmap-color": new es(Fe.paint_heatmap["heatmap-color"]), "heatmap-opacity": new xn(Fe.paint_heatmap["heatmap-opacity"]) }) }; function t_(u, { width: a, height: d }, m, _) { if (_) { if (_ instanceof Uint8ClampedArray) _ = new Uint8Array(_.buffer); else if (_.length !== a * d * m) throw new RangeError(`mismatched image size. expected: ${_.length} but got: ${a * d * m}`) } else _ = new Uint8Array(a * d * m); return u.width = a, u.height = d, u.data = _, u } function n4(u, { width: a, height: d }, m) { if (a === u.width && d === u.height) return; const _ = t_({}, { width: a, height: d }, m); n_(u, _, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(u.width, a), height: Math.min(u.height, d) }, m), u.width = a, u.height = d, u.data = _.data } function n_(u, a, d, m, _, S) { if (_.width === 0 || _.height === 0) return a; if (_.width > u.width || _.height > u.height || d.x > u.width - _.width || d.y > u.height - _.height) throw new RangeError("out of range source coordinates for image copy"); if (_.width > a.width || _.height > a.height || m.x > a.width - _.width || m.y > a.height - _.height) throw new RangeError("out of range destination coordinates for image copy"); const T = u.data, L = a.data; if (T === L) throw new Error("srcData equals dstData, so image is already copied"); for (let F = 0; F < _.height; F++) { const K = ((d.y + F) * u.width + d.x) * S, Q = ((m.y + F) * a.width + m.x) * S; for (let ne = 0; ne < _.width * S; ne++)L[Q + ne] = T[K + ne] } return a } class vh { constructor(a, d) { t_(this, a, 1, d) } resize(a) { n4(this, a, 1) } clone() { return new vh({ width: this.width, height: this.height }, new Uint8Array(this.data)) } static copy(a, d, m, _, S) { n_(a, d, m, _, S, 1) } } class Uo { constructor(a, d) { t_(this, a, 4, d) } resize(a) { n4(this, a, 4) } replace(a, d) { d ? this.data.set(a) : this.data = a instanceof Uint8ClampedArray ? new Uint8Array(a.buffer) : a } clone() { return new Uo({ width: this.width, height: this.height }, new Uint8Array(this.data)) } static copy(a, d, m, _, S) { n_(a, d, m, _, S, 4) } } function r4(u) { const a = {}, d = u.resolution || 256, m = u.clips ? u.clips.length : 1, _ = u.image || new Uo({ width: d, height: m }); if (Math.log(d) / Math.LN2 % 1 != 0) throw new Error(`width is not a power of 2 - ${d}`); const S = (T, L, F) => { a[u.evaluationKey] = F; const K = u.expression.evaluate(a); _.data[T + L + 0] = Math.floor(255 * K.r / K.a), _.data[T + L + 1] = Math.floor(255 * K.g / K.a), _.data[T + L + 2] = Math.floor(255 * K.b / K.a), _.data[T + L + 3] = Math.floor(255 * K.a) }; if (u.clips) for (let T = 0, L = 0; T < m; ++T, L += 4 * d)for (let F = 0, K = 0; F < d; F++, K += 4) { const Q = F / (d - 1), { start: ne, end: ue } = u.clips[T]; S(L, K, ne * (1 - Q) + ue * Q) } else for (let T = 0, L = 0; T < d; T++, L += 4)S(0, L, T / (d - 1)); return _ } mn("AlphaImage", vh), mn("RGBAImage", Uo); var hF = { paint: new Pi({ "hillshade-illumination-direction": new xn(Fe.paint_hillshade["hillshade-illumination-direction"]), "hillshade-illumination-anchor": new xn(Fe.paint_hillshade["hillshade-illumination-anchor"]), "hillshade-exaggeration": new xn(Fe.paint_hillshade["hillshade-exaggeration"]), "hillshade-shadow-color": new xn(Fe.paint_hillshade["hillshade-shadow-color"]), "hillshade-highlight-color": new xn(Fe.paint_hillshade["hillshade-highlight-color"]), "hillshade-accent-color": new xn(Fe.paint_hillshade["hillshade-accent-color"]) }) }; const pF = ni([{ name: "a_pos", components: 2, type: "Int16" }], 4), { members: mF } = pF; var _v = { exports: {} }; function bv(u, a, d) { d = d || 2; var m, _, S, T, L, F, K, Q = a && a.length, ne = Q ? a[0] * d : u.length, ue = i4(u, 0, ne, d, !0), he = []; if (!ue || ue.next === ue.prev) return he; if (Q && (ue = function (Ne, Ae, Ye, lt) { var Ke, it, kt, Tt = []; for (Ke = 0, it = Ae.length; Ke < it; Ke++)(kt = i4(Ne, Ae[Ke] * lt, Ke < it - 1 ? Ae[Ke + 1] * lt : Ne.length, lt, !1)) === kt.next && (kt.steiner = !0), Tt.push(CF(kt)); for (Tt.sort(_F), Ke = 0; Ke < Tt.length; Ke++)Ye = bF(Tt[Ke], Ye); return Ye }(u, a, ue, d)), u.length > 80 * d) { m = S = u[0], _ = T = u[1]; for (var pe = d; pe < ne; pe += d)(L = u[pe]) < m && (m = L), (F = u[pe + 1]) < _ && (_ = F), L > S && (S = L), F > T && (T = F); K = (K = Math.max(S - m, T - _)) !== 0 ? 32767 / K : 0 } return gh(ue, he, d, m, _, K, 0), he } function i4(u, a, d, m, _) { var S, T; if (_ === o_(u, a, d, m) > 0) for (S = a; S < d; S += m)T = s4(S, u[S], u[S + 1], T); else for (S = d - m; S >= a; S -= m)T = s4(S, u[S], u[S + 1], T); return T && wv(T, T.next) && (xh(T), T = T.next), T } function ju(u, a) { if (!u) return u; a || (a = u); var d, m = u; do if (d = !1, m.steiner || !wv(m, m.next) && Qr(m.prev, m, m.next) !== 0) m = m.next; else { if (xh(m), (m = a = m.prev) === m.next) break; d = !0 } while (d || m !== a); return a } function gh(u, a, d, m, _, S, T) { if (u) { !T && S && function (Q, ne, ue, he) { var pe = Q; do pe.z === 0 && (pe.z = r_(pe.x, pe.y, ne, ue, he)), pe.prevZ = pe.prev, pe.nextZ = pe.next, pe = pe.next; while (pe !== Q); pe.prevZ.nextZ = null, pe.prevZ = null, function (Ne) { var Ae, Ye, lt, Ke, it, kt, Tt, hn, vn = 1; do { for (Ye = Ne, Ne = null, it = null, kt = 0; Ye;) { for (kt++, lt = Ye, Tt = 0, Ae = 0; Ae < vn && (Tt++, lt = lt.nextZ); Ae++); for (hn = vn; Tt > 0 || hn > 0 && lt;)Tt !== 0 && (hn === 0 || !lt || Ye.z <= lt.z) ? (Ke = Ye, Ye = Ye.nextZ, Tt--) : (Ke = lt, lt = lt.nextZ, hn--), it ? it.nextZ = Ke : Ne = Ke, Ke.prevZ = it, it = Ke; Ye = lt } it.nextZ = null, vn *= 2 } while (kt > 1) }(pe) }(u, m, _, S); for (var L, F, K = u; u.prev !== u.next;)if (L = u.prev, F = u.next, S ? gF(u, m, _, S) : vF(u)) a.push(L.i / d | 0), a.push(u.i / d | 0), a.push(F.i / d | 0), xh(u), u = F.next, K = F.next; else if ((u = F) === K) { T ? T === 1 ? gh(u = yF(ju(u), a, d), a, d, m, _, S, 2) : T === 2 && xF(u, a, d, m, _, S) : gh(ju(u), a, d, m, _, S, 1); break } } } function vF(u) { var a = u.prev, d = u, m = u.next; if (Qr(a, d, m) >= 0) return !1; for (var _ = a.x, S = d.x, T = m.x, L = a.y, F = d.y, K = m.y, Q = _ < S ? _ < T ? _ : T : S < T ? S : T, ne = L < F ? L < K ? L : K : F < K ? F : K, ue = _ > S ? _ > T ? _ : T : S > T ? S : T, he = L > F ? L > K ? L : K : F > K ? F : K, pe = m.next; pe !== a;) { if (pe.x >= Q && pe.x <= ue && pe.y >= ne && pe.y <= he && ad(_, L, S, F, T, K, pe.x, pe.y) && Qr(pe.prev, pe, pe.next) >= 0) return !1; pe = pe.next } return !0 } function gF(u, a, d, m) { var _ = u.prev, S = u, T = u.next; if (Qr(_, S, T) >= 0) return !1; for (var L = _.x, F = S.x, K = T.x, Q = _.y, ne = S.y, ue = T.y, he = L < F ? L < K ? L : K : F < K ? F : K, pe = Q < ne ? Q < ue ? Q : ue : ne < ue ? ne : ue, Ne = L > F ? L > K ? L : K : F > K ? F : K, Ae = Q > ne ? Q > ue ? Q : ue : ne > ue ? ne : ue, Ye = r_(he, pe, a, d, m), lt = r_(Ne, Ae, a, d, m), Ke = u.prevZ, it = u.nextZ; Ke && Ke.z >= Ye && it && it.z <= lt;) { if (Ke.x >= he && Ke.x <= Ne && Ke.y >= pe && Ke.y <= Ae && Ke !== _ && Ke !== T && ad(L, Q, F, ne, K, ue, Ke.x, Ke.y) && Qr(Ke.prev, Ke, Ke.next) >= 0 || (Ke = Ke.prevZ, it.x >= he && it.x <= Ne && it.y >= pe && it.y <= Ae && it !== _ && it !== T && ad(L, Q, F, ne, K, ue, it.x, it.y) && Qr(it.prev, it, it.next) >= 0)) return !1; it = it.nextZ } for (; Ke && Ke.z >= Ye;) { if (Ke.x >= he && Ke.x <= Ne && Ke.y >= pe && Ke.y <= Ae && Ke !== _ && Ke !== T && ad(L, Q, F, ne, K, ue, Ke.x, Ke.y) && Qr(Ke.prev, Ke, Ke.next) >= 0) return !1; Ke = Ke.prevZ } for (; it && it.z <= lt;) { if (it.x >= he && it.x <= Ne && it.y >= pe && it.y <= Ae && it !== _ && it !== T && ad(L, Q, F, ne, K, ue, it.x, it.y) && Qr(it.prev, it, it.next) >= 0) return !1; it = it.nextZ } return !0 } function yF(u, a, d) { var m = u; do { var _ = m.prev, S = m.next.next; !wv(_, S) && o4(_, m, m.next, S) && yh(_, S) && yh(S, _) && (a.push(_.i / d | 0), a.push(m.i / d | 0), a.push(S.i / d | 0), xh(m), xh(m.next), m = u = S), m = m.next } while (m !== u); return ju(m) } function xF(u, a, d, m, _, S) { var T = u; do { for (var L = T.next.next; L !== T.prev;) { if (T.i !== L.i && SF(T, L)) { var F = a4(T, L); return T = ju(T, T.next), F = ju(F, F.next), gh(T, a, d, m, _, S, 0), void gh(F, a, d, m, _, S, 0) } L = L.next } T = T.next } while (T !== u) } function _F(u, a) { return u.x - a.x } function bF(u, a) { var d = function (_, S) { var T, L = S, F = _.x, K = _.y, Q = -1 / 0; do { if (K <= L.y && K >= L.next.y && L.next.y !== L.y) { var ne = L.x + (K - L.y) * (L.next.x - L.x) / (L.next.y - L.y); if (ne <= F && ne > Q && (Q = ne, T = L.x < L.next.x ? L : L.next, ne === F)) return T } L = L.next } while (L !== S); if (!T) return null; var ue, he = T, pe = T.x, Ne = T.y, Ae = 1 / 0; L = T; do F >= L.x && L.x >= pe && F !== L.x && ad(K < Ne ? F : Q, K, pe, Ne, K < Ne ? Q : F, K, L.x, L.y) && (ue = Math.abs(K - L.y) / (F - L.x), yh(L, _) && (ue < Ae || ue === Ae && (L.x > T.x || L.x === T.x && wF(T, L))) && (T = L, Ae = ue)), L = L.next; while (L !== he); return T }(u, a); if (!d) return a; var m = a4(d, u); return ju(m, m.next), ju(d, d.next) } function wF(u, a) { return Qr(u.prev, u, a.prev) < 0 && Qr(a.next, u, u.next) < 0 } function r_(u, a, d, m, _) { return (u = 1431655765 & ((u = 858993459 & ((u = 252645135 & ((u = 16711935 & ((u = (u - d) * _ | 0) | u << 8)) | u << 4)) | u << 2)) | u << 1)) | (a = 1431655765 & ((a = 858993459 & ((a = 252645135 & ((a = 16711935 & ((a = (a - m) * _ | 0) | a << 8)) | a << 4)) | a << 2)) | a << 1)) << 1 } function CF(u) { var a = u, d = u; do (a.x < d.x || a.x === d.x && a.y < d.y) && (d = a), a = a.next; while (a !== u); return d } function ad(u, a, d, m, _, S, T, L) { return (_ - T) * (a - L) >= (u - T) * (S - L) && (u - T) * (m - L) >= (d - T) * (a - L) && (d - T) * (S - L) >= (_ - T) * (m - L) } function SF(u, a) { return u.next.i !== a.i && u.prev.i !== a.i && !function (d, m) { var _ = d; do { if (_.i !== d.i && _.next.i !== d.i && _.i !== m.i && _.next.i !== m.i && o4(_, _.next, d, m)) return !0; _ = _.next } while (_ !== d); return !1 }(u, a) && (yh(u, a) && yh(a, u) && function (d, m) { var _ = d, S = !1, T = (d.x + m.x) / 2, L = (d.y + m.y) / 2; do _.y > L != _.next.y > L && _.next.y !== _.y && T < (_.next.x - _.x) * (L - _.y) / (_.next.y - _.y) + _.x && (S = !S), _ = _.next; while (_ !== d); return S }(u, a) && (Qr(u.prev, u, a.prev) || Qr(u, a.prev, a)) || wv(u, a) && Qr(u.prev, u, u.next) > 0 && Qr(a.prev, a, a.next) > 0) } function Qr(u, a, d) { return (a.y - u.y) * (d.x - a.x) - (a.x - u.x) * (d.y - a.y) } function wv(u, a) { return u.x === a.x && u.y === a.y } function o4(u, a, d, m) { var _ = Sv(Qr(u, a, d)), S = Sv(Qr(u, a, m)), T = Sv(Qr(d, m, u)), L = Sv(Qr(d, m, a)); return _ !== S && T !== L || !(_ !== 0 || !Cv(u, d, a)) || !(S !== 0 || !Cv(u, m, a)) || !(T !== 0 || !Cv(d, u, m)) || !(L !== 0 || !Cv(d, a, m)) } function Cv(u, a, d) { return a.x <= Math.max(u.x, d.x) && a.x >= Math.min(u.x, d.x) && a.y <= Math.max(u.y, d.y) && a.y >= Math.min(u.y, d.y) } function Sv(u) { return u > 0 ? 1 : u < 0 ? -1 : 0 } function yh(u, a) { return Qr(u.prev, u, u.next) < 0 ? Qr(u, a, u.next) >= 0 && Qr(u, u.prev, a) >= 0 : Qr(u, a, u.prev) < 0 || Qr(u, u.next, a) < 0 } function a4(u, a) { var d = new i_(u.i, u.x, u.y), m = new i_(a.i, a.x, a.y), _ = u.next, S = a.prev; return u.next = a, a.prev = u, d.next = _, _.prev = d, m.next = d, d.prev = m, S.next = m, m.prev = S, m } function s4(u, a, d, m) { var _ = new i_(u, a, d); return m ? (_.next = m.next, _.prev = m, m.next.prev = _, m.next = _) : (_.prev = _, _.next = _), _ } function xh(u) { u.next.prev = u.prev, u.prev.next = u.next, u.prevZ && (u.prevZ.nextZ = u.nextZ), u.nextZ && (u.nextZ.prevZ = u.prevZ) } function i_(u, a, d) { this.i = u, this.x = a, this.y = d, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1 } function o_(u, a, d, m) { for (var _ = 0, S = a, T = d - m; S < d; S += m)_ += (u[T] - u[S]) * (u[S + 1] + u[T + 1]), T = S; return _ } function EF(u, a, d, m, _) { l4(u, a, d || 0, m || u.length - 1, _ || PF) } function l4(u, a, d, m, _) { for (; m > d;) { if (m - d > 600) { var S = m - d + 1, T = a - d + 1, L = Math.log(S), F = .5 * Math.exp(2 * L / 3), K = .5 * Math.sqrt(L * F * (S - F) / S) * (T - S / 2 < 0 ? -1 : 1); l4(u, a, Math.max(d, Math.floor(a - T * F / S + K)), Math.min(m, Math.floor(a + (S - T) * F / S + K)), _) } var Q = u[a], ne = d, ue = m; for (_h(u, d, a), _(u[m], Q) > 0 && _h(u, d, m); ne < ue;) { for (_h(u, ne, ue), ne++, ue--; _(u[ne], Q) < 0;)ne++; for (; _(u[ue], Q) > 0;)ue-- } _(u[d], Q) === 0 ? _h(u, d, ue) : _h(u, ++ue, m), ue <= a && (d = ue + 1), a <= ue && (m = ue - 1) } } function _h(u, a, d) { var m = u[a]; u[a] = u[d], u[d] = m } function PF(u, a) { return u < a ? -1 : u > a ? 1 : 0 } function a_(u, a) { const d = u.length; if (d <= 1) return [u]; const m = []; let _, S; for (let T = 0; T < d; T++) { const L = G(u[T]); L !== 0 && (u[T].area = Math.abs(L), S === void 0 && (S = L < 0), S === L < 0 ? (_ && m.push(_), _ = [u[T]]) : _.push(u[T])) } if (_ && m.push(_), a > 1) for (let T = 0; T < m.length; T++)m[T].length <= a || (EF(m[T], a, 1, m[T].length - 1, TF), m[T] = m[T].slice(0, a)); return m } function TF(u, a) { return a.area - u.area } function s_(u, a, d) { const m = d.patternDependencies; let _ = !1; for (const S of a) { const T = S.paint.get(`${u}-pattern`); T.isConstant() || (_ = !0); const L = T.constantOr(null); L && (_ = !0, m[L.to] = !0, m[L.from] = !0) } return _ } function l_(u, a, d, m, _) { const S = _.patternDependencies; for (const T of a) { const L = T.paint.get(`${u}-pattern`).value; if (L.kind !== "constant") { let F = L.evaluate({ zoom: m - 1 }, d, {}, _.availableImages), K = L.evaluate({ zoom: m }, d, {}, _.availableImages), Q = L.evaluate({ zoom: m + 1 }, d, {}, _.availableImages); F = F && F.name ? F.name : F, K = K && K.name ? K.name : K, Q = Q && Q.name ? Q.name : Q, S[F] = !0, S[K] = !0, S[Q] = !0, d.patterns[T.id] = { min: F, mid: K, max: Q } } } return d } _v.exports = bv, _v.exports.default = bv, bv.deviation = function (u, a, d, m) { var _ = a && a.length, S = Math.abs(o_(u, 0, _ ? a[0] * d : u.length, d)); if (_) for (var T = 0, L = a.length; T < L; T++)S -= Math.abs(o_(u, a[T] * d, T < L - 1 ? a[T + 1] * d : u.length, d)); var F = 0; for (T = 0; T < m.length; T += 3) { var K = m[T] * d, Q = m[T + 1] * d, ne = m[T + 2] * d; F += Math.abs((u[K] - u[ne]) * (u[Q + 1] - u[K + 1]) - (u[K] - u[Q]) * (u[ne + 1] - u[K + 1])) } return S === 0 && F === 0 ? 0 : Math.abs((F - S) / S) }, bv.flatten = function (u) { for (var a = u[0][0].length, d = { vertices: [], holes: [], dimensions: a }, m = 0, _ = 0; _ < u.length; _++) { for (var S = 0; S < u[_].length; S++)for (var T = 0; T < a; T++)d.vertices.push(u[_][S][T]); _ > 0 && d.holes.push(m += u[_ - 1].length) } return d }; class u_ { constructor(a) { this.zoom = a.zoom, this.overscaling = a.overscaling, this.layers = a.layers, this.layerIds = this.layers.map(d => d.id), this.index = a.index, this.hasPattern = !1, this.patternFeatures = [], this.layoutVertexArray = new hr, this.indexArray = new Yi, this.indexArray2 = new Ra, this.programConfigurations = new Bu(a.layers, a.zoom), this.segments = new Wn, this.segments2 = new Wn, this.stateDependentLayerIds = this.layers.filter(d => d.isStateDependent()).map(d => d.id) } populate(a, d, m) { this.hasPattern = s_("fill", this.layers, d); const _ = this.layers[0].layout.get("fill-sort-key"), S = !_.isConstant(), T = []; for (const { feature: L, id: F, index: K, sourceLayerIndex: Q } of a) { const ne = this.layers[0]._featureFilter.needGeometry, ue = Uu(L, ne); if (!this.layers[0]._featureFilter.filter(new Or(this.zoom), ue, m)) continue; const he = S ? _.evaluate(ue, {}, m, d.availableImages) : void 0, pe = { id: F, properties: L.properties, type: L.type, sourceLayerIndex: Q, index: K, geometry: ne ? ue.geometry : Vu(L), patterns: {}, sortKey: he }; T.push(pe) } S && T.sort((L, F) => L.sortKey - F.sortKey); for (const L of T) { const { geometry: F, index: K, sourceLayerIndex: Q } = L; if (this.hasPattern) { const ne = l_("fill", this.layers, L, this.zoom, d); this.patternFeatures.push(ne) } else this.addFeature(L, F, K, m, {}); d.featureIndex.insert(a[K].feature, F, K, Q, this.index) } } update(a, d, m) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(a, d, this.stateDependentLayers, m) } addFeatures(a, d, m) { for (const _ of this.patternFeatures) this.addFeature(_, _.geometry, _.index, d, m) } isEmpty() { return this.layoutVertexArray.length === 0 } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(a) { this.uploaded || (this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, mF), this.indexBuffer = a.createIndexBuffer(this.indexArray), this.indexBuffer2 = a.createIndexBuffer(this.indexArray2)), this.programConfigurations.upload(a), this.uploaded = !0 } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.indexBuffer2.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.segments2.destroy()) } addFeature(a, d, m, _, S) { for (const T of a_(d, 500)) { let L = 0; for (const he of T) L += he.length; const F = this.segments.prepareSegment(L, this.layoutVertexArray, this.indexArray), K = F.vertexLength, Q = [], ne = []; for (const he of T) { if (he.length === 0) continue; he !== T[0] && ne.push(Q.length / 2); const pe = this.segments2.prepareSegment(he.length, this.layoutVertexArray, this.indexArray2), Ne = pe.vertexLength; this.layoutVertexArray.emplaceBack(he[0].x, he[0].y), this.indexArray2.emplaceBack(Ne + he.length - 1, Ne), Q.push(he[0].x), Q.push(he[0].y); for (let Ae = 1; Ae < he.length; Ae++)this.layoutVertexArray.emplaceBack(he[Ae].x, he[Ae].y), this.indexArray2.emplaceBack(Ne + Ae - 1, Ne + Ae), Q.push(he[Ae].x), Q.push(he[Ae].y); pe.vertexLength += he.length, pe.primitiveLength += he.length } const ue = _v.exports(Q, ne); for (let he = 0; he < ue.length; he += 3)this.indexArray.emplaceBack(K + ue[he], K + ue[he + 1], K + ue[he + 2]); F.vertexLength += L, F.primitiveLength += ue.length / 3 } this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, a, m, S, _) } } mn("FillBucket", u_, { omit: ["layers", "patternFeatures"] }); const kF = new Pi({ "fill-sort-key": new In(Fe.layout_fill["fill-sort-key"]) }); var IF = { paint: new Pi({ "fill-antialias": new xn(Fe.paint_fill["fill-antialias"]), "fill-opacity": new In(Fe.paint_fill["fill-opacity"]), "fill-color": new In(Fe.paint_fill["fill-color"]), "fill-outline-color": new In(Fe.paint_fill["fill-outline-color"]), "fill-translate": new xn(Fe.paint_fill["fill-translate"]), "fill-translate-anchor": new xn(Fe.paint_fill["fill-translate-anchor"]), "fill-pattern": new Pl(Fe.paint_fill["fill-pattern"]) }), layout: kF }; const RF = ni([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_normal_ed", components: 4, type: "Int16" }], 4), MF = ni([{ name: "a_centroid", components: 2, type: "Int16" }], 4), { members: AF } = RF; var Il = {}, NF = ie, u4 = sd; function sd(u, a, d, m, _) { this.properties = {}, this.extent = d, this.type = 0, this._pbf = u, this._geometry = -1, this._keys = m, this._values = _, u.readFields(OF, this, a) } function OF(u, a, d) { u == 1 ? a.id = d.readVarint() : u == 2 ? function (m, _) { for (var S = m.readVarint() + m.pos; m.pos < S;) { var T = _._keys[m.readVarint()], L = _._values[m.readVarint()]; _.properties[T] = L } }(d, a) : u == 3 ? a.type = d.readVarint() : u == 4 && (a._geometry = d.pos) } function DF(u) { for (var a, d, m = 0, _ = 0, S = u.length, T = S - 1; _ < S; T = _++)m += ((d = u[T]).x - (a = u[_]).x) * (a.y + d.y); return m } sd.types = ["Unknown", "Point", "LineString", "Polygon"], sd.prototype.loadGeometry = function () { var u = this._pbf; u.pos = this._geometry; for (var a, d = u.readVarint() + u.pos, m = 1, _ = 0, S = 0, T = 0, L = []; u.pos < d;) { if (_ <= 0) { var F = u.readVarint(); m = 7 & F, _ = F >> 3 } if (_--, m === 1 || m === 2) S += u.readSVarint(), T += u.readSVarint(), m === 1 && (a && L.push(a), a = []), a.push(new NF(S, T)); else { if (m !== 7) throw new Error("unknown command " + m); a && a.push(a[0].clone()) } } return a && L.push(a), L }, sd.prototype.bbox = function () { var u = this._pbf; u.pos = this._geometry; for (var a = u.readVarint() + u.pos, d = 1, m = 0, _ = 0, S = 0, T = 1 / 0, L = -1 / 0, F = 1 / 0, K = -1 / 0; u.pos < a;) { if (m <= 0) { var Q = u.readVarint(); d = 7 & Q, m = Q >> 3 } if (m--, d === 1 || d === 2) (_ += u.readSVarint()) < T && (T = _), _ > L && (L = _), (S += u.readSVarint()) < F && (F = S), S > K && (K = S); else if (d !== 7) throw new Error("unknown command " + d) } return [T, F, L, K] }, sd.prototype.toGeoJSON = function (u, a, d) { var m, _, S = this.extent * Math.pow(2, d), T = this.extent * u, L = this.extent * a, F = this.loadGeometry(), K = sd.types[this.type]; function Q(he) { for (var pe = 0; pe < he.length; pe++) { var Ne = he[pe]; he[pe] = [360 * (Ne.x + T) / S - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (Ne.y + L) / S) * Math.PI / 180)) - 90] } } switch (this.type) { case 1: var ne = []; for (m = 0; m < F.length; m++)ne[m] = F[m][0]; Q(F = ne); break; case 2: for (m = 0; m < F.length; m++)Q(F[m]); break; case 3: for (F = function (he) { var pe = he.length; if (pe <= 1) return [he]; for (var Ne, Ae, Ye = [], lt = 0; lt < pe; lt++) { var Ke = DF(he[lt]); Ke !== 0 && (Ae === void 0 && (Ae = Ke < 0), Ae === Ke < 0 ? (Ne && Ye.push(Ne), Ne = [he[lt]]) : Ne.push(he[lt])) } return Ne && Ye.push(Ne), Ye }(F), m = 0; m < F.length; m++)for (_ = 0; _ < F[m].length; _++)Q(F[m][_]) }F.length === 1 ? F = F[0] : K = "Multi" + K; var ue = { type: "Feature", geometry: { type: K, coordinates: F }, properties: this.properties }; return "id" in this && (ue.id = this.id), ue }; var LF = u4, c4 = d4; function d4(u, a) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = u, this._keys = [], this._values = [], this._features = [], u.readFields(zF, this, a), this.length = this._features.length } function zF(u, a, d) { u === 15 ? a.version = d.readVarint() : u === 1 ? a.name = d.readString() : u === 5 ? a.extent = d.readVarint() : u === 2 ? a._features.push(d.pos) : u === 3 ? a._keys.push(d.readString()) : u === 4 && a._values.push(function (m) { for (var _ = null, S = m.readVarint() + m.pos; m.pos < S;) { var T = m.readVarint() >> 3; _ = T === 1 ? m.readString() : T === 2 ? m.readFloat() : T === 3 ? m.readDouble() : T === 4 ? m.readVarint64() : T === 5 ? m.readVarint() : T === 6 ? m.readSVarint() : T === 7 ? m.readBoolean() : null } return _ }(d)) } d4.prototype.feature = function (u) { if (u < 0 || u >= this._features.length) throw new Error("feature index out of bounds"); this._pbf.pos = this._features[u]; var a = this._pbf.readVarint() + this._pbf.pos; return new LF(this._pbf, a, this.extent, this._keys, this._values) }; var FF = c4; function $F(u, a, d) { if (u === 3) { var m = new FF(d, d.readVarint() + d.pos); m.length && (a[m.name] = m) } } Il.VectorTile = function (u, a) { this.layers = u.readFields($F, {}, a) }, Il.VectorTileFeature = u4, Il.VectorTileLayer = c4; const BF = Il.VectorTileFeature.types, c_ = Math.pow(2, 13); function bh(u, a, d, m, _, S, T, L) { u.emplaceBack(a, d, 2 * Math.floor(m * c_) + T, _ * c_ * 2, S * c_ * 2, Math.round(L)) } class d_ { constructor(a) { this.zoom = a.zoom, this.overscaling = a.overscaling, this.layers = a.layers, this.layerIds = this.layers.map(d => d.id), this.index = a.index, this.hasPattern = !1, this.layoutVertexArray = new er, this.centroidVertexArray = new Pn, this.indexArray = new Yi, this.programConfigurations = new Bu(a.layers, a.zoom), this.segments = new Wn, this.stateDependentLayerIds = this.layers.filter(d => d.isStateDependent()).map(d => d.id) } populate(a, d, m) { this.features = [], this.hasPattern = s_("fill-extrusion", this.layers, d); for (const { feature: _, id: S, index: T, sourceLayerIndex: L } of a) { const F = this.layers[0]._featureFilter.needGeometry, K = Uu(_, F); if (!this.layers[0]._featureFilter.filter(new Or(this.zoom), K, m)) continue; const Q = { id: S, sourceLayerIndex: L, index: T, geometry: F ? K.geometry : Vu(_), properties: _.properties, type: _.type, patterns: {} }; this.hasPattern ? this.features.push(l_("fill-extrusion", this.layers, Q, this.zoom, d)) : this.addFeature(Q, Q.geometry, T, m, {}), d.featureIndex.insert(_, Q.geometry, T, L, this.index, !0) } } addFeatures(a, d, m) { for (const _ of this.features) { const { geometry: S } = _; this.addFeature(_, S, _.index, d, m) } } update(a, d, m) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(a, d, this.stateDependentLayers, m) } isEmpty() { return this.layoutVertexArray.length === 0 && this.centroidVertexArray.length === 0 } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(a) { this.uploaded || (this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, AF), this.centroidVertexBuffer = a.createVertexBuffer(this.centroidVertexArray, MF.members, !0), this.indexBuffer = a.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(a), this.uploaded = !0 } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.centroidVertexBuffer.destroy()) } addFeature(a, d, m, _, S) { const T = { x: 0, y: 0, vertexCount: 0 }; for (const L of a_(d, 500)) { let F = 0; for (const pe of L) F += pe.length; let K = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray); for (const pe of L) { if (pe.length === 0 || UF(pe)) continue; let Ne = 0; for (let Ae = 0; Ae < pe.length; Ae++) { const Ye = pe[Ae]; if (Ae >= 1) { const lt = pe[Ae - 1]; if (!VF(Ye, lt)) { K.vertexLength + 4 > Wn.MAX_VERTEX_ARRAY_LENGTH && (K = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray)); const Ke = Ye.sub(lt)._perp()._unit(), it = lt.dist(Ye); Ne + it > 32768 && (Ne = 0), bh(this.layoutVertexArray, Ye.x, Ye.y, Ke.x, Ke.y, 0, 0, Ne), bh(this.layoutVertexArray, Ye.x, Ye.y, Ke.x, Ke.y, 0, 1, Ne), T.x += 2 * Ye.x, T.y += 2 * Ye.y, T.vertexCount += 2, Ne += it, bh(this.layoutVertexArray, lt.x, lt.y, Ke.x, Ke.y, 0, 0, Ne), bh(this.layoutVertexArray, lt.x, lt.y, Ke.x, Ke.y, 0, 1, Ne), T.x += 2 * lt.x, T.y += 2 * lt.y, T.vertexCount += 2; const kt = K.vertexLength; this.indexArray.emplaceBack(kt, kt + 2, kt + 1), this.indexArray.emplaceBack(kt + 1, kt + 2, kt + 3), K.vertexLength += 4, K.primitiveLength += 2 } } } } if (K.vertexLength + F > Wn.MAX_VERTEX_ARRAY_LENGTH && (K = this.segments.prepareSegment(F, this.layoutVertexArray, this.indexArray)), BF[a.type] !== "Polygon") continue; const Q = [], ne = [], ue = K.vertexLength; for (const pe of L) if (pe.length !== 0) { pe !== L[0] && ne.push(Q.length / 2); for (let Ne = 0; Ne < pe.length; Ne++) { const Ae = pe[Ne]; bh(this.layoutVertexArray, Ae.x, Ae.y, 0, 0, 1, 1, 0), T.x += Ae.x, T.y += Ae.y, T.vertexCount += 1, Q.push(Ae.x), Q.push(Ae.y) } } const he = _v.exports(Q, ne); for (let pe = 0; pe < he.length; pe += 3)this.indexArray.emplaceBack(ue + he[pe], ue + he[pe + 2], ue + he[pe + 1]); K.primitiveLength += he.length / 3, K.vertexLength += F } for (let L = 0; L < T.vertexCount; L++)this.centroidVertexArray.emplaceBack(Math.floor(T.x / T.vertexCount), Math.floor(T.y / T.vertexCount)); this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, a, m, S, _) } } function VF(u, a) { return u.x === a.x && (u.x < 0 || u.x > fi) || u.y === a.y && (u.y < 0 || u.y > fi) } function UF(u) { return u.every(a => a.x < 0) || u.every(a => a.x > fi) || u.every(a => a.y < 0) || u.every(a => a.y > fi) } mn("FillExtrusionBucket", d_, { omit: ["layers", "features"] }); var jF = { paint: new Pi({ "fill-extrusion-opacity": new xn(Fe["paint_fill-extrusion"]["fill-extrusion-opacity"]), "fill-extrusion-color": new In(Fe["paint_fill-extrusion"]["fill-extrusion-color"]), "fill-extrusion-translate": new xn(Fe["paint_fill-extrusion"]["fill-extrusion-translate"]), "fill-extrusion-translate-anchor": new xn(Fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]), "fill-extrusion-pattern": new Pl(Fe["paint_fill-extrusion"]["fill-extrusion-pattern"]), "fill-extrusion-height": new In(Fe["paint_fill-extrusion"]["fill-extrusion-height"]), "fill-extrusion-base": new In(Fe["paint_fill-extrusion"]["fill-extrusion-base"]), "fill-extrusion-vertical-gradient": new xn(Fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]) }) }; function wh(u, a) { return u.x * a.x + u.y * a.y } function f4(u, a) { if (u.length === 1) { let d = 0; const m = a[d++]; let _; for (; !_ || m.equals(_);)if (_ = a[d++], !_) return 1 / 0; for (; d < a.length; d++) { const S = a[d], T = u[0], L = _.sub(m), F = S.sub(m), K = T.sub(m), Q = wh(L, L), ne = wh(L, F), ue = wh(F, F), he = wh(K, L), pe = wh(K, F), Ne = Q * ue - ne * ne, Ae = (ue * he - ne * pe) / Ne, Ye = (Q * pe - ne * he) / Ne, lt = m.z * (1 - Ae - Ye) + _.z * Ae + S.z * Ye; if (isFinite(lt)) return lt } return 1 / 0 } { let d = 1 / 0; for (const m of a) d = Math.min(d, m.z); return d } } const KF = ni([{ name: "a_pos_normal", components: 2, type: "Int16" }, { name: "a_data", components: 4, type: "Uint8" }], 4), { members: HF } = KF, WF = ni([{ name: "a_uv_x", components: 1, type: "Float32" }, { name: "a_split_index", components: 1, type: "Float32" }]), { members: GF } = WF, qF = Il.VectorTileFeature.types, ZF = Math.cos(Math.PI / 180 * 37.5), h4 = Math.pow(2, 14) / .5; class f_ { constructor(a) { this.zoom = a.zoom, this.overscaling = a.overscaling, this.layers = a.layers, this.layerIds = this.layers.map(d => d.id), this.index = a.index, this.hasPattern = !1, this.patternFeatures = [], this.lineClipsArray = [], this.gradients = {}, this.layers.forEach(d => { this.gradients[d.id] = {} }), this.layoutVertexArray = new ir, this.layoutVertexArray2 = new vr, this.indexArray = new Yi, this.programConfigurations = new Bu(a.layers, a.zoom), this.segments = new Wn, this.maxLineLength = 0, this.stateDependentLayerIds = this.layers.filter(d => d.isStateDependent()).map(d => d.id) } populate(a, d, m) { this.hasPattern = s_("line", this.layers, d); const _ = this.layers[0].layout.get("line-sort-key"), S = !_.isConstant(), T = []; for (const { feature: L, id: F, index: K, sourceLayerIndex: Q } of a) { const ne = this.layers[0]._featureFilter.needGeometry, ue = Uu(L, ne); if (!this.layers[0]._featureFilter.filter(new Or(this.zoom), ue, m)) continue; const he = S ? _.evaluate(ue, {}, m) : void 0, pe = { id: F, properties: L.properties, type: L.type, sourceLayerIndex: Q, index: K, geometry: ne ? ue.geometry : Vu(L), patterns: {}, sortKey: he }; T.push(pe) } S && T.sort((L, F) => L.sortKey - F.sortKey); for (const L of T) { const { geometry: F, index: K, sourceLayerIndex: Q } = L; if (this.hasPattern) { const ne = l_("line", this.layers, L, this.zoom, d); this.patternFeatures.push(ne) } else this.addFeature(L, F, K, m, {}); d.featureIndex.insert(a[K].feature, F, K, Q, this.index) } } update(a, d, m) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(a, d, this.stateDependentLayers, m) } addFeatures(a, d, m) { for (const _ of this.patternFeatures) this.addFeature(_, _.geometry, _.index, d, m) } isEmpty() { return this.layoutVertexArray.length === 0 } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(a) { this.uploaded || (this.layoutVertexArray2.length !== 0 && (this.layoutVertexBuffer2 = a.createVertexBuffer(this.layoutVertexArray2, GF)), this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, HF), this.indexBuffer = a.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(a), this.uploaded = !0 } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy()) } lineFeatureClips(a) { if (a.properties && Object.prototype.hasOwnProperty.call(a.properties, "mapbox_clip_start") && Object.prototype.hasOwnProperty.call(a.properties, "mapbox_clip_end")) return { start: +a.properties.mapbox_clip_start, end: +a.properties.mapbox_clip_end } } addFeature(a, d, m, _, S) { const T = this.layers[0].layout, L = T.get("line-join").evaluate(a, {}), F = T.get("line-cap"), K = T.get("line-miter-limit"), Q = T.get("line-round-limit"); this.lineClips = this.lineFeatureClips(a); for (const ne of d) this.addLine(ne, a, L, F, K, Q); this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, a, m, S, _) } addLine(a, d, m, _, S, T) { if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.lineClips) { this.lineClipsArray.push(this.lineClips); for (let Ye = 0; Ye < a.length - 1; Ye++)this.totalDistance += a[Ye].dist(a[Ye + 1]); this.updateScaledDistance(), this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance) } const L = qF[d.type] === "Polygon"; let F = a.length; for (; F >= 2 && a[F - 1].equals(a[F - 2]);)F--; let K = 0; for (; K < F - 1 && a[K].equals(a[K + 1]);)K++; if (F < (L ? 3 : 2)) return; m === "bevel" && (S = 1.05); const Q = this.overscaling <= 16 ? 122880 / (512 * this.overscaling) : 0, ne = this.segments.prepareSegment(10 * F, this.layoutVertexArray, this.indexArray); let ue, he, pe, Ne, Ae; this.e1 = this.e2 = -1, L && (ue = a[F - 2], Ae = a[K].sub(ue)._unit()._perp()); for (let Ye = K; Ye < F; Ye++) { if (pe = Ye === F - 1 ? L ? a[K + 1] : void 0 : a[Ye + 1], pe && a[Ye].equals(pe)) continue; Ae && (Ne = Ae), ue && (he = ue), ue = a[Ye], Ae = pe ? pe.sub(ue)._unit()._perp() : Ne, Ne = Ne || Ae; let lt = Ne.add(Ae); lt.x === 0 && lt.y === 0 || lt._unit(); const Ke = Ne.x * Ae.x + Ne.y * Ae.y, it = lt.x * Ae.x + lt.y * Ae.y, kt = it !== 0 ? 1 / it : 1 / 0, Tt = 2 * Math.sqrt(2 - 2 * it), hn = it < ZF && he && pe, vn = Ne.x * Ae.y - Ne.y * Ae.x > 0; if (hn && Ye > K) { const Gt = ue.dist(he); if (Gt > 2 * Q) { const an = ue.sub(ue.sub(he)._mult(Q / Gt)._round()); this.updateDistance(he, an), this.addCurrentVertex(an, Ne, 0, 0, ne), he = an } } const on = he && pe; let Qt = on ? m : L ? "butt" : _; if (on && Qt === "round" && (kt < T ? Qt = "miter" : kt <= 2 && (Qt = "fakeround")), Qt === "miter" && kt > S && (Qt = "bevel"), Qt === "bevel" && (kt > 2 && (Qt = "flipbevel"), kt < S && (Qt = "miter")), he && this.updateDistance(he, ue), Qt === "miter") lt._mult(kt), this.addCurrentVertex(ue, lt, 0, 0, ne); else if (Qt === "flipbevel") { if (kt > 100) lt = Ae.mult(-1); else { const Gt = kt * Ne.add(Ae).mag() / Ne.sub(Ae).mag(); lt._perp()._mult(Gt * (vn ? -1 : 1)) } this.addCurrentVertex(ue, lt, 0, 0, ne), this.addCurrentVertex(ue, lt.mult(-1), 0, 0, ne) } else if (Qt === "bevel" || Qt === "fakeround") { const Gt = -Math.sqrt(kt * kt - 1), an = vn ? Gt : 0, tn = vn ? 0 : Gt; if (he && this.addCurrentVertex(ue, Ne, an, tn, ne), Qt === "fakeround") { const $t = Math.round(180 * Tt / Math.PI / 20); for (let Tn = 1; Tn < $t; Tn++) { let _n = Tn / $t; if (_n !== .5) { const kr = _n - .5; _n += _n * kr * (_n - 1) * ((1.0904 + Ke * (Ke * (3.55645 - 1.43519 * Ke) - 3.2452)) * kr * kr + (.848013 + Ke * (.215638 * Ke - 1.06021))) } const jn = Ae.sub(Ne)._mult(_n)._add(Ne)._unit()._mult(vn ? -1 : 1); this.addHalfVertex(ue, jn.x, jn.y, !1, vn, 0, ne) } } pe && this.addCurrentVertex(ue, Ae, -an, -tn, ne) } else if (Qt === "butt") this.addCurrentVertex(ue, lt, 0, 0, ne); else if (Qt === "square") { const Gt = he ? 1 : -1; this.addCurrentVertex(ue, lt, Gt, Gt, ne) } else Qt === "round" && (he && (this.addCurrentVertex(ue, Ne, 0, 0, ne), this.addCurrentVertex(ue, Ne, 1, 1, ne, !0)), pe && (this.addCurrentVertex(ue, Ae, -1, -1, ne, !0), this.addCurrentVertex(ue, Ae, 0, 0, ne))); if (hn && Ye < F - 1) { const Gt = ue.dist(pe); if (Gt > 2 * Q) { const an = ue.add(pe.sub(ue)._mult(Q / Gt)._round()); this.updateDistance(ue, an), this.addCurrentVertex(an, Ae, 0, 0, ne), ue = an } } } } addCurrentVertex(a, d, m, _, S, T = !1) { const L = d.y * _ - d.x, F = -d.y - d.x * _; this.addHalfVertex(a, d.x + d.y * m, d.y - d.x * m, T, !1, m, S), this.addHalfVertex(a, L, F, T, !0, -_, S), this.distance > h4 / 2 && this.totalDistance === 0 && (this.distance = 0, this.addCurrentVertex(a, d, m, _, S, T)) } addHalfVertex({ x: a, y: d }, m, _, S, T, L, F) { const K = .5 * (this.lineClips ? this.scaledDistance * (h4 - 1) : this.scaledDistance); this.layoutVertexArray.emplaceBack((a << 1) + (S ? 1 : 0), (d << 1) + (T ? 1 : 0), Math.round(63 * m) + 128, Math.round(63 * _) + 128, 1 + (L === 0 ? 0 : L < 0 ? -1 : 1) | (63 & K) << 2, K >> 6), this.lineClips && this.layoutVertexArray2.emplaceBack((this.scaledDistance - this.lineClips.start) / (this.lineClips.end - this.lineClips.start), this.lineClipsArray.length); const Q = F.vertexLength++; this.e1 >= 0 && this.e2 >= 0 && (this.indexArray.emplaceBack(this.e1, this.e2, Q), F.primitiveLength++), T ? this.e2 = Q : this.e1 = Q } updateScaledDistance() { this.scaledDistance = this.lineClips ? this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance : this.distance } updateDistance(a, d) { this.distance += a.dist(d), this.updateScaledDistance() } } mn("LineBucket", f_, { omit: ["layers", "patternFeatures"] }); const XF = new Pi({ "line-cap": new xn(Fe.layout_line["line-cap"]), "line-join": new In(Fe.layout_line["line-join"]), "line-miter-limit": new xn(Fe.layout_line["line-miter-limit"]), "line-round-limit": new xn(Fe.layout_line["line-round-limit"]), "line-sort-key": new In(Fe.layout_line["line-sort-key"]) }); var p4 = { paint: new Pi({ "line-opacity": new In(Fe.paint_line["line-opacity"]), "line-color": new In(Fe.paint_line["line-color"]), "line-translate": new xn(Fe.paint_line["line-translate"]), "line-translate-anchor": new xn(Fe.paint_line["line-translate-anchor"]), "line-width": new In(Fe.paint_line["line-width"]), "line-gap-width": new In(Fe.paint_line["line-gap-width"]), "line-offset": new In(Fe.paint_line["line-offset"]), "line-blur": new In(Fe.paint_line["line-blur"]), "line-dasharray": new uh(Fe.paint_line["line-dasharray"]), "line-pattern": new Pl(Fe.paint_line["line-pattern"]), "line-gradient": new es(Fe.paint_line["line-gradient"]) }), layout: XF }; const m4 = new class extends In { possiblyEvaluate(u, a) { return a = new Or(Math.floor(a.zoom), { now: a.now, fadeDuration: a.fadeDuration, zoomHistory: a.zoomHistory, transition: a.transition }), super.possiblyEvaluate(u, a) } evaluate(u, a, d, m) { return a = k({}, a, { zoom: Math.floor(a.zoom) }), super.evaluate(u, a, d, m) } }(p4.paint.properties["line-width"].specification); function v4(u, a) { return a > 0 ? a + 2 * u : u } m4.useIntegerZoom = !0; const YF = ni([{ name: "a_pos_offset", components: 4, type: "Int16" }, { name: "a_data", components: 4, type: "Uint16" }, { name: "a_pixeloffset", components: 4, type: "Int16" }], 4), QF = ni([{ name: "a_projected_pos", components: 3, type: "Float32" }], 4); ni([{ name: "a_fade_opacity", components: 1, type: "Uint32" }], 4); const JF = ni([{ name: "a_placed", components: 2, type: "Uint8" }, { name: "a_shift", components: 2, type: "Float32" }]); ni([{ type: "Int16", name: "anchorPointX" }, { type: "Int16", name: "anchorPointY" }, { type: "Int16", name: "x1" }, { type: "Int16", name: "y1" }, { type: "Int16", name: "x2" }, { type: "Int16", name: "y2" }, { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" }]); const g4 = ni([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_anchor_pos", components: 2, type: "Int16" }, { name: "a_extrude", components: 2, type: "Int16" }], 4), e$ = ni([{ name: "a_pos", components: 2, type: "Float32" }, { name: "a_radius", components: 1, type: "Float32" }, { name: "a_flags", components: 2, type: "Int16" }], 4); function t$(u, a, d) { return u.sections.forEach(m => { m.text = function (_, S, T) { const L = S.layout.get("text-transform").evaluate(T, {}); return L === "uppercase" ? _ = _.toLocaleUpperCase() : L === "lowercase" && (_ = _.toLocaleLowerCase()), ko.applyArabicShaping && (_ = ko.applyArabicShaping(_)), _ }(m.text, a, d) }), u } ni([{ name: "triangle", components: 3, type: "Uint16" }]), ni([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Uint16", name: "glyphStartIndex" }, { type: "Uint16", name: "numGlyphs" }, { type: "Uint32", name: "vertexStartIndex" }, { type: "Uint32", name: "lineStartIndex" }, { type: "Uint32", name: "lineLength" }, { type: "Uint16", name: "segment" }, { type: "Uint16", name: "lowerSize" }, { type: "Uint16", name: "upperSize" }, { type: "Float32", name: "lineOffsetX" }, { type: "Float32", name: "lineOffsetY" }, { type: "Uint8", name: "writingMode" }, { type: "Uint8", name: "placedOrientation" }, { type: "Uint8", name: "hidden" }, { type: "Uint32", name: "crossTileID" }, { type: "Int16", name: "associatedIconIndex" }]), ni([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Int16", name: "rightJustifiedTextSymbolIndex" }, { type: "Int16", name: "centerJustifiedTextSymbolIndex" }, { type: "Int16", name: "leftJustifiedTextSymbolIndex" }, { type: "Int16", name: "verticalPlacedTextSymbolIndex" }, { type: "Int16", name: "placedIconSymbolIndex" }, { type: "Int16", name: "verticalPlacedIconSymbolIndex" }, { type: "Uint16", name: "key" }, { type: "Uint16", name: "textBoxStartIndex" }, { type: "Uint16", name: "textBoxEndIndex" }, { type: "Uint16", name: "verticalTextBoxStartIndex" }, { type: "Uint16", name: "verticalTextBoxEndIndex" }, { type: "Uint16", name: "iconBoxStartIndex" }, { type: "Uint16", name: "iconBoxEndIndex" }, { type: "Uint16", name: "verticalIconBoxStartIndex" }, { type: "Uint16", name: "verticalIconBoxEndIndex" }, { type: "Uint16", name: "featureIndex" }, { type: "Uint16", name: "numHorizontalGlyphVertices" }, { type: "Uint16", name: "numVerticalGlyphVertices" }, { type: "Uint16", name: "numIconVertices" }, { type: "Uint16", name: "numVerticalIconVertices" }, { type: "Uint16", name: "useRuntimeCollisionCircles" }, { type: "Uint32", name: "crossTileID" }, { type: "Float32", name: "textBoxScale" }, { type: "Float32", components: 2, name: "textOffset" }, { type: "Float32", name: "collisionCircleDiameter" }]), ni([{ type: "Float32", name: "offsetX" }]), ni([{ type: "Int16", name: "x" }, { type: "Int16", name: "y" }, { type: "Int16", name: "tileUnitDistanceFromAnchor" }]); const Ch = { "!": "\uFE15", "#": "\uFF03", $: "\uFF04", "%": "\uFF05", "&": "\uFF06", "(": "\uFE35", ")": "\uFE36", "*": "\uFF0A", "+": "\uFF0B", ",": "\uFE10", "-": "\uFE32", ".": "\u30FB", "/": "\uFF0F", ":": "\uFE13", ";": "\uFE14", "<": "\uFE3F", "=": "\uFF1D", ">": "\uFE40", "?": "\uFE16", "@": "\uFF20", "[": "\uFE47", "\\": "\uFF3C", "]": "\uFE48", "^": "\uFF3E", _: "\uFE33", "`": "\uFF40", "{": "\uFE37", "|": "\u2015", "}": "\uFE38", "~": "\uFF5E", "\xA2": "\uFFE0", "\xA3": "\uFFE1", "\xA5": "\uFFE5", "\xA6": "\uFFE4", "\xAC": "\uFFE2", "\xAF": "\uFFE3", "\u2013": "\uFE32", "\u2014": "\uFE31", "\u2018": "\uFE43", "\u2019": "\uFE44", "\u201C": "\uFE41", "\u201D": "\uFE42", "\u2026": "\uFE19", "\u2027": "\u30FB", "\u20A9": "\uFFE6", "\u3001": "\uFE11", "\u3002": "\uFE12", "\u3008": "\uFE3F", "\u3009": "\uFE40", "\u300A": "\uFE3D", "\u300B": "\uFE3E", "\u300C": "\uFE41", "\u300D": "\uFE42", "\u300E": "\uFE43", "\u300F": "\uFE44", "\u3010": "\uFE3B", "\u3011": "\uFE3C", "\u3014": "\uFE39", "\u3015": "\uFE3A", "\u3016": "\uFE17", "\u3017": "\uFE18", "\uFF01": "\uFE15", "\uFF08": "\uFE35", "\uFF09": "\uFE36", "\uFF0C": "\uFE10", "\uFF0D": "\uFE32", "\uFF0E": "\u30FB", "\uFF1A": "\uFE13", "\uFF1B": "\uFE14", "\uFF1C": "\uFE3F", "\uFF1E": "\uFE40", "\uFF1F": "\uFE16", "\uFF3B": "\uFE47", "\uFF3D": "\uFE48", "\uFF3F": "\uFE33", "\uFF5B": "\uFE37", "\uFF5C": "\u2015", "\uFF5D": "\uFE38", "\uFF5F": "\uFE35", "\uFF60": "\uFE36", "\uFF61": "\uFE12", "\uFF62": "\uFE41", "\uFF63": "\uFE42" }; var Ti = 24, h_ = _r, y4 = function (u, a, d, m, _) { var S, T, L = 8 * _ - m - 1, F = (1 << L) - 1, K = F >> 1, Q = -7, ne = d ? _ - 1 : 0, ue = d ? -1 : 1, he = u[a + ne]; for (ne += ue, S = he & (1 << -Q) - 1, he >>= -Q, Q += L; Q > 0; S = 256 * S + u[a + ne], ne += ue, Q -= 8); for (T = S & (1 << -Q) - 1, S >>= -Q, Q += m; Q > 0; T = 256 * T + u[a + ne], ne += ue, Q -= 8); if (S === 0) S = 1 - K; else { if (S === F) return T ? NaN : 1 / 0 * (he ? -1 : 1); T += Math.pow(2, m), S -= K } return (he ? -1 : 1) * T * Math.pow(2, S - m) }, x4 = function (u, a, d, m, _, S) { var T, L, F, K = 8 * S - _ - 1, Q = (1 << K) - 1, ne = Q >> 1, ue = _ === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, he = m ? 0 : S - 1, pe = m ? 1 : -1, Ne = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0; for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (L = isNaN(a) ? 1 : 0, T = Q) : (T = Math.floor(Math.log(a) / Math.LN2), a * (F = Math.pow(2, -T)) < 1 && (T--, F *= 2), (a += T + ne >= 1 ? ue / F : ue * Math.pow(2, 1 - ne)) * F >= 2 && (T++, F /= 2), T + ne >= Q ? (L = 0, T = Q) : T + ne >= 1 ? (L = (a * F - 1) * Math.pow(2, _), T += ne) : (L = a * Math.pow(2, ne - 1) * Math.pow(2, _), T = 0)); _ >= 8; u[d + he] = 255 & L, he += pe, L /= 256, _ -= 8); for (T = T << _ | L, K += _; K > 0; u[d + he] = 255 & T, he += pe, T /= 256, K -= 8); u[d + he - pe] |= 128 * Ne }; function _r(u) { this.buf = ArrayBuffer.isView && ArrayBuffer.isView(u) ? u : new Uint8Array(u || 0), this.pos = 0, this.type = 0, this.length = this.buf.length } _r.Varint = 0, _r.Fixed64 = 1, _r.Bytes = 2, _r.Fixed32 = 5; var Rl, p_ = 4294967296, _4 = 1 / p_, b4 = typeof TextDecoder > "u" ? null : new TextDecoder("utf8"); function Os(u) { return u.type === _r.Bytes ? u.readVarint() + u.pos : u.pos + 1 } function ld(u, a, d) { return d ? 4294967296 * a + (u >>> 0) : 4294967296 * (a >>> 0) + (u >>> 0) } function w4(u, a, d) { var m = a <= 16383 ? 1 : a <= 2097151 ? 2 : a <= 268435455 ? 3 : Math.floor(Math.log(a) / (7 * Math.LN2)); d.realloc(m); for (var _ = d.pos - 1; _ >= u; _--)d.buf[_ + m] = d.buf[_] } function n$(u, a) { for (var d = 0; d < u.length; d++)a.writeVarint(u[d]) } function r$(u, a) { for (var d = 0; d < u.length; d++)a.writeSVarint(u[d]) } function i$(u, a) { for (var d = 0; d < u.length; d++)a.writeFloat(u[d]) } function o$(u, a) { for (var d = 0; d < u.length; d++)a.writeDouble(u[d]) } function a$(u, a) { for (var d = 0; d < u.length; d++)a.writeBoolean(u[d]) } function s$(u, a) { for (var d = 0; d < u.length; d++)a.writeFixed32(u[d]) } function l$(u, a) { for (var d = 0; d < u.length; d++)a.writeSFixed32(u[d]) } function u$(u, a) { for (var d = 0; d < u.length; d++)a.writeFixed64(u[d]) } function c$(u, a) { for (var d = 0; d < u.length; d++)a.writeSFixed64(u[d]) } function Ev(u, a) { return (u[a] | u[a + 1] << 8 | u[a + 2] << 16) + 16777216 * u[a + 3] } function ud(u, a, d) { u[d] = a, u[d + 1] = a >>> 8, u[d + 2] = a >>> 16, u[d + 3] = a >>> 24 } function C4(u, a) { return (u[a] | u[a + 1] << 8 | u[a + 2] << 16) + (u[a + 3] << 24) } function d$(u, a, d) { u === 1 && d.readMessage(f$, a) } function f$(u, a, d) { if (u === 3) { const { id: m, bitmap: _, width: S, height: T, left: L, top: F, advance: K } = d.readMessage(h$, {}); a.push({ id: m, bitmap: new vh({ width: S + 6, height: T + 6 }, _), metrics: { width: S, height: T, left: L, top: F, advance: K } }) } } function h$(u, a, d) { u === 1 ? a.id = d.readVarint() : u === 2 ? a.bitmap = d.readBytes() : u === 3 ? a.width = d.readVarint() : u === 4 ? a.height = d.readVarint() : u === 5 ? a.left = d.readSVarint() : u === 6 ? a.top = d.readSVarint() : u === 7 && (a.advance = d.readVarint()) } function S4(u) { let a = 0, d = 0; for (const T of u) a += T.w * T.h, d = Math.max(d, T.w); u.sort((T, L) => L.h - T.h); const m = [{ x: 0, y: 0, w: Math.max(Math.ceil(Math.sqrt(a / .95)), d), h: 1 / 0 }]; let _ = 0, S = 0; for (const T of u) for (let L = m.length - 1; L >= 0; L--) { const F = m[L]; if (!(T.w > F.w || T.h > F.h)) { if (T.x = F.x, T.y = F.y, S = Math.max(S, T.y + T.h), _ = Math.max(_, T.x + T.w), T.w === F.w && T.h === F.h) { const K = m.pop(); L < m.length && (m[L] = K) } else T.h === F.h ? (F.x += T.w, F.w -= T.w) : T.w === F.w ? (F.y += T.h, F.h -= T.h) : (m.push({ x: F.x + T.w, y: F.y, w: F.w - T.w, h: T.h }), F.y += T.h, F.h -= T.h); break } } return { w: _, h: S, fill: a / (_ * S) || 0 } } _r.prototype = { destroy: function () { this.buf = null }, readFields: function (u, a, d) { for (d = d || this.length; this.pos < d;) { var m = this.readVarint(), _ = m >> 3, S = this.pos; this.type = 7 & m, u(_, a, this), this.pos === S && this.skip(m) } return a }, readMessage: function (u, a) { return this.readFields(u, a, this.readVarint() + this.pos) }, readFixed32: function () { var u = Ev(this.buf, this.pos); return this.pos += 4, u }, readSFixed32: function () { var u = C4(this.buf, this.pos); return this.pos += 4, u }, readFixed64: function () { var u = Ev(this.buf, this.pos) + Ev(this.buf, this.pos + 4) * p_; return this.pos += 8, u }, readSFixed64: function () { var u = Ev(this.buf, this.pos) + C4(this.buf, this.pos + 4) * p_; return this.pos += 8, u }, readFloat: function () { var u = y4(this.buf, this.pos, !0, 23, 4); return this.pos += 4, u }, readDouble: function () { var u = y4(this.buf, this.pos, !0, 52, 8); return this.pos += 8, u }, readVarint: function (u) { var a, d, m = this.buf; return a = 127 & (d = m[this.pos++]), d < 128 ? a : (a |= (127 & (d = m[this.pos++])) << 7, d < 128 ? a : (a |= (127 & (d = m[this.pos++])) << 14, d < 128 ? a : (a |= (127 & (d = m[this.pos++])) << 21, d < 128 ? a : function (_, S, T) { var L, F, K = T.buf; if (L = (112 & (F = K[T.pos++])) >> 4, F < 128 || (L |= (127 & (F = K[T.pos++])) << 3, F < 128) || (L |= (127 & (F = K[T.pos++])) << 10, F < 128) || (L |= (127 & (F = K[T.pos++])) << 17, F < 128) || (L |= (127 & (F = K[T.pos++])) << 24, F < 128) || (L |= (1 & (F = K[T.pos++])) << 31, F < 128)) return ld(_, L, S); throw new Error("Expected varint not more than 10 bytes") }(a |= (15 & (d = m[this.pos])) << 28, u, this)))) }, readVarint64: function () { return this.readVarint(!0) }, readSVarint: function () { var u = this.readVarint(); return u % 2 == 1 ? (u + 1) / -2 : u / 2 }, readBoolean: function () { return Boolean(this.readVarint()) }, readString: function () { var u = this.readVarint() + this.pos, a = this.pos; return this.pos = u, u - a >= 12 && b4 ? function (d, m, _) { return b4.decode(d.subarray(m, _)) }(this.buf, a, u) : function (d, m, _) { for (var S = "", T = m; T < _;) { var L, F, K, Q = d[T], ne = null, ue = Q > 239 ? 4 : Q > 223 ? 3 : Q > 191 ? 2 : 1; if (T + ue > _) break; ue === 1 ? Q < 128 && (ne = Q) : ue === 2 ? (192 & (L = d[T + 1])) == 128 && (ne = (31 & Q) << 6 | 63 & L) <= 127 && (ne = null) : ue === 3 ? (F = d[T + 2], (192 & (L = d[T + 1])) == 128 && (192 & F) == 128 && ((ne = (15 & Q) << 12 | (63 & L) << 6 | 63 & F) <= 2047 || ne >= 55296 && ne <= 57343) && (ne = null)) : ue === 4 && (F = d[T + 2], K = d[T + 3], (192 & (L = d[T + 1])) == 128 && (192 & F) == 128 && (192 & K) == 128 && ((ne = (15 & Q) << 18 | (63 & L) << 12 | (63 & F) << 6 | 63 & K) <= 65535 || ne >= 1114112) && (ne = null)), ne === null ? (ne = 65533, ue = 1) : ne > 65535 && (ne -= 65536, S += String.fromCharCode(ne >>> 10 & 1023 | 55296), ne = 56320 | 1023 & ne), S += String.fromCharCode(ne), T += ue } return S }(this.buf, a, u) }, readBytes: function () { var u = this.readVarint() + this.pos, a = this.buf.subarray(this.pos, u); return this.pos = u, a }, readPackedVarint: function (u, a) { if (this.type !== _r.Bytes) return u.push(this.readVarint(a)); var d = Os(this); for (u = u || []; this.pos < d;)u.push(this.readVarint(a)); return u }, readPackedSVarint: function (u) { if (this.type !== _r.Bytes) return u.push(this.readSVarint()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readSVarint()); return u }, readPackedBoolean: function (u) { if (this.type !== _r.Bytes) return u.push(this.readBoolean()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readBoolean()); return u }, readPackedFloat: function (u) { if (this.type !== _r.Bytes) return u.push(this.readFloat()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readFloat()); return u }, readPackedDouble: function (u) { if (this.type !== _r.Bytes) return u.push(this.readDouble()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readDouble()); return u }, readPackedFixed32: function (u) { if (this.type !== _r.Bytes) return u.push(this.readFixed32()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readFixed32()); return u }, readPackedSFixed32: function (u) { if (this.type !== _r.Bytes) return u.push(this.readSFixed32()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readSFixed32()); return u }, readPackedFixed64: function (u) { if (this.type !== _r.Bytes) return u.push(this.readFixed64()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readFixed64()); return u }, readPackedSFixed64: function (u) { if (this.type !== _r.Bytes) return u.push(this.readSFixed64()); var a = Os(this); for (u = u || []; this.pos < a;)u.push(this.readSFixed64()); return u }, skip: function (u) { var a = 7 & u; if (a === _r.Varint) for (; this.buf[this.pos++] > 127;); else if (a === _r.Bytes) this.pos = this.readVarint() + this.pos; else if (a === _r.Fixed32) this.pos += 4; else { if (a !== _r.Fixed64) throw new Error("Unimplemented type: " + a); this.pos += 8 } }, writeTag: function (u, a) { this.writeVarint(u << 3 | a) }, realloc: function (u) { for (var a = this.length || 16; a < this.pos + u;)a *= 2; if (a !== this.length) { var d = new Uint8Array(a); d.set(this.buf), this.buf = d, this.length = a } }, finish: function () { return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length) }, writeFixed32: function (u) { this.realloc(4), ud(this.buf, u, this.pos), this.pos += 4 }, writeSFixed32: function (u) { this.realloc(4), ud(this.buf, u, this.pos), this.pos += 4 }, writeFixed64: function (u) { this.realloc(8), ud(this.buf, -1 & u, this.pos), ud(this.buf, Math.floor(u * _4), this.pos + 4), this.pos += 8 }, writeSFixed64: function (u) { this.realloc(8), ud(this.buf, -1 & u, this.pos), ud(this.buf, Math.floor(u * _4), this.pos + 4), this.pos += 8 }, writeVarint: function (u) { (u = +u || 0) > 268435455 || u < 0 ? function (a, d) { var m, _; if (a >= 0 ? (m = a % 4294967296 | 0, _ = a / 4294967296 | 0) : (_ = ~(-a / 4294967296), 4294967295 ^ (m = ~(-a % 4294967296)) ? m = m + 1 | 0 : (m = 0, _ = _ + 1 | 0)), a >= 18446744073709552e3 || a < -18446744073709552e3) throw new Error("Given varint doesn't fit into 10 bytes"); d.realloc(10), function (S, T, L) { L.buf[L.pos++] = 127 & S | 128, S >>>= 7, L.buf[L.pos++] = 127 & S | 128, S >>>= 7, L.buf[L.pos++] = 127 & S | 128, S >>>= 7, L.buf[L.pos++] = 127 & S | 128, L.buf[L.pos] = 127 & (S >>>= 7) }(m, 0, d), function (S, T) { var L = (7 & S) << 4; T.buf[T.pos++] |= L | ((S >>>= 3) ? 128 : 0), S && (T.buf[T.pos++] = 127 & S | ((S >>>= 7) ? 128 : 0), S && (T.buf[T.pos++] = 127 & S | ((S >>>= 7) ? 128 : 0), S && (T.buf[T.pos++] = 127 & S | ((S >>>= 7) ? 128 : 0), S && (T.buf[T.pos++] = 127 & S | ((S >>>= 7) ? 128 : 0), S && (T.buf[T.pos++] = 127 & S))))) }(_, d) }(u, this) : (this.realloc(4), this.buf[this.pos++] = 127 & u | (u > 127 ? 128 : 0), u <= 127 || (this.buf[this.pos++] = 127 & (u >>>= 7) | (u > 127 ? 128 : 0), u <= 127 || (this.buf[this.pos++] = 127 & (u >>>= 7) | (u > 127 ? 128 : 0), u <= 127 || (this.buf[this.pos++] = u >>> 7 & 127)))) }, writeSVarint: function (u) { this.writeVarint(u < 0 ? 2 * -u - 1 : 2 * u) }, writeBoolean: function (u) { this.writeVarint(Boolean(u)) }, writeString: function (u) { u = String(u), this.realloc(4 * u.length), this.pos++; var a = this.pos; this.pos = function (m, _, S) { for (var T, L, F = 0; F < _.length; F++) { if ((T = _.charCodeAt(F)) > 55295 && T < 57344) { if (!L) { T > 56319 || F + 1 === _.length ? (m[S++] = 239, m[S++] = 191, m[S++] = 189) : L = T; continue } if (T < 56320) { m[S++] = 239, m[S++] = 191, m[S++] = 189, L = T; continue } T = L - 55296 << 10 | T - 56320 | 65536, L = null } else L && (m[S++] = 239, m[S++] = 191, m[S++] = 189, L = null); T < 128 ? m[S++] = T : (T < 2048 ? m[S++] = T >> 6 | 192 : (T < 65536 ? m[S++] = T >> 12 | 224 : (m[S++] = T >> 18 | 240, m[S++] = T >> 12 & 63 | 128), m[S++] = T >> 6 & 63 | 128), m[S++] = 63 & T | 128) } return S }(this.buf, u, this.pos); var d = this.pos - a; d >= 128 && w4(a, d, this), this.pos = a - 1, this.writeVarint(d), this.pos += d }, writeFloat: function (u) { this.realloc(4), x4(this.buf, u, this.pos, !0, 23, 4), this.pos += 4 }, writeDouble: function (u) { this.realloc(8), x4(this.buf, u, this.pos, !0, 52, 8), this.pos += 8 }, writeBytes: function (u) { var a = u.length; this.writeVarint(a), this.realloc(a); for (var d = 0; d < a; d++)this.buf[this.pos++] = u[d] }, writeRawMessage: function (u, a) { this.pos++; var d = this.pos; u(a, this); var m = this.pos - d; m >= 128 && w4(d, m, this), this.pos = d - 1, this.writeVarint(m), this.pos += m }, writeMessage: function (u, a, d) { this.writeTag(u, _r.Bytes), this.writeRawMessage(a, d) }, writePackedVarint: function (u, a) { a.length && this.writeMessage(u, n$, a) }, writePackedSVarint: function (u, a) { a.length && this.writeMessage(u, r$, a) }, writePackedBoolean: function (u, a) { a.length && this.writeMessage(u, a$, a) }, writePackedFloat: function (u, a) { a.length && this.writeMessage(u, i$, a) }, writePackedDouble: function (u, a) { a.length && this.writeMessage(u, o$, a) }, writePackedFixed32: function (u, a) { a.length && this.writeMessage(u, s$, a) }, writePackedSFixed32: function (u, a) { a.length && this.writeMessage(u, l$, a) }, writePackedFixed64: function (u, a) { a.length && this.writeMessage(u, u$, a) }, writePackedSFixed64: function (u, a) { a.length && this.writeMessage(u, c$, a) }, writeBytesField: function (u, a) { this.writeTag(u, _r.Bytes), this.writeBytes(a) }, writeFixed32Field: function (u, a) { this.writeTag(u, _r.Fixed32), this.writeFixed32(a) }, writeSFixed32Field: function (u, a) { this.writeTag(u, _r.Fixed32), this.writeSFixed32(a) }, writeFixed64Field: function (u, a) { this.writeTag(u, _r.Fixed64), this.writeFixed64(a) }, writeSFixed64Field: function (u, a) { this.writeTag(u, _r.Fixed64), this.writeSFixed64(a) }, writeVarintField: function (u, a) { this.writeTag(u, _r.Varint), this.writeVarint(a) }, writeSVarintField: function (u, a) { this.writeTag(u, _r.Varint), this.writeSVarint(a) }, writeStringField: function (u, a) { this.writeTag(u, _r.Bytes), this.writeString(a) }, writeFloatField: function (u, a) { this.writeTag(u, _r.Fixed32), this.writeFloat(a) }, writeDoubleField: function (u, a) { this.writeTag(u, _r.Fixed64), this.writeDouble(a) }, writeBooleanField: function (u, a) { this.writeVarintField(u, Boolean(a)) } }; class m_ { constructor(a, { pixelRatio: d, version: m, stretchX: _, stretchY: S, content: T }) { this.paddedRect = a, this.pixelRatio = d, this.stretchX = _, this.stretchY = S, this.content = T, this.version = m } get tl() { return [this.paddedRect.x + 1, this.paddedRect.y + 1] } get br() { return [this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1] } get tlbr() { return this.tl.concat(this.br) } get displaySize() { return [(this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio] } } class E4 { constructor(a, d) { const m = {}, _ = {}; this.haveRenderCallbacks = []; const S = []; this.addImages(a, m, S), this.addImages(d, _, S); const { w: T, h: L } = S4(S), F = new Uo({ width: T || 1, height: L || 1 }); for (const K in a) { const Q = a[K], ne = m[K].paddedRect; Uo.copy(Q.data, F, { x: 0, y: 0 }, { x: ne.x + 1, y: ne.y + 1 }, Q.data) } for (const K in d) { const Q = d[K], ne = _[K].paddedRect, ue = ne.x + 1, he = ne.y + 1, pe = Q.data.width, Ne = Q.data.height; Uo.copy(Q.data, F, { x: 0, y: 0 }, { x: ue, y: he }, Q.data), Uo.copy(Q.data, F, { x: 0, y: Ne - 1 }, { x: ue, y: he - 1 }, { width: pe, height: 1 }), Uo.copy(Q.data, F, { x: 0, y: 0 }, { x: ue, y: he + Ne }, { width: pe, height: 1 }), Uo.copy(Q.data, F, { x: pe - 1, y: 0 }, { x: ue - 1, y: he }, { width: 1, height: Ne }), Uo.copy(Q.data, F, { x: 0, y: 0 }, { x: ue + pe, y: he }, { width: 1, height: Ne }) } this.image = F, this.iconPositions = m, this.patternPositions = _ } addImages(a, d, m) { for (const _ in a) { const S = a[_], T = { x: 0, y: 0, w: S.data.width + 2, h: S.data.height + 2 }; m.push(T), d[_] = new m_(T, S), S.hasRenderCallback && this.haveRenderCallbacks.push(_) } } patchUpdatedImages(a, d) { a.dispatchRenderCallbacks(this.haveRenderCallbacks); for (const m in a.updatedImages) this.patchUpdatedImage(this.iconPositions[m], a.getImage(m), d), this.patchUpdatedImage(this.patternPositions[m], a.getImage(m), d) } patchUpdatedImage(a, d, m) { if (!a || !d || a.version === d.version) return; a.version = d.version; const [_, S] = a.tl; m.update(d.data, void 0, { x: _, y: S }) } } mn("ImagePosition", m_), mn("ImageAtlas", E4), o.WritingMode = void 0, (Rl = o.WritingMode || (o.WritingMode = {}))[Rl.none = 0] = "none", Rl[Rl.horizontal = 1] = "horizontal", Rl[Rl.vertical = 2] = "vertical", Rl[Rl.horizontalOnly = 3] = "horizontalOnly"; const Pv = -17; class Sh { constructor() { this.scale = 1, this.fontStack = "", this.imageName = null } static forText(a, d) { const m = new Sh; return m.scale = a || 1, m.fontStack = d, m } static forImage(a) { const d = new Sh; return d.imageName = a, d } } class cd { constructor() { this.text = "", this.sectionIndex = [], this.sections = [], this.imageSectionID = null } static fromFeature(a, d) { const m = new cd; for (let _ = 0; _ < a.sections.length; _++) { const S = a.sections[_]; S.image ? m.addImageSection(S) : m.addTextSection(S, d) } return m } length() { return this.text.length } getSection(a) { return this.sections[this.sectionIndex[a]] } getSectionIndex(a) { return this.sectionIndex[a] } getCharCode(a) { return this.text.charCodeAt(a) } verticalizePunctuation() { this.text = function (a) { let d = ""; for (let m = 0; m < a.length; m++) { const _ = a.charCodeAt(m + 1) || null, S = a.charCodeAt(m - 1) || null; d += _ && av(_) && !Ch[a[m + 1]] || S && av(S) && !Ch[a[m - 1]] || !Ch[a[m]] ? a[m] : Ch[a[m]] } return d }(this.text) } trim() { let a = 0; for (let m = 0; m < this.text.length && kv[this.text.charCodeAt(m)]; m++)a++; let d = this.text.length; for (let m = this.text.length - 1; m >= 0 && m >= a && kv[this.text.charCodeAt(m)]; m--)d--; this.text = this.text.substring(a, d), this.sectionIndex = this.sectionIndex.slice(a, d) } substring(a, d) { const m = new cd; return m.text = this.text.substring(a, d), m.sectionIndex = this.sectionIndex.slice(a, d), m.sections = this.sections, m } toString() { return this.text } getMaxScale() { return this.sectionIndex.reduce((a, d) => Math.max(a, this.sections[d].scale), 0) } addTextSection(a, d) { this.text += a.text, this.sections.push(Sh.forText(a.scale, a.fontStack || d)); const m = this.sections.length - 1; for (let _ = 0; _ < a.text.length; ++_)this.sectionIndex.push(m) } addImageSection(a) { const d = a.image ? a.image.name : ""; if (d.length === 0) return void B("Can't add FormattedSection with an empty image."); const m = this.getNextImageSectionCharCode(); m ? (this.text += String.fromCharCode(m), this.sections.push(Sh.forImage(d)), this.sectionIndex.push(this.sections.length - 1)) : B("Reached maximum number of images 6401") } getNextImageSectionCharCode() { return this.imageSectionID ? this.imageSectionID >= 63743 ? null : ++this.imageSectionID : (this.imageSectionID = 57344, this.imageSectionID) } } function Tv(u, a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne) { const Ae = cd.fromFeature(u, _); let Ye; ne === o.WritingMode.vertical && Ae.verticalizePunctuation(); const { processBidirectionalText: lt, processStyledBidirectionalText: Ke } = ko; if (lt && Ae.sections.length === 1) { Ye = []; const Tt = lt(Ae.toString(), v_(Ae, K, S, a, m, he, pe)); for (const hn of Tt) { const vn = new cd; vn.text = hn, vn.sections = Ae.sections; for (let on = 0; on < hn.length; on++)vn.sectionIndex.push(0); Ye.push(vn) } } else if (Ke) { Ye = []; const Tt = Ke(Ae.text, Ae.sectionIndex, v_(Ae, K, S, a, m, he, pe)); for (const hn of Tt) { const vn = new cd; vn.text = hn[0], vn.sectionIndex = hn[1], vn.sections = Ae.sections, Ye.push(vn) } } else Ye = function (Tt, hn) { const vn = [], on = Tt.text; let Qt = 0; for (const Gt of hn) vn.push(Tt.substring(Qt, Gt)), Qt = Gt; return Qt < on.length && vn.push(Tt.substring(Qt, on.length)), vn }(Ae, v_(Ae, K, S, a, m, he, pe)); const it = [], kt = { positionedLines: it, text: Ae.toString(), top: Q[1], bottom: Q[1], left: Q[0], right: Q[0], writingMode: ne, iconsInText: !1, verticalizable: !1 }; return function (Tt, hn, vn, on, Qt, Gt, an, tn, $t, Tn, _n, jn) { let kr = 0, Lr = Pv, hi = 0, Ko = 0; const Ni = tn === "right" ? 1 : tn === "left" ? 0 : .5; let ri = 0; for (const ii of Qt) { ii.trim(); const Di = ii.getMaxScale(), ji = (Di - 1) * Ti, eo = { positionedGlyphs: [], lineOffset: 0 }; Tt.positionedLines[ri] = eo; const ho = eo.positionedGlyphs; let po = 0; if (!ii.length()) { Lr += Gt, ++ri; continue } for (let bi = 0; bi < ii.length(); bi++) { const qn = ii.getSection(bi), Mo = ii.getSectionIndex(bi), Li = ii.getCharCode(bi); let Ki = 0, ua = null, Aa = null, Na = null, Ls = Ti; const ca = !($t === o.WritingMode.horizontal || !_n && !rh(Li) || _n && (kv[Li] || (_i = Li, rn.Arabic(_i) || rn["Arabic Supplement"](_i) || rn["Arabic Extended-A"](_i) || rn["Arabic Presentation Forms-A"](_i) || rn["Arabic Presentation Forms-B"](_i)))); if (qn.imageName) { const Ho = on[qn.imageName]; if (!Ho) continue; Na = qn.imageName, Tt.iconsInText = Tt.iconsInText || !0, Aa = Ho.paddedRect; const mo = Ho.displaySize; qn.scale = qn.scale * Ti / jn, ua = { width: mo[0], height: mo[1], left: 1, top: -3, advance: ca ? mo[1] : mo[0] }, Ki = ji + (Ti - mo[1] * qn.scale), Ls = ua.advance; const zs = ca ? mo[0] * qn.scale - Ti * Di : mo[1] * qn.scale - Ti * Di; zs > 0 && zs > po && (po = zs) } else { const Ho = vn[qn.fontStack], mo = Ho && Ho[Li]; if (mo && mo.rect) Aa = mo.rect, ua = mo.metrics; else { const zs = hn[qn.fontStack], Th = zs && zs[Li]; if (!Th) continue; ua = Th.metrics } Ki = (Di - qn.scale) * Ti } ca ? (Tt.verticalizable = !0, ho.push({ glyph: Li, imageName: Na, x: kr, y: Lr + Ki, vertical: ca, scale: qn.scale, fontStack: qn.fontStack, sectionIndex: Mo, metrics: ua, rect: Aa }), kr += Ls * qn.scale + Tn) : (ho.push({ glyph: Li, imageName: Na, x: kr, y: Lr + Ki, vertical: ca, scale: qn.scale, fontStack: qn.fontStack, sectionIndex: Mo, metrics: ua, rect: Aa }), kr += ua.advance * qn.scale + Tn) } ho.length !== 0 && (hi = Math.max(kr - Tn, hi), v$(ho, 0, ho.length - 1, Ni, po)), kr = 0; const Vr = Gt * Di + po; eo.lineOffset = Math.max(po, ji), Lr += Vr, Ko = Math.max(Vr, Ko), ++ri } var _i; const Oi = Lr - Pv, { horizontalAlign: Ui, verticalAlign: fo } = g_(an); (function (ii, Di, ji, eo, ho, po, Vr, bi, qn) { const Mo = (Di - ji) * ho; let Li = 0; Li = po !== Vr ? -bi * eo - Pv : (-eo * qn + .5) * Vr; for (const Ki of ii) for (const ua of Ki.positionedGlyphs) ua.x += Mo, ua.y += Li })(Tt.positionedLines, Ni, Ui, fo, hi, Ko, Gt, Oi, Qt.length), Tt.top += -fo * Oi, Tt.bottom = Tt.top + Oi, Tt.left += -Ui * hi, Tt.right = Tt.left + hi }(kt, a, d, m, Ye, T, L, F, ne, K, ue, Ne), !function (Tt) { for (const hn of Tt) if (hn.positionedGlyphs.length !== 0) return !1; return !0 }(it) && kt } const kv = { 9: !0, 10: !0, 11: !0, 12: !0, 13: !0, 32: !0 }, p$ = { 10: !0, 32: !0, 38: !0, 40: !0, 41: !0, 43: !0, 45: !0, 47: !0, 173: !0, 183: !0, 8203: !0, 8208: !0, 8211: !0, 8231: !0 }; function P4(u, a, d, m, _, S) { if (a.imageName) { const T = m[a.imageName]; return T ? T.displaySize[0] * a.scale * Ti / S + _ : 0 } { const T = d[a.fontStack], L = T && T[u]; return L ? L.metrics.advance * a.scale + _ : 0 } } function T4(u, a, d, m) { const _ = Math.pow(u - a, 2); return m ? u < a ? _ / 2 : 2 * _ : _ + Math.abs(d) * d } function m$(u, a, d) { let m = 0; return u === 10 && (m -= 1e4), d && (m += 150), u !== 40 && u !== 65288 || (m += 50), a !== 41 && a !== 65289 || (m += 50), m } function k4(u, a, d, m, _, S) { let T = null, L = T4(a, d, _, S); for (const F of m) { const K = T4(a - F.x, d, _, S) + F.badness; K <= L && (T = F, L = K) } return { index: u, x: a, priorBreak: T, badness: L } } function I4(u) { return u ? I4(u.priorBreak).concat(u.index) : [] } function v_(u, a, d, m, _, S, T) { if (S !== "point") return []; if (!u) return []; const L = [], F = function (ue, he, pe, Ne, Ae, Ye) { let lt = 0; for (let Ke = 0; Ke < ue.length(); Ke++) { const it = ue.getSection(Ke); lt += P4(ue.getCharCode(Ke), it, Ne, Ae, he, Ye) } return lt / Math.max(1, Math.ceil(lt / pe)) }(u, a, d, m, _, T), K = u.text.indexOf("\u200B") >= 0; let Q = 0; for (let ue = 0; ue < u.length(); ue++) { const he = u.getSection(ue), pe = u.getCharCode(ue); if (kv[pe] || (Q += P4(pe, he, m, _, a, T)), ue < u.length() - 1) { const Ne = !((ne = pe) < 11904 || !(rn["Bopomofo Extended"](ne) || rn.Bopomofo(ne) || rn["CJK Compatibility Forms"](ne) || rn["CJK Compatibility Ideographs"](ne) || rn["CJK Compatibility"](ne) || rn["CJK Radicals Supplement"](ne) || rn["CJK Strokes"](ne) || rn["CJK Symbols and Punctuation"](ne) || rn["CJK Unified Ideographs Extension A"](ne) || rn["CJK Unified Ideographs"](ne) || rn["Enclosed CJK Letters and Months"](ne) || rn["Halfwidth and Fullwidth Forms"](ne) || rn.Hiragana(ne) || rn["Ideographic Description Characters"](ne) || rn["Kangxi Radicals"](ne) || rn["Katakana Phonetic Extensions"](ne) || rn.Katakana(ne) || rn["Vertical Forms"](ne) || rn["Yi Radicals"](ne) || rn["Yi Syllables"](ne))); (p$[pe] || Ne || he.imageName) && L.push(k4(ue + 1, Q, F, L, m$(pe, u.getCharCode(ue + 1), Ne && K), !1)) } } var ne; return I4(k4(u.length(), Q, F, L, 0, !0)) } function g_(u) { let a = .5, d = .5; switch (u) { case "right": case "top-right": case "bottom-right": a = 1; break; case "left": case "top-left": case "bottom-left": a = 0 }switch (u) { case "bottom": case "bottom-right": case "bottom-left": d = 1; break; case "top": case "top-right": case "top-left": d = 0 }return { horizontalAlign: a, verticalAlign: d } } function v$(u, a, d, m, _) { if (!m && !_) return; const S = u[d], T = (u[d].x + S.metrics.advance * S.scale) * m; for (let L = a; L <= d; L++)u[L].x -= T, u[L].y += _ } function g$(u, a, d) { const { horizontalAlign: m, verticalAlign: _ } = g_(d), S = a[0] - u.displaySize[0] * m, T = a[1] - u.displaySize[1] * _; return { image: u, top: T, bottom: T + u.displaySize[1], left: S, right: S + u.displaySize[0] } } function R4(u, a, d, m, _, S) { const T = u.image; let L; if (T.content) { const Ae = T.content, Ye = T.pixelRatio || 1; L = [Ae[0] / Ye, Ae[1] / Ye, T.displaySize[0] - Ae[2] / Ye, T.displaySize[1] - Ae[3] / Ye] } const F = a.left * S, K = a.right * S; let Q, ne, ue, he; d === "width" || d === "both" ? (he = _[0] + F - m[3], ne = _[0] + K + m[1]) : (he = _[0] + (F + K - T.displaySize[0]) / 2, ne = he + T.displaySize[0]); const pe = a.top * S, Ne = a.bottom * S; return d === "height" || d === "both" ? (Q = _[1] + pe - m[0], ue = _[1] + Ne + m[2]) : (Q = _[1] + (pe + Ne - T.displaySize[1]) / 2, ue = Q + T.displaySize[1]), { image: T, top: Q, right: ne, bottom: ue, left: he, collisionPadding: L } } const Ds = 128; function M4(u, a) { const { expression: d } = a; if (d.kind === "constant") return { kind: "constant", layoutSize: d.evaluate(new Or(u + 1)) }; if (d.kind === "source") return { kind: "source" }; { const { zoomStops: m, interpolationType: _ } = d; let S = 0; for (; S < m.length && m[S] <= u;)S++; S = Math.max(0, S - 1); let T = S; for (; T < m.length && m[T] < u + 1;)T++; T = Math.min(m.length - 1, T); const L = m[S], F = m[T]; return d.kind === "composite" ? { kind: "composite", minZoom: L, maxZoom: F, interpolationType: _ } : { kind: "camera", minZoom: L, maxZoom: F, minSize: d.evaluate(new Or(L)), maxSize: d.evaluate(new Or(F)), interpolationType: _ } } } class Ml extends ie { constructor(a, d, m, _) { super(a, d), this.angle = m, _ !== void 0 && (this.segment = _) } clone() { return new Ml(this.x, this.y, this.angle, this.segment) } } function A4(u, a, d, m, _) { if (a.segment === void 0) return !0; let S = a, T = a.segment + 1, L = 0; for (; L > -d / 2;) { if (T--, T < 0) return !1; L -= u[T].dist(S), S = u[T] } L += u[T].dist(u[T + 1]), T++; const F = []; let K = 0; for (; L < d / 2;) { const Q = u[T], ne = u[T + 1]; if (!ne) return !1; let ue = u[T - 1].angleTo(Q) - Q.angleTo(ne); for (ue = Math.abs((ue + 3 * Math.PI) % (2 * Math.PI) - Math.PI), F.push({ distance: L, angleDelta: ue }), K += ue; L - F[0].distance > m;)K -= F.shift().angleDelta; if (K > _) return !1; T++, L += Q.dist(ne) } return !0 } function N4(u) { let a = 0; for (let d = 0; d < u.length - 1; d++)a += u[d].dist(u[d + 1]); return a } function O4(u, a, d) { return u ? .6 * a * d : 0 } function D4(u, a) { return Math.max(u ? u.right - u.left : 0, a ? a.right - a.left : 0) } function y$(u, a, d, m, _, S) { const T = O4(d, _, S), L = D4(d, m) * S; let F = 0; const K = N4(u) / 2; for (let Q = 0; Q < u.length - 1; Q++) { const ne = u[Q], ue = u[Q + 1], he = ne.dist(ue); if (F + he > K) { const pe = (K - F) / he, Ne = xr(ne.x, ue.x, pe), Ae = xr(ne.y, ue.y, pe), Ye = new Ml(Ne, Ae, ue.angleTo(ne), Q); return Ye._round(), !T || A4(u, Ye, L, T, a) ? Ye : void 0 } F += he } } function x$(u, a, d, m, _, S, T, L, F) { const K = O4(m, S, T), Q = D4(m, _), ne = Q * T, ue = u[0].x === 0 || u[0].x === F || u[0].y === 0 || u[0].y === F; return a - ne < a / 4 && (a = ne + a / 4), L4(u, ue ? a / 2 * L % a : (Q / 2 + 2 * S) * T * L % a, a, K, d, ne, ue, !1, F) } function L4(u, a, d, m, _, S, T, L, F) { const K = S / 2, Q = N4(u); let ne = 0, ue = a - d, he = []; for (let pe = 0; pe < u.length - 1; pe++) { const Ne = u[pe], Ae = u[pe + 1], Ye = Ne.dist(Ae), lt = Ae.angleTo(Ne); for (; ue + d < ne + Ye;) { ue += d; const Ke = (ue - ne) / Ye, it = xr(Ne.x, Ae.x, Ke), kt = xr(Ne.y, Ae.y, Ke); if (it >= 0 && it < F && kt >= 0 && kt < F && ue - K >= 0 && ue + K <= Q) { const Tt = new Ml(it, kt, lt, pe); Tt._round(), m && !A4(u, Tt, S, m, _) || he.push(Tt) } } ne += Ye } return L || he.length || T || (he = L4(u, ne / 2, d, m, _, S, T, !0, F)), he } function z4(u, a, d, m, _) { const S = []; for (let T = 0; T < u.length; T++) { const L = u[T]; let F; for (let K = 0; K < L.length - 1; K++) { let Q = L[K], ne = L[K + 1]; Q.x < a && ne.x < a || (Q.x < a ? Q = new ie(a, Q.y + (a - Q.x) / (ne.x - Q.x) * (ne.y - Q.y))._round() : ne.x < a && (ne = new ie(a, Q.y + (a - Q.x) / (ne.x - Q.x) * (ne.y - Q.y))._round()), Q.y < d && ne.y < d || (Q.y < d ? Q = new ie(Q.x + (d - Q.y) / (ne.y - Q.y) * (ne.x - Q.x), d)._round() : ne.y < d && (ne = new ie(Q.x + (d - Q.y) / (ne.y - Q.y) * (ne.x - Q.x), d)._round()), Q.x >= m && ne.x >= m || (Q.x >= m ? Q = new ie(m, Q.y + (m - Q.x) / (ne.x - Q.x) * (ne.y - Q.y))._round() : ne.x >= m && (ne = new ie(m, Q.y + (m - Q.x) / (ne.x - Q.x) * (ne.y - Q.y))._round()), Q.y >= _ && ne.y >= _ || (Q.y >= _ ? Q = new ie(Q.x + (_ - Q.y) / (ne.y - Q.y) * (ne.x - Q.x), _)._round() : ne.y >= _ && (ne = new ie(Q.x + (_ - Q.y) / (ne.y - Q.y) * (ne.x - Q.x), _)._round()), F && Q.equals(F[F.length - 1]) || (F = [Q], S.push(F)), F.push(ne))))) } } return S } function F4(u, a, d, m) { const _ = [], S = u.image, T = S.pixelRatio, L = S.paddedRect.w - 2, F = S.paddedRect.h - 2, K = u.right - u.left, Q = u.bottom - u.top, ne = S.stretchX || [[0, L]], ue = S.stretchY || [[0, F]], he = (Gt, an) => Gt + an[1] - an[0], pe = ne.reduce(he, 0), Ne = ue.reduce(he, 0), Ae = L - pe, Ye = F - Ne; let lt = 0, Ke = pe, it = 0, kt = Ne, Tt = 0, hn = Ae, vn = 0, on = Ye; if (S.content && m) { const Gt = S.content; lt = Iv(ne, 0, Gt[0]), it = Iv(ue, 0, Gt[1]), Ke = Iv(ne, Gt[0], Gt[2]), kt = Iv(ue, Gt[1], Gt[3]), Tt = Gt[0] - lt, vn = Gt[1] - it, hn = Gt[2] - Gt[0] - Ke, on = Gt[3] - Gt[1] - kt } const Qt = (Gt, an, tn, $t) => { const Tn = Rv(Gt.stretch - lt, Ke, K, u.left), _n = Mv(Gt.fixed - Tt, hn, Gt.stretch, pe), jn = Rv(an.stretch - it, kt, Q, u.top), kr = Mv(an.fixed - vn, on, an.stretch, Ne), Lr = Rv(tn.stretch - lt, Ke, K, u.left), hi = Mv(tn.fixed - Tt, hn, tn.stretch, pe), Ko = Rv($t.stretch - it, kt, Q, u.top), Ni = Mv($t.fixed - vn, on, $t.stretch, Ne), ri = new ie(Tn, jn), _i = new ie(Lr, jn), Oi = new ie(Lr, Ko), Ui = new ie(Tn, Ko), fo = new ie(_n / T, kr / T), ii = new ie(hi / T, Ni / T), Di = a * Math.PI / 180; if (Di) { const ho = Math.sin(Di), po = Math.cos(Di), Vr = [po, -ho, ho, po]; ri._matMult(Vr), _i._matMult(Vr), Ui._matMult(Vr), Oi._matMult(Vr) } const ji = Gt.stretch + Gt.fixed, eo = an.stretch + an.fixed; return { tl: ri, tr: _i, bl: Ui, br: Oi, tex: { x: S.paddedRect.x + 1 + ji, y: S.paddedRect.y + 1 + eo, w: tn.stretch + tn.fixed - ji, h: $t.stretch + $t.fixed - eo }, writingMode: void 0, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL: fo, pixelOffsetBR: ii, minFontScaleX: hn / T / K, minFontScaleY: on / T / Q, isSDF: d } }; if (m && (S.stretchX || S.stretchY)) { const Gt = $4(ne, Ae, pe), an = $4(ue, Ye, Ne); for (let tn = 0; tn < Gt.length - 1; tn++) { const $t = Gt[tn], Tn = Gt[tn + 1]; for (let _n = 0; _n < an.length - 1; _n++)_.push(Qt($t, an[_n], Tn, an[_n + 1])) } } else _.push(Qt({ fixed: 0, stretch: -1 }, { fixed: 0, stretch: -1 }, { fixed: 0, stretch: L + 1 }, { fixed: 0, stretch: F + 1 })); return _ } function Iv(u, a, d) { let m = 0; for (const _ of u) m += Math.max(a, Math.min(d, _[1])) - Math.max(a, Math.min(d, _[0])); return m } function $4(u, a, d) { const m = [{ fixed: -1, stretch: 0 }]; for (const [_, S] of u) { const T = m[m.length - 1]; m.push({ fixed: _ - T.stretch, stretch: T.stretch }), m.push({ fixed: _ - T.stretch, stretch: T.stretch + (S - _) }) } return m.push({ fixed: a + 1, stretch: d }), m } function Rv(u, a, d, m) { return u / a * d + m } function Mv(u, a, d, m) { return u - a * d / m } mn("Anchor", Ml); class Av { constructor(a, d, m, _, S, T, L, F, K, Q) { if (this.boxStartIndex = a.length, K) { let ne = T.top, ue = T.bottom; const he = T.collisionPadding; he && (ne -= he[1], ue += he[3]); let pe = ue - ne; pe > 0 && (pe = Math.max(10, pe), this.circleDiameter = pe) } else { let ne = T.top * L - F[0], ue = T.bottom * L + F[2], he = T.left * L - F[3], pe = T.right * L + F[1]; const Ne = T.collisionPadding; if (Ne && (he -= Ne[0] * L, ne -= Ne[1] * L, pe += Ne[2] * L, ue += Ne[3] * L), Q) { const Ae = new ie(he, ne), Ye = new ie(pe, ne), lt = new ie(he, ue), Ke = new ie(pe, ue), it = Q * Math.PI / 180; Ae._rotate(it), Ye._rotate(it), lt._rotate(it), Ke._rotate(it), he = Math.min(Ae.x, Ye.x, lt.x, Ke.x), pe = Math.max(Ae.x, Ye.x, lt.x, Ke.x), ne = Math.min(Ae.y, Ye.y, lt.y, Ke.y), ue = Math.max(Ae.y, Ye.y, lt.y, Ke.y) } a.emplaceBack(d.x, d.y, he, ne, pe, ue, m, _, S) } this.boxEndIndex = a.length } } class _$ { constructor(a = [], d = b$) { if (this.data = a, this.length = this.data.length, this.compare = d, this.length > 0) for (let m = (this.length >> 1) - 1; m >= 0; m--)this._down(m) } push(a) { this.data.push(a), this.length++, this._up(this.length - 1) } pop() { if (this.length === 0) return; const a = this.data[0], d = this.data.pop(); return this.length--, this.length > 0 && (this.data[0] = d, this._down(0)), a } peek() { return this.data[0] } _up(a) { const { data: d, compare: m } = this, _ = d[a]; for (; a > 0;) { const S = a - 1 >> 1, T = d[S]; if (m(_, T) >= 0) break; d[a] = T, a = S } d[a] = _ } _down(a) { const { data: d, compare: m } = this, _ = this.length >> 1, S = d[a]; for (; a < _;) { let T = 1 + (a << 1), L = d[T]; const F = T + 1; if (F < this.length && m(d[F], L) < 0 && (T = F, L = d[F]), m(L, S) >= 0) break; d[a] = L, a = T } d[a] = S } } function b$(u, a) { return u < a ? -1 : u > a ? 1 : 0 } function w$(u, a = 1, d = !1) { let m = 1 / 0, _ = 1 / 0, S = -1 / 0, T = -1 / 0; const L = u[0]; for (let he = 0; he < L.length; he++) { const pe = L[he]; (!he || pe.x < m) && (m = pe.x), (!he || pe.y < _) && (_ = pe.y), (!he || pe.x > S) && (S = pe.x), (!he || pe.y > T) && (T = pe.y) } const F = Math.min(S - m, T - _); let K = F / 2; const Q = new _$([], C$); if (F === 0) return new ie(m, _); for (let he = m; he < S; he += F)for (let pe = _; pe < T; pe += F)Q.push(new dd(he + K, pe + K, K, u)); let ne = function (he) { let pe = 0, Ne = 0, Ae = 0; const Ye = he[0]; for (let lt = 0, Ke = Ye.length, it = Ke - 1; lt < Ke; it = lt++) { const kt = Ye[lt], Tt = Ye[it], hn = kt.x * Tt.y - Tt.x * kt.y; Ne += (kt.x + Tt.x) * hn, Ae += (kt.y + Tt.y) * hn, pe += 3 * hn } return new dd(Ne / pe, Ae / pe, 0, he) }(u), ue = Q.length; for (; Q.length;) { const he = Q.pop(); (he.d > ne.d || !ne.d) && (ne = he, d && console.log("found best %d after %d probes", Math.round(1e4 * he.d) / 1e4, ue)), he.max - ne.d <= a || (K = he.h / 2, Q.push(new dd(he.p.x - K, he.p.y - K, K, u)), Q.push(new dd(he.p.x + K, he.p.y - K, K, u)), Q.push(new dd(he.p.x - K, he.p.y + K, K, u)), Q.push(new dd(he.p.x + K, he.p.y + K, K, u)), ue += 4) } return d && (console.log(`num probes: ${ue}`), console.log(`best distance: ${ne.d}`)), ne.p } function C$(u, a) { return a.max - u.max } function dd(u, a, d, m) { this.p = new ie(u, a), this.h = d, this.d = function (_, S) { let T = !1, L = 1 / 0; for (let F = 0; F < S.length; F++) { const K = S[F]; for (let Q = 0, ne = K.length, ue = ne - 1; Q < ne; ue = Q++) { const he = K[Q], pe = K[ue]; he.y > _.y != pe.y > _.y && _.x < (pe.x - he.x) * (_.y - he.y) / (pe.y - he.y) + he.x && (T = !T), L = Math.min(L, GE(_, he, pe)) } } return (T ? 1 : -1) * Math.sqrt(L) }(this.p, m), this.max = this.d + this.h * Math.SQRT2 } const y_ = Number.POSITIVE_INFINITY; function B4(u, a) { return a[1] !== y_ ? function (d, m, _) { let S = 0, T = 0; switch (m = Math.abs(m), _ = Math.abs(_), d) { case "top-right": case "top-left": case "top": T = _ - 7; break; case "bottom-right": case "bottom-left": case "bottom": T = 7 - _ }switch (d) { case "top-right": case "bottom-right": case "right": S = -m; break; case "top-left": case "bottom-left": case "left": S = m }return [S, T] }(u, a[0], a[1]) : function (d, m) { let _ = 0, S = 0; m < 0 && (m = 0); const T = m / Math.sqrt(2); switch (d) { case "top-right": case "top-left": S = T - 7; break; case "bottom-right": case "bottom-left": S = 7 - T; break; case "bottom": S = 7 - m; break; case "top": S = m - 7 }switch (d) { case "top-right": case "bottom-right": _ = -T; break; case "top-left": case "bottom-left": _ = T; break; case "left": _ = m; break; case "right": _ = -m }return [_, S] }(u, a[0]) } function x_(u) { switch (u) { case "right": case "top-right": case "bottom-right": return "right"; case "left": case "top-left": case "bottom-left": return "left" }return "center" } function S$(u, a, d, m, _, S, T, L, F, K, Q) { let ne = S.textMaxSize.evaluate(a, {}); ne === void 0 && (ne = T); const ue = u.layers[0].layout, he = ue.get("icon-offset").evaluate(a, {}, Q), pe = U4(d.horizontal), Ne = T / 24, Ae = u.tilePixelRatio * Ne, Ye = u.tilePixelRatio * ne / 24, lt = u.tilePixelRatio * L, Ke = u.tilePixelRatio * ue.get("symbol-spacing"), it = ue.get("text-padding") * u.tilePixelRatio, kt = function ($t, Tn, _n, jn = 1) { const kr = $t.get("icon-padding").evaluate(Tn, {}, _n), Lr = kr && kr.values; return [Lr[0] * jn, Lr[1] * jn, Lr[2] * jn, Lr[3] * jn] }(ue, a, Q, u.tilePixelRatio), Tt = ue.get("text-max-angle") / 180 * Math.PI, hn = ue.get("text-rotation-alignment") !== "viewport" && ue.get("symbol-placement") !== "point", vn = ue.get("icon-rotation-alignment") === "map" && ue.get("symbol-placement") !== "point", on = ue.get("symbol-placement"), Qt = Ke / 2, Gt = ue.get("icon-text-fit"); let an; m && Gt !== "none" && (u.allowVerticalPlacement && d.vertical && (an = R4(m, d.vertical, Gt, ue.get("icon-text-fit-padding"), he, Ne)), pe && (m = R4(m, pe, Gt, ue.get("icon-text-fit-padding"), he, Ne))); const tn = ($t, Tn) => { Tn.x < 0 || Tn.x >= fi || Tn.y < 0 || Tn.y >= fi || function (_n, jn, kr, Lr, hi, Ko, Ni, ri, _i, Oi, Ui, fo, ii, Di, ji, eo, ho, po, Vr, bi, qn, Mo, Li, Ki, ua) { const Aa = _n.addToLineVertexArray(jn, kr); let Na, Ls, ca, Ho, mo = 0, zs = 0, Th = 0, iP = 0, I_ = -1, R_ = -1; const Fs = {}; let oP = xi.exports(""), M_ = 0, A_ = 0; if (ri._unevaluatedLayout.getValue("text-radial-offset") === void 0 ? [M_, A_] = ri.layout.get("text-offset").evaluate(qn, {}, Ki).map(vo => vo * Ti) : (M_ = ri.layout.get("text-radial-offset").evaluate(qn, {}, Ki) * Ti, A_ = y_), _n.allowVerticalPlacement && Lr.vertical) { const vo = ri.layout.get("text-rotate").evaluate(qn, {}, Ki) + 90; ca = new Av(_i, jn, Oi, Ui, fo, Lr.vertical, ii, Di, ji, vo), Ni && (Ho = new Av(_i, jn, Oi, Ui, fo, Ni, ho, po, ji, vo)) } if (hi) { const vo = ri.layout.get("icon-rotate").evaluate(qn, {}), os = ri.layout.get("icon-text-fit") !== "none", kh = F4(hi, vo, Li, os), Ih = Ni ? F4(Ni, vo, Li, os) : void 0; Ls = new Av(_i, jn, Oi, Ui, fo, hi, ho, po, !1, vo), mo = 4 * kh.length; const lP = _n.iconSizeData; let Hu = null; lP.kind === "source" ? (Hu = [Ds * ri.layout.get("icon-size").evaluate(qn, {})], Hu[0] > Al && B(`${_n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)) : lP.kind === "composite" && (Hu = [Ds * Mo.compositeIconSizes[0].evaluate(qn, {}, Ki), Ds * Mo.compositeIconSizes[1].evaluate(qn, {}, Ki)], (Hu[0] > Al || Hu[1] > Al) && B(`${_n.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)), _n.addSymbols(_n.icon, kh, Hu, bi, Vr, qn, o.WritingMode.none, jn, Aa.lineStartIndex, Aa.lineLength, -1, Ki), I_ = _n.icon.placedSymbolArray.length - 1, Ih && (zs = 4 * Ih.length, _n.addSymbols(_n.icon, Ih, Hu, bi, Vr, qn, o.WritingMode.vertical, jn, Aa.lineStartIndex, Aa.lineLength, -1, Ki), R_ = _n.icon.placedSymbolArray.length - 1) } const aP = Object.keys(Lr.horizontal); for (const vo of aP) { const os = Lr.horizontal[vo]; if (!Na) { oP = xi.exports(os.text); const Ih = ri.layout.get("text-rotate").evaluate(qn, {}, Ki); Na = new Av(_i, jn, Oi, Ui, fo, os, ii, Di, ji, Ih) } const kh = os.positionedLines.length === 1; if (Th += V4(_n, jn, os, Ko, ri, ji, qn, eo, Aa, Lr.vertical ? o.WritingMode.horizontal : o.WritingMode.horizontalOnly, kh ? aP : [vo], Fs, I_, Mo, Ki), kh) break } Lr.vertical && (iP += V4(_n, jn, Lr.vertical, Ko, ri, ji, qn, eo, Aa, o.WritingMode.vertical, ["vertical"], Fs, R_, Mo, Ki)); const z$ = Na ? Na.boxStartIndex : _n.collisionBoxArray.length, F$ = Na ? Na.boxEndIndex : _n.collisionBoxArray.length, $$ = ca ? ca.boxStartIndex : _n.collisionBoxArray.length, B$ = ca ? ca.boxEndIndex : _n.collisionBoxArray.length, V$ = Ls ? Ls.boxStartIndex : _n.collisionBoxArray.length, U$ = Ls ? Ls.boxEndIndex : _n.collisionBoxArray.length, j$ = Ho ? Ho.boxStartIndex : _n.collisionBoxArray.length, K$ = Ho ? Ho.boxEndIndex : _n.collisionBoxArray.length; let Oa = -1; const zv = (vo, os) => vo && vo.circleDiameter ? Math.max(vo.circleDiameter, os) : os; Oa = zv(Na, Oa), Oa = zv(ca, Oa), Oa = zv(Ls, Oa), Oa = zv(Ho, Oa); const sP = Oa > -1 ? 1 : 0; sP && (Oa *= ua / Ti), _n.glyphOffsetArray.length >= fd.MAX_GLYPHS && B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"), qn.sortKey !== void 0 && _n.addToSortKeyRanges(_n.symbolInstances.length, qn.sortKey), _n.symbolInstances.emplaceBack(jn.x, jn.y, Fs.right >= 0 ? Fs.right : -1, Fs.center >= 0 ? Fs.center : -1, Fs.left >= 0 ? Fs.left : -1, Fs.vertical || -1, I_, R_, oP, z$, F$, $$, B$, V$, U$, j$, K$, Oi, Th, iP, mo, zs, sP, 0, ii, M_, A_, Oa) }(u, Tn, $t, d, m, _, an, u.layers[0], u.collisionBoxArray, a.index, a.sourceLayerIndex, u.index, Ae, [it, it, it, it], hn, F, lt, kt, vn, he, a, S, K, Q, T) }; if (on === "line") for (const $t of z4(a.geometry, 0, 0, fi, fi)) { const Tn = x$($t, Ke, Tt, d.vertical || pe, m, 24, Ye, u.overscaling, fi); for (const _n of Tn) { const jn = pe; jn && E$(u, jn.text, Qt, _n) || tn($t, _n) } } else if (on === "line-center") { for (const $t of a.geometry) if ($t.length > 1) { const Tn = y$($t, Tt, d.vertical || pe, m, 24, Ye); Tn && tn($t, Tn) } } else if (a.type === "Polygon") for (const $t of a_(a.geometry, 0)) { const Tn = w$($t, 16); tn($t[0], new Ml(Tn.x, Tn.y, 0)) } else if (a.type === "LineString") for (const $t of a.geometry) tn($t, new Ml($t[0].x, $t[0].y, 0)); else if (a.type === "Point") for (const $t of a.geometry) for (const Tn of $t) tn([Tn], new Ml(Tn.x, Tn.y, 0)) } const Al = 32640; function V4(u, a, d, m, _, S, T, L, F, K, Q, ne, ue, he, pe) { const Ne = function (lt, Ke, it, kt, Tt, hn, vn, on) { const Qt = kt.layout.get("text-rotate").evaluate(hn, {}) * Math.PI / 180, Gt = []; for (const an of Ke.positionedLines) for (const tn of an.positionedGlyphs) { if (!tn.rect) continue; const $t = tn.rect || {}; let Tn = 4, _n = !0, jn = 1, kr = 0; const Lr = (Tt || on) && tn.vertical, hi = tn.metrics.advance * tn.scale / 2; if (on && Ke.verticalizable) { const Vr = (tn.scale - 1) * Ti, bi = (Ti - tn.metrics.width * tn.scale) / 2; kr = an.lineOffset / 2 - (tn.imageName ? -bi : Vr) } if (tn.imageName) { const Vr = vn[tn.imageName]; _n = Vr.sdf, jn = Vr.pixelRatio, Tn = 1 / jn } const Ko = Tt ? [tn.x + hi, tn.y] : [0, 0]; let Ni = Tt ? [0, 0] : [tn.x + hi + it[0], tn.y + it[1] - kr], ri = [0, 0]; Lr && (ri = Ni, Ni = [0, 0]); const _i = (tn.metrics.left - Tn) * tn.scale - hi + Ni[0], Oi = (-tn.metrics.top - Tn) * tn.scale + Ni[1], Ui = _i + $t.w * tn.scale / jn, fo = Oi + $t.h * tn.scale / jn, ii = new ie(_i, Oi), Di = new ie(Ui, Oi), ji = new ie(_i, fo), eo = new ie(Ui, fo); if (Lr) { const Vr = new ie(-hi, hi - Pv), bi = -Math.PI / 2, qn = 12 - hi, Mo = new ie(22 - qn, -(tn.imageName ? qn : 0)), Li = new ie(...ri); ii._rotateAround(bi, Vr)._add(Mo)._add(Li), Di._rotateAround(bi, Vr)._add(Mo)._add(Li), ji._rotateAround(bi, Vr)._add(Mo)._add(Li), eo._rotateAround(bi, Vr)._add(Mo)._add(Li) } if (Qt) { const Vr = Math.sin(Qt), bi = Math.cos(Qt), qn = [bi, -Vr, Vr, bi]; ii._matMult(qn), Di._matMult(qn), ji._matMult(qn), eo._matMult(qn) } const ho = new ie(0, 0), po = new ie(0, 0); Gt.push({ tl: ii, tr: Di, bl: ji, br: eo, tex: $t, writingMode: Ke.writingMode, glyphOffset: Ko, sectionIndex: tn.sectionIndex, isSDF: _n, pixelOffsetTL: ho, pixelOffsetBR: po, minFontScaleX: 0, minFontScaleY: 0 }) } return Gt }(0, d, L, _, S, T, m, u.allowVerticalPlacement), Ae = u.textSizeData; let Ye = null; Ae.kind === "source" ? (Ye = [Ds * _.layout.get("text-size").evaluate(T, {})], Ye[0] > Al && B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)) : Ae.kind === "composite" && (Ye = [Ds * he.compositeTextSizes[0].evaluate(T, {}, pe), Ds * he.compositeTextSizes[1].evaluate(T, {}, pe)], (Ye[0] > Al || Ye[1] > Al) && B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)), u.addSymbols(u.text, Ne, Ye, L, S, T, K, a, F.lineStartIndex, F.lineLength, ue, pe); for (const lt of Q) ne[lt] = u.text.placedSymbolArray.length - 1; return 4 * Ne.length } function U4(u) { for (const a in u) return u[a]; return null } function E$(u, a, d, m) { const _ = u.compareText; if (a in _) { const S = _[a]; for (let T = S.length - 1; T >= 0; T--)if (m.dist(S[T]) < d) return !0 } else _[a] = []; return _[a].push(m), !1 } const P$ = Il.VectorTileFeature.types, T$ = [{ name: "a_fade_opacity", components: 1, type: "Uint8", offset: 0 }]; function Nv(u, a, d, m, _, S, T, L, F, K, Q, ne, ue) { const he = L ? Math.min(Al, Math.round(L[0])) : 0, pe = L ? Math.min(Al, Math.round(L[1])) : 0; u.emplaceBack(a, d, Math.round(32 * m), Math.round(32 * _), S, T, (he << 1) + (F ? 1 : 0), pe, 16 * K, 16 * Q, 256 * ne, 256 * ue) } function __(u, a, d) { u.emplaceBack(a.x, a.y, d), u.emplaceBack(a.x, a.y, d), u.emplaceBack(a.x, a.y, d), u.emplaceBack(a.x, a.y, d) } function k$(u) { for (const a of u.sections) if (lv(a.text)) return !0; return !1 } class b_ { constructor(a) { this.layoutVertexArray = new sa, this.indexArray = new Yi, this.programConfigurations = a, this.segments = new Wn, this.dynamicLayoutVertexArray = new Vo, this.opacityVertexArray = new la, this.placedSymbolArray = new Ft } isEmpty() { return this.layoutVertexArray.length === 0 && this.indexArray.length === 0 && this.dynamicLayoutVertexArray.length === 0 && this.opacityVertexArray.length === 0 } upload(a, d, m, _) { this.isEmpty() || (m && (this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, YF.members), this.indexBuffer = a.createIndexBuffer(this.indexArray, d), this.dynamicLayoutVertexBuffer = a.createVertexBuffer(this.dynamicLayoutVertexArray, QF.members, !0), this.opacityVertexBuffer = a.createVertexBuffer(this.opacityVertexArray, T$, !0), this.opacityVertexBuffer.itemSize = 1), (m || _) && this.programConfigurations.upload(a)) } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.dynamicLayoutVertexBuffer.destroy(), this.opacityVertexBuffer.destroy()) } } mn("SymbolBuffers", b_); class w_ { constructor(a, d, m) { this.layoutVertexArray = new a, this.layoutAttributes = d, this.indexArray = new m, this.segments = new Wn, this.collisionVertexArray = new Io } upload(a) { this.layoutVertexBuffer = a.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes), this.indexBuffer = a.createIndexBuffer(this.indexArray), this.collisionVertexBuffer = a.createVertexBuffer(this.collisionVertexArray, JF.members, !0) } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.segments.destroy(), this.collisionVertexBuffer.destroy()) } } mn("CollisionBuffers", w_); class fd { constructor(a) { this.collisionBoxArray = a.collisionBoxArray, this.zoom = a.zoom, this.overscaling = a.overscaling, this.layers = a.layers, this.layerIds = this.layers.map(T => T.id), this.index = a.index, this.pixelRatio = a.pixelRatio, this.sourceLayerIndex = a.sourceLayerIndex, this.hasPattern = !1, this.hasRTLText = !1, this.sortKeyRanges = [], this.collisionCircleArray = [], this.placementInvProjMatrix = e_([]), this.placementViewportMatrix = e_([]); const d = this.layers[0]._unevaluatedLayout._values; this.textSizeData = M4(this.zoom, d["text-size"]), this.iconSizeData = M4(this.zoom, d["icon-size"]); const m = this.layers[0].layout, _ = m.get("symbol-sort-key"), S = m.get("symbol-z-order"); this.canOverlap = S_(m, "text-overlap", "text-allow-overlap") !== "never" || S_(m, "icon-overlap", "icon-allow-overlap") !== "never" || m.get("text-ignore-placement") || m.get("icon-ignore-placement"), this.sortFeaturesByKey = S !== "viewport-y" && !_.isConstant(), this.sortFeaturesByY = (S === "viewport-y" || S === "auto" && !this.sortFeaturesByKey) && this.canOverlap, m.get("symbol-placement") === "point" && (this.writingModes = m.get("text-writing-mode").map(T => o.WritingMode[T])), this.stateDependentLayerIds = this.layers.filter(T => T.isStateDependent()).map(T => T.id), this.sourceID = a.sourceID } createArrays() { this.text = new b_(new Bu(this.layers, this.zoom, a => /^text/.test(a))), this.icon = new b_(new Bu(this.layers, this.zoom, a => /^icon/.test(a))), this.glyphOffsetArray = new Yt, this.lineVertexArray = new fn, this.symbolInstances = new sn } calculateGlyphDependencies(a, d, m, _, S) { for (let T = 0; T < a.length; T++)if (d[a.charCodeAt(T)] = !0, (m || _) && S) { const L = Ch[a.charAt(T)]; L && (d[L.charCodeAt(0)] = !0) } } populate(a, d, m) { const _ = this.layers[0], S = _.layout, T = S.get("text-font"), L = S.get("text-field"), F = S.get("icon-image"), K = (L.value.kind !== "constant" || L.value.value instanceof be && !L.value.value.isEmpty() || L.value.value.toString().length > 0) && (T.value.kind !== "constant" || T.value.value.length > 0), Q = F.value.kind !== "constant" || !!F.value.value || Object.keys(F.parameters).length > 0, ne = S.get("symbol-sort-key"); if (this.features = [], !K && !Q) return; const ue = d.iconDependencies, he = d.glyphDependencies, pe = d.availableImages, Ne = new Or(this.zoom); for (const { feature: Ae, id: Ye, index: lt, sourceLayerIndex: Ke } of a) { const it = _._featureFilter.needGeometry, kt = Uu(Ae, it); if (!_._featureFilter.filter(Ne, kt, m)) continue; let Tt, hn; if (it || (kt.geometry = Vu(Ae)), K) { const on = _.getValueAndResolveTokens("text-field", kt, m, pe), Qt = be.factory(on); k$(Qt) && (this.hasRTLText = !0), (!this.hasRTLText || zu() === "unavailable" || this.hasRTLText && ko.isParsed()) && (Tt = t$(Qt, _, kt)) } if (Q) { const on = _.getValueAndResolveTokens("icon-image", kt, m, pe); hn = on instanceof Le ? on : Le.fromString(on) } if (!Tt && !hn) continue; const vn = this.sortFeaturesByKey ? ne.evaluate(kt, {}, m) : void 0; if (this.features.push({ id: Ye, text: Tt, icon: hn, index: lt, sourceLayerIndex: Ke, geometry: kt.geometry, properties: Ae.properties, type: P$[Ae.type], sortKey: vn }), hn && (ue[hn.name] = !0), Tt) { const on = T.evaluate(kt, {}, m).join(","), Qt = S.get("text-rotation-alignment") !== "viewport" && S.get("symbol-placement") !== "point"; this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(o.WritingMode.vertical) >= 0; for (const Gt of Tt.sections) if (Gt.image) ue[Gt.image.name] = !0; else { const an = ed(Tt.toString()), tn = Gt.fontStack || on, $t = he[tn] = he[tn] || {}; this.calculateGlyphDependencies(Gt.text, $t, Qt, this.allowVerticalPlacement, an) } } } S.get("symbol-placement") === "line" && (this.features = function (Ae) { const Ye = {}, lt = {}, Ke = []; let it = 0; function kt(on) { Ke.push(Ae[on]), it++ } function Tt(on, Qt, Gt) { const an = lt[on]; return delete lt[on], lt[Qt] = an, Ke[an].geometry[0].pop(), Ke[an].geometry[0] = Ke[an].geometry[0].concat(Gt[0]), an } function hn(on, Qt, Gt) { const an = Ye[Qt]; return delete Ye[Qt], Ye[on] = an, Ke[an].geometry[0].shift(), Ke[an].geometry[0] = Gt[0].concat(Ke[an].geometry[0]), an } function vn(on, Qt, Gt) { const an = Gt ? Qt[0][Qt[0].length - 1] : Qt[0][0]; return `${on}:${an.x}:${an.y}` } for (let on = 0; on < Ae.length; on++) { const Qt = Ae[on], Gt = Qt.geometry, an = Qt.text ? Qt.text.toString() : null; if (!an) { kt(on); continue } const tn = vn(an, Gt), $t = vn(an, Gt, !0); if (tn in lt && $t in Ye && lt[tn] !== Ye[$t]) { const Tn = hn(tn, $t, Gt), _n = Tt(tn, $t, Ke[Tn].geometry); delete Ye[tn], delete lt[$t], lt[vn(an, Ke[_n].geometry, !0)] = _n, Ke[Tn].geometry = null } else tn in lt ? Tt(tn, $t, Gt) : $t in Ye ? hn(tn, $t, Gt) : (kt(on), Ye[tn] = it - 1, lt[$t] = it - 1) } return Ke.filter(on => on.geometry) }(this.features)), this.sortFeaturesByKey && this.features.sort((Ae, Ye) => Ae.sortKey - Ye.sortKey) } update(a, d, m) { this.stateDependentLayers.length && (this.text.programConfigurations.updatePaintArrays(a, d, this.layers, m), this.icon.programConfigurations.updatePaintArrays(a, d, this.layers, m)) } isEmpty() { return this.symbolInstances.length === 0 && !this.hasRTLText } uploadPending() { return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload } upload(a) { !this.uploaded && this.hasDebugData() && (this.textCollisionBox.upload(a), this.iconCollisionBox.upload(a)), this.text.upload(a, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload), this.icon.upload(a, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload), this.uploaded = !0 } destroyDebugData() { this.textCollisionBox.destroy(), this.iconCollisionBox.destroy() } destroy() { this.text.destroy(), this.icon.destroy(), this.hasDebugData() && this.destroyDebugData() } addToLineVertexArray(a, d) { const m = this.lineVertexArray.length; if (a.segment !== void 0) { let _ = a.dist(d[a.segment + 1]), S = a.dist(d[a.segment]); const T = {}; for (let L = a.segment + 1; L < d.length; L++)T[L] = { x: d[L].x, y: d[L].y, tileUnitDistanceFromAnchor: _ }, L < d.length - 1 && (_ += d[L + 1].dist(d[L])); for (let L = a.segment || 0; L >= 0; L--)T[L] = { x: d[L].x, y: d[L].y, tileUnitDistanceFromAnchor: S }, L > 0 && (S += d[L - 1].dist(d[L])); for (let L = 0; L < d.length; L++) { const F = T[L]; this.lineVertexArray.emplaceBack(F.x, F.y, F.tileUnitDistanceFromAnchor) } } return { lineStartIndex: m, lineLength: this.lineVertexArray.length - m } } addSymbols(a, d, m, _, S, T, L, F, K, Q, ne, ue) { const he = a.indexArray, pe = a.layoutVertexArray, Ne = a.segments.prepareSegment(4 * d.length, pe, he, this.canOverlap ? T.sortKey : void 0), Ae = this.glyphOffsetArray.length, Ye = Ne.vertexLength, lt = this.allowVerticalPlacement && L === o.WritingMode.vertical ? Math.PI / 2 : 0, Ke = T.text && T.text.sections; for (let it = 0; it < d.length; it++) { const { tl: kt, tr: Tt, bl: hn, br: vn, tex: on, pixelOffsetTL: Qt, pixelOffsetBR: Gt, minFontScaleX: an, minFontScaleY: tn, glyphOffset: $t, isSDF: Tn, sectionIndex: _n } = d[it], jn = Ne.vertexLength, kr = $t[1]; Nv(pe, F.x, F.y, kt.x, kr + kt.y, on.x, on.y, m, Tn, Qt.x, Qt.y, an, tn), Nv(pe, F.x, F.y, Tt.x, kr + Tt.y, on.x + on.w, on.y, m, Tn, Gt.x, Qt.y, an, tn), Nv(pe, F.x, F.y, hn.x, kr + hn.y, on.x, on.y + on.h, m, Tn, Qt.x, Gt.y, an, tn), Nv(pe, F.x, F.y, vn.x, kr + vn.y, on.x + on.w, on.y + on.h, m, Tn, Gt.x, Gt.y, an, tn), __(a.dynamicLayoutVertexArray, F, lt), he.emplaceBack(jn, jn + 1, jn + 2), he.emplaceBack(jn + 1, jn + 2, jn + 3), Ne.vertexLength += 4, Ne.primitiveLength += 2, this.glyphOffsetArray.emplaceBack($t[0]), it !== d.length - 1 && _n === d[it + 1].sectionIndex || a.programConfigurations.populatePaintArrays(pe.length, T, T.index, {}, ue, Ke && Ke[_n]) } a.placedSymbolArray.emplaceBack(F.x, F.y, Ae, this.glyphOffsetArray.length - Ae, Ye, K, Q, F.segment, m ? m[0] : 0, m ? m[1] : 0, _[0], _[1], L, 0, !1, 0, ne) } _addCollisionDebugVertex(a, d, m, _, S, T) { return d.emplaceBack(0, 0), a.emplaceBack(m.x, m.y, _, S, Math.round(T.x), Math.round(T.y)) } addCollisionDebugVertices(a, d, m, _, S, T, L) { const F = S.segments.prepareSegment(4, S.layoutVertexArray, S.indexArray), K = F.vertexLength, Q = S.layoutVertexArray, ne = S.collisionVertexArray, ue = L.anchorX, he = L.anchorY; this._addCollisionDebugVertex(Q, ne, T, ue, he, new ie(a, d)), this._addCollisionDebugVertex(Q, ne, T, ue, he, new ie(m, d)), this._addCollisionDebugVertex(Q, ne, T, ue, he, new ie(m, _)), this._addCollisionDebugVertex(Q, ne, T, ue, he, new ie(a, _)), F.vertexLength += 4; const pe = S.indexArray; pe.emplaceBack(K, K + 1), pe.emplaceBack(K + 1, K + 2), pe.emplaceBack(K + 2, K + 3), pe.emplaceBack(K + 3, K), F.primitiveLength += 4 } addDebugCollisionBoxes(a, d, m, _) { for (let S = a; S < d; S++) { const T = this.collisionBoxArray.get(S); this.addCollisionDebugVertices(T.x1, T.y1, T.x2, T.y2, _ ? this.textCollisionBox : this.iconCollisionBox, T.anchorPoint, m) } } generateCollisionDebugBuffers() { this.hasDebugData() && this.destroyDebugData(), this.textCollisionBox = new w_(rs, g4.members, Ra), this.iconCollisionBox = new w_(rs, g4.members, Ra); for (let a = 0; a < this.symbolInstances.length; a++) { const d = this.symbolInstances.get(a); this.addDebugCollisionBoxes(d.textBoxStartIndex, d.textBoxEndIndex, d, !0), this.addDebugCollisionBoxes(d.verticalTextBoxStartIndex, d.verticalTextBoxEndIndex, d, !0), this.addDebugCollisionBoxes(d.iconBoxStartIndex, d.iconBoxEndIndex, d, !1), this.addDebugCollisionBoxes(d.verticalIconBoxStartIndex, d.verticalIconBoxEndIndex, d, !1) } } _deserializeCollisionBoxesForSymbol(a, d, m, _, S, T, L, F, K) { const Q = {}; for (let ne = d; ne < m; ne++) { const ue = a.get(ne); Q.textBox = { x1: ue.x1, y1: ue.y1, x2: ue.x2, y2: ue.y2, anchorPointX: ue.anchorPointX, anchorPointY: ue.anchorPointY }, Q.textFeatureIndex = ue.featureIndex; break } for (let ne = _; ne < S; ne++) { const ue = a.get(ne); Q.verticalTextBox = { x1: ue.x1, y1: ue.y1, x2: ue.x2, y2: ue.y2, anchorPointX: ue.anchorPointX, anchorPointY: ue.anchorPointY }, Q.verticalTextFeatureIndex = ue.featureIndex; break } for (let ne = T; ne < L; ne++) { const ue = a.get(ne); Q.iconBox = { x1: ue.x1, y1: ue.y1, x2: ue.x2, y2: ue.y2, anchorPointX: ue.anchorPointX, anchorPointY: ue.anchorPointY }, Q.iconFeatureIndex = ue.featureIndex; break } for (let ne = F; ne < K; ne++) { const ue = a.get(ne); Q.verticalIconBox = { x1: ue.x1, y1: ue.y1, x2: ue.x2, y2: ue.y2, anchorPointX: ue.anchorPointX, anchorPointY: ue.anchorPointY }, Q.verticalIconFeatureIndex = ue.featureIndex; break } return Q } deserializeCollisionBoxes(a) { this.collisionArrays = []; for (let d = 0; d < this.symbolInstances.length; d++) { const m = this.symbolInstances.get(d); this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(a, m.textBoxStartIndex, m.textBoxEndIndex, m.verticalTextBoxStartIndex, m.verticalTextBoxEndIndex, m.iconBoxStartIndex, m.iconBoxEndIndex, m.verticalIconBoxStartIndex, m.verticalIconBoxEndIndex)) } } hasTextData() { return this.text.segments.get().length > 0 } hasIconData() { return this.icon.segments.get().length > 0 } hasDebugData() { return this.textCollisionBox && this.iconCollisionBox } hasTextCollisionBoxData() { return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0 } hasIconCollisionBoxData() { return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0 } addIndicesForPlacedSymbol(a, d) { const m = a.placedSymbolArray.get(d), _ = m.vertexStartIndex + 4 * m.numGlyphs; for (let S = m.vertexStartIndex; S < _; S += 4)a.indexArray.emplaceBack(S, S + 1, S + 2), a.indexArray.emplaceBack(S + 1, S + 2, S + 3) } getSortedSymbolIndexes(a) { if (this.sortedAngle === a && this.symbolInstanceIndexes !== void 0) return this.symbolInstanceIndexes; const d = Math.sin(a), m = Math.cos(a), _ = [], S = [], T = []; for (let L = 0; L < this.symbolInstances.length; ++L) { T.push(L); const F = this.symbolInstances.get(L); _.push(0 | Math.round(d * F.anchorX + m * F.anchorY)), S.push(F.featureIndex) } return T.sort((L, F) => _[L] - _[F] || S[F] - S[L]), T } addToSortKeyRanges(a, d) { const m = this.sortKeyRanges[this.sortKeyRanges.length - 1]; m && m.sortKey === d ? m.symbolInstanceEnd = a + 1 : this.sortKeyRanges.push({ sortKey: d, symbolInstanceStart: a, symbolInstanceEnd: a + 1 }) } sortFeatures(a) { if (this.sortFeaturesByY && this.sortedAngle !== a && !(this.text.segments.get().length > 1 || this.icon.segments.get().length > 1)) { this.symbolInstanceIndexes = this.getSortedSymbolIndexes(a), this.sortedAngle = a, this.text.indexArray.clear(), this.icon.indexArray.clear(), this.featureSortOrder = []; for (const d of this.symbolInstanceIndexes) { const m = this.symbolInstances.get(d); this.featureSortOrder.push(m.featureIndex), [m.rightJustifiedTextSymbolIndex, m.centerJustifiedTextSymbolIndex, m.leftJustifiedTextSymbolIndex].forEach((_, S, T) => { _ >= 0 && T.indexOf(_) === S && this.addIndicesForPlacedSymbol(this.text, _) }), m.verticalPlacedTextSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.text, m.verticalPlacedTextSymbolIndex), m.placedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, m.placedIconSymbolIndex), m.verticalPlacedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, m.verticalPlacedIconSymbolIndex) } this.text.indexBuffer && this.text.indexBuffer.updateData(this.text.indexArray), this.icon.indexBuffer && this.icon.indexBuffer.updateData(this.icon.indexArray) } } } mn("SymbolBucket", fd, { omit: ["layers", "collisionBoxArray", "features", "compareText"] }), fd.MAX_GLYPHS = 65535, fd.addDynamicAttributes = __; const I$ = new Pi({ "symbol-placement": new xn(Fe.layout_symbol["symbol-placement"]), "symbol-spacing": new xn(Fe.layout_symbol["symbol-spacing"]), "symbol-avoid-edges": new xn(Fe.layout_symbol["symbol-avoid-edges"]), "symbol-sort-key": new In(Fe.layout_symbol["symbol-sort-key"]), "symbol-z-order": new xn(Fe.layout_symbol["symbol-z-order"]), "icon-allow-overlap": new xn(Fe.layout_symbol["icon-allow-overlap"]), "icon-overlap": new xn(Fe.layout_symbol["icon-overlap"]), "icon-ignore-placement": new xn(Fe.layout_symbol["icon-ignore-placement"]), "icon-optional": new xn(Fe.layout_symbol["icon-optional"]), "icon-rotation-alignment": new xn(Fe.layout_symbol["icon-rotation-alignment"]), "icon-size": new In(Fe.layout_symbol["icon-size"]), "icon-text-fit": new xn(Fe.layout_symbol["icon-text-fit"]), "icon-text-fit-padding": new xn(Fe.layout_symbol["icon-text-fit-padding"]), "icon-image": new In(Fe.layout_symbol["icon-image"]), "icon-rotate": new In(Fe.layout_symbol["icon-rotate"]), "icon-padding": new In(Fe.layout_symbol["icon-padding"]), "icon-keep-upright": new xn(Fe.layout_symbol["icon-keep-upright"]), "icon-offset": new In(Fe.layout_symbol["icon-offset"]), "icon-anchor": new In(Fe.layout_symbol["icon-anchor"]), "icon-pitch-alignment": new xn(Fe.layout_symbol["icon-pitch-alignment"]), "text-pitch-alignment": new xn(Fe.layout_symbol["text-pitch-alignment"]), "text-rotation-alignment": new xn(Fe.layout_symbol["text-rotation-alignment"]), "text-field": new In(Fe.layout_symbol["text-field"]), "text-font": new In(Fe.layout_symbol["text-font"]), "text-size": new In(Fe.layout_symbol["text-size"]), "text-max-width": new In(Fe.layout_symbol["text-max-width"]), "text-line-height": new xn(Fe.layout_symbol["text-line-height"]), "text-letter-spacing": new In(Fe.layout_symbol["text-letter-spacing"]), "text-justify": new In(Fe.layout_symbol["text-justify"]), "text-radial-offset": new In(Fe.layout_symbol["text-radial-offset"]), "text-variable-anchor": new xn(Fe.layout_symbol["text-variable-anchor"]), "text-anchor": new In(Fe.layout_symbol["text-anchor"]), "text-max-angle": new xn(Fe.layout_symbol["text-max-angle"]), "text-writing-mode": new xn(Fe.layout_symbol["text-writing-mode"]), "text-rotate": new In(Fe.layout_symbol["text-rotate"]), "text-padding": new xn(Fe.layout_symbol["text-padding"]), "text-keep-upright": new xn(Fe.layout_symbol["text-keep-upright"]), "text-transform": new In(Fe.layout_symbol["text-transform"]), "text-offset": new In(Fe.layout_symbol["text-offset"]), "text-allow-overlap": new xn(Fe.layout_symbol["text-allow-overlap"]), "text-overlap": new xn(Fe.layout_symbol["text-overlap"]), "text-ignore-placement": new xn(Fe.layout_symbol["text-ignore-placement"]), "text-optional": new xn(Fe.layout_symbol["text-optional"]) }); var C_ = { paint: new Pi({ "icon-opacity": new In(Fe.paint_symbol["icon-opacity"]), "icon-color": new In(Fe.paint_symbol["icon-color"]), "icon-halo-color": new In(Fe.paint_symbol["icon-halo-color"]), "icon-halo-width": new In(Fe.paint_symbol["icon-halo-width"]), "icon-halo-blur": new In(Fe.paint_symbol["icon-halo-blur"]), "icon-translate": new xn(Fe.paint_symbol["icon-translate"]), "icon-translate-anchor": new xn(Fe.paint_symbol["icon-translate-anchor"]), "text-opacity": new In(Fe.paint_symbol["text-opacity"]), "text-color": new In(Fe.paint_symbol["text-color"], { runtimeType: Xt, getOverride: u => u.textColor, hasOverride: u => !!u.textColor }), "text-halo-color": new In(Fe.paint_symbol["text-halo-color"]), "text-halo-width": new In(Fe.paint_symbol["text-halo-width"]), "text-halo-blur": new In(Fe.paint_symbol["text-halo-blur"]), "text-translate": new xn(Fe.paint_symbol["text-translate"]), "text-translate-anchor": new xn(Fe.paint_symbol["text-translate-anchor"]) }), layout: I$ }; class j4 { constructor(a) { if (a.property.overrides === void 0) throw new Error("overrides must be provided to instantiate FormatSectionOverride class"); this.type = a.property.overrides ? a.property.overrides.runtimeType : Nn, this.defaultValue = a } evaluate(a) { if (a.formattedSection) { const d = this.defaultValue.property.overrides; if (d && d.hasOverride(a.formattedSection)) return d.getOverride(a.formattedSection) } return a.feature && a.featureState ? this.defaultValue.evaluate(a.feature, a.featureState) : this.defaultValue.property.specification.default } eachChild(a) { this.defaultValue.isConstant() || a(this.defaultValue.value._styleExpression.expression) } outputDefined() { return !1 } serialize() { return null } } mn("FormatSectionOverride", j4, { omit: ["defaultValue"] }); class Ov extends aa { constructor(a) { super(a, C_) } recalculate(a, d) { if (super.recalculate(a, d), this.layout.get("icon-rotation-alignment") === "auto" && (this.layout._values["icon-rotation-alignment"] = this.layout.get("symbol-placement") !== "point" ? "map" : "viewport"), this.layout.get("text-rotation-alignment") === "auto" && (this.layout._values["text-rotation-alignment"] = this.layout.get("symbol-placement") !== "point" ? "map" : "viewport"), this.layout.get("text-pitch-alignment") === "auto" && (this.layout._values["text-pitch-alignment"] = this.layout.get("text-rotation-alignment") === "map" ? "map" : "viewport"), this.layout.get("icon-pitch-alignment") === "auto" && (this.layout._values["icon-pitch-alignment"] = this.layout.get("icon-rotation-alignment")), this.layout.get("symbol-placement") === "point") { const m = this.layout.get("text-writing-mode"); if (m) { const _ = []; for (const S of m) _.indexOf(S) < 0 && _.push(S); this.layout._values["text-writing-mode"] = _ } else this.layout._values["text-writing-mode"] = ["horizontal"] } this._setPaintOverrides() } getValueAndResolveTokens(a, d, m, _) { const S = this.layout.get(a).evaluate(d, {}, m, _), T = this._unevaluatedLayout._values[a]; return T.isDataDriven() || Su(T.value) || !S ? S : function (L, F) { return F.replace(/{([^{}]+)}/g, (K, Q) => Q in L ? String(L[Q]) : "") }(d.properties, S) } createBucket(a) { return new fd(a) } queryRadius() { return 0 } queryIntersectsFeature() { throw new Error("Should take a different path in FeatureIndex") } _setPaintOverrides() { for (const a of C_.paint.overridableProperties) { if (!Ov.hasPaintOverride(this.layout, a)) continue; const d = this.paint.get(a), m = new j4(d), _ = new qc(m, d.property.specification); let S = null; S = d.value.kind === "constant" || d.value.kind === "source" ? new Pu("source", _) : new Yf("composite", _, d.value.zoomStops), this.paint._values[a] = new oa(d.property, S, d.parameters) } } _handleOverridablePaintPropertyUpdate(a, d, m) { return !(!this.layout || d.isDataDriven() || m.isDataDriven()) && Ov.hasPaintOverride(this.layout, a) } static hasPaintOverride(a, d) { const m = a.get("text-field"), _ = C_.paint.properties[d]; let S = !1; const T = L => { for (const F of L) if (_.overrides && _.overrides.hasOverride(F)) return void (S = !0) }; if (m.value.kind === "constant" && m.value.value instanceof be) T(m.value.value.sections); else if (m.value.kind === "source") { const L = K => { S || (K instanceof Ct && Ve(K.value) === Sn ? T(K.value.sections) : K instanceof Wc ? T(K.sections) : K.eachChild(L)) }, F = m.value; F._styleExpression && L(F._styleExpression.expression) } return S } } function S_(u, a, d) { let m = "never"; const _ = u.get(a); return _ ? m = _ : u.get(d) && (m = "always"), m } var R$ = { paint: new Pi({ "background-color": new xn(Fe.paint_background["background-color"]), "background-pattern": new uh(Fe.paint_background["background-pattern"]), "background-opacity": new xn(Fe.paint_background["background-opacity"]) }) }, M$ = { paint: new Pi({ "raster-opacity": new xn(Fe.paint_raster["raster-opacity"]), "raster-hue-rotate": new xn(Fe.paint_raster["raster-hue-rotate"]), "raster-brightness-min": new xn(Fe.paint_raster["raster-brightness-min"]), "raster-brightness-max": new xn(Fe.paint_raster["raster-brightness-max"]), "raster-saturation": new xn(Fe.paint_raster["raster-saturation"]), "raster-contrast": new xn(Fe.paint_raster["raster-contrast"]), "raster-resampling": new xn(Fe.paint_raster["raster-resampling"]), "raster-fade-duration": new xn(Fe.paint_raster["raster-fade-duration"]) }) }; class A$ extends aa { constructor(a) { super(a, {}), this.onAdd = d => { this.implementation.onAdd && this.implementation.onAdd(d, d.painter.context.gl) }, this.onRemove = d => { this.implementation.onRemove && this.implementation.onRemove(d, d.painter.context.gl) }, this.implementation = a } is3D() { return this.implementation.renderingMode === "3d" } hasOffscreenPass() { return this.implementation.prerender !== void 0 } recalculate() { } updateTransitions() { } hasTransition() { return !1 } serialize() { throw new Error("Custom layers cannot be serialized") } } const N$ = { circle: class extends aa { constructor(u) { super(u, cF) } createBucket(u) { return new Yx(u) } queryRadius(u) { const a = u; return ph("circle-radius", this, a) + ph("circle-stroke-width", this, a) + gv(this.paint.get("circle-translate")) } queryIntersectsFeature(u, a, d, m, _, S, T, L) { const F = yv(u, this.paint.get("circle-translate"), this.paint.get("circle-translate-anchor"), S.angle, T), K = this.paint.get("circle-radius").evaluate(a, d) + this.paint.get("circle-stroke-width").evaluate(a, d), Q = this.paint.get("circle-pitch-alignment") === "map", ne = Q ? F : function (he, pe) { return he.map(Ne => e4(Ne, pe)) }(F, L), ue = Q ? K * T : K; for (const he of m) for (const pe of he) { const Ne = Q ? pe : e4(pe, L); let Ae = ue; const Ye = xv([], [pe.x, pe.y, 0, 1], L); if (this.paint.get("circle-pitch-scale") === "viewport" && this.paint.get("circle-pitch-alignment") === "map" ? Ae *= Ye[3] / S.cameraToCenterDistance : this.paint.get("circle-pitch-scale") === "map" && this.paint.get("circle-pitch-alignment") === "viewport" && (Ae *= S.cameraToCenterDistance / Ye[3]), oF(ne, Ne, Ae)) return !0 } return !1 } }, heatmap: class extends aa { constructor(u) { super(u, fF), this._updateColorRamp() } createBucket(u) { return new t4(u) } _handleSpecialPaintPropertyUpdate(u) { u === "heatmap-color" && this._updateColorRamp() } _updateColorRamp() { this.colorRamp = r4({ expression: this._transitionablePaint._values["heatmap-color"].value.expression, evaluationKey: "heatmapDensity", image: this.colorRamp }), this.colorRampTexture = null } resize() { this.heatmapFbo && (this.heatmapFbo.destroy(), this.heatmapFbo = null) } queryRadius() { return 0 } queryIntersectsFeature() { return !1 } hasOffscreenPass() { return this.paint.get("heatmap-opacity") !== 0 && this.visibility !== "none" } }, hillshade: class extends aa { constructor(u) { super(u, hF) } hasOffscreenPass() { return this.paint.get("hillshade-exaggeration") !== 0 && this.visibility !== "none" } }, fill: class extends aa { constructor(u) { super(u, IF) } recalculate(u, a) { super.recalculate(u, a); const d = this.paint._values["fill-outline-color"]; d.value.kind === "constant" && d.value.value === void 0 && (this.paint._values["fill-outline-color"] = this.paint._values["fill-color"]) } createBucket(u) { return new u_(u) } queryRadius() { return gv(this.paint.get("fill-translate")) } queryIntersectsFeature(u, a, d, m, _, S, T) { return WE(yv(u, this.paint.get("fill-translate"), this.paint.get("fill-translate-anchor"), S.angle, T), m) } isTileClipped() { return !0 } }, "fill-extrusion": class extends aa { constructor(u) { super(u, jF) } createBucket(u) { return new d_(u) } queryRadius() { return gv(this.paint.get("fill-extrusion-translate")) } is3D() { return !0 } queryIntersectsFeature(u, a, d, m, _, S, T, L) { const F = yv(u, this.paint.get("fill-extrusion-translate"), this.paint.get("fill-extrusion-translate-anchor"), S.angle, T), K = this.paint.get("fill-extrusion-height").evaluate(a, d), Q = this.paint.get("fill-extrusion-base").evaluate(a, d), ne = function (he, pe, Ne, Ae) { const Ye = []; for (const lt of he) { const Ke = [lt.x, lt.y, 0, 1]; xv(Ke, Ke, pe), Ye.push(new ie(Ke[0] / Ke[3], Ke[1] / Ke[3])) } return Ye }(F, L), ue = function (he, pe, Ne, Ae) { const Ye = [], lt = [], Ke = Ae[8] * pe, it = Ae[9] * pe, kt = Ae[10] * pe, Tt = Ae[11] * pe, hn = Ae[8] * Ne, vn = Ae[9] * Ne, on = Ae[10] * Ne, Qt = Ae[11] * Ne; for (const Gt of he) { const an = [], tn = []; for (const $t of Gt) { const Tn = $t.x, _n = $t.y, jn = Ae[0] * Tn + Ae[4] * _n + Ae[12], kr = Ae[1] * Tn + Ae[5] * _n + Ae[13], Lr = Ae[2] * Tn + Ae[6] * _n + Ae[14], hi = Ae[3] * Tn + Ae[7] * _n + Ae[15], Ko = Lr + kt, Ni = hi + Tt, ri = jn + hn, _i = kr + vn, Oi = Lr + on, Ui = hi + Qt, fo = new ie((jn + Ke) / Ni, (kr + it) / Ni); fo.z = Ko / Ni, an.push(fo); const ii = new ie(ri / Ui, _i / Ui); ii.z = Oi / Ui, tn.push(ii) } Ye.push(an), lt.push(tn) } return [Ye, lt] }(m, Q, K, L); return function (he, pe, Ne) { let Ae = 1 / 0; WE(Ne, pe) && (Ae = f4(Ne, pe[0])); for (let Ye = 0; Ye < pe.length; Ye++) { const lt = pe[Ye], Ke = he[Ye]; for (let it = 0; it < lt.length - 1; it++) { const kt = lt[it], Tt = [kt, lt[it + 1], Ke[it + 1], Ke[it], kt]; HE(Ne, Tt) && (Ae = Math.min(Ae, f4(Ne, Tt))) } } return Ae !== 1 / 0 && Ae }(ue[0], ue[1], ne) } }, line: class extends aa { constructor(u) { super(u, p4), this.gradientVersion = 0 } _handleSpecialPaintPropertyUpdate(u) { u === "line-gradient" && (this.stepInterpolant = this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Pa, this.gradientVersion = (this.gradientVersion + 1) % Number.MAX_SAFE_INTEGER) } gradientExpression() { return this._transitionablePaint._values["line-gradient"].value.expression } recalculate(u, a) { super.recalculate(u, a), this.paint._values["line-floorwidth"] = m4.possiblyEvaluate(this._transitioningPaint._values["line-width"].value, u) } createBucket(u) { return new f_(u) } queryRadius(u) { const a = u, d = v4(ph("line-width", this, a), ph("line-gap-width", this, a)), m = ph("line-offset", this, a); return d / 2 + Math.abs(m) + gv(this.paint.get("line-translate")) } queryIntersectsFeature(u, a, d, m, _, S, T) { const L = yv(u, this.paint.get("line-translate"), this.paint.get("line-translate-anchor"), S.angle, T), F = T / 2 * v4(this.paint.get("line-width").evaluate(a, d), this.paint.get("line-gap-width").evaluate(a, d)), K = this.paint.get("line-offset").evaluate(a, d); return K && (m = function (Q, ne) { const ue = []; for (let he = 0; he < Q.length; he++) { const pe = Q[he], Ne = []; for (let Ae = 0; Ae < pe.length; Ae++) { const Ye = pe[Ae - 1], lt = pe[Ae], Ke = pe[Ae + 1], it = Ae === 0 ? new ie(0, 0) : lt.sub(Ye)._unit()._perp(), kt = Ae === pe.length - 1 ? new ie(0, 0) : Ke.sub(lt)._unit()._perp(), Tt = it._add(kt)._unit(), hn = Tt.x * kt.x + Tt.y * kt.y; hn !== 0 && Tt._mult(1 / hn), Ne.push(Tt._mult(ne)._add(lt)) } ue.push(Ne) } return ue }(m, K * T)), function (Q, ne, ue) { for (let he = 0; he < ne.length; he++) { const pe = ne[he]; if (Q.length >= 3) { for (let Ne = 0; Ne < pe.length; Ne++)if (od(Q, pe[Ne])) return !0 } if (aF(Q, pe, ue)) return !0 } return !1 }(L, m, F) } isTileClipped() { return !0 } }, symbol: Ov, background: class extends aa { constructor(u) { super(u, R$) } }, raster: class extends aa { constructor(u) { super(u, M$) } } }; class O$ { constructor(a) { this._callback = a, this._triggered = !1, typeof MessageChannel < "u" && (this._channel = new MessageChannel, this._channel.port2.onmessage = () => { this._triggered = !1, this._callback() }) } trigger() { this._triggered || (this._triggered = !0, this._channel ? this._channel.port1.postMessage(!0) : setTimeout(() => { this._triggered = !1, this._callback() }, 0)) } remove() { delete this._channel, this._callback = () => { } } } const K4 = 63710088e-1; class Zr { constructor(a, d) { if (isNaN(a) || isNaN(d)) throw new Error(`Invalid LngLat object: (${a}, ${d})`); if (this.lng = +a, this.lat = +d, this.lat > 90 || this.lat < -90) throw new Error("Invalid LngLat latitude value: must be between -90 and 90") } wrap() { return new Zr(P(this.lng, -180, 180), this.lat) } toArray() { return [this.lng, this.lat] } toString() { return `LngLat(${this.lng}, ${this.lat})` } distanceTo(a) { const d = Math.PI / 180, m = this.lat * d, _ = a.lat * d, S = Math.sin(m) * Math.sin(_) + Math.cos(m) * Math.cos(_) * Math.cos((a.lng - this.lng) * d); return K4 * Math.acos(Math.min(S, 1)) } toBounds(a = 0) { const d = 360 * a / 40075017, m = d / Math.cos(Math.PI / 180 * this.lat); return new Ku(new Zr(this.lng - m, this.lat - d), new Zr(this.lng + m, this.lat + d)) } static convert(a) { if (a instanceof Zr) return a; if (Array.isArray(a) && (a.length === 2 || a.length === 3)) return new Zr(Number(a[0]), Number(a[1])); if (!Array.isArray(a) && typeof a == "object" && a !== null) return new Zr(Number("lng" in a ? a.lng : a.lon), Number(a.lat)); throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]") } } class Ku { constructor(a, d) { a && (d ? this.setSouthWest(a).setNorthEast(d) : a.length === 4 ? this.setSouthWest([a[0], a[1]]).setNorthEast([a[2], a[3]]) : this.setSouthWest(a[0]).setNorthEast(a[1])) } setNorthEast(a) { return this._ne = a instanceof Zr ? new Zr(a.lng, a.lat) : Zr.convert(a), this } setSouthWest(a) { return this._sw = a instanceof Zr ? new Zr(a.lng, a.lat) : Zr.convert(a), this } extend(a) { const d = this._sw, m = this._ne; let _, S; if (a instanceof Zr) _ = a, S = a; else { if (!(a instanceof Ku)) return Array.isArray(a) ? a.length === 4 || a.every(Array.isArray) ? this.extend(Ku.convert(a)) : this.extend(Zr.convert(a)) : this; if (_ = a._sw, S = a._ne, !_ || !S) return this } return d || m ? (d.lng = Math.min(_.lng, d.lng), d.lat = Math.min(_.lat, d.lat), m.lng = Math.max(S.lng, m.lng), m.lat = Math.max(S.lat, m.lat)) : (this._sw = new Zr(_.lng, _.lat), this._ne = new Zr(S.lng, S.lat)), this } getCenter() { return new Zr((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2) } getSouthWest() { return this._sw } getNorthEast() { return this._ne } getNorthWest() { return new Zr(this.getWest(), this.getNorth()) } getSouthEast() { return new Zr(this.getEast(), this.getSouth()) } getWest() { return this._sw.lng } getSouth() { return this._sw.lat } getEast() { return this._ne.lng } getNorth() { return this._ne.lat } toArray() { return [this._sw.toArray(), this._ne.toArray()] } toString() { return `LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})` } isEmpty() { return !(this._sw && this._ne) } contains(a) { const { lng: d, lat: m } = Zr.convert(a); let _ = this._sw.lng <= d && d <= this._ne.lng; return this._sw.lng > this._ne.lng && (_ = this._sw.lng >= d && d >= this._ne.lng), this._sw.lat <= m && m <= this._ne.lat && _ } static convert(a) { return a instanceof Ku ? a : a && new Ku(a) } } const H4 = 2 * Math.PI * K4; function W4(u) { return H4 * Math.cos(u * Math.PI / 180) } function G4(u) { return (180 + u) / 360 } function q4(u) { return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + u * Math.PI / 360))) / 360 } function Z4(u, a) { return u / W4(a) } function E_(u) { return 360 / Math.PI * Math.atan(Math.exp((180 - 360 * u) * Math.PI / 180)) - 90 } class Dv { constructor(a, d, m = 0) { this.x = +a, this.y = +d, this.z = +m } static fromLngLat(a, d = 0) { const m = Zr.convert(a); return new Dv(G4(m.lng), q4(m.lat), Z4(d, m.lat)) } toLngLat() { return new Zr(360 * this.x - 180, E_(this.y)) } toAltitude() { return this.z * W4(E_(this.y)) } meterInMercatorCoordinateUnits() { return 1 / H4 * (a = E_(this.y), 1 / Math.cos(a * Math.PI / 180)); var a } } function X4(u, a, d) { var m = 2 * Math.PI * 6378137 / 256 / Math.pow(2, d); return [u * m - 2 * Math.PI * 6378137 / 2, a * m - 2 * Math.PI * 6378137 / 2] } class P_ { constructor(a, d, m) { if (a < 0 || a > 25 || m < 0 || m >= Math.pow(2, a) || d < 0 || d >= Math.pow(2, a)) throw new Error(`x=${d}, y=${m}, z=${a} outside of bounds. 0<=x<${Math.pow(2, a)}, 0<=y<${Math.pow(2, a)} 0<=z<=25 `); this.z = a, this.x = d, this.y = m, this.key = Eh(0, a, a, d, m) } equals(a) { return this.z === a.z && this.x === a.x && this.y === a.y } url(a, d, m) { const _ = (T = this.y, L = this.z, F = X4(256 * (S = this.x), 256 * (T = Math.pow(2, L) - T - 1), L), K = X4(256 * (S + 1), 256 * (T + 1), L), F[0] + "," + F[1] + "," + K[0] + "," + K[1]); var S, T, L, F, K; const Q = function (ne, ue, he) { let pe, Ne = ""; for (let Ae = ne; Ae > 0; Ae--)pe = 1 << Ae - 1, Ne += (ue & pe ? 1 : 0) + (he & pe ? 2 : 0); return Ne }(this.z, this.x, this.y); return a[(this.x + this.y) % a.length].replace(/{prefix}/g, (this.x % 16).toString(16) + (this.y % 16).toString(16)).replace(/{z}/g, String(this.z)).replace(/{x}/g, String(this.x)).replace(/{y}/g, String(m === "tms" ? Math.pow(2, this.z) - this.y - 1 : this.y)).replace(/{ratio}/g, d > 1 ? "@2x" : "").replace(/{quadkey}/g, Q).replace(/{bbox-epsg-3857}/g, _) } isChildOf(a) { const d = this.z - a.z; return d > 0 && a.x === this.x >> d && a.y === this.y >> d } getTilePoint(a) { const d = Math.pow(2, this.z); return new ie((a.x * d - this.x) * fi, (a.y * d - this.y) * fi) } toString() { return `${this.z}/${this.x}/${this.y}` } } class Y4 { constructor(a, d) { this.wrap = a, this.canonical = d, this.key = Eh(a, d.z, d.z, d.x, d.y) } } class jo { constructor(a, d, m, _, S) { if (a < m) throw new Error(`overscaledZ should be >= z; overscaledZ = ${a}; z = ${m}`); this.overscaledZ = a, this.wrap = d, this.canonical = new P_(m, +_, +S), this.key = Eh(d, a, m, _, S) } clone() { return new jo(this.overscaledZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y) } equals(a) { return this.overscaledZ === a.overscaledZ && this.wrap === a.wrap && this.canonical.equals(a.canonical) } scaledTo(a) { if (a > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`); const d = this.canonical.z - a; return a > this.canonical.z ? new jo(a, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y) : new jo(a, this.wrap, a, this.canonical.x >> d, this.canonical.y >> d) } calculateScaledKey(a, d) { if (a > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`); const m = this.canonical.z - a; return a > this.canonical.z ? Eh(this.wrap * +d, a, this.canonical.z, this.canonical.x, this.canonical.y) : Eh(this.wrap * +d, a, a, this.canonical.x >> m, this.canonical.y >> m) } isChildOf(a) { if (a.wrap !== this.wrap) return !1; const d = this.canonical.z - a.canonical.z; return a.overscaledZ === 0 || a.overscaledZ < this.overscaledZ && a.canonical.x === this.canonical.x >> d && a.canonical.y === this.canonical.y >> d } children(a) { if (this.overscaledZ >= a) return [new jo(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)]; const d = this.canonical.z + 1, m = 2 * this.canonical.x, _ = 2 * this.canonical.y; return [new jo(d, this.wrap, d, m, _), new jo(d, this.wrap, d, m + 1, _), new jo(d, this.wrap, d, m, _ + 1), new jo(d, this.wrap, d, m + 1, _ + 1)] } isLessThan(a) { return this.wrap < a.wrap || !(this.wrap > a.wrap) && (this.overscaledZ < a.overscaledZ || !(this.overscaledZ > a.overscaledZ) && (this.canonical.x < a.canonical.x || !(this.canonical.x > a.canonical.x) && this.canonical.y < a.canonical.y)) } wrapped() { return new jo(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y) } unwrapTo(a) { return new jo(this.overscaledZ, a, this.canonical.z, this.canonical.x, this.canonical.y) } overscaleFactor() { return Math.pow(2, this.overscaledZ - this.canonical.z) } toUnwrapped() { return new Y4(this.wrap, this.canonical) } toString() { return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}` } getTilePoint(a) { return this.canonical.getTilePoint(new Dv(a.x - this.wrap, a.y)) } } function Eh(u, a, d, m, _) { (u *= 2) < 0 && (u = -1 * u - 1); const S = 1 << d; return (S * S * u + S * _ + m).toString(36) + d.toString(36) + a.toString(36) } mn("CanonicalTileID", P_), mn("OverscaledTileID", jo, { omit: ["posMatrix"] }); class Q4 { constructor(a, d, m) { if (this.uid = a, d.height !== d.width) throw new RangeError("DEM tiles must be square"); if (m && m !== "mapbox" && m !== "terrarium") return void B(`"${m}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`); this.stride = d.height; const _ = this.dim = d.height - 2; this.data = new Uint32Array(d.data.buffer), this.encoding = m || "mapbox"; for (let S = 0; S < _; S++)this.data[this._idx(-1, S)] = this.data[this._idx(0, S)], this.data[this._idx(_, S)] = this.data[this._idx(_ - 1, S)], this.data[this._idx(S, -1)] = this.data[this._idx(S, 0)], this.data[this._idx(S, _)] = this.data[this._idx(S, _ - 1)]; this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)], this.data[this._idx(_, -1)] = this.data[this._idx(_ - 1, 0)], this.data[this._idx(-1, _)] = this.data[this._idx(0, _ - 1)], this.data[this._idx(_, _)] = this.data[this._idx(_ - 1, _ - 1)], this.min = Number.MAX_SAFE_INTEGER, this.max = Number.MIN_SAFE_INTEGER; for (let S = 0; S < _; S++)for (let T = 0; T < _; T++) { const L = this.get(S, T); L > this.max && (this.max = L), L < this.min && (this.min = L) } } get(a, d) { const m = new Uint8Array(this.data.buffer), _ = 4 * this._idx(a, d); return (this.encoding === "terrarium" ? this._unpackTerrarium : this._unpackMapbox)(m[_], m[_ + 1], m[_ + 2]) } getUnpackVector() { return this.encoding === "terrarium" ? [256, 1, 1 / 256, 32768] : [6553.6, 25.6, .1, 1e4] } _idx(a, d) { if (a < -1 || a >= this.dim + 1 || d < -1 || d >= this.dim + 1) throw new RangeError("out of range source coordinates for DEM data"); return (d + 1) * this.stride + (a + 1) } _unpackMapbox(a, d, m) { return (256 * a * 256 + 256 * d + m) / 10 - 1e4 } _unpackTerrarium(a, d, m) { return 256 * a + d + m / 256 - 32768 } getPixels() { return new Uo({ width: this.stride, height: this.stride }, new Uint8Array(this.data.buffer)) } backfillBorder(a, d, m) { if (this.dim !== a.dim) throw new Error("dem dimension mismatch"); let _ = d * this.dim, S = d * this.dim + this.dim, T = m * this.dim, L = m * this.dim + this.dim; switch (d) { case -1: _ = S - 1; break; case 1: S = _ + 1 }switch (m) { case -1: T = L - 1; break; case 1: L = T + 1 }const F = -d * this.dim, K = -m * this.dim; for (let Q = T; Q < L; Q++)for (let ne = _; ne < S; ne++)this.data[this._idx(ne, Q)] = a.data[this._idx(ne + F, Q + K)] } } mn("DEMData", Q4); class J4 { constructor(a) { this._stringToNumber = {}, this._numberToString = []; for (let d = 0; d < a.length; d++) { const m = a[d]; this._stringToNumber[m] = d, this._numberToString[d] = m } } encode(a) { return this._stringToNumber[a] } decode(a) { if (a >= this._numberToString.length) throw new Error(`Out of bounds. Index requested n=${a} can't be >= this._numberToString.length ${this._numberToString.length}`); return this._numberToString[a] } } class eP { constructor(a, d, m, _, S) { this.type = "Feature", this._vectorTileFeature = a, a._z = d, a._x = m, a._y = _, this.properties = a.properties, this.id = S } get geometry() { return this._geometry === void 0 && (this._geometry = this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x, this._vectorTileFeature._y, this._vectorTileFeature._z).geometry), this._geometry } set geometry(a) { this._geometry = a } toJSON() { const a = { geometry: this.geometry }; for (const d in this) d !== "_geometry" && d !== "_vectorTileFeature" && (a[d] = this[d]); return a } } class tP { constructor(a, d) { this.tileID = a, this.x = a.canonical.x, this.y = a.canonical.y, this.z = a.canonical.z, this.grid = new Lu(fi, 16, 0), this.grid3D = new Lu(fi, 16, 0), this.featureIndexArray = new Un, this.promoteId = d } insert(a, d, m, _, S, T) { const L = this.featureIndexArray.length; this.featureIndexArray.emplaceBack(m, _, S); const F = T ? this.grid3D : this.grid; for (let K = 0; K < d.length; K++) { const Q = d[K], ne = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; for (let ue = 0; ue < Q.length; ue++) { const he = Q[ue]; ne[0] = Math.min(ne[0], he.x), ne[1] = Math.min(ne[1], he.y), ne[2] = Math.max(ne[2], he.x), ne[3] = Math.max(ne[3], he.y) } ne[0] < fi && ne[1] < fi && ne[2] >= 0 && ne[3] >= 0 && F.insert(L, ne[0], ne[1], ne[2], ne[3]) } } loadVTLayers() { return this.vtLayers || (this.vtLayers = new Il.VectorTile(new h_(this.rawTileData)).layers, this.sourceLayerCoder = new J4(this.vtLayers ? Object.keys(this.vtLayers).sort() : ["_geojsonTileLayer"])), this.vtLayers } query(a, d, m, _) { this.loadVTLayers(); const S = a.params || {}, T = fi / a.tileSize / a.scale, L = Yc(S.filter), F = a.queryGeometry, K = a.queryPadding * T, Q = rP(F), ne = this.grid.query(Q.minX - K, Q.minY - K, Q.maxX + K, Q.maxY + K), ue = rP(a.cameraQueryGeometry), he = this.grid3D.query(ue.minX - K, ue.minY - K, ue.maxX + K, ue.maxY + K, (Ae, Ye, lt, Ke) => function (it, kt, Tt, hn, vn) { for (const Qt of it) if (kt <= Qt.x && Tt <= Qt.y && hn >= Qt.x && vn >= Qt.y) return !0; const on = [new ie(kt, Tt), new ie(kt, vn), new ie(hn, vn), new ie(hn, Tt)]; if (it.length > 2) { for (const Qt of on) if (od(it, Qt)) return !0 } for (let Qt = 0; Qt < it.length - 1; Qt++)if (lF(it[Qt], it[Qt + 1], on)) return !0; return !1 }(a.cameraQueryGeometry, Ae - K, Ye - K, lt + K, Ke + K)); for (const Ae of he) ne.push(Ae); ne.sort(D$); const pe = {}; let Ne; for (let Ae = 0; Ae < ne.length; Ae++) { const Ye = ne[Ae]; if (Ye === Ne) continue; Ne = Ye; const lt = this.featureIndexArray.get(Ye); let Ke = null; this.loadMatchingFeature(pe, lt.bucketIndex, lt.sourceLayerIndex, lt.featureIndex, L, S.layers, S.availableImages, d, m, _, (it, kt, Tt) => (Ke || (Ke = Vu(it)), kt.queryIntersectsFeature(F, it, Tt, Ke, this.z, a.transform, T, a.pixelPosMatrix))) } return pe } loadMatchingFeature(a, d, m, _, S, T, L, F, K, Q, ne) { const ue = this.bucketLayerIDs[d]; if (T && !function (Ae, Ye) { for (let lt = 0; lt < Ae.length; lt++)if (Ye.indexOf(Ae[lt]) >= 0) return !0; return !1 }(T, ue)) return; const he = this.sourceLayerCoder.decode(m), pe = this.vtLayers[he].feature(_); if (S.needGeometry) { const Ae = Uu(pe, !0); if (!S.filter(new Or(this.tileID.overscaledZ), Ae, this.tileID.canonical)) return } else if (!S.filter(new Or(this.tileID.overscaledZ), pe)) return; const Ne = this.getId(pe, he); for (let Ae = 0; Ae < ue.length; Ae++) { const Ye = ue[Ae]; if (T && T.indexOf(Ye) < 0) continue; const lt = F[Ye]; if (!lt) continue; let Ke = {}; Ne && Q && (Ke = Q.getState(lt.sourceLayer || "_geojsonTileLayer", Ne)); const it = k({}, K[Ye]); it.paint = nP(it.paint, lt.paint, pe, Ke, L), it.layout = nP(it.layout, lt.layout, pe, Ke, L); const kt = !ne || ne(pe, lt, Ke); if (!kt) continue; const Tt = new eP(pe, this.z, this.x, this.y, Ne); Tt.layer = it; let hn = a[Ye]; hn === void 0 && (hn = a[Ye] = []), hn.push({ featureIndex: _, feature: Tt, intersectionZ: kt }) } } lookupSymbolFeatures(a, d, m, _, S, T, L, F) { const K = {}; this.loadVTLayers(); const Q = Yc(S); for (const ne of a) this.loadMatchingFeature(K, m, _, ne, Q, T, L, F, d); return K } hasLayer(a) { for (const d of this.bucketLayerIDs) for (const m of d) if (a === m) return !0; return !1 } getId(a, d) { let m = a.id; return this.promoteId && (m = a.properties[typeof this.promoteId == "string" ? this.promoteId : this.promoteId[d]], typeof m == "boolean" && (m = Number(m))), m } } function nP(u, a, d, m, _) { return R(u, (S, T) => { const L = a instanceof $u ? a.get(T) : null; return L && L.evaluate ? L.evaluate(d, m, _) : L }) } function rP(u) { let a = 1 / 0, d = 1 / 0, m = -1 / 0, _ = -1 / 0; for (const S of u) a = Math.min(a, S.x), d = Math.min(d, S.y), m = Math.max(m, S.x), _ = Math.max(_, S.y); return { minX: a, minY: d, maxX: m, maxY: _ } } function D$(u, a) { return a - u } var T_; mn("FeatureIndex", tP, { omit: ["rawTileData", "sourceLayerCoder"] }), o.PerformanceMarkers = void 0, (T_ = o.PerformanceMarkers || (o.PerformanceMarkers = {})).create = "create", T_.load = "load", T_.fullLoad = "fullLoad"; let Lv = null, Ph = []; const k_ = 1e3 / 30, L$ = { mark(u) { performance.mark(u) }, frame(u) { const a = u; Lv != null && Ph.push(a - Lv), Lv = a }, clearMetrics() { Lv = null, Ph = [], performance.clearMeasures("loadTime"), performance.clearMeasures("fullLoadTime"); for (const u in o.PerformanceMarkers) performance.clearMarks(o.PerformanceMarkers[u]) }, getPerformanceMetrics() { performance.measure("loadTime", o.PerformanceMarkers.create, o.PerformanceMarkers.load), performance.measure("fullLoadTime", o.PerformanceMarkers.create, o.PerformanceMarkers.fullLoad); const u = performance.getEntriesByName("loadTime")[0].duration, a = performance.getEntriesByName("fullLoadTime")[0].duration, d = Ph.length, m = 1 / (Ph.reduce((S, T) => S + T, 0) / d / 1e3), _ = Ph.filter(S => S > k_).reduce((S, T) => S + (T - k_) / k_, 0); return { loadTime: u, fullLoadTime: a, fps: m, percentDroppedFrames: _ / (d + _) * 100 } } }; o.AJAXError = We, o.ARRAY_TYPE = Ji, o.Actor = class { constructor(u, a, d) { this.target = u, this.parent = a, this.mapId = d, this.callbacks = {}, this.tasks = {}, this.taskQueue = [], this.cancelCallbacks = {}, N(["receive", "process"], this), this.invoker = new O$(this.process), this.target.addEventListener("message", this.receive, !1), this.globalScope = j() ? u : window } send(u, a, d, m, _ = !1) { const S = Math.round(1e18 * Math.random()).toString(36).substring(0, 10); d && (this.callbacks[S] = d); const T = Z(this.globalScope) ? void 0 : []; return this.target.postMessage({ id: S, type: u, hasCallback: !!d, targetMapId: m, mustQueue: _, sourceMapId: this.mapId, data: ks(a, T) }, T), { cancel: () => { d && delete this.callbacks[S], this.target.postMessage({ id: S, type: "<cancel>", targetMapId: m, sourceMapId: this.mapId }) } } } receive(u) { const a = u.data, d = a.id; if (d && (!a.targetMapId || this.mapId === a.targetMapId)) if (a.type === "<cancel>") { delete this.tasks[d]; const m = this.cancelCallbacks[d]; delete this.cancelCallbacks[d], m && m() } else j() || a.mustQueue ? (this.tasks[d] = a, this.taskQueue.push(d), this.invoker.trigger()) : this.processTask(d, a) } process() { if (!this.taskQueue.length) return; const u = this.taskQueue.shift(), a = this.tasks[u]; delete this.tasks[u], this.taskQueue.length && this.invoker.trigger(), a && this.processTask(u, a) } processTask(u, a) { if (a.type === "<response>") { const d = this.callbacks[u]; delete this.callbacks[u], d && (a.error ? d(Qa(a.error)) : d(null, Qa(a.data))) } else { let d = !1; const m = Z(this.globalScope) ? void 0 : [], _ = a.hasCallback ? (L, F) => { d = !0, delete this.cancelCallbacks[u], this.target.postMessage({ id: u, type: "<response>", sourceMapId: this.mapId, error: L ? ks(L) : null, data: ks(F, m) }, m) } : L => { d = !0 }; let S = null; const T = Qa(a.data); if (this.parent[a.type]) S = this.parent[a.type](a.sourceMapId, T, _); else if (this.parent.getWorkerSource) { const L = a.type.split("."); S = this.parent.getWorkerSource(a.sourceMapId, L[0], T.source)[L[1]](T, _) } else _(new Error(`Could not find function ${a.type}`)); !d && S && S.cancel && (this.cancelCallbacks[u] = S.cancel) } } remove() { this.invoker.remove(), this.target.removeEventListener("message", this.receive, !1) } }, o.AlphaImage = vh, o.CanonicalTileID = P_, o.CollisionBoxArray = xt, o.CollisionCircleLayoutArray = class extends te { }, o.Color = le, o.DEMData = Q4, o.DataConstantProperty = xn, o.DictionaryCoder = J4, o.EXTENT = fi, o.ErrorEvent = Ut, o.EvaluationParameters = Or, o.Event = Wt, o.Evented = Jt, o.FeatureIndex = tP, o.FillBucket = u_, o.FillExtrusionBucket = d_, o.GeoJSONFeature = eP, o.ImageAtlas = E4, o.ImagePosition = m_, o.LineBucket = f_, o.LineStripIndexArray = class extends Me { }, o.LngLat = Zr, o.LngLatBounds = Ku, o.MercatorCoordinate = Dv, o.ONE_EM = Ti, o.OverscaledTileID = jo, o.PerformanceUtils = L$, o.PosArray = Pn, o.Properties = Pi, o.QuadTriangleArray = class extends fe { }, o.RGBAImage = Uo, o.RasterBoundsArray = class extends x { }, o.RequestPerformance = class { constructor(u) { this._marks = { start: [u.url, "start"].join("#"), end: [u.url, "end"].join("#"), measure: u.url.toString() }, performance.mark(this._marks.start) } finish() { performance.mark(this._marks.end); let u = performance.getEntriesByName(this._marks.measure); return u.length === 0 && (performance.measure(this._marks.measure, this._marks.start, this._marks.end), u = performance.getEntriesByName(this._marks.measure), performance.clearMarks(this._marks.start), performance.clearMarks(this._marks.end), performance.clearMeasures(this._marks.measure)), u } }, o.ResourceType = It, o.SegmentVector = Wn, o.SymbolBucket = fd, o.Transitionable = dv, o.TriangleIndexArray = Yi, o.Uniform1f = As, o.Uniform1i = class extends Ms { constructor(u, a) { super(u, a), this.current = 0 } set(u) { this.current !== u && (this.current = u, this.gl.uniform1i(this.location, u)) } }, o.Uniform2f = class extends Ms { constructor(u, a) { super(u, a), this.current = [0, 0] } set(u) { u[0] === this.current[0] && u[1] === this.current[1] || (this.current = u, this.gl.uniform2f(this.location, u[0], u[1])) } }, o.Uniform3f = class extends Ms { constructor(u, a) { super(u, a), this.current = [0, 0, 0] } set(u) { u[0] === this.current[0] && u[1] === this.current[1] && u[2] === this.current[2] || (this.current = u, this.gl.uniform3f(this.location, u[0], u[1], u[2])) } }, o.Uniform4f = rd, o.UniformColor = VE, o.UniformMatrix4f = class extends Ms { constructor(u, a) { super(u, a), this.current = rF } set(u) { if (u[12] !== this.current[12] || u[0] !== this.current[0]) return this.current = u, void this.gl.uniformMatrix4fv(this.location, !1, u); for (let a = 1; a < 16; a++)if (u[a] !== this.current[a]) { this.current = u, this.gl.uniformMatrix4fv(this.location, !1, u); break } } }, o.UnwrappedTileID = Y4, o.ValidationError = Ge, o.ZoomHistory = th, o.add = function (u, a, d) { return u[0] = a[0] + d[0], u[1] = a[1] + d[1], u[2] = a[2] + d[2], u }, o.addDynamicAttributes = __, o.asyncAll = function (u, a, d) { if (!u.length) return d(null, []); let m = u.length; const _ = new Array(u.length); let S = null; u.forEach((T, L) => { a(T, (F, K) => { F && (S = F), _[L] = K, --m == 0 && d(S, _) }) }) }, o.bezier = v, o.bindAll = N, o.cacheEntryPossiblyAdded = function (u) { ke++, ke > De && (u.getActor().send("enforceCacheSizeLimit", Pe), ke = 0) }, o.clamp = w, o.clearTileCache = function (u) { const a = caches.delete(ye); u && a.catch(u).then(() => u()) }, o.clipLine = z4, o.clone = function (u) { var a = new Ji(16); return a[0] = u[0], a[1] = u[1], a[2] = u[2], a[3] = u[3], a[4] = u[4], a[5] = u[5], a[6] = u[6], a[7] = u[7], a[8] = u[8], a[9] = u[9], a[10] = u[10], a[11] = u[11], a[12] = u[12], a[13] = u[13], a[14] = u[14], a[15] = u[15], a }, o.clone$1 = O, o.clone$2 = function (u) { var a = new Ji(3); return a[0] = u[0], a[1] = u[1], a[2] = u[2], a }, o.collisionCircleLayout = e$, o.config = oe, o.copy = function (u, a) { return u[0] = a[0], u[1] = a[1], u[2] = a[2], u[3] = a[3], u[4] = a[4], u[5] = a[5], u[6] = a[6], u[7] = a[7], u[8] = a[8], u[9] = a[9], u[10] = a[10], u[11] = a[11], u[12] = a[12], u[13] = a[13], u[14] = a[14], u[15] = a[15], u }, o.create = function () { var u = new Ji(16); return Ji != Float32Array && (u[1] = 0, u[2] = 0, u[3] = 0, u[4] = 0, u[6] = 0, u[7] = 0, u[8] = 0, u[9] = 0, u[11] = 0, u[12] = 0, u[13] = 0, u[14] = 0), u[0] = 1, u[5] = 1, u[10] = 1, u[15] = 1, u }, o.create$1 = ZE, o.createExpression = Eu, o.createFilter = Yc, o.createLayout = ni, o.createStyleLayer = function (u) { return u.type === "custom" ? new A$(u) : new N$[u.type](u) }, o.cross = function (u, a, d) { var m = a[0], _ = a[1], S = a[2], T = d[0], L = d[1], F = d[2]; return u[0] = _ * F - S * L, u[1] = S * T - m * F, u[2] = m * L - _ * T, u }, o.dot = function (u, a) { return u[0] * a[0] + u[1] * a[1] + u[2] * a[2] }, o.dot$1 = function (u, a) { return u[0] * a[0] + u[1] * a[1] + u[2] * a[2] + u[3] * a[3] }, o.ease = y, o.emitValidationErrors = Jc, o.enforceCacheSizeLimit = function (u) { Re(), Ie && Ie.then(a => { a.keys().then(d => { for (let m = 0; m < d.length - u; m++)a.delete(d[m]) }) }) }, o.equals = function (u, a) { var d = u[0], m = u[1], _ = u[2], S = u[3], T = u[4], L = u[5], F = u[6], K = u[7], Q = u[8], ne = u[9], ue = u[10], he = u[11], pe = u[12], Ne = u[13], Ae = u[14], Ye = u[15], lt = a[0], Ke = a[1], it = a[2], kt = a[3], Tt = a[4], hn = a[5], vn = a[6], on = a[7], Qt = a[8], Gt = a[9], an = a[10], tn = a[11], $t = a[12], Tn = a[13], _n = a[14], jn = a[15]; return Math.abs(d - lt) <= Qi * Math.max(1, Math.abs(d), Math.abs(lt)) && Math.abs(m - Ke) <= Qi * Math.max(1, Math.abs(m), Math.abs(Ke)) && Math.abs(_ - it) <= Qi * Math.max(1, Math.abs(_), Math.abs(it)) && Math.abs(S - kt) <= Qi * Math.max(1, Math.abs(S), Math.abs(kt)) && Math.abs(T - Tt) <= Qi * Math.max(1, Math.abs(T), Math.abs(Tt)) && Math.abs(L - hn) <= Qi * Math.max(1, Math.abs(L), Math.abs(hn)) && Math.abs(F - vn) <= Qi * Math.max(1, Math.abs(F), Math.abs(vn)) && Math.abs(K - on) <= Qi * Math.max(1, Math.abs(K), Math.abs(on)) && Math.abs(Q - Qt) <= Qi * Math.max(1, Math.abs(Q), Math.abs(Qt)) && Math.abs(ne - Gt) <= Qi * Math.max(1, Math.abs(ne), Math.abs(Gt)) && Math.abs(ue - an) <= Qi * Math.max(1, Math.abs(ue), Math.abs(an)) && Math.abs(he - tn) <= Qi * Math.max(1, Math.abs(he), Math.abs(tn)) && Math.abs(pe - $t) <= Qi * Math.max(1, Math.abs(pe), Math.abs($t)) && Math.abs(Ne - Tn) <= Qi * Math.max(1, Math.abs(Ne), Math.abs(Tn)) && Math.abs(Ae - _n) <= Qi * Math.max(1, Math.abs(Ae), Math.abs(_n)) && Math.abs(Ye - jn) <= Qi * Math.max(1, Math.abs(Ye), Math.abs(jn)) }, o.evaluateSizeForFeature = function (u, { uSize: a, uSizeT: d }, { lowerSize: m, upperSize: _ }) { return u.kind === "source" ? m / Ds : u.kind === "composite" ? xr(m / Ds, _ / Ds, d) : a }, o.evaluateSizeForZoom = function (u, a) { let d = 0, m = 0; if (u.kind === "constant") m = u.layoutSize; else if (u.kind !== "source") { const { interpolationType: _, minZoom: S, maxZoom: T } = u, L = _ ? w(lo.interpolationFactor(_, a, S, T), 0, 1) : 0; u.kind === "camera" ? m = xr(u.minSize, u.maxSize, L) : d = L } return { uSizeT: d, uSize: m } }, o.evaluateVariableOffset = B4, o.evented = lh, o.exported = ve, o.exported$1 = Oe, o.extend = k, o.filterObject = M, o.fromRotation = function (u, a) { var d = Math.sin(a), m = Math.cos(a); return u[0] = m, u[1] = d, u[2] = 0, u[3] = -d, u[4] = m, u[5] = 0, u[6] = 0, u[7] = 0, u[8] = 1, u }, o.fromScaling = function (u, a) { return u[0] = a[0], u[1] = 0, u[2] = 0, u[3] = 0, u[4] = 0, u[5] = a[1], u[6] = 0, u[7] = 0, u[8] = 0, u[9] = 0, u[10] = a[2], u[11] = 0, u[12] = 0, u[13] = 0, u[14] = 0, u[15] = 1, u }, o.getAnchorAlignment = g_, o.getAnchorJustification = x_, o.getArrayBuffer = yt, o.getImage = rt, o.getJSON = function (u, a) { return Rt(k(u, { type: "json" }), a) }, o.getOverlapMode = S_, o.getRTLTextPluginStatus = zu, o.getReferrer = Pt, o.getVideo = function (u, a) { const d = window.document.createElement("video"); d.muted = !0, d.onloadstart = function () { a(null, d) }; for (let m = 0; m < u.length; m++) { const _ = window.document.createElement("source"); Mt(u[m]) || (d.crossOrigin = "Anonymous"), _.src = u[m], d.appendChild(_) } return { cancel: () => { } } }, o.identity = e_, o.invert = function (u, a) { var d = a[0], m = a[1], _ = a[2], S = a[3], T = a[4], L = a[5], F = a[6], K = a[7], Q = a[8], ne = a[9], ue = a[10], he = a[11], pe = a[12], Ne = a[13], Ae = a[14], Ye = a[15], lt = d * L - m * T, Ke = d * F - _ * T, it = d * K - S * T, kt = m * F - _ * L, Tt = m * K - S * L, hn = _ * K - S * F, vn = Q * Ne - ne * pe, on = Q * Ae - ue * pe, Qt = Q * Ye - he * pe, Gt = ne * Ae - ue * Ne, an = ne * Ye - he * Ne, tn = ue * Ye - he * Ae, $t = lt * tn - Ke * an + it * Gt + kt * Qt - Tt * on + hn * vn; return $t ? (u[0] = (L * tn - F * an + K * Gt) * ($t = 1 / $t), u[1] = (_ * an - m * tn - S * Gt) * $t, u[2] = (Ne * hn - Ae * Tt + Ye * kt) * $t, u[3] = (ue * Tt - ne * hn - he * kt) * $t, u[4] = (F * Qt - T * tn - K * on) * $t, u[5] = (d * tn - _ * Qt + S * on) * $t, u[6] = (Ae * it - pe * hn - Ye * Ke) * $t, u[7] = (Q * hn - ue * it + he * Ke) * $t, u[8] = (T * an - L * Qt + K * vn) * $t, u[9] = (m * Qt - d * an - S * vn) * $t, u[10] = (pe * Tt - Ne * it + Ye * lt) * $t, u[11] = (ne * it - Q * Tt - he * lt) * $t, u[12] = (L * on - T * Gt - F * vn) * $t, u[13] = (d * Gt - m * on + _ * vn) * $t, u[14] = (Ne * Ke - pe * kt - Ae * lt) * $t, u[15] = (Q * kt - ne * Ke + ue * lt) * $t, u) : null }, o.isImageBitmap = J, o.isSafari = Z, o.isWorker = j, o.keysDifference = function (u, a) { const d = []; for (const m in u) m in a || d.push(m); return d }, o.lazyLoadRTLTextPlugin = function () { ko.isLoading() || ko.isLoaded() || zu() !== "deferred" || cv() }, o.makeRequest = Rt, o.mapObject = R, o.mercatorXfromLng = G4, o.mercatorYfromLat = q4, o.mercatorZfromAltitude = Z4, o.mul = dF, o.mul$1 = function (u, a, d) { return u[0] = a[0] * d[0], u[1] = a[1] * d[1], u[2] = a[2] * d[2], u[3] = a[3] * d[3], u }, o.multiply = XE, o.nextPowerOfTwo = function (u) { return u <= 1 ? 1 : Math.pow(2, Math.ceil(Math.log(u) / Math.LN2)) }, o.normalize = function (u, a) { var d = a[0], m = a[1], _ = a[2], S = d * d + m * m + _ * _; return S > 0 && (S = 1 / Math.sqrt(S)), u[0] = a[0] * S, u[1] = a[1] * S, u[2] = a[2] * S, u }, o.number = xr, o.ortho = function (u, a, d, m, _, S, T) { var L = 1 / (a - d), F = 1 / (m - _), K = 1 / (S - T); return u[0] = -2 * L, u[1] = 0, u[2] = 0, u[3] = 0, u[4] = 0, u[5] = -2 * F, u[6] = 0, u[7] = 0, u[8] = 0, u[9] = 0, u[10] = 2 * K, u[11] = 0, u[12] = (a + d) * L, u[13] = (_ + m) * F, u[14] = (T + S) * K, u[15] = 1, u }, o.parseCacheControl = X, o.parseGlyphPbf = function (u) { return new h_(u).readFields(d$, []) }, o.pbf = h_, o.performSymbolLayout = function (u) { u.bucket.createArrays(), u.bucket.tilePixelRatio = fi / (512 * u.bucket.overscaling), u.bucket.compareText = {}, u.bucket.iconsNeedLinear = !1; const a = u.bucket.layers[0].layout, d = u.bucket.layers[0]._unevaluatedLayout._values, m = { layoutIconSize: d["icon-size"].possiblyEvaluate(new Or(u.bucket.zoom + 1), u.canonical), layoutTextSize: d["text-size"].possiblyEvaluate(new Or(u.bucket.zoom + 1), u.canonical), textMaxSize: d["text-size"].possiblyEvaluate(new Or(18)) }; if (u.bucket.textSizeData.kind === "composite") { const { minZoom: F, maxZoom: K } = u.bucket.textSizeData; m.compositeTextSizes = [d["text-size"].possiblyEvaluate(new Or(F), u.canonical), d["text-size"].possiblyEvaluate(new Or(K), u.canonical)] } if (u.bucket.iconSizeData.kind === "composite") { const { minZoom: F, maxZoom: K } = u.bucket.iconSizeData; m.compositeIconSizes = [d["icon-size"].possiblyEvaluate(new Or(F), u.canonical), d["icon-size"].possiblyEvaluate(new Or(K), u.canonical)] } const _ = a.get("text-line-height") * Ti, S = a.get("text-rotation-alignment") !== "viewport" && a.get("symbol-placement") !== "point", T = a.get("text-keep-upright"), L = a.get("text-size"); for (const F of u.bucket.features) { const K = a.get("text-font").evaluate(F, {}, u.canonical).join(","), Q = L.evaluate(F, {}, u.canonical), ne = m.layoutTextSize.evaluate(F, {}, u.canonical), ue = m.layoutIconSize.evaluate(F, {}, u.canonical), he = { horizontal: {}, vertical: void 0 }, pe = F.text; let Ne, Ae = [0, 0]; if (pe) { const Ke = pe.toString(), it = a.get("text-letter-spacing").evaluate(F, {}, u.canonical) * Ti, kt = Wx(Ke) ? it : 0, Tt = a.get("text-anchor").evaluate(F, {}, u.canonical), hn = a.get("text-variable-anchor"); if (!hn) { const an = a.get("text-radial-offset").evaluate(F, {}, u.canonical); Ae = an ? B4(Tt, [an * Ti, y_]) : a.get("text-offset").evaluate(F, {}, u.canonical).map(tn => tn * Ti) } let vn = S ? "center" : a.get("text-justify").evaluate(F, {}, u.canonical); const on = a.get("symbol-placement"), Qt = on === "point" ? a.get("text-max-width").evaluate(F, {}, u.canonical) * Ti : 0, Gt = () => { u.bucket.allowVerticalPlacement && ed(Ke) && (he.vertical = Tv(pe, u.glyphMap, u.glyphPositions, u.imagePositions, K, Qt, _, Tt, "left", kt, Ae, o.WritingMode.vertical, !0, on, ne, Q)) }; if (!S && hn) { const an = vn === "auto" ? hn.map($t => x_($t)) : [vn]; let tn = !1; for (let $t = 0; $t < an.length; $t++) { const Tn = an[$t]; if (!he.horizontal[Tn]) if (tn) he.horizontal[Tn] = he.horizontal[0]; else { const _n = Tv(pe, u.glyphMap, u.glyphPositions, u.imagePositions, K, Qt, _, "center", Tn, kt, Ae, o.WritingMode.horizontal, !1, on, ne, Q); _n && (he.horizontal[Tn] = _n, tn = _n.positionedLines.length === 1) } } Gt() } else { vn === "auto" && (vn = x_(Tt)); const an = Tv(pe, u.glyphMap, u.glyphPositions, u.imagePositions, K, Qt, _, Tt, vn, kt, Ae, o.WritingMode.horizontal, !1, on, ne, Q); an && (he.horizontal[vn] = an), Gt(), ed(Ke) && S && T && (he.vertical = Tv(pe, u.glyphMap, u.glyphPositions, u.imagePositions, K, Qt, _, Tt, vn, kt, Ae, o.WritingMode.vertical, !1, on, ne, Q)) } } let Ye = !1; if (F.icon && F.icon.name) { const Ke = u.imageMap[F.icon.name]; Ke && (Ne = g$(u.imagePositions[F.icon.name], a.get("icon-offset").evaluate(F, {}, u.canonical), a.get("icon-anchor").evaluate(F, {}, u.canonical)), Ye = !!Ke.sdf, u.bucket.sdfIcons === void 0 ? u.bucket.sdfIcons = Ye : u.bucket.sdfIcons !== Ye && B("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"), (Ke.pixelRatio !== u.bucket.pixelRatio || a.get("icon-rotate").constantOr(1) !== 0) && (u.bucket.iconsNeedLinear = !0)) } const lt = U4(he.horizontal) || he.vertical; u.bucket.iconsInText = !!lt && lt.iconsInText, (lt || Ne) && S$(u.bucket, F, he, Ne, u.imageMap, m, ne, ue, Ae, Ye, u.canonical) } u.showCollisionBoxes && u.bucket.generateCollisionDebugBuffers() }, o.perspective = function (u, a, d, m, _) { var S, T = 1 / Math.tan(a / 2); return u[0] = T / d, u[1] = 0, u[2] = 0, u[3] = 0, u[4] = 0, u[5] = T, u[6] = 0, u[7] = 0, u[8] = 0, u[9] = 0, u[11] = -1, u[12] = 0, u[13] = 0, u[15] = 0, _ != null && _ !== 1 / 0 ? (u[10] = (_ + m) * (S = 1 / (m - _)), u[14] = 2 * _ * m * S) : (u[10] = -1, u[14] = -2 * m), u }, o.pick = function (u, a) { const d = {}; for (let m = 0; m < a.length; m++) { const _ = a[m]; _ in u && (d[_] = u[_]) } return d }, o.plugin = ko, o.pointGeometry = ie, o.polygonIntersectsPolygon = HE, o.potpack = S4, o.refProperties = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"], o.register = mn, o.registerForPluginStateChange = function (u) { return u({ pluginStatus: Xi, pluginURL: Ja }), lh.on("pluginStateChange", u), u }, o.renderColorRamp = r4, o.rotateX = function (u, a, d) { var m = Math.sin(d), _ = Math.cos(d), S = a[4], T = a[5], L = a[6], F = a[7], K = a[8], Q = a[9], ne = a[10], ue = a[11]; return a !== u && (u[0] = a[0], u[1] = a[1], u[2] = a[2], u[3] = a[3], u[12] = a[12], u[13] = a[13], u[14] = a[14], u[15] = a[15]), u[4] = S * _ + K * m, u[5] = T * _ + Q * m, u[6] = L * _ + ne * m, u[7] = F * _ + ue * m, u[8] = K * _ - S * m, u[9] = Q * _ - T * m, u[10] = ne * _ - L * m, u[11] = ue * _ - F * m, u }, o.rotateZ = function (u, a, d) { var m = Math.sin(d), _ = Math.cos(d), S = a[0], T = a[1], L = a[2], F = a[3], K = a[4], Q = a[5], ne = a[6], ue = a[7]; return a !== u && (u[8] = a[8], u[9] = a[9], u[10] = a[10], u[11] = a[11], u[12] = a[12], u[13] = a[13], u[14] = a[14], u[15] = a[15]), u[0] = S * _ + K * m, u[1] = T * _ + Q * m, u[2] = L * _ + ne * m, u[3] = F * _ + ue * m, u[4] = K * _ - S * m, u[5] = Q * _ - T * m, u[6] = ne * _ - L * m, u[7] = ue * _ - F * m, u }, o.scale = function (u, a, d) { var m = d[0], _ = d[1], S = d[2]; return u[0] = a[0] * m, u[1] = a[1] * m, u[2] = a[2] * m, u[3] = a[3] * m, u[4] = a[4] * _, u[5] = a[5] * _, u[6] = a[6] * _, u[7] = a[7] * _, u[8] = a[8] * S, u[9] = a[9] * S, u[10] = a[10] * S, u[11] = a[11] * S, u[12] = a[12], u[13] = a[13], u[14] = a[14], u[15] = a[15], u }, o.scale$1 = function (u, a, d) { return u[0] = a[0] * d, u[1] = a[1] * d, u[2] = a[2] * d, u }, o.setCacheLimits = function (u, a) { Pe = u, De = a }, o.setRTLTextPlugin = function (u, a, d = !1) { if (Xi === ih || Xi === oh || Xi === ah) throw new Error("setRTLTextPlugin cannot be called multiple times."); Ja = ve.resolveURL(u), Xi = ih, sh = a, El(), d || cv() }, o.spec = Fe, o.sphericalToCartesian = function ([u, a, d]) { return a += 90, a *= Math.PI / 180, d *= Math.PI / 180, { x: u * Math.cos(a) * Math.sin(d), y: u * Math.sin(a) * Math.sin(d), z: u * Math.cos(d) } }, o.sqrLen = function (u) { var a = u[0], d = u[1]; return a * a + d * d }, o.sub = function (u, a, d) { return u[0] = a[0] - d[0], u[1] = a[1] - d[1], u[2] = a[2] - d[2], u }, o.toEvaluationFeature = Uu, o.transformMat3 = function (u, a, d) { var m = a[0], _ = a[1], S = a[2]; return u[0] = m * d[0] + _ * d[3] + S * d[6], u[1] = m * d[1] + _ * d[4] + S * d[7], u[2] = m * d[2] + _ * d[5] + S * d[8], u }, o.transformMat4 = xv, o.transformMat4$1 = function (u, a, d) { var m = a[0], _ = a[1]; return u[0] = d[0] * m + d[4] * _ + d[12], u[1] = d[1] * m + d[5] * _ + d[13], u }, o.translate = function (u, a, d) { var m, _, S, T, L, F, K, Q, ne, ue, he, pe, Ne = d[0], Ae = d[1], Ye = d[2]; return a === u ? (u[12] = a[0] * Ne + a[4] * Ae + a[8] * Ye + a[12], u[13] = a[1] * Ne + a[5] * Ae + a[9] * Ye + a[13], u[14] = a[2] * Ne + a[6] * Ae + a[10] * Ye + a[14], u[15] = a[3] * Ne + a[7] * Ae + a[11] * Ye + a[15]) : (_ = a[1], S = a[2], T = a[3], L = a[4], F = a[5], K = a[6], Q = a[7], ne = a[8], ue = a[9], he = a[10], pe = a[11], u[0] = m = a[0], u[1] = _, u[2] = S, u[3] = T, u[4] = L, u[5] = F, u[6] = K, u[7] = Q, u[8] = ne, u[9] = ue, u[10] = he, u[11] = pe, u[12] = m * Ne + L * Ae + ne * Ye + a[12], u[13] = _ * Ne + F * Ae + ue * Ye + a[13], u[14] = S * Ne + K * Ae + he * Ye + a[14], u[15] = T * Ne + Q * Ae + pe * Ye + a[15]), u }, o.triggerPluginCompletionEvent = uv, o.unicodeBlockLookup = rn, o.uniqueId = function () { return A++ }, o.validateCustomStyleLayer = function (u) { const a = [], d = u.id; return d === void 0 && a.push({ message: `layers.${d}: missing required property "id"` }), u.render === void 0 && a.push({ message: `layers.${d}: missing required method "render"` }), u.renderingMode && u.renderingMode !== "2d" && u.renderingMode !== "3d" && a.push({ message: `layers.${d}: property "renderingMode" must be either "2d" or "3d"` }), a }, o.validateLight = eh, o.validateStyle = Du, o.vectorTile = Il, o.warnOnce = B, o.wrap = P
|
|
|
}), s(["./shared"], function (o) { function f(me) { const H = typeof me; if (H === "number" || H === "boolean" || H === "string" || me == null) return JSON.stringify(me); if (Array.isArray(me)) { let le = "["; for (const xe of me) le += `${f(xe)},`; return `${le}]` } const q = Object.keys(me).sort(); let de = "{"; for (let le = 0; le < q.length; le++)de += `${JSON.stringify(q[le])}:${f(me[q[le]])},`; return `${de}}` } function p(me) { let H = ""; for (const q of o.refProperties) H += `/${f(me[q])}`; return H } class v { constructor(H) { this.keyCache = {}, H && this.replace(H) } replace(H) { this._layerConfigs = {}, this._layers = {}, this.update(H, []) } update(H, q) { for (const le of H) { this._layerConfigs[le.id] = le; const xe = this._layers[le.id] = o.createStyleLayer(le); xe._featureFilter = o.createFilter(xe.filter), this.keyCache[le.id] && delete this.keyCache[le.id] } for (const le of q) delete this.keyCache[le], delete this._layerConfigs[le], delete this._layers[le]; this.familiesBySource = {}; const de = function (le, xe) { const Ee = {}; for (let Ce = 0; Ce < le.length; Ce++) { const Le = xe && xe[le[Ce].id] || p(le[Ce]); xe && (xe[le[Ce].id] = Le); let qe = Ee[Le]; qe || (qe = Ee[Le] = []), qe.push(le[Ce]) } const be = []; for (const Ce in Ee) be.push(Ee[Ce]); return be }(Object.values(this._layerConfigs), this.keyCache); for (const le of de) { const xe = le.map(Ze => this._layers[Ze.id]), Ee = xe[0]; if (Ee.visibility === "none") continue; const be = Ee.source || ""; let Ce = this.familiesBySource[be]; Ce || (Ce = this.familiesBySource[be] = {}); const Le = Ee.sourceLayer || "_geojsonTileLayer"; let qe = Ce[Le]; qe || (qe = Ce[Le] = []), qe.push(xe) } } } class y { constructor(H) { const q = {}, de = []; for (const be in H) { const Ce = H[be], Le = q[be] = {}; for (const qe in Ce) { const Ze = Ce[+qe]; if (!Ze || Ze.bitmap.width === 0 || Ze.bitmap.height === 0) continue; const Ve = { x: 0, y: 0, w: Ze.bitmap.width + 2, h: Ze.bitmap.height + 2 }; de.push(Ve), Le[qe] = { rect: Ve, metrics: Ze.metrics } } } const { w: le, h: xe } = o.potpack(de), Ee = new o.AlphaImage({ width: le || 1, height: xe || 1 }); for (const be in H) { const Ce = H[be]; for (const Le in Ce) { const qe = Ce[+Le]; if (!qe || qe.bitmap.width === 0 || qe.bitmap.height === 0) continue; const Ze = q[be][Le].rect; o.AlphaImage.copy(qe.bitmap, Ee, { x: 0, y: 0 }, { x: Ze.x + 1, y: Ze.y + 1 }, qe.bitmap) } } this.image = Ee, this.positions = q } } o.register("GlyphAtlas", y); class w { constructor(H) { this.tileID = new o.OverscaledTileID(H.tileID.overscaledZ, H.tileID.wrap, H.tileID.canonical.z, H.tileID.canonical.x, H.tileID.canonical.y), this.uid = H.uid, this.zoom = H.zoom, this.pixelRatio = H.pixelRatio, this.tileSize = H.tileSize, this.source = H.source, this.overscaling = this.tileID.overscaleFactor(), this.showCollisionBoxes = H.showCollisionBoxes, this.collectResourceTiming = !!H.collectResourceTiming, this.returnDependencies = !!H.returnDependencies, this.promoteId = H.promoteId } parse(H, q, de, le, xe) { this.status = "parsing", this.data = H, this.collisionBoxArray = new o.CollisionBoxArray; const Ee = new o.DictionaryCoder(Object.keys(H.layers).sort()), be = new o.FeatureIndex(this.tileID, this.promoteId); be.bucketLayerIDs = []; const Ce = {}, Le = { featureIndex: be, iconDependencies: {}, patternDependencies: {}, glyphDependencies: {}, availableImages: de }, qe = q.familiesBySource[this.source]; for (const un in qe) { const wn = H.layers[un]; if (!wn) continue; wn.version === 1 && o.warnOnce(`Vector tile source "${this.source}" layer "${un}" does not use vector tile spec v2 and therefore may have some rendering errors.`); const Vn = Ee.encode(un), rr = []; for (let $r = 0; $r < wn.length; $r++) { const sr = wn.feature($r), Mr = be.getId(sr, un); rr.push({ feature: sr, id: Mr, index: $r, sourceLayerIndex: Vn }) } for (const $r of qe[un]) { const sr = $r[0]; sr.source !== this.source && o.warnOnce(`layer.source = ${sr.source} does not equal this.source = ${this.source}`), sr.minzoom && this.zoom < Math.floor(sr.minzoom) || sr.maxzoom && this.zoom >= sr.maxzoom || sr.visibility !== "none" && (P($r, this.zoom, de), (Ce[sr.id] = sr.createBucket({ index: be.bucketLayerIDs.length, layers: $r, zoom: this.zoom, pixelRatio: this.pixelRatio, overscaling: this.overscaling, collisionBoxArray: this.collisionBoxArray, sourceLayerIndex: Vn, sourceID: this.source })).populate(rr, Le, this.tileID.canonical), be.bucketLayerIDs.push($r.map(Mr => Mr.id))) } } let Ze, Ve, Lt, Ct; const Je = o.mapObject(Le.glyphDependencies, un => Object.keys(un).map(Number)); Object.keys(Je).length ? le.send("getGlyphs", { uid: this.uid, stacks: Je }, (un, wn) => { Ze || (Ze = un, Ve = wn, bn.call(this)) }) : Ve = {}; const Ot = Object.keys(Le.iconDependencies); Ot.length ? le.send("getImages", { icons: Ot, source: this.source, tileID: this.tileID, type: "icons" }, (un, wn) => { Ze || (Ze = un, Lt = wn, bn.call(this)) }) : Lt = {}; const Vt = Object.keys(Le.patternDependencies); function bn() { if (Ze) return xe(Ze); if (Ve && Lt && Ct) { const un = new y(Ve), wn = new o.ImageAtlas(Lt, Ct); for (const Vn in Ce) { const rr = Ce[Vn]; rr instanceof o.SymbolBucket ? (P(rr.layers, this.zoom, de), o.performSymbolLayout({ bucket: rr, glyphMap: Ve, glyphPositions: un.positions, imageMap: Lt, imagePositions: wn.iconPositions, showCollisionBoxes: this.showCollisionBoxes, canonical: this.tileID.canonical })) : rr.hasPattern && (rr instanceof o.LineBucket || rr instanceof o.FillBucket || rr instanceof o.FillExtrusionBucket) && (P(rr.layers, this.zoom, de), rr.addFeatures(Le, this.tileID.canonical, wn.patternPositions)) } this.status = "done", xe(null, { buckets: Object.values(Ce).filter(Vn => !Vn.isEmpty()), featureIndex: be, collisionBoxArray: this.collisionBoxArray, glyphAtlasImage: un.image, imageAtlas: wn, glyphMap: this.returnDependencies ? Ve : null, iconMap: this.returnDependencies ? Lt : null, glyphPositions: this.returnDependencies ? un.positions : null }) } } Vt.length ? le.send("getImages", { icons: Vt, source: this.source, tileID: this.tileID, type: "patterns" }, (un, wn) => { Ze || (Ze = un, Ct = wn, bn.call(this)) }) : Ct = {}, bn.call(this) } } function P(me, H, q) { const de = new o.EvaluationParameters(H); for (const le of me) le.recalculate(de, q) } function k(me, H) { const q = o.getArrayBuffer(me.request, (de, le, xe, Ee) => { de ? H(de) : le && H(null, { vectorTile: new o.vectorTile.VectorTile(new o.pbf(le)), rawData: le, cacheControl: xe, expires: Ee }) }); return () => { q.cancel(), H() } } class A { constructor(H, q, de, le) { this.actor = H, this.layerIndex = q, this.availableImages = de, this.loadVectorData = le || k, this.loading = {}, this.loaded = {} } loadTile(H, q) { const de = H.uid; this.loading || (this.loading = {}); const le = !!(H && H.request && H.request.collectResourceTiming) && new o.RequestPerformance(H.request), xe = this.loading[de] = new w(H); xe.abort = this.loadVectorData(H, (Ee, be) => { if (delete this.loading[de], Ee || !be) return xe.status = "done", this.loaded[de] = xe, q(Ee); const Ce = be.rawData, Le = {}; be.expires && (Le.expires = be.expires), be.cacheControl && (Le.cacheControl = be.cacheControl); const qe = {}; if (le) { const Ze = le.finish(); Ze && (qe.resourceTiming = JSON.parse(JSON.stringify(Ze))) } xe.vectorTile = be.vectorTile, xe.parse(be.vectorTile, this.layerIndex, this.availableImages, this.actor, (Ze, Ve) => { if (Ze || !Ve) return q(Ze); q(null, o.extend({ rawTileData: Ce.slice(0) }, Ve, Le, qe)) }), this.loaded = this.loaded || {}, this.loaded[de] = xe }) } reloadTile(H, q) { const de = this.loaded, le = H.uid, xe = this; if (de && de[le]) { const Ee = de[le]; Ee.showCollisionBoxes = H.showCollisionBoxes; const be = (Ce, Le) => { const qe = Ee.reloadCallback; qe && (delete Ee.reloadCallback, Ee.parse(Ee.vectorTile, xe.layerIndex, this.availableImages, xe.actor, qe)), q(Ce, Le) }; Ee.status === "parsing" ? Ee.reloadCallback = be : Ee.status === "done" && (Ee.vectorTile ? Ee.parse(Ee.vectorTile, this.layerIndex, this.availableImages, this.actor, be) : be()) } } abortTile(H, q) { const de = this.loading, le = H.uid; de && de[le] && de[le].abort && (de[le].abort(), delete de[le]), q() } removeTile(H, q) { const de = this.loaded, le = H.uid; de && de[le] && delete de[le], q() } } class N { constructor() { this.loaded = {} } loadTile(H, q) { const { uid: de, encoding: le, rawImageData: xe } = H, Ee = o.isImageBitmap(xe) ? this.getImageData(xe) : xe, be = new o.DEMData(de, Ee, le); this.loaded = this.loaded || {}, this.loaded[de] = be, q(null, be) } getImageData(H) { this.offscreenCanvas && this.offscreenCanvasContext || (this.offscreenCanvas = new OffscreenCanvas(H.width, H.height), this.offscreenCanvasContext = this.offscreenCanvas.getContext("2d")), this.offscreenCanvas.width = H.width, this.offscreenCanvas.height = H.height, this.offscreenCanvasContext.drawImage(H, 0, 0, H.width, H.height); const q = this.offscreenCanvasContext.getImageData(-1, -1, H.width + 2, H.height + 2); return this.offscreenCanvasContext.clearRect(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height), new o.RGBAImage({ width: q.width, height: q.height }, q.data) } removeTile(H) { const q = this.loaded, de = H.uid; q && q[de] && delete q[de] } } var R = function me(H, q) { var de, le = H && H.type; if (le === "FeatureCollection") for (de = 0; de < H.features.length; de++)me(H.features[de], q); else if (le === "GeometryCollection") for (de = 0; de < H.geometries.length; de++)me(H.geometries[de], q); else if (le === "Feature") me(H.geometry, q); else if (le === "Polygon") M(H.coordinates, q); else if (le === "MultiPolygon") for (de = 0; de < H.coordinates.length; de++)M(H.coordinates[de], q); return H }; function M(me, H) { if (me.length !== 0) { O(me[0], H); for (var q = 1; q < me.length; q++)O(me[q], !H) } } function O(me, H) { for (var q = 0, de = 0, le = 0, xe = me.length, Ee = xe - 1; le < xe; Ee = le++) { var be = (me[le][0] - me[Ee][0]) * (me[Ee][1] + me[le][1]), Ce = q + be; de += Math.abs(q) >= Math.abs(be) ? q - Ce + be : be - Ce + q, q = Ce } q + de >= 0 != !!H && me.reverse() } const z = o.vectorTile.VectorTileFeature.prototype.toGeoJSON; class B { constructor(H) { this._feature = H, this.extent = o.EXTENT, this.type = H.type, this.properties = H.tags, "id" in H && !isNaN(H.id) && (this.id = parseInt(H.id, 10)) } loadGeometry() { if (this._feature.type === 1) { const H = []; for (const q of this._feature.geometry) H.push([new o.pointGeometry(q[0], q[1])]); return H } { const H = []; for (const q of this._feature.geometry) { const de = []; for (const le of q) de.push(new o.pointGeometry(le[0], le[1])); H.push(de) } return H } } toGeoJSON(H, q, de) { return z.call(this, H, q, de) } } class V { constructor(H) { this.layers = { _geojsonTileLayer: this }, this.name = "_geojsonTileLayer", this.extent = o.EXTENT, this.length = H.length, this._features = H } feature(H) { return new B(this._features[H]) } } var G = { exports: {} }, j = o.pointGeometry, X = o.vectorTile.VectorTileFeature, Y = se; function se(me, H) { this.options = H || {}, this.features = me, this.length = me.length } function ee(me, H) { this.id = typeof me.id == "number" ? me.id : void 0, this.type = me.type, this.rawGeometry = me.type === 1 ? [me.geometry] : me.geometry, this.properties = me.tags, this.extent = H || 4096 } se.prototype.feature = function (me) { return new ee(this.features[me], this.options.extent) }, ee.prototype.loadGeometry = function () { var me = this.rawGeometry; this.geometry = []; for (var H = 0; H < me.length; H++) { for (var q = me[H], de = [], le = 0; le < q.length; le++)de.push(new j(q[le][0], q[le][1])); this.geometry.push(de) } return this.geometry }, ee.prototype.bbox = function () { this.geometry || this.loadGeometry(); for (var me = this.geometry, H = 1 / 0, q = -1 / 0, de = 1 / 0, le = -1 / 0, xe = 0; xe < me.length; xe++)for (var Ee = me[xe], be = 0; be < Ee.length; be++) { var Ce = Ee[be]; H = Math.min(H, Ce.x), q = Math.max(q, Ce.x), de = Math.min(de, Ce.y), le = Math.max(le, Ce.y) } return [H, de, q, le] }, ee.prototype.toGeoJSON = X.prototype.toGeoJSON; var Z = o.pbf, J = Y; function ve(me) { var H = new Z; return function (q, de) { for (var le in q.layers) de.writeMessage(3, ie, q.layers[le]) }(me, H), H.finish() } function ie(me, H) { var q; H.writeVarintField(15, me.version || 1), H.writeStringField(1, me.name || ""), H.writeVarintField(5, me.extent || 4096); var de = { keys: [], values: [], keycache: {}, valuecache: {} }; for (q = 0; q < me.length; q++)de.feature = me.feature(q), H.writeMessage(2, ce, de); var le = de.keys; for (q = 0; q < le.length; q++)H.writeStringField(3, le[q]); var xe = de.values; for (q = 0; q < xe.length; q++)H.writeMessage(4, Pe, xe[q]) } function ce(me, H) { var q = me.feature; q.id !== void 0 && H.writeVarintField(1, q.id), H.writeMessage(2, oe, me), H.writeVarintField(3, q.type), H.writeMessage(4, Te, q) } function oe(me, H) { var q = me.feature, de = me.keys, le = me.values, xe = me.keycache, Ee = me.valuecache; for (var be in q.properties) { var Ce = q.properties[be], Le = xe[be]; if (Ce !== null) { Le === void 0 && (de.push(be), xe[be] = Le = de.length - 1), H.writeVarint(Le); var qe = typeof Ce; qe !== "string" && qe !== "boolean" && qe !== "number" && (Ce = JSON.stringify(Ce)); var Ze = qe + ":" + Ce, Ve = Ee[Ze]; Ve === void 0 && (le.push(Ce), Ee[Ze] = Ve = le.length - 1), H.writeVarint(Ve) } } } function ye(me, H) { return (H << 3) + (7 & me) } function Ie(me) { return me << 1 ^ me >> 31 } function Te(me, H) { for (var q = me.loadGeometry(), de = me.type, le = 0, xe = 0, Ee = q.length, be = 0; be < Ee; be++) { var Ce = q[be], Le = 1; de === 1 && (Le = Ce.length), H.writeVarint(ye(1, Le)); for (var qe = de === 3 ? Ce.length - 1 : Ce.length, Ze = 0; Ze < qe; Ze++) { Ze === 1 && de !== 1 && H.writeVarint(ye(2, qe - 1)); var Ve = Ce[Ze].x - le, Lt = Ce[Ze].y - xe; H.writeVarint(Ie(Ve)), H.writeVarint(Ie(Lt)), le += Ve, xe += Lt } de === 3 && H.writeVarint(ye(7, 1)) } } function Pe(me, H) { var q = typeof me; q === "string" ? H.writeStringField(1, me) : q === "boolean" ? H.writeBooleanField(7, me) : q === "number" && (me % 1 != 0 ? H.writeDoubleField(3, me) : me < 0 ? H.writeSVarintField(6, me) : H.writeVarintField(5, me)) } function De(me, H, q, de, le, xe) { if (le - de <= q) return; const Ee = de + le >> 1; Re(me, H, Ee, de, le, xe % 2), De(me, H, q, de, Ee - 1, xe + 1), De(me, H, q, Ee + 1, le, xe + 1) } function Re(me, H, q, de, le, xe) { for (; le > de;) { if (le - de > 600) { const Le = le - de + 1, qe = q - de + 1, Ze = Math.log(Le), Ve = .5 * Math.exp(2 * Ze / 3), Lt = .5 * Math.sqrt(Ze * Ve * (Le - Ve) / Le) * (qe - Le / 2 < 0 ? -1 : 1); Re(me, H, q, Math.max(de, Math.floor(q - qe * Ve / Le + Lt)), Math.min(le, Math.floor(q + (Le - qe) * Ve / Le + Lt)), xe) } const Ee = H[2 * q + xe]; let be = de, Ce = le; for (ke(me, H, de, q), H[2 * le + xe] > Ee && ke(me, H, de, le); be < Ce;) { for (ke(me, H, be, Ce), be++, Ce--; H[2 * be + xe] < Ee;)be++; for (; H[2 * Ce + xe] > Ee;)Ce-- } H[2 * de + xe] === Ee ? ke(me, H, de, Ce) : (Ce++, ke(me, H, Ce, le)), Ce <= q && (de = Ce + 1), q <= Ce && (le = Ce - 1) } } function ke(me, H, q, de) { Oe(me, q, de), Oe(H, 2 * q, 2 * de), Oe(H, 2 * q + 1, 2 * de + 1) } function Oe(me, H, q) { const de = me[H]; me[H] = me[q], me[q] = de } function $e(me, H, q, de) { const le = me - q, xe = H - de; return le * le + xe * xe } G.exports = ve, G.exports.fromVectorTileJs = ve, G.exports.fromGeojsonVt = function (me, H) { H = H || {}; var q = {}; for (var de in me) q[de] = new J(me[de].features, H), q[de].name = de, q[de].version = H.version, q[de].extent = H.extent; return ve({ layers: q }) }, G.exports.GeoJSONWrapper = J; const He = me => me[0], Ue = me => me[1]; class st { constructor(H, q = He, de = Ue, le = 64, xe = Float64Array) { this.nodeSize = le, this.points = H; const Ee = H.length < 65536 ? Uint16Array : Uint32Array, be = this.ids = new Ee(H.length), Ce = this.coords = new xe(2 * H.length); for (let Le = 0; Le < H.length; Le++)be[Le] = Le, Ce[2 * Le] = q(H[Le]), Ce[2 * Le + 1] = de(H[Le]); De(be, Ce, le, 0, be.length - 1, 0) } range(H, q, de, le) { return function (xe, Ee, be, Ce, Le, qe, Ze) { const Ve = [0, xe.length - 1, 0], Lt = []; let Ct, Je; for (; Ve.length;) { const Ot = Ve.pop(), Vt = Ve.pop(), bn = Ve.pop(); if (Vt - bn <= Ze) { for (let Vn = bn; Vn <= Vt; Vn++)Ct = Ee[2 * Vn], Je = Ee[2 * Vn + 1], Ct >= be && Ct <= Le && Je >= Ce && Je <= qe && Lt.push(xe[Vn]); continue } const un = Math.floor((bn + Vt) / 2); Ct = Ee[2 * un], Je = Ee[2 * un + 1], Ct >= be && Ct <= Le && Je >= Ce && Je <= qe && Lt.push(xe[un]); const wn = (Ot + 1) % 2; (Ot === 0 ? be <= Ct : Ce <= Je) && (Ve.push(bn), Ve.push(un - 1), Ve.push(wn)), (Ot === 0 ? Le >= Ct : qe >= Je) && (Ve.push(un + 1), Ve.push(Vt), Ve.push(wn)) } return Lt }(this.ids, this.coords, H, q, de, le, this.nodeSize) } within(H, q, de) { return function (le, xe, Ee, be, Ce, Le) { const qe = [0, le.length - 1, 0], Ze = [], Ve = Ce * Ce; for (; qe.length;) { const Lt = qe.pop(), Ct = qe.pop(), Je = qe.pop(); if (Ct - Je <= Le) { for (let wn = Je; wn <= Ct; wn++)$e(xe[2 * wn], xe[2 * wn + 1], Ee, be) <= Ve && Ze.push(le[wn]); continue } const Ot = Math.floor((Je + Ct) / 2), Vt = xe[2 * Ot], bn = xe[2 * Ot + 1]; $e(Vt, bn, Ee, be) <= Ve && Ze.push(le[Ot]); const un = (Lt + 1) % 2; (Lt === 0 ? Ee - Ce <= Vt : be - Ce <= bn) && (qe.push(Je), qe.push(Ot - 1), qe.push(un)), (Lt === 0 ? Ee + Ce >= Vt : be + Ce >= bn) && (qe.push(Ot + 1), qe.push(Ct), qe.push(un)) } return Ze }(this.ids, this.coords, H, q, de, this.nodeSize) } } const ft = { minZoom: 0, maxZoom: 16, minPoints: 2, radius: 40, extent: 512, nodeSize: 64, log: !1, generateId: !1, reduce: null, map: me => me }, It = Math.fround || (We = new Float32Array(1), me => (We[0] = +me, We[0])); var We; class Pt { constructor(H) { this.options = rt(Object.create(ft), H), this.trees = new Array(this.options.maxZoom + 1) } load(H) { const { log: q, minZoom: de, maxZoom: le, nodeSize: xe } = this.options; q && console.time("total time"); const Ee = `prepare ${H.length} points`; q && console.time(Ee), this.points = H; let be = []; for (let Ce = 0; Ce < H.length; Ce++)H[Ce].geometry && be.push(Rt(H[Ce], Ce)); this.trees[le + 1] = new st(be, ht, bt, xe, Float32Array), q && console.timeEnd(Ee); for (let Ce = le; Ce >= de; Ce--) { const Le = +Date.now(); be = this._cluster(be, Ce), this.trees[Ce] = new st(be, ht, bt, xe, Float32Array), q && console.log("z%d: %d clusters in %dms", Ce, be.length, +Date.now() - Le) } return q && console.timeEnd("total time"), this } getClusters(H, q) { let de = ((H[0] + 180) % 360 + 360) % 360 - 180; const le = Math.max(-90, Math.min(90, H[1])); let xe = H[2] === 180 ? 180 : ((H[2] + 180) % 360 + 360) % 360 - 180; const Ee = Math.max(-90, Math.min(90, H[3])); if (H[2] - H[0] >= 360) de = -180, xe = 180; else if (de > xe) { const qe = this.getClusters([de, le, 180, Ee], q), Ze = this.getClusters([-180, le, xe, Ee], q); return qe.concat(Ze) } const be = this.trees[this._limitZoom(q)], Ce = be.range(ut(de), dt(Ee), ut(xe), dt(le)), Le = []; for (const qe of Ce) { const Ze = be.points[qe]; Le.push(Ze.numPoints ? yt(Ze) : this.points[Ze.index]) } return Le } getChildren(H) { const q = this._getOriginId(H), de = this._getOriginZoom(H), le = "No cluster with the specified id.", xe = this.trees[de]; if (!xe) throw new Error(le); const Ee = xe.points[q]; if (!Ee) throw new Error(le); const be = this.options.radius / (this.options.extent * Math.pow(2, de - 1)), Ce = xe.within(Ee.x, Ee.y, be), Le = []; for (const qe of Ce) { const Ze = xe.points[qe]; Ze.parentId === H && Le.push(Ze.numPoints ? yt(Ze) : this.points[Ze.index]) } if (Le.length === 0) throw new Error(le); return Le } getLeaves(H, q, de) { const le = []; return this._appendLeaves(le, H, q = q || 10, de = de || 0, 0), le } getTile(H, q, de) { const le = this.trees[this._limitZoom(H)], xe = Math.pow(2, H), { extent: Ee, radius: be } = this.options, Ce = be / Ee, Le = (de - Ce) / xe, qe = (de + 1 + Ce) / xe, Ze = { features: [] }; return this._addTileFeatures(le.range((q - Ce) / xe, Le, (q + 1 + Ce) / xe, qe), le.points, q, de, xe, Ze), q === 0 && this._addTileFeatures(le.range(1 - Ce / xe, Le, 1, qe), le.points, xe, de, xe, Ze), q === xe - 1 && this._addTileFeatures(le.range(0, Le, Ce / xe, qe), le.points, -1, de, xe, Ze), Ze.features.length ? Ze : null } getClusterExpansionZoom(H) { let q = this._getOriginZoom(H) - 1; for (; q <= this.options.maxZoom;) { const de = this.getChildren(H); if (q++, de.length !== 1) break; H = de[0].properties.cluster_id } return q } _appendLeaves(H, q, de, le, xe) { const Ee = this.getChildren(q); for (const be of Ee) { const Ce = be.properties; if (Ce && Ce.cluster ? xe + Ce.point_count <= le ? xe += Ce.point_count : xe = this._appendLeaves(H, Ce.cluster_id, de, le, xe) : xe < le ? xe++ : H.push(be), H.length === de) break } return xe } _addTileFeatures(H, q, de, le, xe, Ee) { for (const be of H) { const Ce = q[be], Le = Ce.numPoints; let qe, Ze, Ve; if (Le) qe = Mt(Ce), Ze = Ce.x, Ve = Ce.y; else { const Je = this.points[Ce.index]; qe = Je.properties, Ze = ut(Je.geometry.coordinates[0]), Ve = dt(Je.geometry.coordinates[1]) } const Lt = { type: 1, geometry: [[Math.round(this.options.extent * (Ze * xe - de)), Math.round(this.options.extent * (Ve * xe - le))]], tags: qe }; let Ct; Le ? Ct = Ce.id : this.options.generateId ? Ct = Ce.index : this.points[Ce.index].id && (Ct = this.points[Ce.index].id), Ct !== void 0 && (Lt.id = Ct), Ee.features.push(Lt) } } _limitZoom(H) { return Math.max(this.options.minZoom, Math.min(Math.floor(+H), this.options.maxZoom + 1)) } _cluster(H, q) { const de = [], { radius: le, extent: xe, reduce: Ee, minPoints: be } = this.options, Ce = le / (xe * Math.pow(2, q)); for (let Le = 0; Le < H.length; Le++) { const qe = H[Le]; if (qe.zoom <= q) continue; qe.zoom = q; const Ze = this.trees[q + 1], Ve = Ze.within(qe.x, qe.y, Ce), Lt = qe.numPoints || 1; let Ct = Lt; for (const Je of Ve) { const Ot = Ze.points[Je]; Ot.zoom > q && (Ct += Ot.numPoints || 1) } if (Ct > Lt && Ct >= be) { let Je = qe.x * Lt, Ot = qe.y * Lt, Vt = Ee && Lt > 1 ? this._map(qe, !0) : null; const bn = (Le << 5) + (q + 1) + this.points.length; for (const un of Ve) { const wn = Ze.points[un]; if (wn.zoom <= q) continue; wn.zoom = q; const Vn = wn.numPoints || 1; Je += wn.x * Vn, Ot += wn.y * Vn, wn.parentId = bn, Ee && (Vt || (Vt = this._map(qe, !0)), Ee(Vt, this._map(wn))) } qe.parentId = bn, de.push(pt(Je / Ct, Ot / Ct, bn, Ct, Vt)) } else if (de.push(qe), Ct > 1) for (const Je of Ve) { const Ot = Ze.points[Je]; Ot.zoom <= q || (Ot.zoom = q, de.push(Ot)) } } return de } _getOriginId(H) { return H - this.points.length >> 5 } _getOriginZoom(H) { return (H - this.points.length) % 32 } _map(H, q) { if (H.numPoints) return q ? rt({}, H.properties) : H.properties; const de = this.points[H.index].properties, le = this.options.map(de); return q && le === de ? rt({}, le) : le } } function pt(me, H, q, de, le) { return { x: It(me), y: It(H), zoom: 1 / 0, id: q, parentId: -1, numPoints: de, properties: le } } function Rt(me, H) { const [q, de] = me.geometry.coordinates; return { x: It(ut(q)), y: It(dt(de)), zoom: 1 / 0, index: H, parentId: -1 } } function yt(me) { return { type: "Feature", id: me.id, properties: Mt(me), geometry: { type: "Point", coordinates: [(H = me.x, 360 * (H - .5)), ct(me.y)] } }; var H } function Mt(me) { const H = me.numPoints, q = H >= 1e4 ? `${Math.round(H / 1e3)}k` : H >= 1e3 ? Math.round(H / 100) / 10 + "k" : H; return rt(rt({}, me.properties), { cluster: !0, cluster_id: me.id, point_count: H, point_count_abbreviated: q }) } function ut(me) { return me / 360 + .5 } function dt(me) { const H = Math.sin(me * Math.PI / 180), q = .5 - .25 * Math.log((1 + H) / (1 - H)) / Math.PI; return q < 0 ? 0 : q > 1 ? 1 : q } function ct(me) { const H = (180 - 360 * me) * Math.PI / 180; return 360 * Math.atan(Math.exp(H)) / Math.PI - 90 } function rt(me, H) { for (const q in H) me[q] = H[q]; return me } function ht(me) { return me.x } function bt(me) { return me.y } function Wt(me, H, q, de) { for (var le, xe = de, Ee = q - H >> 1, be = q - H, Ce = me[H], Le = me[H + 1], qe = me[q], Ze = me[q + 1], Ve = H + 3; Ve < q; Ve += 3) { var Lt = Ut(me[Ve], me[Ve + 1], Ce, Le, qe, Ze); if (Lt > xe) le = Ve, xe = Lt; else if (Lt === xe) { var Ct = Math.abs(Ve - Ee); Ct < be && (le = Ve, be = Ct) } } xe > de && (le - H > 3 && Wt(me, H, le, de), me[le + 2] = xe, q - le > 3 && Wt(me, le, q, de)) } function Ut(me, H, q, de, le, xe) { var Ee = le - q, be = xe - de; if (Ee !== 0 || be !== 0) { var Ce = ((me - q) * Ee + (H - de) * be) / (Ee * Ee + be * be); Ce > 1 ? (q = le, de = xe) : Ce > 0 && (q += Ee * Ce, de += be * Ce) } return (Ee = me - q) * Ee + (be = H - de) * be } function Jt(me, H, q, de) { var le = { id: me === void 0 ? null : me, type: H, geometry: q, tags: de, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 }; return function (xe) { var Ee = xe.geometry, be = xe.type; if (be === "Point" || be === "MultiPoint" || be === "LineString") Fe(xe, Ee); else if (be === "Polygon" || be === "MultiLineString") for (var Ce = 0; Ce < Ee.length; Ce++)Fe(xe, Ee[Ce]); else if (be === "MultiPolygon") for (Ce = 0; Ce < Ee.length; Ce++)for (var Le = 0; Le < Ee[Ce].length; Le++)Fe(xe, Ee[Ce][Le]) }(le), le } function Fe(me, H) { for (var q = 0; q < H.length; q += 3)me.minX = Math.min(me.minX, H[q]), me.minY = Math.min(me.minY, H[q + 1]), me.maxX = Math.max(me.maxX, H[q]), me.maxY = Math.max(me.maxY, H[q + 1]) } function Ge(me, H, q, de) { if (H.geometry) { var le = H.geometry.coordinates, xe = H.geometry.type, Ee = Math.pow(q.tolerance / ((1 << q.maxZoom) * q.extent), 2), be = [], Ce = H.id; if (q.promoteId ? Ce = H.properties[q.promoteId] : q.generateId && (Ce = de || 0), xe === "Point") Zt(le, be); else if (xe === "MultiPoint") for (var Le = 0; Le < le.length; Le++)Zt(le[Le], be); else if (xe === "LineString") cn(le, be, Ee, !1); else if (xe === "MultiLineString") { if (q.lineMetrics) { for (Le = 0; Le < le.length; Le++)cn(le[Le], be = [], Ee, !1), me.push(Jt(Ce, "LineString", be, H.properties)); return } jt(le, be, Ee, !1) } else if (xe === "Polygon") jt(le, be, Ee, !0); else { if (xe !== "MultiPolygon") { if (xe === "GeometryCollection") { for (Le = 0; Le < H.geometry.geometries.length; Le++)Ge(me, { id: Ce, geometry: H.geometry.geometries[Le], properties: H.properties }, q, de); return } throw new Error("Input data is not a valid GeoJSON object.") } for (Le = 0; Le < le.length; Le++) { var qe = []; jt(le[Le], qe, Ee, !0), be.push(qe) } } me.push(Jt(Ce, xe, be, H.properties)) } } function Zt(me, H) { H.push(Kt(me[0])), H.push(nn(me[1])), H.push(0) } function cn(me, H, q, de) { for (var le, xe, Ee = 0, be = 0; be < me.length; be++) { var Ce = Kt(me[be][0]), Le = nn(me[be][1]); H.push(Ce), H.push(Le), H.push(0), be > 0 && (Ee += de ? (le * Le - Ce * xe) / 2 : Math.sqrt(Math.pow(Ce - le, 2) + Math.pow(Le - xe, 2))), le = Ce, xe = Le } var qe = H.length - 3; H[2] = 1, Wt(H, 0, qe, q), H[qe + 2] = 1, H.size = Math.abs(Ee), H.start = 0, H.end = H.size } function jt(me, H, q, de) { for (var le = 0; le < me.length; le++) { var xe = []; cn(me[le], xe, q, de), H.push(xe) } } function Kt(me) { return me / 360 + .5 } function nn(me) { var H = Math.sin(me * Math.PI / 180), q = .5 - .25 * Math.log((1 + H) / (1 - H)) / Math.PI; return q < 0 ? 0 : q > 1 ? 1 : q } function Cn(me, H, q, de, le, xe, Ee, be) { if (de /= H, xe >= (q /= H) && Ee < de) return me; if (Ee < q || xe >= de) return null; for (var Ce = [], Le = 0; Le < me.length; Le++) { var qe = me[Le], Ze = qe.geometry, Ve = qe.type, Lt = le === 0 ? qe.minX : qe.minY, Ct = le === 0 ? qe.maxX : qe.maxY; if (Lt >= q && Ct < de) Ce.push(qe); else if (!(Ct < q || Lt >= de)) { var Je = []; if (Ve === "Point" || Ve === "MultiPoint") Nn(Ze, Je, q, de, le); else if (Ve === "LineString") wt(Ze, Je, q, de, le, !1, be.lineMetrics); else if (Ve === "MultiLineString") At(Ze, Je, q, de, le, !1); else if (Ve === "Polygon") At(Ze, Je, q, de, le, !0); else if (Ve === "MultiPolygon") for (var Ot = 0; Ot < Ze.length; Ot++) { var Vt = []; At(Ze[Ot], Vt, q, de, le, !0), Vt.length && Je.push(Vt) } if (Je.length) { if (be.lineMetrics && Ve === "LineString") { for (Ot = 0; Ot < Je.length; Ot++)Ce.push(Jt(qe.id, Ve, Je[Ot], qe.tags)); continue } Ve !== "LineString" && Ve !== "MultiLineString" || (Je.length === 1 ? (Ve = "LineString", Je = Je[0]) : Ve = "MultiLineString"), Ve !== "Point" && Ve !== "MultiPoint" || (Ve = Je.length === 3 ? "Point" : "MultiPoint"), Ce.push(Jt(qe.id, Ve, Je, qe.tags)) } } } return Ce.length ? Ce : null } function Nn(me, H, q, de, le) { for (var xe = 0; xe < me.length; xe += 3) { var Ee = me[xe + le]; Ee >= q && Ee <= de && (H.push(me[xe]), H.push(me[xe + 1]), H.push(me[xe + 2])) } } function wt(me, H, q, de, le, xe, Ee) { for (var be, Ce, Le = qt(me), qe = le === 0 ? en : gt, Ze = me.start, Ve = 0; Ve < me.length - 3; Ve += 3) { var Lt = me[Ve], Ct = me[Ve + 1], Je = me[Ve + 2], Ot = me[Ve + 3], Vt = me[Ve + 4], bn = le === 0 ? Lt : Ct, un = le === 0 ? Ot : Vt, wn = !1; Ee && (be = Math.sqrt(Math.pow(Lt - Ot, 2) + Math.pow(Ct - Vt, 2))), bn < q ? un > q && (Ce = qe(Le, Lt, Ct, Ot, Vt, q), Ee && (Le.start = Ze + be * Ce)) : bn > de ? un < de && (Ce = qe(Le, Lt, Ct, Ot, Vt, de), Ee && (Le.start = Ze + be * Ce)) : Xt(Le, Lt, Ct, Je), un < q && bn >= q && (Ce = qe(Le, Lt, Ct, Ot, Vt, q), wn = !0), un > de && bn <= de && (Ce = qe(Le, Lt, Ct, Ot, Vt, de), wn = !0), !xe && wn && (Ee && (Le.end = Ze + be * Ce), H.push(Le), Le = qt(me)), Ee && (Ze += be) } var Vn = me.length - 3; Lt = me[Vn], Ct = me[Vn + 1], Je = me[Vn + 2], (bn = le === 0 ? Lt : Ct) >= q && bn <= de && Xt(Le, Lt, Ct, Je), Vn = Le.length - 3, xe && Vn >= 3 && (Le[Vn] !== Le[0] || Le[Vn + 1] !== Le[1]) && Xt(Le, Le[0], Le[1], Le[2]), Le.length && H.push(Le) } function qt(me) { var H = []; return H.size = me.size, H.start = me.start, H.end = me.end, H } function At(me, H, q, de, le, xe) { for (var Ee = 0; Ee < me.length; Ee++)wt(me[Ee], H, q, de, le, xe, !1) } function Xt(me, H, q, de) { me.push(H), me.push(q), me.push(de) } function en(me, H, q, de, le, xe) { var Ee = (xe - H) / (de - H); return me.push(xe), me.push(q + (le - q) * Ee), me.push(1), Ee } function gt(me, H, q, de, le, xe) { var Ee = (xe - q) / (le - q); return me.push(H + (de - H) * Ee), me.push(xe), me.push(1), Ee } function yn(me, H) { for (var q = [], de = 0; de < me.length; de++) { var le, xe = me[de], Ee = xe.type; if (Ee === "Point" || Ee === "MultiPoint" || Ee === "LineString") le = Sn(xe.geometry, H); else if (Ee === "MultiLineString" || Ee === "Polygon") { le = []; for (var be = 0; be < xe.geometry.length; be++)le.push(Sn(xe.geometry[be], H)) } else if (Ee === "MultiPolygon") for (le = [], be = 0; be < xe.geometry.length; be++) { for (var Ce = [], Le = 0; Le < xe.geometry[be].length; Le++)Ce.push(Sn(xe.geometry[be][Le], H)); le.push(Ce) } q.push(Jt(xe.id, Ee, le, xe.tags)) } return q } function Sn(me, H) { var q = []; q.size = me.size, me.start !== void 0 && (q.start = me.start, q.end = me.end); for (var de = 0; de < me.length; de += 3)q.push(me[de] + H, me[de + 1], me[de + 2]); return q } function dn(me, H) { if (me.transformed) return me; var q, de, le, xe = 1 << me.z, Ee = me.x, be = me.y; for (q = 0; q < me.features.length; q++) { var Ce = me.features[q], Le = Ce.geometry, qe = Ce.type; if (Ce.geometry = [], qe === 1) for (de = 0; de < Le.length; de += 2)Ce.geometry.push(zt(Le[de], Le[de + 1], H, xe, Ee, be)); else for (de = 0; de < Le.length; de++) { var Ze = []; for (le = 0; le < Le[de].length; le += 2)Ze.push(zt(Le[de][le], Le[de][le + 1], H, xe, Ee, be)); Ce.geometry.push(Ze) } } return me.transformed = !0, me } function zt(me, H, q, de, le, xe) { return [Math.round(q * (me * de - le)), Math.round(q * (H * de - xe))] } function ot(me, H, q, de, le) { for (var xe = H === le.maxZoom ? 0 : le.tolerance / ((1 << H) * le.extent), Ee = { features: [], numPoints: 0, numSimplified: 0, numFeatures: 0, source: null, x: q, y: de, z: H, transformed: !1, minX: 2, minY: 1, maxX: -1, maxY: 0 }, be = 0; be < me.length; be++) { Ee.numFeatures++, mt(Ee, me[be], xe, le); var Ce = me[be].minX, Le = me[be].minY, qe = me[be].maxX, Ze = me[be].maxY; Ce < Ee.minX && (Ee.minX = Ce), Le < Ee.minY && (Ee.minY = Le), qe > Ee.maxX && (Ee.maxX = qe), Ze > Ee.maxY && (Ee.maxY = Ze) } return Ee } function mt(me, H, q, de) { var le = H.geometry, xe = H.type, Ee = []; if (xe === "Point" || xe === "MultiPoint") for (var be = 0; be < le.length; be += 3)Ee.push(le[be]), Ee.push(le[be + 1]), me.numPoints++, me.numSimplified++; else if (xe === "LineString") Dt(Ee, le, me, q, !1, !1); else if (xe === "MultiLineString" || xe === "Polygon") for (be = 0; be < le.length; be++)Dt(Ee, le[be], me, q, xe === "Polygon", be === 0); else if (xe === "MultiPolygon") for (var Ce = 0; Ce < le.length; Ce++) { var Le = le[Ce]; for (be = 0; be < Le.length; be++)Dt(Ee, Le[be], me, q, !0, be === 0) } if (Ee.length) { var qe = H.tags || null; if (xe === "LineString" && de.lineMetrics) { for (var Ze in qe = {}, H.tags) qe[Ze] = H.tags[Ze]; qe.mapbox_clip_start = le.start / le.size, qe.mapbox_clip_end = le.end / le.size } var Ve = { geometry: Ee, type: xe === "Polygon" || xe === "MultiPolygon" ? 3 : xe === "LineString" || xe === "MultiLineString" ? 2 : 1, tags: qe }; H.id !== null && (Ve.id = H.id), me.features.push(Ve) } } function Dt(me, H, q, de, le, xe) { var Ee = de * de; if (de > 0 && H.size < (le ? Ee : de)) q.numPoints += H.length / 3; else { for (var be = [], Ce = 0; Ce < H.length; Ce += 3)(de === 0 || H[Ce + 2] > Ee) && (q.numSimplified++, be.push(H[Ce]), be.push(H[Ce + 1])), q.numPoints++; le && function (Le, qe) { for (var Ze = 0, Ve = 0, Lt = Le.length, Ct = Lt - 2; Ve < Lt; Ct = Ve, Ve += 2)Ze += (Le[Ve] - Le[Ct]) * (Le[Ve + 1] + Le[Ct + 1]); if (Ze > 0 === qe) for (Ve = 0, Lt = Le.length; Ve < Lt / 2; Ve += 2) { var Je = Le[Ve], Ot = Le[Ve + 1]; Le[Ve] = Le[Lt - 2 - Ve], Le[Ve + 1] = Le[Lt - 1 - Ve], Le[Lt - 2 - Ve] = Je, Le[Lt - 1 - Ve] = Ot } }(be, xe), me.push(be) } } function Bt(me, H) { var q = (H = this.options = function (le, xe) { for (var Ee in xe) le[Ee] = xe[Ee]; return le }(Object.create(this.options), H)).debug; if (q && console.time("preprocess data"), H.maxZoom < 0 || H.maxZoom > 24) throw new Error("maxZoom should be in the 0-24 range"); if (H.promoteId && H.generateId) throw new Error("promoteId and generateId cannot be used together."); var de = function (le, xe) { var Ee = []; if (le.type === "FeatureCollection") for (var be = 0; be < le.features.length; be++)Ge(Ee, le.features[be], xe, be); else Ge(Ee, le.type === "Feature" ? le : { geometry: le }, xe); return Ee }(me, H); this.tiles = {}, this.tileCoords = [], q && (console.timeEnd("preprocess data"), console.log("index: maxZoom: %d, maxPoints: %d", H.indexMaxZoom, H.indexMaxPoints), console.time("generate tiles"), this.stats = {}, this.total = 0), de = function (le, xe) { var Ee = xe.buffer / xe.extent, be = le, Ce = Cn(le, 1, -1 - Ee, Ee, 0, -1, 2, xe), Le = Cn(le, 1, 1 - Ee, 2 + Ee, 0, -1, 2, xe); return (Ce || Le) && (be = Cn(le, 1, -Ee, 1 + Ee, 0, -1, 2, xe) || [], Ce && (be = yn(Ce, 1).concat(be)), Le && (be = be.concat(yn(Le, -1)))), be }(de, H), de.length && this.splitTile(de, 0, 0, 0), q && (de.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats))) } function pn(me, H, q) { return 32 * ((1 << me) * q + H) + me } function On(me, H) { const q = me.tileID.canonical; if (!this._geoJSONIndex) return H(null, null); const de = this._geoJSONIndex.getTile(q.z, q.x, q.y); if (!de) return H(null, null); const le = new V(de.features); let xe = G.exports(le); xe.byteOffset === 0 && xe.byteLength === xe.buffer.byteLength || (xe = new Uint8Array(xe)), H(null, { vectorTile: le, rawData: xe.buffer }) } Bt.prototype.options = { maxZoom: 14, indexMaxZoom: 5, indexMaxPoints: 1e5, tolerance: 3, extent: 4096, buffer: 64, lineMetrics: !1, promoteId: null, generateId: !1, debug: 0 }, Bt.prototype.splitTile = function (me, H, q, de, le, xe, Ee) { for (var be = [me, H, q, de], Ce = this.options, Le = Ce.debug; be.length;) { de = be.pop(), q = be.pop(), H = be.pop(), me = be.pop(); var qe = 1 << H, Ze = pn(H, q, de), Ve = this.tiles[Ze]; if (!Ve && (Le > 1 && console.time("creation"), Ve = this.tiles[Ze] = ot(me, H, q, de, Ce), this.tileCoords.push({ z: H, x: q, y: de }), Le)) { Le > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", H, q, de, Ve.numFeatures, Ve.numPoints, Ve.numSimplified), console.timeEnd("creation")); var Lt = "z" + H; this.stats[Lt] = (this.stats[Lt] || 0) + 1, this.total++ } if (Ve.source = me, le) { if (H === Ce.maxZoom || H === le) continue; var Ct = 1 << le - H; if (q !== Math.floor(xe / Ct) || de !== Math.floor(Ee / Ct)) continue } else if (H === Ce.indexMaxZoom || Ve.numPoints <= Ce.indexMaxPoints) continue; if (Ve.source = null, me.length !== 0) { Le > 1 && console.time("clipping"); var Je, Ot, Vt, bn, un, wn, Vn = .5 * Ce.buffer / Ce.extent, rr = .5 - Vn, $r = .5 + Vn, sr = 1 + Vn; Je = Ot = Vt = bn = null, un = Cn(me, qe, q - Vn, q + $r, 0, Ve.minX, Ve.maxX, Ce), wn = Cn(me, qe, q + rr, q + sr, 0, Ve.minX, Ve.maxX, Ce), me = null, un && (Je = Cn(un, qe, de - Vn, de + $r, 1, Ve.minY, Ve.maxY, Ce), Ot = Cn(un, qe, de + rr, de + sr, 1, Ve.minY, Ve.maxY, Ce), un = null), wn && (Vt = Cn(wn, qe, de - Vn, de + $r, 1, Ve.minY, Ve.maxY, Ce), bn = Cn(wn, qe, de + rr, de + sr, 1, Ve.minY, Ve.maxY, Ce), wn = null), Le > 1 && console.timeEnd("clipping"), be.push(Je || [], H + 1, 2 * q, 2 * de), be.push(Ot || [], H + 1, 2 * q, 2 * de + 1), be.push(Vt || [], H + 1, 2 * q + 1, 2 * de), be.push(bn || [], H + 1, 2 * q + 1, 2 * de + 1) } } }, Bt.prototype.getTile = function (me, H, q) { var de = this.options, le = de.extent, xe = de.debug; if (me < 0 || me > 24) return null; var Ee = 1 << me, be = pn(me, H = (H % Ee + Ee) % Ee, q); if (this.tiles[be]) return dn(this.tiles[be], le); xe > 1 && console.log("drilling down to z%d-%d-%d", me, H, q); for (var Ce, Le = me, qe = H, Ze = q; !Ce && Le > 0;)Le--, qe = Math.floor(qe / 2), Ze = Math.floor(Ze / 2), Ce = this.tiles[pn(Le, qe, Ze)]; return Ce && Ce.source ? (xe > 1 && console.log("found parent tile z%d-%d-%d", Le, qe, Ze), xe > 1 && console.time("drilling down"), this.splitTile(Ce.source, Le, qe, Ze, me, H, q), xe > 1 && console.timeEnd("drilling down"), this.tiles[be] ? dn(this.tiles[be], le) : null) : null }; class Zn extends A { constructor(H, q, de, le) { super(H, q, de, On), le && (this.loadGeoJSON = le) } loadData(H, q) { var de; (de = this._pendingRequest) === null || de === void 0 || de.cancel(), this._pendingCallback && this._pendingCallback(null, { abandoned: !0 }); const le = !!(H && H.request && H.request.collectResourceTiming) && new o.RequestPerformance(H.request); this._pendingCallback = q, this._pendingRequest = this.loadGeoJSON(H, (xe, Ee) => { if (delete this._pendingCallback, delete this._pendingRequest, xe || !Ee) return q(xe); if (typeof Ee != "object") return q(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`)); { R(Ee, !0); try { if (H.filter) { const Ce = o.createExpression(H.filter, { type: "boolean", "property-type": "data-driven", overridable: !1, transition: !1 }); if (Ce.result === "error") throw new Error(Ce.value.map(qe => `${qe.key}: ${qe.message}`).join(", ")); Ee = { type: "FeatureCollection", features: Ee.features.filter(qe => Ce.value.evaluate({ zoom: 0 }, qe)) } } this._geoJSONIndex = H.cluster ? new Pt(function ({ superclusterOptions: Ce, clusterProperties: Le }) { if (!Le || !Ce) return Ce; const qe = {}, Ze = {}, Ve = { accumulated: null, zoom: 0 }, Lt = { properties: null }, Ct = Object.keys(Le); for (const Je of Ct) { const [Ot, Vt] = Le[Je], bn = o.createExpression(Vt), un = o.createExpression(typeof Ot == "string" ? [Ot, ["accumulated"], ["get", Je]] : Ot); qe[Je] = bn.value, Ze[Je] = un.value } return Ce.map = Je => { Lt.properties = Je; const Ot = {}; for (const Vt of Ct) Ot[Vt] = qe[Vt].evaluate(Ve, Lt); return Ot }, Ce.reduce = (Je, Ot) => { Lt.properties = Ot; for (const Vt of Ct) Ve.accumulated = Je[Vt], Je[Vt] = Ze[Vt].evaluate(Ve, Lt) }, Ce }(H)).load(Ee.features) : function (Ce, Le) { return new Bt(Ce, Le) }(Ee, H.geojsonVtOptions) } catch (Ce) { return q(Ce) } this.loaded = {}; const be = {}; if (le) { const Ce = le.finish(); Ce && (be.resourceTiming = {}, be.resourceTiming[H.source] = JSON.parse(JSON.stringify(Ce))) } q(null, be) } }) } reloadTile(H, q) { const de = this.loaded; return de && de[H.uid] ? super.reloadTile(H, q) : this.loadTile(H, q) } loadGeoJSON(H, q) { if (H.request) return o.getJSON(H.request, q); if (typeof H.data == "string") try { q(null, JSON.parse(H.data)) } catch { q(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`)) } else q(new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`)); return { cancel: () => { } } } removeSource(H, q) { this._pendingCallback && this._pendingCallback(null, { abandoned: !0 }), q() } getClusterExpansionZoom(H, q) { try { q(null, this._geoJSONIndex.getClusterExpansionZoom(H.clusterId)) } catch (de) { q(de) } } getClusterChildren(H, q) { try { q(null, this._geoJSONIndex.getChildren(H.clusterId)) } catch (de) { q(de) } } getClusterLeaves(H, q) { try { q(null, this._geoJSONIndex.getLeaves(H.clusterId, H.limit, H.offset)) } catch (de) { q(de) } } } class Xn { constructor(H) { this.self = H, this.actor = new o.Actor(H, this), this.layerIndexes = {}, this.availableImages = {}, this.workerSourceTypes = { vector: A, geojson: Zn }, this.workerSources = {}, this.demWorkerSources = {}, this.self.registerWorkerSource = (q, de) => { if (this.workerSourceTypes[q]) throw new Error(`Worker source with name "${q}" already registered.`); this.workerSourceTypes[q] = de }, this.self.registerRTLTextPlugin = q => { if (o.plugin.isParsed()) throw new Error("RTL text plugin already registered."); o.plugin.applyArabicShaping = q.applyArabicShaping, o.plugin.processBidirectionalText = q.processBidirectionalText, o.plugin.processStyledBidirectionalText = q.processStyledBidirectionalText } } setReferrer(H, q) { this.referrer = q } setImages(H, q, de) { this.availableImages[H] = q; for (const le in this.workerSources[H]) { const xe = this.workerSources[H][le]; for (const Ee in xe) xe[Ee].availableImages = q } de() } setLayers(H, q, de) { this.getLayerIndex(H).replace(q), de() } updateLayers(H, q, de) { this.getLayerIndex(H).update(q.layers, q.removedIds), de() } loadTile(H, q, de) { this.getWorkerSource(H, q.type, q.source).loadTile(q, de) } loadDEMTile(H, q, de) { this.getDEMWorkerSource(H, q.source).loadTile(q, de) } reloadTile(H, q, de) { this.getWorkerSource(H, q.type, q.source).reloadTile(q, de) } abortTile(H, q, de) { this.getWorkerSource(H, q.type, q.source).abortTile(q, de) } removeTile(H, q, de) { this.getWorkerSource(H, q.type, q.source).removeTile(q, de) } removeDEMTile(H, q) { this.getDEMWorkerSource(H, q.source).removeTile(q) } removeSource(H, q, de) { if (!this.workerSources[H] || !this.workerSources[H][q.type] || !this.workerSources[H][q.type][q.source]) return; const le = this.workerSources[H][q.type][q.source]; delete this.workerSources[H][q.type][q.source], le.removeSource !== void 0 ? le.removeSource(q, de) : de() } loadWorkerSource(H, q, de) { try { this.self.importScripts(q.url), de() } catch (le) { de(le.toString()) } } syncRTLPluginState(H, q, de) { try { o.plugin.setState(q); const le = o.plugin.getPluginURL(); if (o.plugin.isLoaded() && !o.plugin.isParsed() && le != null) { this.self.importScripts(le); const xe = o.plugin.isParsed(); de(xe ? void 0 : new Error(`RTL Text Plugin failed to import scripts from ${le}`), xe) } } catch (le) { de(le.toString()) } } getAvailableImages(H) { let q = this.availableImages[H]; return q || (q = []), q } getLayerIndex(H) { let q = this.layerIndexes[H]; return q || (q = this.layerIndexes[H] = new v), q } getWorkerSource(H, q, de) { if (this.workerSources[H] || (this.workerSources[H] = {}), this.workerSources[H][q] || (this.workerSources[H][q] = {}), !this.workerSources[H][q][de]) { const le = { send: (xe, Ee, be) => { this.actor.send(xe, Ee, be, H) } }; this.workerSources[H][q][de] = new this.workerSourceTypes[q](le, this.getLayerIndex(H), this.getAvailableImages(H)) } return this.workerSources[H][q][de] } getDEMWorkerSource(H, q) { return this.demWorkerSources[H] || (this.demWorkerSources[H] = {}), this.demWorkerSources[H][q] || (this.demWorkerSources[H][q] = new N), this.demWorkerSources[H][q] } enforceCacheSizeLimit(H, q) { o.enforceCacheSizeLimit(q) } } return o.isWorker() && (self.worker = new Xn(self)), Xn }), s(["./shared"], function (o) {
|
|
|
var f = p; function p(x) { return !function (l) { return typeof window > "u" || typeof document > "u" ? "not a browser" : Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach && Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some && Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray ? Function.prototype && Function.prototype.bind ? Object.keys && Object.create && Object.getPrototypeOf && Object.getOwnPropertyNames && Object.isSealed && Object.isFrozen && Object.isExtensible && Object.getOwnPropertyDescriptor && Object.defineProperty && Object.defineProperties && Object.seal && Object.freeze && Object.preventExtensions ? "JSON" in window && "parse" in JSON && "stringify" in JSON ? function () { if (!("Worker" in window && "Blob" in window && "URL" in window)) return !1; var g, b, E = new Blob([""], { type: "text/javascript" }), D = URL.createObjectURL(E); try { b = new Worker(D), g = !0 } catch { g = !1 } return b && b.terminate(), URL.revokeObjectURL(D), g }() ? "Uint8ClampedArray" in window ? ArrayBuffer.isView ? function () { var g = document.createElement("canvas"); g.width = g.height = 1; var b = g.getContext("2d"); if (!b) return !1; var E = b.getImageData(0, 0, 1, 1); return E && E.width === g.width }() ? (v[h = l && l.failIfMajorPerformanceCaveat] === void 0 && (v[h] = function (g) { var b, E = function (D) { var $ = document.createElement("canvas"), U = Object.create(p.webGLContextAttributes); return U.failIfMajorPerformanceCaveat = D, $.getContext("webgl", U) || $.getContext("experimental-webgl", U) }(g); if (!E) return !1; try { b = E.createShader(E.VERTEX_SHADER) } catch { return !1 } return !(!b || E.isContextLost()) && (E.shaderSource(b, "void main() {}"), E.compileShader(b), E.getShaderParameter(b, E.COMPILE_STATUS) === !0) }(h)), v[h] ? document.documentMode ? "insufficient ECMAScript 6 support" : void 0 : "insufficient WebGL support") : "insufficient Canvas/getImageData support" : "insufficient ArrayBuffer support" : "insufficient Uint8ClampedArray support" : "insufficient worker support" : "insufficient JSON support" : "insufficient Object support" : "insufficient Function support" : "insufficent Array support"; var h }(x) } var v = {}; function y(x, l) { if (Array.isArray(x)) { if (!Array.isArray(l) || x.length !== l.length) return !1; for (let h = 0; h < x.length; h++)if (!y(x[h], l[h])) return !1; return !0 } if (typeof x == "object" && x !== null && l !== null) { if (typeof l != "object" || Object.keys(x).length !== Object.keys(l).length) return !1; for (const h in x) if (!y(x[h], l[h])) return !1; return !0 } return x === l } p.webGLContextAttributes = { antialias: !1, alpha: !0, stencil: !0, depth: !0 }; class w { static testProp(l) { if (!w.docStyle) return l[0]; for (let h = 0; h < l.length; h++)if (l[h] in w.docStyle) return l[h]; return l[0] } static create(l, h, g) { const b = window.document.createElement(l); return h !== void 0 && (b.className = h), g && g.appendChild(b), b } static createNS(l, h) { return window.document.createElementNS(l, h) } static disableDrag() { w.docStyle && w.selectProp && (w.userSelect = w.docStyle[w.selectProp], w.docStyle[w.selectProp] = "none") } static enableDrag() { w.docStyle && w.selectProp && (w.docStyle[w.selectProp] = w.userSelect) } static setTransform(l, h) { l.style[w.transformProp] = h } static addEventListener(l, h, g, b = {}) { l.addEventListener(h, g, "passive" in b ? b : b.capture) } static removeEventListener(l, h, g, b = {}) { l.removeEventListener(h, g, "passive" in b ? b : b.capture) } static suppressClickInternal(l) { l.preventDefault(), l.stopPropagation(), window.removeEventListener("click", w.suppressClickInternal, !0) } static suppressClick() { window.addEventListener("click", w.suppressClickInternal, !0), window.setTimeout(() => { window.removeEventListener("click", w.suppressClickInternal, !0) }, 0) } static mousePos(l, h) { const g = l.getBoundingClientRect(); return new o.pointGeometry(h.clientX - g.left - l.clientLeft, h.clientY - g.top - l.clientTop) } static touchPos(l, h) { const g = l.getBoundingClientRect(), b = []; for (let E = 0; E < h.length; E++)b.push(new o.pointGeometry(h[E].clientX - g.left - l.clientLeft, h[E].clientY - g.top - l.clientTop)); return b } static mouseButton(l) { return l.button } static remove(l) { l.parentNode && l.parentNode.removeChild(l) } } w.docStyle = typeof window < "u" && window.document && window.document.documentElement.style, w.selectProp = w.testProp(["userSelect", "MozUserSelect", "WebkitUserSelect", "msUserSelect"]), w.transformProp = w.testProp(["transform", "WebkitTransform"]); class P { constructor(l) { this._transformRequestFn = l } transformRequest(l, h) { return this._transformRequestFn && this._transformRequestFn(l, h) || { url: l } } normalizeSpriteURL(l, h, g) { const b = function (E) { const D = E.match(k); if (!D) throw new Error(`Unable to parse URL "${E}"`); return { protocol: D[1], authority: D[2], path: D[3] || "/", params: D[4] ? D[4].split("&") : [] } }(l); return b.path += `${h}${g}`, function (E) { const D = E.params.length ? `?${E.params.join("&")}` : ""; return `${E.protocol}://${E.authority}${E.path}${D}` }(b) } setTransformRequest(l) { this._transformRequestFn = l } } const k = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/; class A { constructor(l, h, g, b) { this.context = l, this.format = g, this.texture = l.gl.createTexture(), this.update(h, b) } update(l, h, g) { const { width: b, height: E } = l, D = !(this.size && this.size[0] === b && this.size[1] === E || g), { context: $ } = this, { gl: U } = $; if (this.useMipmap = Boolean(h && h.useMipmap), U.bindTexture(U.TEXTURE_2D, this.texture), $.pixelStoreUnpackFlipY.set(!1), $.pixelStoreUnpack.set(1), $.pixelStoreUnpackPremultiplyAlpha.set(this.format === U.RGBA && (!h || h.premultiply !== !1)), D) this.size = [b, E], l instanceof HTMLImageElement || l instanceof HTMLCanvasElement || l instanceof HTMLVideoElement || l instanceof ImageData || o.isImageBitmap(l) ? U.texImage2D(U.TEXTURE_2D, 0, this.format, this.format, U.UNSIGNED_BYTE, l) : U.texImage2D(U.TEXTURE_2D, 0, this.format, b, E, 0, this.format, U.UNSIGNED_BYTE, l.data); else { const { x: W, y: te } = g || { x: 0, y: 0 }; l instanceof HTMLImageElement || l instanceof HTMLCanvasElement || l instanceof HTMLVideoElement || l instanceof ImageData || o.isImageBitmap(l) ? U.texSubImage2D(U.TEXTURE_2D, 0, W, te, U.RGBA, U.UNSIGNED_BYTE, l) : U.texSubImage2D(U.TEXTURE_2D, 0, W, te, b, E, U.RGBA, U.UNSIGNED_BYTE, l.data) } this.useMipmap && this.isSizePowerOfTwo() && U.generateMipmap(U.TEXTURE_2D) } bind(l, h, g) { const { context: b } = this, { gl: E } = b; E.bindTexture(E.TEXTURE_2D, this.texture), g !== E.LINEAR_MIPMAP_NEAREST || this.isSizePowerOfTwo() || (g = E.LINEAR), l !== this.filter && (E.texParameteri(E.TEXTURE_2D, E.TEXTURE_MAG_FILTER, l), E.texParameteri(E.TEXTURE_2D, E.TEXTURE_MIN_FILTER, g || l), this.filter = l), h !== this.wrap && (E.texParameteri(E.TEXTURE_2D, E.TEXTURE_WRAP_S, h), E.texParameteri(E.TEXTURE_2D, E.TEXTURE_WRAP_T, h), this.wrap = h) } isSizePowerOfTwo() { return this.size[0] === this.size[1] && Math.log(this.size[0]) / Math.LN2 % 1 == 0 } destroy() { const { gl: l } = this.context; l.deleteTexture(this.texture), this.texture = null } } function N(x) { const { userImage: l } = x; return !!(l && l.render && l.render()) && (x.data.replace(new Uint8Array(l.data.buffer)), !0) } class R extends o.Evented { constructor() { super(), this.images = {}, this.updatedImages = {}, this.callbackDispatchedThisFrame = {}, this.loaded = !1, this.requestors = [], this.patterns = {}, this.atlasImage = new o.RGBAImage({ width: 1, height: 1 }), this.dirty = !0 } isLoaded() { return this.loaded } setLoaded(l) { if (this.loaded !== l && (this.loaded = l, l)) { for (const { ids: h, callback: g } of this.requestors) this._notify(h, g); this.requestors = [] } } getImage(l) { return this.images[l] } addImage(l, h) { if (this.images[l]) throw new Error(`Image id ${l} already exist, use updateImage instead`); this._validate(l, h) && (this.images[l] = h) } _validate(l, h) { let g = !0; return this._validateStretch(h.stretchX, h.data && h.data.width) || (this.fire(new o.ErrorEvent(new Error(`Image "${l}" has invalid "stretchX" value`))), g = !1), this._validateStretch(h.stretchY, h.data && h.data.height) || (this.fire(new o.ErrorEvent(new Error(`Image "${l}" has invalid "stretchY" value`))), g = !1), this._validateContent(h.content, h) || (this.fire(new o.ErrorEvent(new Error(`Image "${l}" has invalid "content" value`))), g = !1), g } _validateStretch(l, h) { if (!l) return !0; let g = 0; for (const b of l) { if (b[0] < g || b[1] < b[0] || h < b[1]) return !1; g = b[1] } return !0 } _validateContent(l, h) { return !(l && (l.length !== 4 || l[0] < 0 || h.data.width < l[0] || l[1] < 0 || h.data.height < l[1] || l[2] < 0 || h.data.width < l[2] || l[3] < 0 || h.data.height < l[3] || l[2] < l[0] || l[3] < l[1])) } updateImage(l, h) { const g = this.images[l]; if (g.data.width !== h.data.width || g.data.height !== h.data.height) throw new Error(`size mismatch between old image (${g.data.width}x${g.data.height}) and new image (${h.data.width}x${h.data.height}).`); h.version = g.version + 1, this.images[l] = h, this.updatedImages[l] = !0 } removeImage(l) { const h = this.images[l]; delete this.images[l], delete this.patterns[l], h.userImage && h.userImage.onRemove && h.userImage.onRemove() } listImages() { return Object.keys(this.images) } getImages(l, h) { let g = !0; if (!this.isLoaded()) for (const b of l) this.images[b] || (g = !1); this.isLoaded() || g ? this._notify(l, h) : this.requestors.push({ ids: l, callback: h }) } _notify(l, h) { const g = {}; for (const b of l) { this.images[b] || this.fire(new o.Event("styleimagemissing", { id: b })); const E = this.images[b]; E ? g[b] = { data: E.data.clone(), pixelRatio: E.pixelRatio, sdf: E.sdf, version: E.version, stretchX: E.stretchX, stretchY: E.stretchY, content: E.content, hasRenderCallback: Boolean(E.userImage && E.userImage.render) } : o.warnOnce(`Image "${b}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`) } h(null, g) } getPixelSize() { const { width: l, height: h } = this.atlasImage; return { width: l, height: h } } getPattern(l) { const h = this.patterns[l], g = this.getImage(l); if (!g) return null; if (h && h.position.version === g.version) return h.position; if (h) h.position.version = g.version; else { const b = { w: g.data.width + 2, h: g.data.height + 2, x: 0, y: 0 }, E = new o.ImagePosition(b, g); this.patterns[l] = { bin: b, position: E } } return this._updatePatternAtlas(), this.patterns[l].position } bind(l) { const h = l.gl; this.atlasTexture ? this.dirty && (this.atlasTexture.update(this.atlasImage), this.dirty = !1) : this.atlasTexture = new A(l, this.atlasImage, h.RGBA), this.atlasTexture.bind(h.LINEAR, h.CLAMP_TO_EDGE) } _updatePatternAtlas() { const l = []; for (const E in this.patterns) l.push(this.patterns[E].bin); const { w: h, h: g } = o.potpack(l), b = this.atlasImage; b.resize({ width: h || 1, height: g || 1 }); for (const E in this.patterns) { const { bin: D } = this.patterns[E], $ = D.x + 1, U = D.y + 1, W = this.images[E].data, te = W.width, ae = W.height; o.RGBAImage.copy(W, b, { x: 0, y: 0 }, { x: $, y: U }, { width: te, height: ae }), o.RGBAImage.copy(W, b, { x: 0, y: ae - 1 }, { x: $, y: U - 1 }, { width: te, height: 1 }), o.RGBAImage.copy(W, b, { x: 0, y: 0 }, { x: $, y: U + ae }, { width: te, height: 1 }), o.RGBAImage.copy(W, b, { x: te - 1, y: 0 }, { x: $ - 1, y: U }, { width: 1, height: ae }), o.RGBAImage.copy(W, b, { x: 0, y: 0 }, { x: $ + te, y: U }, { width: 1, height: ae }) } this.dirty = !0 } beginFrame() { this.callbackDispatchedThisFrame = {} } dispatchRenderCallbacks(l) { for (const h of l) { if (this.callbackDispatchedThisFrame[h]) continue; this.callbackDispatchedThisFrame[h] = !0; const g = this.images[h]; g || o.warnOnce(`Image with ID: "${h}" was not found`), N(g) && this.updateImage(h, g) } } } const M = 1e20; function O(x, l, h, g, b, E, D, $, U) { for (let W = l; W < l + g; W++)z(x, h * E + W, E, b, D, $, U); for (let W = h; W < h + b; W++)z(x, W * E + l, 1, g, D, $, U) } function z(x, l, h, g, b, E, D) { E[0] = 0, D[0] = -M, D[1] = M, b[0] = x[l]; for (let $ = 1, U = 0, W = 0; $ < g; $++) { b[$] = x[l + $ * h]; const te = $ * $; do { const ae = E[U]; W = (b[$] - b[ae] + te - ae * ae) / ($ - ae) / 2 } while (W <= D[U] && --U > -1); U++, E[U] = $, D[U] = W, D[U + 1] = M } for (let $ = 0, U = 0; $ < g; $++) { for (; D[U + 1] < $;)U++; const W = E[U], te = $ - W; x[l + $ * h] = b[W] + te * te } } class B { constructor(l, h) { this.requestManager = l, this.localIdeographFontFamily = h, this.entries = {} } setURL(l) { this.url = l } getGlyphs(l, h) { const g = []; for (const b in l) for (const E of l[b]) g.push({ stack: b, id: E }); o.asyncAll(g, ({ stack: b, id: E }, D) => { let $ = this.entries[b]; $ || ($ = this.entries[b] = { glyphs: {}, requests: {}, ranges: {} }); let U = $.glyphs[E]; if (U !== void 0) return void D(null, { stack: b, id: E, glyph: U }); if (U = this._tinySDF($, b, E), U) return $.glyphs[E] = U, void D(null, { stack: b, id: E, glyph: U }); const W = Math.floor(E / 256); if (256 * W > 65535) return void D(new Error("glyphs > 65535 not supported")); if ($.ranges[W]) return void D(null, { stack: b, id: E, glyph: U }); let te = $.requests[W]; te || (te = $.requests[W] = [], B.loadGlyphRange(b, W, this.url, this.requestManager, (ae, fe) => { if (fe) { for (const Se in fe) this._doesCharSupportLocalGlyph(+Se) || ($.glyphs[+Se] = fe[+Se]); $.ranges[W] = !0 } for (const Se of te) Se(ae, fe); delete $.requests[W] })), te.push((ae, fe) => { ae ? D(ae) : fe && D(null, { stack: b, id: E, glyph: fe[E] || null }) }) }, (b, E) => { if (b) h(b); else if (E) { const D = {}; for (const { stack: $, id: U, glyph: W } of E) (D[$] || (D[$] = {}))[U] = W && { id: W.id, bitmap: W.bitmap.clone(), metrics: W.metrics }; h(null, D) } }) } _doesCharSupportLocalGlyph(l) { return !!this.localIdeographFontFamily && (o.unicodeBlockLookup["CJK Unified Ideographs"](l) || o.unicodeBlockLookup["Hangul Syllables"](l) || o.unicodeBlockLookup.Hiragana(l) || o.unicodeBlockLookup.Katakana(l)) } _tinySDF(l, h, g) { const b = this.localIdeographFontFamily; if (!b || !this._doesCharSupportLocalGlyph(g)) return; let E = l.tinySDF; if (!E) { let $ = "400"; /bold/i.test(h) ? $ = "900" : /medium/i.test(h) ? $ = "500" : /light/i.test(h) && ($ = "200"), E = l.tinySDF = new B.TinySDF({ fontSize: 24, buffer: 3, radius: 8, cutoff: .25, fontFamily: b, fontWeight: $ }) } const D = E.draw(String.fromCharCode(g)); return { id: g, bitmap: new o.AlphaImage({ width: D.width || 30, height: D.height || 30 }, D.data), metrics: { width: D.glyphWidth || 24, height: D.glyphHeight || 24, left: D.glyphLeft || 0, top: D.glyphTop - 27 || -8, advance: D.glyphAdvance || 24 } } } } B.loadGlyphRange = function (x, l, h, g, b) { const E = 256 * l, D = E + 255, $ = g.transformRequest(h.replace("{fontstack}", x).replace("{range}", `${E}-${D}`), o.ResourceType.Glyphs); o.getArrayBuffer($, (U, W) => { if (U) b(U); else if (W) { const te = {}; for (const ae of o.parseGlyphPbf(W)) te[ae.id] = ae; b(null, te) } }) }, B.TinySDF = class { constructor({ fontSize: x = 24, buffer: l = 3, radius: h = 8, cutoff: g = .25, fontFamily: b = "sans-serif", fontWeight: E = "normal", fontStyle: D = "normal" } = {}) { this.buffer = l, this.cutoff = g, this.radius = h; const $ = this.size = x + 4 * l, U = this._createCanvas($), W = this.ctx = U.getContext("2d", { willReadFrequently: !0 }); W.font = `${D} ${E} ${x}px ${b}`, W.textBaseline = "alphabetic", W.textAlign = "left", W.fillStyle = "black", this.gridOuter = new Float64Array($ * $), this.gridInner = new Float64Array($ * $), this.f = new Float64Array($), this.z = new Float64Array($ + 1), this.v = new Uint16Array($) } _createCanvas(x) { const l = document.createElement("canvas"); return l.width = l.height = x, l } draw(x) { const { width: l, actualBoundingBoxAscent: h, actualBoundingBoxDescent: g, actualBoundingBoxLeft: b, actualBoundingBoxRight: E } = this.ctx.measureText(x), D = Math.ceil(h), $ = Math.min(this.size - this.buffer, Math.ceil(E - b)), U = Math.min(this.size - this.buffer, D + Math.ceil(g)), W = $ + 2 * this.buffer, te = U + 2 * this.buffer, ae = Math.max(W * te, 0), fe = new Uint8ClampedArray(ae), Se = { data: fe, width: W, height: te, glyphWidth: $, glyphHeight: U, glyphTop: D, glyphLeft: 0, glyphAdvance: l }; if ($ === 0 || U === 0) return Se; const { ctx: _e, buffer: we, gridInner: Be, gridOuter: je } = this; _e.clearRect(we, we, $, U), _e.fillText(x, we, we + D); const et = _e.getImageData(we, we, $, U); je.fill(M, 0, ae), Be.fill(0, 0, ae); for (let Me = 0; Me < U; Me++)for (let at = 0; at < $; at++) { const nt = et.data[4 * (Me * $ + at) + 3] / 255; if (nt === 0) continue; const xt = (Me + we) * W + at + we; if (nt === 1) je[xt] = 0, Be[xt] = M; else { const _t = .5 - nt; je[xt] = _t > 0 ? _t * _t : 0, Be[xt] = _t < 0 ? _t * _t : 0 } } O(je, 0, 0, W, te, W, this.f, this.v, this.z), O(Be, we, we, $, U, W, this.f, this.v, this.z); for (let Me = 0; Me < ae; Me++) { const at = Math.sqrt(je[Me]) - Math.sqrt(Be[Me]); fe[Me] = Math.round(255 - 255 * (at / this.radius + this.cutoff)) } return Se } }; const V = new o.Properties({ anchor: new o.DataConstantProperty(o.spec.light.anchor), position: new class { constructor() { this.specification = o.spec.light.position } possiblyEvaluate(x, l) { return o.sphericalToCartesian(x.expression.evaluate(l)) } interpolate(x, l, h) { return { x: o.number(x.x, l.x, h), y: o.number(x.y, l.y, h), z: o.number(x.z, l.z, h) } } }, color: new o.DataConstantProperty(o.spec.light.color), intensity: new o.DataConstantProperty(o.spec.light.intensity) }), G = "-transition"; class j extends o.Evented { constructor(l) { super(), this._transitionable = new o.Transitionable(V), this.setLight(l), this._transitioning = this._transitionable.untransitioned() } getLight() { return this._transitionable.serialize() } setLight(l, h = {}) { if (!this._validate(o.validateLight, l, h)) for (const g in l) { const b = l[g]; g.endsWith(G) ? this._transitionable.setTransition(g.slice(0, -G.length), b) : this._transitionable.setValue(g, b) } } updateTransitions(l) { this._transitioning = this._transitionable.transitioned(l, this._transitioning) } hasTransition() { return this._transitioning.hasTransition() } recalculate(l) { this.properties = this._transitioning.possiblyEvaluate(l) } _validate(l, h, g) { return (!g || g.validate !== !1) && o.emitValidationErrors(this, l.call(o.validateStyle, o.extend({ value: h, style: { glyphs: !0, sprite: !0 }, styleSpec: o.spec }))) } } class X { constructor(l, h) { this.width = l, this.height = h, this.nextRow = 0, this.data = new Uint8Array(this.width * this.height), this.dashEntry = {} } getDash(l, h) { const g = l.join(",") + String(h); return this.dashEntry[g] || (this.dashEntry[g] = this.addDash(l, h)), this.dashEntry[g] } getDashRanges(l, h, g) { const b = []; let E = l.length % 2 == 1 ? -l[l.length - 1] * g : 0, D = l[0] * g, $ = !0; b.push({ left: E, right: D, isDash: $, zeroLength: l[0] === 0 }); let U = l[0]; for (let W = 1; W < l.length; W++) { $ = !$; const te = l[W]; E = U * g, U += te, D = U * g, b.push({ left: E, right: D, isDash: $, zeroLength: te === 0 }) } return b } addRoundDash(l, h, g) { const b = h / 2; for (let E = -g; E <= g; E++) { const D = this.width * (this.nextRow + g + E); let $ = 0, U = l[$]; for (let W = 0; W < this.width; W++) { W / U.right > 1 && (U = l[++$]); const te = Math.abs(W - U.left), ae = Math.abs(W - U.right), fe = Math.min(te, ae); let Se; const _e = E / g * (b + 1); if (U.isDash) { const we = b - Math.abs(_e); Se = Math.sqrt(fe * fe + we * we) } else Se = b - Math.sqrt(fe * fe + _e * _e); this.data[D + W] = Math.max(0, Math.min(255, Se + 128)) } } } addRegularDash(l) { for (let $ = l.length - 1; $ >= 0; --$) { const U = l[$], W = l[$ + 1]; U.zeroLength ? l.splice($, 1) : W && W.isDash === U.isDash && (W.left = U.left, l.splice($, 1)) } const h = l[0], g = l[l.length - 1]; h.isDash === g.isDash && (h.left = g.left - this.width, g.right = h.right + this.width); const b = this.width * this.nextRow; let E = 0, D = l[E]; for (let $ = 0; $ < this.width; $++) { $ / D.right > 1 && (D = l[++E]); const U = Math.abs($ - D.left), W = Math.abs($ - D.right), te = Math.min(U, W); this.data[b + $] = Math.max(0, Math.min(255, (D.isDash ? te : -te) + 128)) } } addDash(l, h) { const g = h ? 7 : 0, b = 2 * g + 1; if (this.nextRow + b > this.height) return o.warnOnce("LineAtlas out of space"), null; let E = 0; for (let $ = 0; $ < l.length; $++)E += l[$]; if (E !== 0) { const $ = this.width / E, U = this.getDashRanges(l, this.width, $); h ? this.addRoundDash(U, $, g) : this.addRegularDash(U) } const D = { y: (this.nextRow + g + .5) / this.height, height: 2 * g / this.height, width: E }; return this.nextRow += b, this.dirty = !0, D } bind(l) { const h = l.gl; this.texture ? (h.bindTexture(h.TEXTURE_2D, this.texture), this.dirty && (this.dirty = !1, h.texSubImage2D(h.TEXTURE_2D, 0, 0, 0, this.width, this.height, h.ALPHA, h.UNSIGNED_BYTE, this.data))) : (this.texture = h.createTexture(), h.bindTexture(h.TEXTURE_2D, this.texture), h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_S, h.REPEAT), h.texParameteri(h.TEXTURE_2D, h.TEXTURE_WRAP_T, h.REPEAT), h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MIN_FILTER, h.LINEAR), h.texParameteri(h.TEXTURE_2D, h.TEXTURE_MAG_FILTER, h.LINEAR), h.texImage2D(h.TEXTURE_2D, 0, h.ALPHA, this.width, this.height, 0, h.ALPHA, h.UNSIGNED_BYTE, this.data)) } } class Y { constructor(l, h) { this.workerPool = l, this.actors = [], this.currentActor = 0, this.id = o.uniqueId(); const g = this.workerPool.acquire(this.id); for (let b = 0; b < g.length; b++) { const E = new Y.Actor(g[b], h, this.id); E.name = `Worker ${b}`, this.actors.push(E) } if (!this.actors.length) throw new Error("No actors found") } broadcast(l, h, g) { o.asyncAll(this.actors, (b, E) => { b.send(l, h, E) }, g = g || function () { }) } getActor() { return this.currentActor = (this.currentActor + 1) % this.actors.length, this.actors[this.currentActor] } remove() { this.actors.forEach(l => { l.remove() }), this.actors = [], this.workerPool.release(this.id) } } function se(x, l, h) { const g = function (b, E) { if (b) return h(b); if (E) { const D = o.pick(o.extend(E, x), ["tiles", "minzoom", "maxzoom", "attribution", "bounds", "scheme", "tileSize", "encoding"]); E.vector_layers && (D.vectorLayers = E.vector_layers, D.vectorLayerIds = D.vectorLayers.map($ => $.id)), h(null, D) } }; return x.url ? o.getJSON(l.transformRequest(x.url, o.ResourceType.Source), g) : o.exported.frame(() => g(null, x)) } Y.Actor = o.Actor; class ee { constructor(l, h, g) { this.bounds = o.LngLatBounds.convert(this.validateBounds(l)), this.minzoom = h || 0, this.maxzoom = g || 24 } validateBounds(l) { return Array.isArray(l) && l.length === 4 ? [Math.max(-180, l[0]), Math.max(-90, l[1]), Math.min(180, l[2]), Math.min(90, l[3])] : [-180, -90, 180, 90] } contains(l) { const h = Math.pow(2, l.z), g = Math.floor(o.mercatorXfromLng(this.bounds.getWest()) * h), b = Math.floor(o.mercatorYfromLat(this.bounds.getNorth()) * h), E = Math.ceil(o.mercatorXfromLng(this.bounds.getEast()) * h), D = Math.ceil(o.mercatorYfromLat(this.bounds.getSouth()) * h); return l.x >= g && l.x < E && l.y >= b && l.y < D } } class Z extends o.Evented { constructor(l, h, g, b) { if (super(), this.id = l, this.dispatcher = g, this.type = "vector", this.minzoom = 0, this.maxzoom = 22, this.scheme = "xyz", this.tileSize = 512, this.reparseOverscaled = !0, this.isTileClipped = !0, this._loaded = !1, o.extend(this, o.pick(h, ["url", "scheme", "tileSize", "promoteId"])), this._options = o.extend({ type: "vector" }, h), this._collectResourceTiming = h.collectResourceTiming, this.tileSize !== 512) throw new Error("vector tile sources must have a tileSize of 512"); this.setEventedParent(b) } load() { this._loaded = !1, this.fire(new o.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = se(this._options, this.map._requestManager, (l, h) => { this._tileJSONRequest = null, this._loaded = !0, this.map.style.sourceCaches[this.id].clearTiles(), l ? this.fire(new o.ErrorEvent(l)) : h && (o.extend(this, h), h.bounds && (this.tileBounds = new ee(h.bounds, this.minzoom, this.maxzoom)), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "metadata" })), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "content" }))) }) } loaded() { return this._loaded } hasTile(l) { return !this.tileBounds || this.tileBounds.contains(l.canonical) } onAdd(l) { this.map = l, this.load() } setSourceProperty(l) { this._tileJSONRequest && this._tileJSONRequest.cancel(), l(), this.load() } setTiles(l) { return this.setSourceProperty(() => { this._options.tiles = l }), this } setUrl(l) { return this.setSourceProperty(() => { this.url = l, this._options.url = l }), this } onRemove() { this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null) } serialize() { return o.extend({}, this._options) } loadTile(l, h) { const g = l.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme), b = { request: this.map._requestManager.transformRequest(g, o.ResourceType.Tile), uid: l.uid, tileID: l.tileID, zoom: l.tileID.overscaledZ, tileSize: this.tileSize * l.tileID.overscaleFactor(), type: this.type, source: this.id, pixelRatio: this.map.getPixelRatio(), showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId }; function E(D, $) { return delete l.request, l.aborted ? h(null) : D && D.status !== 404 ? h(D) : ($ && $.resourceTiming && (l.resourceTiming = $.resourceTiming), this.map._refreshExpiredTiles && $ && l.setExpiryData($), l.loadVectorData($, this.map.painter), o.cacheEntryPossiblyAdded(this.dispatcher), h(null), void (l.reloadCallback && (this.loadTile(l, l.reloadCallback), l.reloadCallback = null))) } b.request.collectResourceTiming = this._collectResourceTiming, l.actor && l.state !== "expired" ? l.state === "loading" ? l.reloadCallback = h : l.request = l.actor.send("reloadTile", b, E.bind(this)) : (l.actor = this.dispatcher.getActor(), l.request = l.actor.send("loadTile", b, E.bind(this))) } abortTile(l) { l.request && (l.request.cancel(), delete l.request), l.actor && l.actor.send("abortTile", { uid: l.uid, type: this.type, source: this.id }, void 0) } unloadTile(l) { l.unloadVectorData(), l.actor && l.actor.send("removeTile", { uid: l.uid, type: this.type, source: this.id }, void 0) } hasTransition() { return !1 } } class J extends o.Evented { constructor(l, h, g, b) { super(), this.id = l, this.dispatcher = g, this.setEventedParent(b), this.type = "raster", this.minzoom = 0, this.maxzoom = 22, this.roundZoom = !0, this.scheme = "xyz", this.tileSize = 512, this._loaded = !1, this._options = o.extend({ type: "raster" }, h), o.extend(this, o.pick(h, ["url", "scheme", "tileSize"])) } load() { this._loaded = !1, this.fire(new o.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = se(this._options, this.map._requestManager, (l, h) => { this._tileJSONRequest = null, this._loaded = !0, l ? this.fire(new o.ErrorEvent(l)) : h && (o.extend(this, h), h.bounds && (this.tileBounds = new ee(h.bounds, this.minzoom, this.maxzoom)), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "metadata" })), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "content" }))) }) } loaded() { return this._loaded } onAdd(l) { this.map = l, this.load() } onRemove() { this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null) } serialize() { return o.extend({}, this._options) } hasTile(l) { return !this.tileBounds || this.tileBounds.contains(l.canonical) } loadTile(l, h) { const g = l.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme); l.request = o.getImage(this.map._requestManager.transformRequest(g, o.ResourceType.Tile), (b, E, D) => { if (delete l.request, l.aborted) l.state = "unloaded", h(null); else if (b) l.state = "errored", h(b); else if (E) { this.map._refreshExpiredTiles && l.setExpiryData(D); const $ = this.map.painter.context, U = $.gl; l.texture = this.map.painter.getTileTexture(E.width), l.texture ? l.texture.update(E, { useMipmap: !0 }) : (l.texture = new A($, E, U.RGBA, { useMipmap: !0 }), l.texture.bind(U.LINEAR, U.CLAMP_TO_EDGE, U.LINEAR_MIPMAP_NEAREST), $.extTextureFilterAnisotropic && U.texParameterf(U.TEXTURE_2D, $.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, $.extTextureFilterAnisotropicMax)), l.state = "loaded", o.cacheEntryPossiblyAdded(this.dispatcher), h(null) } }) } abortTile(l, h) { l.request && (l.request.cancel(), delete l.request), h() } unloadTile(l, h) { l.texture && this.map.painter.saveTileTexture(l.texture), h() } hasTransition() { return !1 } } let ve; class ie extends J { constructor(l, h, g, b) { super(l, h, g, b), this.type = "raster-dem", this.maxzoom = 22, this._options = o.extend({ type: "raster-dem" }, h), this.encoding = h.encoding || "mapbox" } serialize() { return { type: "raster-dem", url: this.url, tileSize: this.tileSize, tiles: this.tiles, bounds: this.bounds, encoding: this.encoding } } loadTile(l, h) { const g = l.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme); function b(E, D) { E && (l.state = "errored", h(E)), D && (l.dem = D, l.needsHillshadePrepare = !0, l.needsTerrainPrepare = !0, l.state = "loaded", h(null)) } l.request = o.getImage(this.map._requestManager.transformRequest(g, o.ResourceType.Tile), function (E, D) { if (delete l.request, l.aborted) l.state = "unloaded", h(null); else if (E) l.state = "errored", h(E); else if (D) { this.map._refreshExpiredTiles && l.setExpiryData(D), delete D.cacheControl, delete D.expires; const $ = o.isImageBitmap(D) && (ve == null && (ve = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") && typeof createImageBitmap == "function"), ve) ? D : o.exported.getImageData(D, 1), U = { uid: l.uid, coord: l.tileID, source: this.id, rawImageData: $, encoding: this.encoding }; l.actor && l.state !== "expired" || (l.actor = this.dispatcher.getActor(), l.actor.send("loadDEMTile", U, b.bind(this))) } }.bind(this)), l.neighboringTiles = this._getNeighboringTiles(l.tileID) } _getNeighboringTiles(l) { const h = l.canonical, g = Math.pow(2, h.z), b = (h.x - 1 + g) % g, E = h.x === 0 ? l.wrap - 1 : l.wrap, D = (h.x + 1 + g) % g, $ = h.x + 1 === g ? l.wrap + 1 : l.wrap, U = {}; return U[new o.OverscaledTileID(l.overscaledZ, E, h.z, b, h.y).key] = { backfilled: !1 }, U[new o.OverscaledTileID(l.overscaledZ, $, h.z, D, h.y).key] = { backfilled: !1 }, h.y > 0 && (U[new o.OverscaledTileID(l.overscaledZ, E, h.z, b, h.y - 1).key] = { backfilled: !1 }, U[new o.OverscaledTileID(l.overscaledZ, l.wrap, h.z, h.x, h.y - 1).key] = { backfilled: !1 }, U[new o.OverscaledTileID(l.overscaledZ, $, h.z, D, h.y - 1).key] = { backfilled: !1 }), h.y + 1 < g && (U[new o.OverscaledTileID(l.overscaledZ, E, h.z, b, h.y + 1).key] = { backfilled: !1 }, U[new o.OverscaledTileID(l.overscaledZ, l.wrap, h.z, h.x, h.y + 1).key] = { backfilled: !1 }, U[new o.OverscaledTileID(l.overscaledZ, $, h.z, D, h.y + 1).key] = { backfilled: !1 }), U } unloadTile(l) { l.demTexture && this.map.painter.saveTileTexture(l.demTexture), l.fbo && (l.fbo.destroy(), delete l.fbo), l.dem && delete l.dem, delete l.neighboringTiles, l.state = "unloaded", l.actor && l.actor.send("removeDEMTile", { uid: l.uid, source: this.id }) } } class ce extends o.Evented { constructor(l, h, g, b) { super(), this.id = l, this.type = "geojson", this.minzoom = 0, this.maxzoom = 18, this.tileSize = 512, this.isTileClipped = !0, this.reparseOverscaled = !0, this._removed = !1, this._pendingLoads = 0, this.actor = g.getActor(), this.setEventedParent(b), this._data = h.data, this._options = o.extend({}, h), this._collectResourceTiming = h.collectResourceTiming, h.maxzoom !== void 0 && (this.maxzoom = h.maxzoom), h.type && (this.type = h.type), h.attribution && (this.attribution = h.attribution), this.promoteId = h.promoteId; const E = o.EXTENT / this.tileSize; this.workerOptions = o.extend({ source: this.id, cluster: h.cluster || !1, geojsonVtOptions: { buffer: (h.buffer !== void 0 ? h.buffer : 128) * E, tolerance: (h.tolerance !== void 0 ? h.tolerance : .375) * E, extent: o.EXTENT, maxZoom: this.maxzoom, lineMetrics: h.lineMetrics || !1, generateId: h.generateId || !1 }, superclusterOptions: { maxZoom: h.clusterMaxZoom !== void 0 ? h.clusterMaxZoom : this.maxzoom - 1, minPoints: Math.max(2, h.clusterMinPoints || 2), extent: o.EXTENT, radius: (h.clusterRadius || 50) * E, log: !1, generateId: h.generateId || !1 }, clusterProperties: h.clusterProperties, filter: h.filter }, h.workerOptions) } load() { this._updateWorkerData("metadata") } onAdd(l) { this.map = l, this.load() } setData(l) { return this._data = l, this._updateWorkerData("content"), this } getClusterExpansionZoom(l, h) { return this.actor.send("geojson.getClusterExpansionZoom", { clusterId: l, source: this.id }, h), this } getClusterChildren(l, h) { return this.actor.send("geojson.getClusterChildren", { clusterId: l, source: this.id }, h), this } getClusterLeaves(l, h, g, b) { return this.actor.send("geojson.getClusterLeaves", { source: this.id, clusterId: l, limit: h, offset: g }, b), this } _updateWorkerData(l) { const h = o.extend({}, this.workerOptions), g = this._data; typeof g == "string" ? (h.request = this.map._requestManager.transformRequest(o.exported.resolveURL(g), o.ResourceType.Source), h.request.collectResourceTiming = this._collectResourceTiming) : h.data = JSON.stringify(g), this._pendingLoads++, this.fire(new o.Event("dataloading", { dataType: "source" })), this.actor.send(`${this.type}.loadData`, h, (b, E) => { if (this._pendingLoads--, this._removed || E && E.abandoned) return void this.fire(new o.Event("dataabort", { dataType: "source", sourceDataType: l })); let D = null; if (E && E.resourceTiming && E.resourceTiming[this.id] && (D = E.resourceTiming[this.id].slice(0)), b) return void this.fire(new o.ErrorEvent(b)); const $ = { dataType: "source", sourceDataType: l }; this._collectResourceTiming && D && D.length > 0 && o.extend($, { resourceTiming: D }), this.fire(new o.Event("data", $)) }) } loaded() { return this._pendingLoads === 0 } loadTile(l, h) { const g = l.actor ? "reloadTile" : "loadTile"; l.actor = this.actor; const b = { type: this.type, uid: l.uid, tileID: l.tileID, zoom: l.tileID.overscaledZ, maxZoom: this.maxzoom, tileSize: this.tileSize, source: this.id, pixelRatio: this.map.getPixelRatio(), showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId }; l.request = this.actor.send(g, b, (E, D) => (delete l.request, l.unloadVectorData(), l.aborted ? h(null) : E ? h(E) : (l.loadVectorData(D, this.map.painter, g === "reloadTile"), h(null)))) } abortTile(l) { l.request && (l.request.cancel(), delete l.request), l.aborted = !0 } unloadTile(l) { l.unloadVectorData(), this.actor.send("removeTile", { uid: l.uid, type: this.type, source: this.id }) } onRemove() { this._removed = !0, this.actor.send("removeSource", { type: this.type, source: this.id }) } serialize() { return o.extend({}, this._options, { type: this.type, data: this._data }) } hasTransition() { return !1 } } var oe = o.createLayout([{ name: "a_pos", type: "Int16", components: 2 }, { name: "a_texture_pos", type: "Int16", components: 2 }]); class ye extends o.Evented { constructor(l, h, g, b) { super(), this.id = l, this.dispatcher = g, this.coordinates = h.coordinates, this.type = "image", this.minzoom = 0, this.maxzoom = 22, this.tileSize = 512, this.tiles = {}, this._loaded = !1, this.setEventedParent(b), this.options = h } load(l, h) { this._loaded = !1, this.fire(new o.Event("dataloading", { dataType: "source" })), this.url = this.options.url, o.getImage(this.map._requestManager.transformRequest(this.url, o.ResourceType.Image), (g, b) => { this._loaded = !0, g ? this.fire(new o.ErrorEvent(g)) : b && (this.image = b, l && (this.coordinates = l), h && h(), this._finishLoading()) }) } loaded() { return this._loaded } updateImage(l) { return this.image && l.url ? (this.options.url = l.url, this.load(l.coordinates, () => { this.texture = null }), this) : this } _finishLoading() { this.map && (this.setCoordinates(this.coordinates), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "metadata" }))) } onAdd(l) { this.map = l, this.load() } setCoordinates(l) { this.coordinates = l; const h = l.map(o.MercatorCoordinate.fromLngLat); this.tileID = function (b) { let E = 1 / 0, D = 1 / 0, $ = -1 / 0, U = -1 / 0; for (const fe of b) E = Math.min(E, fe.x), D = Math.min(D, fe.y), $ = Math.max($, fe.x), U = Math.max(U, fe.y); const W = Math.max($ - E, U - D), te = Math.max(0, Math.floor(-Math.log(W) / Math.LN2)), ae = Math.pow(2, te); return new o.CanonicalTileID(te, Math.floor((E + $) / 2 * ae), Math.floor((D + U) / 2 * ae)) }(h), this.minzoom = this.maxzoom = this.tileID.z; const g = h.map(b => this.tileID.getTilePoint(b)._round()); return this._boundsArray = new o.RasterBoundsArray, this._boundsArray.emplaceBack(g[0].x, g[0].y, 0, 0), this._boundsArray.emplaceBack(g[1].x, g[1].y, o.EXTENT, 0), this._boundsArray.emplaceBack(g[3].x, g[3].y, 0, o.EXTENT), this._boundsArray.emplaceBack(g[2].x, g[2].y, o.EXTENT, o.EXTENT), this.boundsBuffer && (this.boundsBuffer.destroy(), delete this.boundsBuffer), this.fire(new o.Event("data", { dataType: "source", sourceDataType: "content" })), this } prepare() { if (Object.keys(this.tiles).length === 0 || !this.image) return; const l = this.map.painter.context, h = l.gl; this.boundsBuffer || (this.boundsBuffer = l.createVertexBuffer(this._boundsArray, oe.members)), this.boundsSegments || (this.boundsSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture || (this.texture = new A(l, this.image, h.RGBA), this.texture.bind(h.LINEAR, h.CLAMP_TO_EDGE)); for (const g in this.tiles) { const b = this.tiles[g]; b.state !== "loaded" && (b.state = "loaded", b.texture = this.texture) } } loadTile(l, h) { this.tileID && this.tileID.equals(l.tileID.canonical) ? (this.tiles[String(l.tileID.wrap)] = l, l.buckets = {}, h(null)) : (l.state = "errored", h(null)) } serialize() { return { type: "image", url: this.options.url, coordinates: this.coordinates } } hasTransition() { return !1 } } class Ie extends ye { constructor(l, h, g, b) { super(l, h, g, b), this.roundZoom = !0, this.type = "video", this.options = h } load() { this._loaded = !1; const l = this.options; this.urls = []; for (const h of l.urls) this.urls.push(this.map._requestManager.transformRequest(h, o.ResourceType.Source).url); o.getVideo(this.urls, (h, g) => { this._loaded = !0, h ? this.fire(new o.ErrorEvent(h)) : g && (this.video = g, this.video.loop = !0, this.video.addEventListener("playing", () => { this.map.triggerRepaint() }), this.map && this.video.play(), this._finishLoading()) }) } pause() { this.video && this.video.pause() } play() { this.video && this.video.play() } seek(l) { if (this.video) { const h = this.video.seekable; l < h.start(0) || l > h.end(0) ? this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`, null, `Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))) : this.video.currentTime = l } } getVideo() { return this.video } onAdd(l) { this.map || (this.map = l, this.load(), this.video && (this.video.play(), this.setCoordinates(this.coordinates))) } prepare() { if (Object.keys(this.tiles).length === 0 || this.video.readyState < 2) return; const l = this.map.painter.context, h = l.gl; this.boundsBuffer || (this.boundsBuffer = l.createVertexBuffer(this._boundsArray, oe.members)), this.boundsSegments || (this.boundsSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? this.video.paused || (this.texture.bind(h.LINEAR, h.CLAMP_TO_EDGE), h.texSubImage2D(h.TEXTURE_2D, 0, 0, 0, h.RGBA, h.UNSIGNED_BYTE, this.video)) : (this.texture = new A(l, this.video, h.RGBA), this.texture.bind(h.LINEAR, h.CLAMP_TO_EDGE)); for (const g in this.tiles) { const b = this.tiles[g]; b.state !== "loaded" && (b.state = "loaded", b.texture = this.texture) } } serialize() { return { type: "video", urls: this.urls, coordinates: this.coordinates } } hasTransition() { return this.video && !this.video.paused } } class Te extends ye { constructor(l, h, g, b) { super(l, h, g, b), h.coordinates ? Array.isArray(h.coordinates) && h.coordinates.length === 4 && !h.coordinates.some(E => !Array.isArray(E) || E.length !== 2 || E.some(D => typeof D != "number")) || this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`, null, '"coordinates" property must be an array of 4 longitude/latitude array pairs'))) : this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`, null, 'missing required property "coordinates"'))), h.animate && typeof h.animate != "boolean" && this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`, null, 'optional "animate" property must be a boolean value'))), h.canvas ? typeof h.canvas == "string" || h.canvas instanceof HTMLCanvasElement || this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`, null, '"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))) : this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${l}`, null, 'missing required property "canvas"'))), this.options = h, this.animate = h.animate === void 0 || h.animate } load() { this._loaded = !0, this.canvas || (this.canvas = this.options.canvas instanceof HTMLCanvasElement ? this.options.canvas : document.getElementById(this.options.canvas)), this.width = this.canvas.width, this.height = this.canvas.height, this._hasInvalidDimensions() ? this.fire(new o.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))) : (this.play = function () { this._playing = !0, this.map.triggerRepaint() }, this.pause = function () { this._playing && (this.prepare(), this._playing = !1) }, this._finishLoading()) } getCanvas() { return this.canvas } onAdd(l) { this.map = l, this.load(), this.canvas && this.animate && this.play() } onRemove() { this.pause() } prepare() { let l = !1; if (this.canvas.width !== this.width && (this.width = this.canvas.width, l = !0), this.canvas.height !== this.height && (this.height = this.canvas.height, l = !0), this._hasInvalidDimensions() || Object.keys(this.tiles).length === 0) return; const h = this.map.painter.context, g = h.gl; this.boundsBuffer || (this.boundsBuffer = h.createVertexBuffer(this._boundsArray, oe.members)), this.boundsSegments || (this.boundsSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? (l || this._playing) && this.texture.update(this.canvas, { premultiply: !0 }) : this.texture = new A(h, this.canvas, g.RGBA, { premultiply: !0 }); for (const b in this.tiles) { const E = this.tiles[b]; E.state !== "loaded" && (E.state = "loaded", E.texture = this.texture) } } serialize() { return { type: "canvas", coordinates: this.coordinates } } hasTransition() { return this._playing } _hasInvalidDimensions() { for (const l of [this.canvas.width, this.canvas.height]) if (isNaN(l) || l <= 0) return !0; return !1 } } const Pe = { vector: Z, raster: J, "raster-dem": ie, geojson: ce, video: Ie, image: ye, canvas: Te }; function De(x, l) { const h = o.create(); return o.translate(h, h, [1, 1, 0]), o.scale(h, h, [.5 * x.width, .5 * x.height, 1]), o.multiply(h, h, x.calculatePosMatrix(l.toUnwrapped())) } function Re(x, l, h, g, b, E) { const D = function (ae, fe, Se) { if (ae) for (const _e of ae) { const we = fe[_e]; if (we && we.source === Se && we.type === "fill-extrusion") return !0 } else for (const _e in fe) { const we = fe[_e]; if (we.source === Se && we.type === "fill-extrusion") return !0 } return !1 }(b && b.layers, l, x.id), $ = E.maxPitchScaleFactor(), U = x.tilesIn(g, $, D); U.sort(ke); const W = []; for (const ae of U) W.push({ wrappedTileID: ae.tileID.wrapped().key, queryResults: ae.tile.queryRenderedFeatures(l, h, x._state, ae.queryGeometry, ae.cameraQueryGeometry, ae.scale, b, E, $, De(x.transform, ae.tileID)) }); const te = function (ae) { const fe = {}, Se = {}; for (const _e of ae) { const we = _e.queryResults, Be = _e.wrappedTileID, je = Se[Be] = Se[Be] || {}; for (const et in we) { const Me = we[et], at = je[et] = je[et] || {}, nt = fe[et] = fe[et] || []; for (const xt of Me) at[xt.featureIndex] || (at[xt.featureIndex] = !0, nt.push(xt)) } } return fe }(W); for (const ae in te) te[ae].forEach(fe => { const Se = fe.feature, _e = x.getFeatureState(Se.layer["source-layer"], Se.id); Se.source = Se.layer.source, Se.layer["source-layer"] && (Se.sourceLayer = Se.layer["source-layer"]), Se.state = _e }); return te } function ke(x, l) { const h = x.tileID, g = l.tileID; return h.overscaledZ - g.overscaledZ || h.canonical.y - g.canonical.y || h.wrap - g.wrap || h.canonical.x - g.canonical.x } class Oe { constructor(l, h) { this.tileID = l, this.uid = o.uniqueId(), this.uses = 0, this.tileSize = h, this.buckets = {}, this.expirationTime = null, this.queryPadding = 0, this.hasSymbolBuckets = !1, this.hasRTLText = !1, this.dependencies = {}, this.textures = [], this.textureCoords = {}, this.expiredRequestCount = 0, this.state = "loading" } registerFadeDuration(l) { const h = l + this.timeAdded; h < o.exported.now() || this.fadeEndTime && h < this.fadeEndTime || (this.fadeEndTime = h) } wasRequested() { return this.state === "errored" || this.state === "loaded" || this.state === "reloading" } clearTextures(l) { this.demTexture && l.saveTileTexture(this.demTexture), this.textures.forEach(h => l.saveTileTexture(h)), this.demTexture = null, this.textures = [], this.textureCoords = {} } loadVectorData(l, h, g) { if (this.hasData() && this.unloadVectorData(), this.state = "loaded", l) { l.featureIndex && (this.latestFeatureIndex = l.featureIndex, l.rawTileData ? (this.latestRawTileData = l.rawTileData, this.latestFeatureIndex.rawTileData = l.rawTileData) : this.latestRawTileData && (this.latestFeatureIndex.rawTileData = this.latestRawTileData)), this.collisionBoxArray = l.collisionBoxArray, this.buckets = function (b, E) { const D = {}; if (!E) return D; for (const $ of b) { const U = $.layerIds.map(W => E.getLayer(W)).filter(Boolean); if (U.length !== 0) { $.layers = U, $.stateDependentLayerIds && ($.stateDependentLayers = $.stateDependentLayerIds.map(W => U.filter(te => te.id === W)[0])); for (const W of U) D[W.id] = $ } } return D }(l.buckets, h.style), this.hasSymbolBuckets = !1; for (const b in this.buckets) { const E = this.buckets[b]; if (E instanceof o.SymbolBucket) { if (this.hasSymbolBuckets = !0, !g) break; E.justReloaded = !0 } } if (this.hasRTLText = !1, this.hasSymbolBuckets) for (const b in this.buckets) { const E = this.buckets[b]; if (E instanceof o.SymbolBucket && E.hasRTLText) { this.hasRTLText = !0, o.lazyLoadRTLTextPlugin(); break } } this.queryPadding = 0; for (const b in this.buckets) { const E = this.buckets[b]; this.queryPadding = Math.max(this.queryPadding, h.style.getLayer(b).queryRadius(E)) } l.imageAtlas && (this.imageAtlas = l.imageAtlas), l.glyphAtlasImage && (this.glyphAtlasImage = l.glyphAtlasImage) } else this.collisionBoxArray = new o.CollisionBoxArray } unloadVectorData() { for (const l in this.buckets) this.buckets[l].destroy(); this.buckets = {}, this.imageAtlasTexture && this.imageAtlasTexture.destroy(), this.imageAtlas && (this.imageAtlas = null), this.glyphAtlasTexture && this.glyphAtlasTexture.destroy(), this.latestFeatureIndex = null, this.state = "unloaded" } getBucket(l) { return this.buckets[l.id] } upload(l) { for (const g in this.buckets) { const b = this.buckets[g]; b.uploadPending() && b.upload(l) } const h = l.gl; this.imageAtlas && !this.imageAtlas.uploaded && (this.imageAtlasTexture = new A(l, this.imageAtlas.image, h.RGBA), this.imageAtlas.uploaded = !0), this.glyphAtlasImage && (this.glyphAtlasTexture = new A(l, this.glyphAtlasImage, h.ALPHA), this.glyphAtlasImage = null) } prepare(l) { this.imageAtlas && this.imageAtlas.patchUpdatedImages(l, this.imageAtlasTexture) } queryRenderedFeatures(l, h, g, b, E, D, $, U, W, te) { return this.latestFeatureIndex && this.latestFeatureIndex.rawTileData ? this.latestFeatureIndex.query({ queryGeometry: b, cameraQueryGeometry: E, scale: D, tileSize: this.tileSize, pixelPosMatrix: te, transform: U, params: $, queryPadding: this.queryPadding * W }, l, h, g) : {} } querySourceFeatures(l, h) { const g = this.latestFeatureIndex; if (!g || !g.rawTileData) return; const b = g.loadVTLayers(), E = h ? h.sourceLayer : "", D = b._geojsonTileLayer || b[E]; if (!D) return; const $ = o.createFilter(h && h.filter), { z: U, x: W, y: te } = this.tileID.canonical, ae = { z: U, x: W, y: te }; for (let fe = 0; fe < D.length; fe++) { const Se = D.feature(fe); if ($.needGeometry) { const Be = o.toEvaluationFeature(Se, !0); if (!$.filter(new o.EvaluationParameters(this.tileID.overscaledZ), Be, this.tileID.canonical)) continue } else if (!$.filter(new o.EvaluationParameters(this.tileID.overscaledZ), Se)) continue; const _e = g.getId(Se, E), we = new o.GeoJSONFeature(Se, U, W, te, _e); we.tile = ae, l.push(we) } } hasData() { return this.state === "loaded" || this.state === "reloading" || this.state === "expired" } patternsLoaded() { return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length } setExpiryData(l) { const h = this.expirationTime; if (l.cacheControl) { const g = o.parseCacheControl(l.cacheControl); g["max-age"] && (this.expirationTime = Date.now() + 1e3 * g["max-age"]) } else l.expires && (this.expirationTime = new Date(l.expires).getTime()); if (this.expirationTime) { const g = Date.now(); let b = !1; if (this.expirationTime > g) b = !1; else if (h) if (this.expirationTime < h) b = !0; else { const E = this.expirationTime - h; E ? this.expirationTime = g + Math.max(E, 3e4) : b = !0 } else b = !0; b ? (this.expiredRequestCount++, this.state = "expired") : this.expiredRequestCount = 0 } } getExpiryTimeout() { if (this.expirationTime) return this.expiredRequestCount ? 1e3 * (1 << Math.min(this.expiredRequestCount - 1, 31)) : Math.min(this.expirationTime - new Date().getTime(), Math.pow(2, 31) - 1) } setFeatureState(l, h) { if (!this.latestFeatureIndex || !this.latestFeatureIndex.rawTileData || Object.keys(l).length === 0) return; const g = this.latestFeatureIndex.loadVTLayers(); for (const b in this.buckets) { if (!h.style.hasLayer(b)) continue; const E = this.buckets[b], D = E.layers[0].sourceLayer || "_geojsonTileLayer", $ = g[D], U = l[D]; if (!$ || !U || Object.keys(U).length === 0) continue; E.update(U, $, this.imageAtlas && this.imageAtlas.patternPositions || {}); const W = h && h.style && h.style.getLayer(b); W && (this.queryPadding = Math.max(this.queryPadding, W.queryRadius(E))) } } holdingForFade() { return this.symbolFadeHoldUntil !== void 0 } symbolFadeFinished() { return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < o.exported.now() } clearFadeHold() { this.symbolFadeHoldUntil = void 0 } setHoldDuration(l) { this.symbolFadeHoldUntil = o.exported.now() + l } setDependencies(l, h) { const g = {}; for (const b of h) g[b] = !0; this.dependencies[l] = g } hasDependency(l, h) { for (const g of l) { const b = this.dependencies[g]; if (b) { for (const E of h) if (b[E]) return !0 } } return !1 } } class $e { constructor(l, h) { this.max = l, this.onRemove = h, this.reset() } reset() { for (const l in this.data) for (const h of this.data[l]) h.timeout && clearTimeout(h.timeout), this.onRemove(h.value); return this.data = {}, this.order = [], this } add(l, h, g) { const b = l.wrapped().key; this.data[b] === void 0 && (this.data[b] = []); const E = { value: h, timeout: void 0 }; if (g !== void 0 && (E.timeout = setTimeout(() => { this.remove(l, E) }, g)), this.data[b].push(E), this.order.push(b), this.order.length > this.max) { const D = this._getAndRemoveByKey(this.order[0]); D && this.onRemove(D) } return this } has(l) { return l.wrapped().key in this.data } getAndRemove(l) { return this.has(l) ? this._getAndRemoveByKey(l.wrapped().key) : null } _getAndRemoveByKey(l) { const h = this.data[l].shift(); return h.timeout && clearTimeout(h.timeout), this.data[l].length === 0 && delete this.data[l], this.order.splice(this.order.indexOf(l), 1), h.value } getByKey(l) { const h = this.data[l]; return h ? h[0].value : null } get(l) { return this.has(l) ? this.data[l.wrapped().key][0].value : null } remove(l, h) { if (!this.has(l)) return this; const g = l.wrapped().key, b = h === void 0 ? 0 : this.data[g].indexOf(h), E = this.data[g][b]; return this.data[g].splice(b, 1), E.timeout && clearTimeout(E.timeout), this.data[g].length === 0 && delete this.data[g], this.onRemove(E.value), this.order.splice(this.order.indexOf(g), 1), this } setMaxSize(l) { for (this.max = l; this.order.length > this.max;) { const h = this._getAndRemoveByKey(this.order[0]); h && this.onRemove(h) } return this } filter(l) { const h = []; for (const g in this.data) for (const b of this.data[g]) l(b.value) || h.push(b); for (const g of h) this.remove(g.value.tileID, g) } } class He { constructor() { this.state = {}, this.stateChanges = {}, this.deletedStates = {} } updateState(l, h, g) { const b = String(h); if (this.stateChanges[l] = this.stateChanges[l] || {}, this.stateChanges[l][b] = this.stateChanges[l][b] || {}, o.extend(this.stateChanges[l][b], g), this.deletedStates[l] === null) { this.deletedStates[l] = {}; for (const E in this.state[l]) E !== b && (this.deletedStates[l][E] = null) } else if (this.deletedStates[l] && this.deletedStates[l][b] === null) { this.deletedStates[l][b] = {}; for (const E in this.state[l][b]) g[E] || (this.deletedStates[l][b][E] = null) } else for (const E in g) this.deletedStates[l] && this.deletedStates[l][b] && this.deletedStates[l][b][E] === null && delete this.deletedStates[l][b][E] } removeFeatureState(l, h, g) { if (this.deletedStates[l] === null) return; const b = String(h); if (this.deletedStates[l] = this.deletedStates[l] || {}, g && h !== void 0) this.deletedStates[l][b] !== null && (this.deletedStates[l][b] = this.deletedStates[l][b] || {}, this.deletedStates[l][b][g] = null); else if (h !== void 0) if (this.stateChanges[l] && this.stateChanges[l][b]) for (g in this.deletedStates[l][b] = {}, this.stateChanges[l][b]) this.deletedStates[l][b][g] = null; else this.deletedStates[l][b] = null; else this.deletedStates[l] = null } getState(l, h) { const g = String(h), b = o.extend({}, (this.state[l] || {})[g], (this.stateChanges[l] || {})[g]); if (this.deletedStates[l] === null) return {}; if (this.deletedStates[l]) { const E = this.deletedStates[l][h]; if (E === null) return {}; for (const D in E) delete b[D] } return b } initializeTileState(l, h) { l.setFeatureState(this.state, h) } coalesceChanges(l, h) { const g = {}; for (const b in this.stateChanges) { this.state[b] = this.state[b] || {}; const E = {}; for (const D in this.stateChanges[b]) this.state[b][D] || (this.state[b][D] = {}), o.extend(this.state[b][D], this.stateChanges[b][D]), E[D] = this.state[b][D]; g[b] = E } for (const b in this.deletedStates) { this.state[b] = this.state[b] || {}; const E = {}; if (this.deletedStates[b] === null) for (const D in this.state[b]) E[D] = {}, this.state[b][D] = {}; else for (const D in this.deletedStates[b]) { if (this.deletedStates[b][D] === null) this.state[b][D] = {}; else for (const $ of Object.keys(this.deletedStates[b][D])) delete this.state[b][D][$]; E[D] = this.state[b][D] } g[b] = g[b] || {}, o.extend(g[b], E) } if (this.stateChanges = {}, this.deletedStates = {}, Object.keys(g).length !== 0) for (const b in l) l[b].setFeatureState(g, h) } } class Ue extends o.Evented { constructor(l, h, g) { super(), this.id = l, this.dispatcher = g, this.on("data", b => { b.dataType === "source" && b.sourceDataType === "metadata" && (this._sourceLoaded = !0), this._sourceLoaded && !this._paused && b.dataType === "source" && b.sourceDataType === "content" && (this.reload(), this.transform && this.update(this.transform, this.terrain)) }), this.on("dataloading", () => { this._sourceErrored = !1 }), this.on("error", () => { this._sourceErrored = this._source.loaded() }), this._source = function (b, E, D, $) { const U = new Pe[E.type](b, E, D, $); if (U.id !== b) throw new Error(`Expected Source id to be ${b} instead of ${U.id}`); return o.bindAll(["load", "abort", "unload", "serialize", "prepare"], U), U }(l, h, g, this), this._tiles = {}, this._cache = new $e(0, this._unloadTile.bind(this)), this._timers = {}, this._cacheTimers = {}, this._maxTileCacheSize = null, this._loadedParentTiles = {}, this._coveredTiles = {}, this._state = new He } onAdd(l) { this.map = l, this._maxTileCacheSize = l ? l._maxTileCacheSize : null, this._source && this._source.onAdd && this._source.onAdd(l) } onRemove(l) { this.clearTiles(), this._source && this._source.onRemove && this._source.onRemove(l) } loaded() { if (this._sourceErrored) return !0; if (!this._sourceLoaded || !this._source.loaded()) return !1; for (const l in this._tiles) { const h = this._tiles[l]; if (h.state !== "loaded" && h.state !== "errored") return !1 } return !0 } getSource() { return this._source } pause() { this._paused = !0 } resume() { if (!this._paused) return; const l = this._shouldReloadOnResume; this._paused = !1, this._shouldReloadOnResume = !1, l && this.reload(), this.transform && this.update(this.transform, this.terrain) } _loadTile(l, h) { return this._source.loadTile(l, h) } _unloadTile(l) { if (this._source.unloadTile) return this._source.unloadTile(l, () => { }) } _abortTile(l) { this._source.abortTile && this._source.abortTile(l, () => { }), this._source.fire(new o.Event("dataabort", { tile: l, coord: l.tileID, dataType: "source" })) } serialize() { return this._source.serialize() } prepare(l) { this._source.prepare && this._source.prepare(), this._state.coalesceChanges(this._tiles, this.map ? this.map.painter : null); for (const h in this._tiles) { const g = this._tiles[h]; g.upload(l), g.prepare(this.map.style.imageManager) } } getIds() { return Object.values(this._tiles).map(l => l.tileID).sort(st).map(l => l.key) } getRenderableIds(l) { const h = []; for (const g in this._tiles) this._isIdRenderable(g, l) && h.push(this._tiles[g]); return l ? h.sort((g, b) => { const E = g.tileID, D = b.tileID, $ = new o.pointGeometry(E.canonical.x, E.canonical.y)._rotate(this.transform.angle), U = new o.pointGeometry(D.canonical.x, D.canonical.y)._rotate(this.transform.angle); return E.overscaledZ - D.overscaledZ || U.y - $.y || U.x - $.x }).map(g => g.tileID.key) : h.map(g => g.tileID).sort(st).map(g => g.key) } hasRenderableParent(l) { const h = this.findLoadedParent(l, 0); return !!h && this._isIdRenderable(h.tileID.key) } _isIdRenderable(l, h) { return this._tiles[l] && this._tiles[l].hasData() && !this._coveredTiles[l] && (h || !this._tiles[l].holdingForFade()) } reload() { if (this._paused) this._shouldReloadOnResume = !0; else { this._cache.reset(); for (const l in this._tiles) this._tiles[l].state !== "errored" && this._reloadTile(l, "reloading") } } _reloadTile(l, h) { const g = this._tiles[l]; g && (g.state !== "loading" && (g.state = h), this._loadTile(g, this._tileLoaded.bind(this, g, l, h))) } _tileLoaded(l, h, g, b) { if (b) return l.state = "errored", void (b.status !== 404 ? this._source.fire(new o.ErrorEvent(b, { tile: l })) : this.update(this.transform, this.terrain)); l.timeAdded = o.exported.now(), g === "expired" && (l.refreshedUponExpiration = !0), this._setTileReloadTimer(h, l), this.getSource().type === "raster-dem" && l.dem && this._backfillDEM(l), this._state.initializeTileState(l, this.map ? this.map.painter : null), l.aborted || this._source.fire(new o.Event("data", { dataType: "source", tile: l, coord: l.tileID })) } _backfillDEM(l) { const h = this.getRenderableIds(); for (let b = 0; b < h.length; b++) { const E = h[b]; if (l.neighboringTiles && l.neighboringTiles[E]) { const D = this.getTileByID(E); g(l, D), g(D, l) } } function g(b, E) { b.needsHillshadePrepare = !0, b.needsTerrainPrepare = !0; let D = E.tileID.canonical.x - b.tileID.canonical.x; const $ = E.tileID.canonical.y - b.tileID.canonical.y, U = Math.pow(2, b.tileID.canonical.z), W = E.tileID.key; D === 0 && $ === 0 || Math.abs($) > 1 || (Math.abs(D) > 1 && (Math.abs(D + U) === 1 ? D += U : Math.abs(D - U) === 1 && (D -= U)), E.dem && b.dem && (b.dem.backfillBorder(E.dem, D, $), b.neighboringTiles && b.neighboringTiles[W] && (b.neighboringTiles[W].backfilled = !0))) } } getTile(l) { return this.getTileByID(l.key) } getTileByID(l) { return this._tiles[l] } _retainLoadedChildren(l, h, g, b) { for (const E in this._tiles) { let D = this._tiles[E]; if (b[E] || !D.hasData() || D.tileID.overscaledZ <= h || D.tileID.overscaledZ > g) continue; let $ = D.tileID; for (; D && D.tileID.overscaledZ > h + 1;) { const W = D.tileID.scaledTo(D.tileID.overscaledZ - 1); D = this._tiles[W.key], D && D.hasData() && ($ = W) } let U = $; for (; U.overscaledZ > h;)if (U = U.scaledTo(U.overscaledZ - 1), l[U.key]) { b[$.key] = $; break } } } findLoadedParent(l, h) { if (l.key in this._loadedParentTiles) { const g = this._loadedParentTiles[l.key]; return g && g.tileID.overscaledZ >= h ? g : null } for (let g = l.overscaledZ - 1; g >= h; g--) { const b = l.scaledTo(g), E = this._getLoadedTile(b); if (E) return E } } _getLoadedTile(l) { const h = this._tiles[l.key]; return h && h.hasData() ? h : this._cache.getByKey(l.wrapped().key) } updateCacheSize(l) { const h = Math.ceil(l.width / this._source.tileSize) + 1, g = Math.ceil(l.height / this._source.tileSize) + 1, b = Math.floor(h * g * 5), E = typeof this._maxTileCacheSize == "number" ? Math.min(this._maxTileCacheSize, b) : b; this._cache.setMaxSize(E) } handleWrapJump(l) { const h = Math.round((l - (this._prevLng === void 0 ? l : this._prevLng)) / 360); if (this._prevLng = l, h) { const g = {}; for (const b in this._tiles) { const E = this._tiles[b]; E.tileID = E.tileID.unwrapTo(E.tileID.wrap + h), g[E.tileID.key] = E } this._tiles = g; for (const b in this._timers) clearTimeout(this._timers[b]), delete this._timers[b]; for (const b in this._tiles) this._setTileReloadTimer(b, this._tiles[b]) } } update(l, h) { if (this.transform = l, this.terrain = h, !this._sourceLoaded || this._paused) return; let g; this.updateCacheSize(l), this.handleWrapJump(this.transform.center.lng), this._coveredTiles = {}, this.used || this.usedForTerrain ? this._source.tileID ? g = l.getVisibleUnwrappedCoordinates(this._source.tileID).map(W => new o.OverscaledTileID(W.canonical.z, W.wrap, W.canonical.z, W.canonical.x, W.canonical.y)) : (g = l.coveringTiles({ tileSize: this.usedForTerrain ? this.tileSize : this._source.tileSize, minzoom: this._source.minzoom, maxzoom: this._source.maxzoom, roundZoom: !this.usedForTerrain && this._source.roundZoom, reparseOverscaled: this._source.reparseOverscaled, terrain: h }), this._source.hasTile && (g = g.filter(W => this._source.hasTile(W)))) : g = []; const b = l.coveringZoomLevel(this._source), E = Math.max(b - Ue.maxOverzooming, this._source.minzoom), D = Math.max(b + Ue.maxUnderzooming, this._source.minzoom); if (this.usedForTerrain) { const W = {}; for (const te of g) if (te.canonical.z > this._source.minzoom) { const ae = te.scaledTo(te.canonical.z - 1); W[ae.key] = ae; const fe = te.scaledTo(Math.max(this._source.minzoom, Math.min(te.canonical.z, 5))); W[fe.key] = fe } g = g.concat(Object.values(W)) } const $ = this._updateRetainedTiles(g, b); if (ft(this._source.type)) { const W = {}, te = {}, ae = Object.keys($); for (const fe of ae) { const Se = $[fe], _e = this._tiles[fe]; if (!_e || _e.fadeEndTime && _e.fadeEndTime <= o.exported.now()) continue; const we = this.findLoadedParent(Se, E); we && (this._addTile(we.tileID), W[we.tileID.key] = we.tileID), te[fe] = Se } this._retainLoadedChildren(te, b, D, $); for (const fe in W) $[fe] || (this._coveredTiles[fe] = !0, $[fe] = W[fe]); if (h) { const fe = {}, Se = {}; for (const _e of g) this._tiles[_e.key].hasData() ? fe[_e.key] = _e : Se[_e.key] = _e; for (const _e in Se) { const we = Se[_e].children(this._source.maxzoom); this._tiles[we[0].key] && this._tiles[we[1].key] && this._tiles[we[2].key] && this._tiles[we[3].key] && (fe[we[0].key] = $[we[0].key] = we[0], fe[we[1].key] = $[we[1].key] = we[1], fe[we[2].key] = $[we[2].key] = we[2], fe[we[3].key] = $[we[3].key] = we[3], delete Se[_e]) } for (const _e in Se) { const we = this.findLoadedParent(Se[_e], this._source.minzoom); if (we) { fe[we.tileID.key] = $[we.tileID.key] = we.tileID; for (const Be in fe) fe[Be].isChildOf(we.tileID) && delete fe[Be] } } for (const _e in this._tiles) fe[_e] || (this._coveredTiles[_e] = !0) } } for (const W in $) this._tiles[W].clearFadeHold(); const U = o.keysDifference(this._tiles, $); for (const W of U) { const te = this._tiles[W]; te.hasSymbolBuckets && !te.holdingForFade() ? te.setHoldDuration(this.map._fadeDuration) : te.hasSymbolBuckets && !te.symbolFadeFinished() || this._removeTile(W) } this._updateLoadedParentTileCache() } releaseSymbolFadeTiles() { for (const l in this._tiles) this._tiles[l].holdingForFade() && this._removeTile(l) } _updateRetainedTiles(l, h) { const g = {}, b = {}, E = Math.max(h - Ue.maxOverzooming, this._source.minzoom), D = Math.max(h + Ue.maxUnderzooming, this._source.minzoom), $ = {}; for (const U of l) { const W = this._addTile(U); g[U.key] = U, W.hasData() || h < this._source.maxzoom && ($[U.key] = U) } this._retainLoadedChildren($, h, D, g); for (const U of l) { let W = this._tiles[U.key]; if (W.hasData()) continue; if (h + 1 > this._source.maxzoom) { const ae = U.children(this._source.maxzoom)[0], fe = this.getTile(ae); if (fe && fe.hasData()) { g[ae.key] = ae; continue } } else { const ae = U.children(this._source.maxzoom); if (g[ae[0].key] && g[ae[1].key] && g[ae[2].key] && g[ae[3].key]) continue } let te = W.wasRequested(); for (let ae = U.overscaledZ - 1; ae >= E; --ae) { const fe = U.scaledTo(ae); if (b[fe.key] || (b[fe.key] = !0, W = this.getTile(fe), !W && te && (W = this._addTile(fe)), W && (g[fe.key] = fe, te = W.wasRequested(), W.hasData()))) break } } return g } _updateLoadedParentTileCache() { this._loadedParentTiles = {}; for (const l in this._tiles) { const h = []; let g, b = this._tiles[l].tileID; for (; b.overscaledZ > 0;) { if (b.key in this._loadedParentTiles) { g = this._loadedParentTiles[b.key]; break } h.push(b.key); const E = b.scaledTo(b.overscaledZ - 1); if (g = this._getLoadedTile(E), g) break; b = E } for (const E of h) this._loadedParentTiles[E] = g } } _addTile(l) { let h = this._tiles[l.key]; if (h) return h; h = this._cache.getAndRemove(l), h && (this._setTileReloadTimer(l.key, h), h.tileID = l, this._state.initializeTileState(h, this.map ? this.map.painter : null), this._cacheTimers[l.key] && (clearTimeout(this._cacheTimers[l.key]), delete this._cacheTimers[l.key], this._setTileReloadTimer(l.key, h))); const g = h; return h || (h = new Oe(l, this._source.tileSize * l.overscaleFactor()), this._loadTile(h, this._tileLoaded.bind(this, h, l.key, h.state))), h.uses++, this._tiles[l.key] = h, g || this._source.fire(new o.Event("dataloading", { tile: h, coord: h.tileID, dataType: "source" })), h } _setTileReloadTimer(l, h) { l in this._timers && (clearTimeout(this._timers[l]), delete this._timers[l]); const g = h.getExpiryTimeout(); g && (this._timers[l] = setTimeout(() => { this._reloadTile(l, "expired"), delete this._timers[l] }, g)) } _removeTile(l) { const h = this._tiles[l]; h && (h.uses--, delete this._tiles[l], this._timers[l] && (clearTimeout(this._timers[l]), delete this._timers[l]), h.uses > 0 || (h.hasData() && h.state !== "reloading" ? this._cache.add(h.tileID, h, h.getExpiryTimeout()) : (h.aborted = !0, this._abortTile(h), this._unloadTile(h)))) } clearTiles() { this._shouldReloadOnResume = !1, this._paused = !1; for (const l in this._tiles) this._removeTile(l); this._cache.reset() } tilesIn(l, h, g) { const b = [], E = this.transform; if (!E) return b; const D = g ? E.getCameraQueryGeometry(l) : l, $ = l.map(_e => E.pointCoordinate(_e, this.terrain)), U = D.map(_e => E.pointCoordinate(_e, this.terrain)), W = this.getIds(); let te = 1 / 0, ae = 1 / 0, fe = -1 / 0, Se = -1 / 0; for (const _e of U) te = Math.min(te, _e.x), ae = Math.min(ae, _e.y), fe = Math.max(fe, _e.x), Se = Math.max(Se, _e.y); for (let _e = 0; _e < W.length; _e++) { const we = this._tiles[W[_e]]; if (we.holdingForFade()) continue; const Be = we.tileID, je = Math.pow(2, E.zoom - we.tileID.overscaledZ), et = h * we.queryPadding * o.EXTENT / we.tileSize / je, Me = [Be.getTilePoint(new o.MercatorCoordinate(te, ae)), Be.getTilePoint(new o.MercatorCoordinate(fe, Se))]; if (Me[0].x - et < o.EXTENT && Me[0].y - et < o.EXTENT && Me[1].x + et >= 0 && Me[1].y + et >= 0) { const at = $.map(xt => Be.getTilePoint(xt)), nt = U.map(xt => Be.getTilePoint(xt)); b.push({ tile: we, tileID: Be, queryGeometry: at, cameraQueryGeometry: nt, scale: je }) } } return b } getVisibleCoordinates(l) { const h = this.getRenderableIds(l).map(g => this._tiles[g].tileID); for (const g of h) g.posMatrix = this.transform.calculatePosMatrix(g.toUnwrapped()); return h } hasTransition() { if (this._source.hasTransition()) return !0; if (ft(this._source.type)) for (const l in this._tiles) { const h = this._tiles[l]; if (h.fadeEndTime !== void 0 && h.fadeEndTime >= o.exported.now()) return !0 } return !1 } setFeatureState(l, h, g) { this._state.updateState(l = l || "_geojsonTileLayer", h, g) } removeFeatureState(l, h, g) { this._state.removeFeatureState(l = l || "_geojsonTileLayer", h, g) } getFeatureState(l, h) { return this._state.getState(l = l || "_geojsonTileLayer", h) } setDependencies(l, h, g) { const b = this._tiles[l]; b && b.setDependencies(h, g) } reloadTilesForDependencies(l, h) { for (const g in this._tiles) this._tiles[g].hasDependency(l, h) && this._reloadTile(g, "reloading"); this._cache.filter(g => !g.hasDependency(l, h)) } } function st(x, l) { const h = Math.abs(2 * x.wrap) - +(x.wrap < 0), g = Math.abs(2 * l.wrap) - +(l.wrap < 0); return x.overscaledZ - l.overscaledZ || g - h || l.canonical.y - x.canonical.y || l.canonical.x - x.canonical.x } function ft(x) { return x === "raster" || x === "image" || x === "video" } Ue.maxOverzooming = 10, Ue.maxUnderzooming = 3; const It = "mapboxgl_preloaded_worker_pool"; class We { constructor() { this.active = {} } acquire(l) { if (!this.workers) for (this.workers = []; this.workers.length < We.workerCount;)this.workers.push(new Worker(Is.workerUrl)); return this.active[l] = !0, this.workers.slice() } release(l) { delete this.active[l], this.numActive() === 0 && (this.workers.forEach(h => { h.terminate() }), this.workers = null) } isPreloaded() { return !!this.active[It] } numActive() { return Object.keys(this.active).length } } const Pt = Math.floor(o.exported.hardwareConcurrency / 2); let pt; function Rt() { return pt || (pt = new We), pt } function yt(x, l) { const h = {}; for (const g in x) g !== "ref" && (h[g] = x[g]); return o.refProperties.forEach(g => { g in l && (h[g] = l[g]) }), h } function Mt(x) { x = x.slice(); const l = Object.create(null); for (let h = 0; h < x.length; h++)l[x[h].id] = x[h]; for (let h = 0; h < x.length; h++)"ref" in x[h] && (x[h] = yt(x[h], l[x[h].ref])); return x } We.workerCount = Math.max(Math.min(Pt, 6), 1); const ut = { setStyle: "setStyle", addLayer: "addLayer", removeLayer: "removeLayer", setPaintProperty: "setPaintProperty", setLayoutProperty: "setLayoutProperty", setFilter: "setFilter", addSource: "addSource", removeSource: "removeSource", setGeoJSONSourceData: "setGeoJSONSourceData", setLayerZoomRange: "setLayerZoomRange", setLayerProperty: "setLayerProperty", setCenter: "setCenter", setZoom: "setZoom", setBearing: "setBearing", setPitch: "setPitch", setSprite: "setSprite", setGlyphs: "setGlyphs", setTransition: "setTransition", setLight: "setLight" }; function dt(x, l, h) { h.push({ command: ut.addSource, args: [x, l[x]] }) } function ct(x, l, h) { l.push({ command: ut.removeSource, args: [x] }), h[x] = !0 } function rt(x, l, h, g) { ct(x, h, g), dt(x, l, h) } function ht(x, l, h) { let g; for (g in x[h]) if (Object.prototype.hasOwnProperty.call(x[h], g) && g !== "data" && !y(x[h][g], l[h][g])) return !1; for (g in l[h]) if (Object.prototype.hasOwnProperty.call(l[h], g) && g !== "data" && !y(x[h][g], l[h][g])) return !1; return !0 } function bt(x, l, h, g, b, E) { let D; for (D in l = l || {}, x = x || {}) Object.prototype.hasOwnProperty.call(x, D) && (y(x[D], l[D]) || h.push({ command: E, args: [g, D, l[D], b] })); for (D in l) Object.prototype.hasOwnProperty.call(l, D) && !Object.prototype.hasOwnProperty.call(x, D) && (y(x[D], l[D]) || h.push({ command: E, args: [g, D, l[D], b] })) } function Wt(x) { return x.id } function Ut(x, l) { return x[l.id] = l, x } class Jt { constructor(l, h) { this.reset(l, h) } reset(l, h) { this.points = l || [], this._distances = [0]; for (let g = 1; g < this.points.length; g++)this._distances[g] = this._distances[g - 1] + this.points[g].dist(this.points[g - 1]); this.length = this._distances[this._distances.length - 1], this.padding = Math.min(h || 0, .5 * this.length), this.paddedLength = this.length - 2 * this.padding } lerp(l) { if (this.points.length === 1) return this.points[0]; l = o.clamp(l, 0, 1); let h = 1, g = this._distances[h]; const b = l * this.paddedLength + this.padding; for (; g < b && h < this._distances.length;)g = this._distances[++h]; const E = h - 1, D = this._distances[E], $ = g - D, U = $ > 0 ? (b - D) / $ : 0; return this.points[E].mult(1 - U).add(this.points[h].mult(U)) } } function Fe(x, l) { let h = !0; return x === "always" || x !== "never" && l !== "never" || (h = !1), h } class Ge { constructor(l, h, g) { const b = this.boxCells = [], E = this.circleCells = []; this.xCellCount = Math.ceil(l / g), this.yCellCount = Math.ceil(h / g); for (let D = 0; D < this.xCellCount * this.yCellCount; D++)b.push([]), E.push([]); this.circleKeys = [], this.boxKeys = [], this.bboxes = [], this.circles = [], this.width = l, this.height = h, this.xScale = this.xCellCount / l, this.yScale = this.yCellCount / h, this.boxUid = 0, this.circleUid = 0 } keysLength() { return this.boxKeys.length + this.circleKeys.length } insert(l, h, g, b, E) { this._forEachCell(h, g, b, E, this._insertBoxCell, this.boxUid++), this.boxKeys.push(l), this.bboxes.push(h), this.bboxes.push(g), this.bboxes.push(b), this.bboxes.push(E) } insertCircle(l, h, g, b) { this._forEachCell(h - b, g - b, h + b, g + b, this._insertCircleCell, this.circleUid++), this.circleKeys.push(l), this.circles.push(h), this.circles.push(g), this.circles.push(b) } _insertBoxCell(l, h, g, b, E, D) { this.boxCells[E].push(D) } _insertCircleCell(l, h, g, b, E, D) { this.circleCells[E].push(D) } _query(l, h, g, b, E, D, $) { if (g < 0 || l > this.width || b < 0 || h > this.height) return []; const U = []; if (l <= 0 && h <= 0 && this.width <= g && this.height <= b) { if (E) return [{ key: null, x1: l, y1: h, x2: g, y2: b }]; for (let W = 0; W < this.boxKeys.length; W++)U.push({ key: this.boxKeys[W], x1: this.bboxes[4 * W], y1: this.bboxes[4 * W + 1], x2: this.bboxes[4 * W + 2], y2: this.bboxes[4 * W + 3] }); for (let W = 0; W < this.circleKeys.length; W++) { const te = this.circles[3 * W], ae = this.circles[3 * W + 1], fe = this.circles[3 * W + 2]; U.push({ key: this.circleKeys[W], x1: te - fe, y1: ae - fe, x2: te + fe, y2: ae + fe }) } } else this._forEachCell(l, h, g, b, this._queryCell, U, { hitTest: E, overlapMode: D, seenUids: { box: {}, circle: {} } }, $); return U } query(l, h, g, b) { return this._query(l, h, g, b, !1, null) } hitTest(l, h, g, b, E, D) { return this._query(l, h, g, b, !0, E, D).length > 0 } hitTestCircle(l, h, g, b, E) { const D = l - g, $ = l + g, U = h - g, W = h + g; if ($ < 0 || D > this.width || W < 0 || U > this.height) return !1; const te = []; return this._forEachCell(D, U, $, W, this._queryCellCircle, te, { hitTest: !0, overlapMode: b, circle: { x: l, y: h, radius: g }, seenUids: { box: {}, circle: {} } }, E), te.length > 0 } _queryCell(l, h, g, b, E, D, $, U) { const { seenUids: W, hitTest: te, overlapMode: ae } = $, fe = this.boxCells[E]; if (fe !== null) { const _e = this.bboxes; for (const we of fe) if (!W.box[we]) { W.box[we] = !0; const Be = 4 * we, je = this.boxKeys[we]; if (l <= _e[Be + 2] && h <= _e[Be + 3] && g >= _e[Be + 0] && b >= _e[Be + 1] && (!U || U(je)) && (!te || !Fe(ae, je.overlapMode)) && (D.push({ key: je, x1: _e[Be], y1: _e[Be + 1], x2: _e[Be + 2], y2: _e[Be + 3] }), te)) return !0 } } const Se = this.circleCells[E]; if (Se !== null) { const _e = this.circles; for (const we of Se) if (!W.circle[we]) { W.circle[we] = !0; const Be = 3 * we, je = this.circleKeys[we]; if (this._circleAndRectCollide(_e[Be], _e[Be + 1], _e[Be + 2], l, h, g, b) && (!U || U(je)) && (!te || !Fe(ae, je.overlapMode))) { const et = _e[Be], Me = _e[Be + 1], at = _e[Be + 2]; if (D.push({ key: je, x1: et - at, y1: Me - at, x2: et + at, y2: Me + at }), te) return !0 } } } return !1 } _queryCellCircle(l, h, g, b, E, D, $, U) { const { circle: W, seenUids: te, overlapMode: ae } = $, fe = this.boxCells[E]; if (fe !== null) { const _e = this.bboxes; for (const we of fe) if (!te.box[we]) { te.box[we] = !0; const Be = 4 * we, je = this.boxKeys[we]; if (this._circleAndRectCollide(W.x, W.y, W.radius, _e[Be + 0], _e[Be + 1], _e[Be + 2], _e[Be + 3]) && (!U || U(je)) && !Fe(ae, je.overlapMode)) return D.push(!0), !0 } } const Se = this.circleCells[E]; if (Se !== null) { const _e = this.circles; for (const we of Se) if (!te.circle[we]) { te.circle[we] = !0; const Be = 3 * we, je = this.circleKeys[we]; if (this._circlesCollide(_e[Be], _e[Be + 1], _e[Be + 2], W.x, W.y, W.radius) && (!U || U(je)) && !Fe(ae, je.overlapMode)) return D.push(!0), !0 } } } _forEachCell(l, h, g, b, E, D, $, U) { const W = this._convertToXCellCoord(l), te = this._convertToYCellCoord(h), ae = this._convertToXCellCoord(g), fe = this._convertToYCellCoord(b); for (let Se = W; Se <= ae; Se++)for (let _e = te; _e <= fe; _e++)if (E.call(this, l, h, g, b, this.xCellCount * _e + Se, D, $, U)) return } _convertToXCellCoord(l) { return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(l * this.xScale))) } _convertToYCellCoord(l) { return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(l * this.yScale))) } _circlesCollide(l, h, g, b, E, D) { const $ = b - l, U = E - h, W = g + D; return W * W > $ * $ + U * U } _circleAndRectCollide(l, h, g, b, E, D, $) { const U = (D - b) / 2, W = Math.abs(l - (b + U)); if (W > U + g) return !1; const te = ($ - E) / 2, ae = Math.abs(h - (E + te)); if (ae > te + g) return !1; if (W <= U || ae <= te) return !0; const fe = W - U, Se = ae - te; return fe * fe + Se * Se <= g * g } } function Zt(x, l, h, g, b) { const E = o.create(); return l ? (o.scale(E, E, [1 / b, 1 / b, 1]), h || o.rotateZ(E, E, g.angle)) : o.multiply(E, g.labelPlaneMatrix, x), E } function cn(x, l, h, g, b) { if (l) { const E = o.clone(x); return o.scale(E, E, [b, b, 1]), h || o.rotateZ(E, E, -g.angle), E } return g.glCoordMatrix } function jt(x, l, h) { let g; h ? (g = [x.x, x.y, h(x.x, x.y), 1], o.transformMat4(g, g, l)) : (g = [x.x, x.y, 0, 1], yn(g, g, l)); const b = g[3]; return { point: new o.pointGeometry(g[0] / b, g[1] / b), signedDistanceFromCamera: b } } function Kt(x, l) { return .5 + x / l * .5 } function nn(x, l) { const h = x[0] / x[3], g = x[1] / x[3]; return h >= -l[0] && h <= l[0] && g >= -l[1] && g <= l[1] } function Cn(x, l, h, g, b, E, D, $, U, W) { const te = g ? x.textSizeData : x.iconSizeData, ae = o.evaluateSizeForZoom(te, h.transform.zoom), fe = [256 / h.width * 2 + 1, 256 / h.height * 2 + 1], Se = g ? x.text.dynamicLayoutVertexArray : x.icon.dynamicLayoutVertexArray; Se.clear(); const _e = x.lineVertexArray, we = g ? x.text.placedSymbolArray : x.icon.placedSymbolArray, Be = h.transform.width / h.transform.height; let je = !1; for (let et = 0; et < we.length; et++) { const Me = we.get(et); if (Me.hidden || Me.writingMode === o.WritingMode.vertical && !je) { gt(Me.numGlyphs, Se); continue } let at; if (je = !1, W ? (at = [Me.anchorX, Me.anchorY, W(Me.anchorX, Me.anchorY), 1], o.transformMat4(at, at, l)) : (at = [Me.anchorX, Me.anchorY, 0, 1], yn(at, at, l)), !nn(at, fe)) { gt(Me.numGlyphs, Se); continue } const nt = Kt(h.transform.cameraToCenterDistance, at[3]), xt = o.evaluateSizeForFeature(te, ae, Me), _t = D ? xt / nt : xt * nt, Ft = new o.pointGeometry(Me.anchorX, Me.anchorY), vt = jt(Ft, b, W).point, sn = {}, Yt = qt(Me, _t, !1, $, l, b, E, x.glyphOffsetArray, _e, Se, vt, Ft, sn, Be, U, W); je = Yt.useVertical, (Yt.notEnoughRoom || je || Yt.needsFlipping && qt(Me, _t, !0, $, l, b, E, x.glyphOffsetArray, _e, Se, vt, Ft, sn, Be, U, W).notEnoughRoom) && gt(Me.numGlyphs, Se) } g ? x.text.dynamicLayoutVertexBuffer.updateData(Se) : x.icon.dynamicLayoutVertexBuffer.updateData(Se) } function Nn(x, l, h, g, b, E, D, $, U, W, te, ae, fe) { const Se = $.glyphStartIndex + $.numGlyphs, _e = $.lineStartIndex, we = $.lineStartIndex + $.lineLength, Be = l.getoffsetX($.glyphStartIndex), je = l.getoffsetX(Se - 1), et = Xt(x * Be, h, g, b, E, D, $.segment, _e, we, U, W, te, ae, fe); if (!et) return null; const Me = Xt(x * je, h, g, b, E, D, $.segment, _e, we, U, W, te, ae, fe); return Me ? { first: et, last: Me } : null } function wt(x, l, h, g) { return x === o.WritingMode.horizontal && Math.abs(h.y - l.y) > Math.abs(h.x - l.x) * g ? { useVertical: !0 } : (x === o.WritingMode.vertical ? l.y < h.y : l.x > h.x) ? { needsFlipping: !0 } : null } function qt(x, l, h, g, b, E, D, $, U, W, te, ae, fe, Se, _e, we) { const Be = l / 24, je = x.lineOffsetX * Be, et = x.lineOffsetY * Be; let Me; if (x.numGlyphs > 1) { const at = x.glyphStartIndex + x.numGlyphs, nt = x.lineStartIndex, xt = x.lineStartIndex + x.lineLength, _t = Nn(Be, $, je, et, h, te, ae, x, U, E, fe, _e, we); if (!_t) return { notEnoughRoom: !0 }; const Ft = jt(_t.first.point, D, we).point, vt = jt(_t.last.point, D, we).point; if (g && !h) { const sn = wt(x.writingMode, Ft, vt, Se); if (sn) return sn } Me = [_t.first]; for (let sn = x.glyphStartIndex + 1; sn < at - 1; sn++)Me.push(Xt(Be * $.getoffsetX(sn), je, et, h, te, ae, x.segment, nt, xt, U, E, fe, _e, we)); Me.push(_t.last) } else { if (g && !h) { const nt = jt(ae, b, we).point, xt = x.lineStartIndex + x.segment + 1, _t = new o.pointGeometry(U.getx(xt), U.gety(xt)), Ft = jt(_t, b, we), vt = Ft.signedDistanceFromCamera > 0 ? Ft.point : At(ae, _t, nt, 1, b, we), sn = wt(x.writingMode, nt, vt, Se); if (sn) return sn } const at = Xt(Be * $.getoffsetX(x.glyphStartIndex), je, et, h, te, ae, x.segment, x.lineStartIndex, x.lineStartIndex + x.lineLength, U, E, fe, _e, we); if (!at) return { notEnoughRoom: !0 }; Me = [at] } for (const at of Me) o.addDynamicAttributes(W, at.point, at.angle); return {} } function At(x, l, h, g, b, E) { const D = jt(x.add(x.sub(l)._unit()), b, E).point, $ = h.sub(D); return h.add($._mult(g / $.mag())) } function Xt(x, l, h, g, b, E, D, $, U, W, te, ae, fe, Se) { const _e = g ? x - l : x + l; let we = _e > 0 ? 1 : -1, Be = 0; g && (we *= -1, Be = Math.PI), we < 0 && (Be += Math.PI); let je = we > 0 ? $ + D : $ + D + 1, et = b, Me = b, at = 0, nt = 0; const xt = Math.abs(_e), _t = []; for (; at + nt <= xt;) { if (je += we, je < $ || je >= U) return null; if (Me = et, _t.push(et), et = ae[je], et === void 0) { const fn = new o.pointGeometry(W.getx(je), W.gety(je)), Fn = jt(fn, te, Se); if (Fn.signedDistanceFromCamera > 0) et = ae[je] = Fn.point; else { const Un = je - we; et = At(at === 0 ? E : new o.pointGeometry(W.getx(Un), W.gety(Un)), fn, Me, xt - at + 1, te, Se) } } at += nt, nt = Me.dist(et) } const Ft = (xt - at) / nt, vt = et.sub(Me), sn = vt.mult(Ft)._add(Me); sn._add(vt._unit()._perp()._mult(h * we)); const Yt = Be + Math.atan2(et.y - Me.y, et.x - Me.x); return _t.push(sn), { point: sn, angle: fe ? Yt : 0, path: _t } } const en = new Float32Array([-1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0]); function gt(x, l) { for (let h = 0; h < x; h++) { const g = l.length; l.resize(g + 4), l.float32.set(en, 3 * g) } } function yn(x, l, h) { const g = l[0], b = l[1]; return x[0] = h[0] * g + h[4] * b + h[12], x[1] = h[1] * g + h[5] * b + h[13], x[3] = h[3] * g + h[7] * b + h[15], x } const Sn = 100; class dn { constructor(l, h = new Ge(l.width + 200, l.height + 200, 25), g = new Ge(l.width + 200, l.height + 200, 25)) { this.transform = l, this.grid = h, this.ignoredGrid = g, this.pitchfactor = Math.cos(l._pitch) * l.cameraToCenterDistance, this.screenRightBoundary = l.width + Sn, this.screenBottomBoundary = l.height + Sn, this.gridRightBoundary = l.width + 200, this.gridBottomBoundary = l.height + 200, this.perspectiveRatioCutoff = .6 } placeCollisionBox(l, h, g, b, E, D) { const $ = this.projectAndGetPerspectiveRatio(b, l.anchorPointX, l.anchorPointY, D), U = g * $.perspectiveRatio, W = l.x1 * U + $.point.x, te = l.y1 * U + $.point.y, ae = l.x2 * U + $.point.x, fe = l.y2 * U + $.point.y; return !this.isInsideGrid(W, te, ae, fe) || h !== "always" && this.grid.hitTest(W, te, ae, fe, h, E) || $.perspectiveRatio < this.perspectiveRatioCutoff ? { box: [], offscreen: !1 } : { box: [W, te, ae, fe], offscreen: this.isOffscreen(W, te, ae, fe) } } placeCollisionCircles(l, h, g, b, E, D, $, U, W, te, ae, fe, Se, _e) { const we = [], Be = new o.pointGeometry(h.anchorX, h.anchorY), je = jt(Be, D, _e), et = Kt(this.transform.cameraToCenterDistance, je.signedDistanceFromCamera), Me = (te ? E / et : E * et) / o.ONE_EM, at = jt(Be, $, _e).point, nt = Nn(Me, b, h.lineOffsetX * Me, h.lineOffsetY * Me, !1, at, Be, h, g, $, {}, !1, _e); let xt = !1, _t = !1, Ft = !0; if (nt) { const vt = .5 * fe * et + Se, sn = new o.pointGeometry(-100, -100), Yt = new o.pointGeometry(this.screenRightBoundary, this.screenBottomBoundary), fn = new Jt, Fn = nt.first, Un = nt.last; let Pn = []; for (let er = Fn.path.length - 1; er >= 1; er--)Pn.push(Fn.path[er]); for (let er = 1; er < Un.path.length; er++)Pn.push(Un.path[er]); const fr = 2.5 * vt; if (U) { const er = Pn.map(ir => jt(ir, U, _e)); Pn = er.some(ir => ir.signedDistanceFromCamera <= 0) ? [] : er.map(ir => ir.point) } let hr = []; if (Pn.length > 0) { const er = Pn[0].clone(), ir = Pn[0].clone(); for (let vr = 1; vr < Pn.length; vr++)er.x = Math.min(er.x, Pn[vr].x), er.y = Math.min(er.y, Pn[vr].y), ir.x = Math.max(ir.x, Pn[vr].x), ir.y = Math.max(ir.y, Pn[vr].y); hr = er.x >= sn.x && ir.x <= Yt.x && er.y >= sn.y && ir.y <= Yt.y ? [Pn] : ir.x < sn.x || er.x > Yt.x || ir.y < sn.y || er.y > Yt.y ? [] : o.clipLine([Pn], sn.x, sn.y, Yt.x, Yt.y) } for (const er of hr) { fn.reset(er, .25 * vt); let ir = 0; ir = fn.length <= .5 * vt ? 1 : Math.ceil(fn.paddedLength / fr) + 1; for (let vr = 0; vr < ir; vr++) { const gi = vr / Math.max(ir - 1, 1), sa = fn.lerp(gi), Vo = sa.x + Sn, la = sa.y + Sn; we.push(Vo, la, vt, 0); const rs = Vo - vt, Io = la - vt, Yi = Vo + vt, Ra = la + vt; if (Ft = Ft && this.isOffscreen(rs, Io, Yi, Ra), _t = _t || this.isInsideGrid(rs, Io, Yi, Ra), l !== "always" && this.grid.hitTestCircle(Vo, la, vt, l, ae) && (xt = !0, !W)) return { circles: [], offscreen: !1, collisionDetected: xt } } } } return { circles: !W && xt || !_t || et < this.perspectiveRatioCutoff ? [] : we, offscreen: Ft, collisionDetected: xt } } queryRenderedSymbols(l) { if (l.length === 0 || this.grid.keysLength() === 0 && this.ignoredGrid.keysLength() === 0) return {}; const h = []; let g = 1 / 0, b = 1 / 0, E = -1 / 0, D = -1 / 0; for (const te of l) { const ae = new o.pointGeometry(te.x + Sn, te.y + Sn); g = Math.min(g, ae.x), b = Math.min(b, ae.y), E = Math.max(E, ae.x), D = Math.max(D, ae.y), h.push(ae) } const $ = this.grid.query(g, b, E, D).concat(this.ignoredGrid.query(g, b, E, D)), U = {}, W = {}; for (const te of $) { const ae = te.key; if (U[ae.bucketInstanceId] === void 0 && (U[ae.bucketInstanceId] = {}), U[ae.bucketInstanceId][ae.featureIndex]) continue; const fe = [new o.pointGeometry(te.x1, te.y1), new o.pointGeometry(te.x2, te.y1), new o.pointGeometry(te.x2, te.y2), new o.pointGeometry(te.x1, te.y2)]; o.polygonIntersectsPolygon(h, fe) && (U[ae.bucketInstanceId][ae.featureIndex] = !0, W[ae.bucketInstanceId] === void 0 && (W[ae.bucketInstanceId] = []), W[ae.bucketInstanceId].push(ae.featureIndex)) } return W } insertCollisionBox(l, h, g, b, E, D) { (g ? this.ignoredGrid : this.grid).insert({ bucketInstanceId: b, featureIndex: E, collisionGroupID: D, overlapMode: h }, l[0], l[1], l[2], l[3]) } insertCollisionCircles(l, h, g, b, E, D) { const $ = g ? this.ignoredGrid : this.grid, U = { bucketInstanceId: b, featureIndex: E, collisionGroupID: D, overlapMode: h }; for (let W = 0; W < l.length; W += 4)$.insertCircle(U, l[W], l[W + 1], l[W + 2]) } projectAndGetPerspectiveRatio(l, h, g, b) { let E; return b ? (E = [h, g, b(h, g), 1], o.transformMat4(E, E, l)) : (E = [h, g, 0, 1], yn(E, E, l)), { point: new o.pointGeometry((E[0] / E[3] + 1) / 2 * this.transform.width + Sn, (-E[1] / E[3] + 1) / 2 * this.transform.height + Sn), perspectiveRatio: .5 + this.transform.cameraToCenterDistance / E[3] * .5 } } isOffscreen(l, h, g, b) { return g < Sn || l >= this.screenRightBoundary || b < Sn || h > this.screenBottomBoundary } isInsideGrid(l, h, g, b) { return g >= 0 && l < this.gridRightBoundary && b >= 0 && h < this.gridBottomBoundary } getViewportMatrix() { const l = o.identity([]); return o.translate(l, l, [-100, -100, 0]), l } } function zt(x, l, h) { return l * (o.EXTENT / (x.tileSize * Math.pow(2, h - x.tileID.overscaledZ))) } class ot { constructor(l, h, g, b) { this.opacity = l ? Math.max(0, Math.min(1, l.opacity + (l.placed ? h : -h))) : b && g ? 1 : 0, this.placed = g } isHidden() { return this.opacity === 0 && !this.placed } } class mt { constructor(l, h, g, b, E) { this.text = new ot(l ? l.text : null, h, g, E), this.icon = new ot(l ? l.icon : null, h, b, E) } isHidden() { return this.text.isHidden() && this.icon.isHidden() } } class Dt { constructor(l, h, g) { this.text = l, this.icon = h, this.skipFade = g } } class Bt { constructor() { this.invProjMatrix = o.create(), this.viewportMatrix = o.create(), this.circles = [] } } class pn { constructor(l, h, g, b, E) { this.bucketInstanceId = l, this.featureIndex = h, this.sourceLayerIndex = g, this.bucketIndex = b, this.tileID = E } } class On { constructor(l) { this.crossSourceCollisions = l, this.maxGroupID = 0, this.collisionGroups = {} } get(l) { if (this.crossSourceCollisions) return { ID: 0, predicate: null }; if (!this.collisionGroups[l]) { const h = ++this.maxGroupID; this.collisionGroups[l] = { ID: h, predicate: g => g.collisionGroupID === h } } return this.collisionGroups[l] } } function Zn(x, l, h, g, b) { const { horizontalAlign: E, verticalAlign: D } = o.getAnchorAlignment(x), $ = -(E - .5) * l, U = -(D - .5) * h, W = o.evaluateVariableOffset(x, g); return new o.pointGeometry($ + W[0] * b, U + W[1] * b) } function Xn(x, l, h, g, b, E) { const { x1: D, x2: $, y1: U, y2: W, anchorPointX: te, anchorPointY: ae } = x, fe = new o.pointGeometry(l, h); return g && fe._rotate(b ? E : -E), { x1: D + fe.x, y1: U + fe.y, x2: $ + fe.x, y2: W + fe.y, anchorPointX: te, anchorPointY: ae } } class me { constructor(l, h, g, b, E) { this.transform = l.clone(), this.terrain = h, this.collisionIndex = new dn(this.transform), this.placements = {}, this.opacities = {}, this.variableOffsets = {}, this.stale = !1, this.commitTime = 0, this.fadeDuration = g, this.retainedQueryData = {}, this.collisionGroups = new On(b), this.collisionCircleArrays = {}, this.prevPlacement = E, E && (E.prevPlacement = void 0), this.placedOrientations = {} } getBucketParts(l, h, g, b) { const E = g.getBucket(h), D = g.latestFeatureIndex; if (!E || !D || h.id !== E.layerIds[0]) return; const $ = g.collisionBoxArray, U = E.layers[0].layout, W = Math.pow(2, this.transform.zoom - g.tileID.overscaledZ), te = g.tileSize / o.EXTENT, ae = this.transform.calculatePosMatrix(g.tileID.toUnwrapped()), fe = U.get("text-pitch-alignment") === "map", Se = U.get("text-rotation-alignment") === "map", _e = zt(g, 1, this.transform.zoom), we = Zt(ae, fe, Se, this.transform, _e); let Be = null; if (fe) { const et = cn(ae, fe, Se, this.transform, _e); Be = o.multiply([], this.transform.labelPlaneMatrix, et) } this.retainedQueryData[E.bucketInstanceId] = new pn(E.bucketInstanceId, D, E.sourceLayerIndex, E.index, g.tileID); const je = { bucket: E, layout: U, posMatrix: ae, textLabelPlaneMatrix: we, labelToScreenMatrix: Be, scale: W, textPixelRatio: te, holdingForFade: g.holdingForFade(), collisionBoxArray: $, partiallyEvaluatedTextSize: o.evaluateSizeForZoom(E.textSizeData, this.transform.zoom), collisionGroup: this.collisionGroups.get(E.sourceID) }; if (b) for (const et of E.sortKeyRanges) { const { sortKey: Me, symbolInstanceStart: at, symbolInstanceEnd: nt } = et; l.push({ sortKey: Me, symbolInstanceStart: at, symbolInstanceEnd: nt, parameters: je }) } else l.push({ symbolInstanceStart: 0, symbolInstanceEnd: E.symbolInstances.length, parameters: je }) } attemptAnchorPlacement(l, h, g, b, E, D, $, U, W, te, ae, fe, Se, _e, we, Be) { const je = [fe.textOffset0, fe.textOffset1], et = Zn(l, g, b, je, E), Me = this.collisionIndex.placeCollisionBox(Xn(h, et.x, et.y, D, $, this.transform.angle), ae, U, W, te.predicate, Be); if ((!we || this.collisionIndex.placeCollisionBox(Xn(we, et.x, et.y, D, $, this.transform.angle), ae, U, W, te.predicate, Be).box.length !== 0) && Me.box.length > 0) { let at; if (this.prevPlacement && this.prevPlacement.variableOffsets[fe.crossTileID] && this.prevPlacement.placements[fe.crossTileID] && this.prevPlacement.placements[fe.crossTileID].text && (at = this.prevPlacement.variableOffsets[fe.crossTileID].anchor), fe.crossTileID === 0) throw new Error("symbolInstance.crossTileID can't be 0"); return this.variableOffsets[fe.crossTileID] = { textOffset: je, width: g, height: b, anchor: l, textBoxScale: E, prevAnchor: at }, this.markUsedJustification(Se, l, fe, _e), Se.allowVerticalPlacement && (this.markUsedOrientation(Se, _e, fe), this.placedOrientations[fe.crossTileID] = _e), { shift: et, placedGlyphBoxes: Me } } } placeLayerBucketPart(l, h, g) { const { bucket: b, layout: E, posMatrix: D, textLabelPlaneMatrix: $, labelToScreenMatrix: U, textPixelRatio: W, holdingForFade: te, collisionBoxArray: ae, partiallyEvaluatedTextSize: fe, collisionGroup: Se } = l.parameters, _e = E.get("text-optional"), we = E.get("icon-optional"), Be = o.getOverlapMode(E, "text-overlap", "text-allow-overlap"), je = Be === "always", et = o.getOverlapMode(E, "icon-overlap", "icon-allow-overlap"), Me = et === "always", at = E.get("text-rotation-alignment") === "map", nt = E.get("text-pitch-alignment") === "map", xt = E.get("icon-text-fit") !== "none", _t = E.get("symbol-z-order") === "viewport-y", Ft = je && (Me || !b.hasIconData() || we), vt = Me && (je || !b.hasTextData() || _e); !b.collisionArrays && ae && b.deserializeCollisionBoxes(ae); const sn = (Yt, fn) => { if (h[Yt.crossTileID]) return; if (te) return void (this.placements[Yt.crossTileID] = new Dt(!1, !1, !1)); let Fn = !1, Un = !1, Pn = !0, fr = null, hr = { box: null, offscreen: null }, er = { box: null, offscreen: null }, ir = null, vr = null, gi = null, sa = 0, Vo = 0, la = 0; fn.textFeatureIndex ? sa = fn.textFeatureIndex : Yt.useRuntimeCollisionCircles && (sa = Yt.featureIndex), fn.verticalTextFeatureIndex && (Vo = fn.verticalTextFeatureIndex); const rs = this.retainedQueryData[b.bucketInstanceId].tileID, Io = this.terrain ? (di, Wn) => this.terrain.getElevation(rs, di, Wn) : null; for (const di of ["textBox", "verticalTextBox", "iconBox", "verticalIconBox"]) { const Wn = fn[di]; Wn && (Wn.elevation = Io ? Io(Wn.anchorPointX, Wn.anchorPointY) : 0) } const Yi = fn.textBox; if (Yi) { const di = dr => { let yi = o.WritingMode.horizontal; if (b.allowVerticalPlacement && !dr && this.prevPlacement) { const xi = this.prevPlacement.placedOrientations[Yt.crossTileID]; xi && (this.placedOrientations[Yt.crossTileID] = xi, yi = xi, this.markUsedOrientation(b, yi, Yt)) } return yi }, Wn = (dr, yi) => { if (b.allowVerticalPlacement && Yt.numVerticalGlyphVertices > 0 && fn.verticalTextBox) { for (const xi of b.writingModes) if (xi === o.WritingMode.vertical ? (hr = yi(), er = hr) : hr = dr(), hr && hr.box && hr.box.length) break } else hr = dr() }; if (E.get("text-variable-anchor")) { let dr = E.get("text-variable-anchor"); if (this.prevPlacement && this.prevPlacement.variableOffsets[Yt.crossTileID]) { const Dr = this.prevPlacement.variableOffsets[Yt.crossTileID]; dr.indexOf(Dr.anchor) > 0 && (dr = dr.filter(Ro => Ro !== Dr.anchor), dr.unshift(Dr.anchor)) } const yi = (Dr, Ro, Rs) => { const dh = Dr.x2 - Dr.x1, Tl = Dr.y2 - Dr.y1, mv = Yt.textBoxScale, fh = xt && et === "never" ? Ro : null; let is = { box: [], offscreen: !1 }; const Ms = Be !== "never" ? 2 * dr.length : dr.length; for (let As = 0; As < Ms; ++As) { const rd = this.attemptAnchorPlacement(dr[As % dr.length], Dr, dh, Tl, mv, at, nt, W, D, Se, As >= dr.length ? Be : "never", Yt, b, Rs, fh, Io); if (rd && (is = rd.placedGlyphBoxes, is && is.box && is.box.length)) { Fn = !0, fr = rd.shift; break } } return is }; Wn(() => yi(Yi, fn.iconBox, o.WritingMode.horizontal), () => { const Dr = fn.verticalTextBox; return b.allowVerticalPlacement && !(hr && hr.box && hr.box.length) && Yt.numVerticalGlyphVertices > 0 && Dr ? yi(Dr, fn.verticalIconBox, o.WritingMode.vertical) : { box: null, offscreen: null } }), hr && (Fn = hr.box, Pn = hr.offscreen); const xi = di(hr && hr.box); if (!Fn && this.prevPlacement) { const Dr = this.prevPlacement.variableOffsets[Yt.crossTileID]; Dr && (this.variableOffsets[Yt.crossTileID] = Dr, this.markUsedJustification(b, Dr.anchor, Yt, xi)) } } else { const dr = (yi, xi) => { const Dr = this.collisionIndex.placeCollisionBox(yi, Be, W, D, Se.predicate, Io); return Dr && Dr.box && Dr.box.length && (this.markUsedOrientation(b, xi, Yt), this.placedOrientations[Yt.crossTileID] = xi), Dr }; Wn(() => dr(Yi, o.WritingMode.horizontal), () => { const yi = fn.verticalTextBox; return b.allowVerticalPlacement && Yt.numVerticalGlyphVertices > 0 && yi ? dr(yi, o.WritingMode.vertical) : { box: null, offscreen: null } }), di(hr && hr.box && hr.box.length) } } if (ir = hr, Fn = ir && ir.box && ir.box.length > 0, Pn = ir && ir.offscreen, Yt.useRuntimeCollisionCircles) { const di = b.text.placedSymbolArray.get(Yt.centerJustifiedTextSymbolIndex), Wn = o.evaluateSizeForFeature(b.textSizeData, fe, di), dr = E.get("text-padding"); vr = this.collisionIndex.placeCollisionCircles(Be, di, b.lineVertexArray, b.glyphOffsetArray, Wn, D, $, U, g, nt, Se.predicate, Yt.collisionCircleDiameter, dr, Io), vr.circles.length && vr.collisionDetected && !g && o.warnOnce("Collisions detected, but collision boxes are not shown"), Fn = je || vr.circles.length > 0 && !vr.collisionDetected, Pn = Pn && vr.offscreen } if (fn.iconFeatureIndex && (la = fn.iconFeatureIndex), fn.iconBox) { const di = Wn => { const dr = xt && fr ? Xn(Wn, fr.x, fr.y, at, nt, this.transform.angle) : Wn; return this.collisionIndex.placeCollisionBox(dr, et, W, D, Se.predicate, Io) }; er && er.box && er.box.length && fn.verticalIconBox ? (gi = di(fn.verticalIconBox), Un = gi.box.length > 0) : (gi = di(fn.iconBox), Un = gi.box.length > 0), Pn = Pn && gi.offscreen } const Ra = _e || Yt.numHorizontalGlyphVertices === 0 && Yt.numVerticalGlyphVertices === 0, nd = we || Yt.numIconVertices === 0; if (Ra || nd ? nd ? Ra || (Un = Un && Fn) : Fn = Un && Fn : Un = Fn = Un && Fn, Fn && ir && ir.box && this.collisionIndex.insertCollisionBox(ir.box, Be, E.get("text-ignore-placement"), b.bucketInstanceId, er && er.box && Vo ? Vo : sa, Se.ID), Un && gi && this.collisionIndex.insertCollisionBox(gi.box, et, E.get("icon-ignore-placement"), b.bucketInstanceId, la, Se.ID), vr && (Fn && this.collisionIndex.insertCollisionCircles(vr.circles, Be, E.get("text-ignore-placement"), b.bucketInstanceId, sa, Se.ID), g)) { const di = b.bucketInstanceId; let Wn = this.collisionCircleArrays[di]; Wn === void 0 && (Wn = this.collisionCircleArrays[di] = new Bt); for (let dr = 0; dr < vr.circles.length; dr += 4)Wn.circles.push(vr.circles[dr + 0]), Wn.circles.push(vr.circles[dr + 1]), Wn.circles.push(vr.circles[dr + 2]), Wn.circles.push(vr.collisionDetected ? 1 : 0) } if (Yt.crossTileID === 0) throw new Error("symbolInstance.crossTileID can't be 0"); if (b.bucketInstanceId === 0) throw new Error("bucket.bucketInstanceId can't be 0"); this.placements[Yt.crossTileID] = new Dt(Fn || Ft, Un || vt, Pn || b.justReloaded), h[Yt.crossTileID] = !0 }; if (_t) { if (l.symbolInstanceStart !== 0) throw new Error("bucket.bucketInstanceId should be 0"); const Yt = b.getSortedSymbolIndexes(this.transform.angle); for (let fn = Yt.length - 1; fn >= 0; --fn) { const Fn = Yt[fn]; sn(b.symbolInstances.get(Fn), b.collisionArrays[Fn]) } } else for (let Yt = l.symbolInstanceStart; Yt < l.symbolInstanceEnd; Yt++)sn(b.symbolInstances.get(Yt), b.collisionArrays[Yt]); if (g && b.bucketInstanceId in this.collisionCircleArrays) { const Yt = this.collisionCircleArrays[b.bucketInstanceId]; o.invert(Yt.invProjMatrix, D), Yt.viewportMatrix = this.collisionIndex.getViewportMatrix() } b.justReloaded = !1 } markUsedJustification(l, h, g, b) { let E; E = b === o.WritingMode.vertical ? g.verticalPlacedTextSymbolIndex : { left: g.leftJustifiedTextSymbolIndex, center: g.centerJustifiedTextSymbolIndex, right: g.rightJustifiedTextSymbolIndex }[o.getAnchorJustification(h)]; const D = [g.leftJustifiedTextSymbolIndex, g.centerJustifiedTextSymbolIndex, g.rightJustifiedTextSymbolIndex, g.verticalPlacedTextSymbolIndex]; for (const $ of D) $ >= 0 && (l.text.placedSymbolArray.get($).crossTileID = E >= 0 && $ !== E ? 0 : g.crossTileID) } markUsedOrientation(l, h, g) { const b = h === o.WritingMode.horizontal || h === o.WritingMode.horizontalOnly ? h : 0, E = h === o.WritingMode.vertical ? h : 0, D = [g.leftJustifiedTextSymbolIndex, g.centerJustifiedTextSymbolIndex, g.rightJustifiedTextSymbolIndex]; for (const $ of D) l.text.placedSymbolArray.get($).placedOrientation = b; g.verticalPlacedTextSymbolIndex && (l.text.placedSymbolArray.get(g.verticalPlacedTextSymbolIndex).placedOrientation = E) } commit(l) { this.commitTime = l, this.zoomAtLastRecencyCheck = this.transform.zoom; const h = this.prevPlacement; let g = !1; this.prevZoomAdjustment = h ? h.zoomAdjustment(this.transform.zoom) : 0; const b = h ? h.symbolFadeChange(l) : 1, E = h ? h.opacities : {}, D = h ? h.variableOffsets : {}, $ = h ? h.placedOrientations : {}; for (const U in this.placements) { const W = this.placements[U], te = E[U]; te ? (this.opacities[U] = new mt(te, b, W.text, W.icon), g = g || W.text !== te.text.placed || W.icon !== te.icon.placed) : (this.opacities[U] = new mt(null, b, W.text, W.icon, W.skipFade), g = g || W.text || W.icon) } for (const U in E) { const W = E[U]; if (!this.opacities[U]) { const te = new mt(W, b, !1, !1); te.isHidden() || (this.opacities[U] = te, g = g || W.text.placed || W.icon.placed) } } for (const U in D) this.variableOffsets[U] || !this.opacities[U] || this.opacities[U].isHidden() || (this.variableOffsets[U] = D[U]); for (const U in $) this.placedOrientations[U] || !this.opacities[U] || this.opacities[U].isHidden() || (this.placedOrientations[U] = $[U]); if (h && h.lastPlacementChangeTime === void 0) throw new Error("Last placement time for previous placement is not defined"); g ? this.lastPlacementChangeTime = l : typeof this.lastPlacementChangeTime != "number" && (this.lastPlacementChangeTime = h ? h.lastPlacementChangeTime : l) } updateLayerOpacities(l, h) { const g = {}; for (const b of h) { const E = b.getBucket(l); E && b.latestFeatureIndex && l.id === E.layerIds[0] && this.updateBucketOpacities(E, g, b.collisionBoxArray) } } updateBucketOpacities(l, h, g) { l.hasTextData() && l.text.opacityVertexArray.clear(), l.hasIconData() && l.icon.opacityVertexArray.clear(), l.hasIconCollisionBoxData() && l.iconCollisionBox.collisionVertexArray.clear(), l.hasTextCollisionBoxData() && l.textCollisionBox.collisionVertexArray.clear(); const b = l.layers[0].layout, E = new mt(null, 0, !1, !1, !0), D = b.get("text-allow-overlap"), $ = b.get("icon-allow-overlap"), U = b.get("text-variable-anchor"), W = b.get("text-rotation-alignment") === "map", te = b.get("text-pitch-alignment") === "map", ae = b.get("icon-text-fit") !== "none", fe = new mt(null, 0, D && ($ || !l.hasIconData() || b.get("icon-optional")), $ && (D || !l.hasTextData() || b.get("text-optional")), !0); !l.collisionArrays && g && (l.hasIconCollisionBoxData() || l.hasTextCollisionBoxData()) && l.deserializeCollisionBoxes(g); const Se = (_e, we, Be) => { for (let je = 0; je < we / 4; je++)_e.opacityVertexArray.emplaceBack(Be) }; for (let _e = 0; _e < l.symbolInstances.length; _e++) { const we = l.symbolInstances.get(_e), { numHorizontalGlyphVertices: Be, numVerticalGlyphVertices: je, crossTileID: et } = we; let Me = this.opacities[et]; h[et] ? Me = E : Me || (Me = fe, this.opacities[et] = Me), h[et] = !0; const at = we.numIconVertices > 0, nt = this.placedOrientations[we.crossTileID], xt = nt === o.WritingMode.vertical, _t = nt === o.WritingMode.horizontal || nt === o.WritingMode.horizontalOnly; if (Be > 0 || je > 0) { const Ft = Le(Me.text); Se(l.text, Be, xt ? qe : Ft), Se(l.text, je, _t ? qe : Ft); const vt = Me.text.isHidden();[we.rightJustifiedTextSymbolIndex, we.centerJustifiedTextSymbolIndex, we.leftJustifiedTextSymbolIndex].forEach(fn => { fn >= 0 && (l.text.placedSymbolArray.get(fn).hidden = vt || xt ? 1 : 0) }), we.verticalPlacedTextSymbolIndex >= 0 && (l.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).hidden = vt || _t ? 1 : 0); const sn = this.variableOffsets[we.crossTileID]; sn && this.markUsedJustification(l, sn.anchor, we, nt); const Yt = this.placedOrientations[we.crossTileID]; Yt && (this.markUsedJustification(l, "left", we, Yt), this.markUsedOrientation(l, Yt, we)) } if (at) { const Ft = Le(Me.icon), vt = !(ae && we.verticalPlacedIconSymbolIndex && xt); we.placedIconSymbolIndex >= 0 && (Se(l.icon, we.numIconVertices, vt ? Ft : qe), l.icon.placedSymbolArray.get(we.placedIconSymbolIndex).hidden = Me.icon.isHidden()), we.verticalPlacedIconSymbolIndex >= 0 && (Se(l.icon, we.numVerticalIconVertices, vt ? qe : Ft), l.icon.placedSymbolArray.get(we.verticalPlacedIconSymbolIndex).hidden = Me.icon.isHidden()) } if (l.hasIconCollisionBoxData() || l.hasTextCollisionBoxData()) { const Ft = l.collisionArrays[_e]; if (Ft) { let vt = new o.pointGeometry(0, 0); if (Ft.textBox || Ft.verticalTextBox) { let Yt = !0; if (U) { const fn = this.variableOffsets[et]; fn ? (vt = Zn(fn.anchor, fn.width, fn.height, fn.textOffset, fn.textBoxScale), W && vt._rotate(te ? this.transform.angle : -this.transform.angle)) : Yt = !1 } Ft.textBox && H(l.textCollisionBox.collisionVertexArray, Me.text.placed, !Yt || xt, vt.x, vt.y), Ft.verticalTextBox && H(l.textCollisionBox.collisionVertexArray, Me.text.placed, !Yt || _t, vt.x, vt.y) } const sn = Boolean(!_t && Ft.verticalIconBox); Ft.iconBox && H(l.iconCollisionBox.collisionVertexArray, Me.icon.placed, sn, ae ? vt.x : 0, ae ? vt.y : 0), Ft.verticalIconBox && H(l.iconCollisionBox.collisionVertexArray, Me.icon.placed, !sn, ae ? vt.x : 0, ae ? vt.y : 0) } } } if (l.sortFeatures(this.transform.angle), this.retainedQueryData[l.bucketInstanceId] && (this.retainedQueryData[l.bucketInstanceId].featureSortOrder = l.featureSortOrder), l.hasTextData() && l.text.opacityVertexBuffer && l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray), l.hasIconData() && l.icon.opacityVertexBuffer && l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray), l.hasIconCollisionBoxData() && l.iconCollisionBox.collisionVertexBuffer && l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray), l.hasTextCollisionBoxData() && l.textCollisionBox.collisionVertexBuffer && l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray), l.text.opacityVertexArray.length !== l.text.layoutVertexArray.length / 4) throw new Error(`bucket.text.opacityVertexArray.length (= ${l.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${l.text.layoutVertexArray.length}) / 4`); if (l.icon.opacityVertexArray.length !== l.icon.layoutVertexArray.length / 4) throw new Error(`bucket.icon.opacityVertexArray.length (= ${l.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${l.icon.layoutVertexArray.length}) / 4`); if (l.bucketInstanceId in this.collisionCircleArrays) { const _e = this.collisionCircleArrays[l.bucketInstanceId]; l.placementInvProjMatrix = _e.invProjMatrix, l.placementViewportMatrix = _e.viewportMatrix, l.collisionCircleArray = _e.circles, delete this.collisionCircleArrays[l.bucketInstanceId] } } symbolFadeChange(l) { return this.fadeDuration === 0 ? 1 : (l - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment } zoomAdjustment(l) { return Math.max(0, (this.transform.zoom - l) / 1.5) } hasTransitions(l) { return this.stale || l - this.lastPlacementChangeTime < this.fadeDuration } stillRecent(l, h) { const g = this.zoomAtLastRecencyCheck === h ? 1 - this.zoomAdjustment(h) : 1; return this.zoomAtLastRecencyCheck = h, this.commitTime + this.fadeDuration * g > l } setStale() { this.stale = !0 } } function H(x, l, h, g, b) { x.emplaceBack(l ? 1 : 0, h ? 1 : 0, g || 0, b || 0), x.emplaceBack(l ? 1 : 0, h ? 1 : 0, g || 0, b || 0), x.emplaceBack(l ? 1 : 0, h ? 1 : 0, g || 0, b || 0), x.emplaceBack(l ? 1 : 0, h ? 1 : 0, g || 0, b || 0) } const q = Math.pow(2, 25), de = Math.pow(2, 24), le = Math.pow(2, 17), xe = Math.pow(2, 16), Ee = Math.pow(2, 9), be = Math.pow(2, 8), Ce = Math.pow(2, 1); function Le(x) { if (x.opacity === 0 && !x.placed) return 0; if (x.opacity === 1 && x.placed) return 4294967295; const l = x.placed ? 1 : 0, h = Math.floor(127 * x.opacity); return h * q + l * de + h * le + l * xe + h * Ee + l * be + h * Ce + l } const qe = 0; class Ze { constructor(l) { this._sortAcrossTiles = l.layout.get("symbol-z-order") !== "viewport-y" && !l.layout.get("symbol-sort-key").isConstant(), this._currentTileIndex = 0, this._currentPartIndex = 0, this._seenCrossTileIDs = {}, this._bucketParts = [] } continuePlacement(l, h, g, b, E) { const D = this._bucketParts; for (; this._currentTileIndex < l.length;)if (h.getBucketParts(D, b, l[this._currentTileIndex], this._sortAcrossTiles), this._currentTileIndex++, E()) return !0; for (this._sortAcrossTiles && (this._sortAcrossTiles = !1, D.sort(($, U) => $.sortKey - U.sortKey)); this._currentPartIndex < D.length;)if (h.placeLayerBucketPart(D[this._currentPartIndex], this._seenCrossTileIDs, g), this._currentPartIndex++, E()) return !0; return !1 } } class Ve { constructor(l, h, g, b, E, D, $, U) { this.placement = new me(l, h, D, $, U), this._currentPlacementIndex = g.length - 1, this._forceFullPlacement = b, this._showCollisionBoxes = E, this._done = !1 } isDone() { return this._done } continuePlacement(l, h, g) { const b = o.exported.now(), E = () => { const D = o.exported.now() - b; return !this._forceFullPlacement && D > 2 }; for (; this._currentPlacementIndex >= 0;) { const D = h[l[this._currentPlacementIndex]], $ = this.placement.collisionIndex.transform.zoom; if (D.type === "symbol" && (!D.minzoom || D.minzoom <= $) && (!D.maxzoom || D.maxzoom > $)) { if (this._inProgressLayer || (this._inProgressLayer = new Ze(D)), this._inProgressLayer.continuePlacement(g[D.source], this.placement, this._showCollisionBoxes, D, E)) return; delete this._inProgressLayer } this._currentPlacementIndex-- } this._done = !0 } commit(l) { return this.placement.commit(l), this.placement } } const Lt = 512 / o.EXTENT / 2; class Ct { constructor(l, h, g) { this.tileID = l, this.indexedSymbolInstances = {}, this.bucketInstanceId = g; for (let b = 0; b < h.length; b++) { const E = h.get(b), D = E.key; this.indexedSymbolInstances[D] || (this.indexedSymbolInstances[D] = []), this.indexedSymbolInstances[D].push({ crossTileID: E.crossTileID, coord: this.getScaledCoordinates(E, l) }) } } getScaledCoordinates(l, h) { const g = Lt / Math.pow(2, h.canonical.z - this.tileID.canonical.z); return { x: Math.floor((h.canonical.x * o.EXTENT + l.anchorX) * g), y: Math.floor((h.canonical.y * o.EXTENT + l.anchorY) * g) } } findMatches(l, h, g) { const b = this.tileID.canonical.z < h.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - h.canonical.z); for (let E = 0; E < l.length; E++) { const D = l.get(E); if (D.crossTileID) continue; const $ = this.indexedSymbolInstances[D.key]; if (!$) continue; const U = this.getScaledCoordinates(D, h); for (const W of $) if (Math.abs(W.coord.x - U.x) <= b && Math.abs(W.coord.y - U.y) <= b && !g[W.crossTileID]) { g[W.crossTileID] = !0, D.crossTileID = W.crossTileID; break } } } } class Je { constructor() { this.maxCrossTileID = 0 } generate() { return ++this.maxCrossTileID } } class Ot { constructor() { this.indexes = {}, this.usedCrossTileIDs = {}, this.lng = 0 } handleWrapJump(l) { const h = Math.round((l - this.lng) / 360); if (h !== 0) for (const g in this.indexes) { const b = this.indexes[g], E = {}; for (const D in b) { const $ = b[D]; $.tileID = $.tileID.unwrapTo($.tileID.wrap + h), E[$.tileID.key] = $ } this.indexes[g] = E } this.lng = l } addBucket(l, h, g) { if (this.indexes[l.overscaledZ] && this.indexes[l.overscaledZ][l.key]) { if (this.indexes[l.overscaledZ][l.key].bucketInstanceId === h.bucketInstanceId) return !1; this.removeBucketCrossTileIDs(l.overscaledZ, this.indexes[l.overscaledZ][l.key]) } for (let E = 0; E < h.symbolInstances.length; E++)h.symbolInstances.get(E).crossTileID = 0; this.usedCrossTileIDs[l.overscaledZ] || (this.usedCrossTileIDs[l.overscaledZ] = {}); const b = this.usedCrossTileIDs[l.overscaledZ]; for (const E in this.indexes) { const D = this.indexes[E]; if (Number(E) > l.overscaledZ) for (const $ in D) { const U = D[$]; U.tileID.isChildOf(l) && U.findMatches(h.symbolInstances, l, b) } else { const $ = D[l.scaledTo(Number(E)).key]; $ && $.findMatches(h.symbolInstances, l, b) } } for (let E = 0; E < h.symbolInstances.length; E++) { const D = h.symbolInstances.get(E); D.crossTileID || (D.crossTileID = g.generate(), b[D.crossTileID] = !0) } return this.indexes[l.overscaledZ] === void 0 && (this.indexes[l.overscaledZ] = {}), this.indexes[l.overscaledZ][l.key] = new Ct(l, h.symbolInstances, h.bucketInstanceId), !0 } removeBucketCrossTileIDs(l, h) { for (const g in h.indexedSymbolInstances) for (const b of h.indexedSymbolInstances[g]) delete this.usedCrossTileIDs[l][b.crossTileID] } removeStaleBuckets(l) { let h = !1; for (const g in this.indexes) { const b = this.indexes[g]; for (const E in b) l[b[E].bucketInstanceId] || (this.removeBucketCrossTileIDs(g, b[E]), delete b[E], h = !0) } return h } } class Vt { constructor() { this.layerIndexes = {}, this.crossTileIDs = new Je, this.maxBucketInstanceId = 0, this.bucketsInCurrentPlacement = {} } addLayer(l, h, g) { let b = this.layerIndexes[l.id]; b === void 0 && (b = this.layerIndexes[l.id] = new Ot); let E = !1; const D = {}; b.handleWrapJump(g); for (const $ of h) { const U = $.getBucket(l); U && l.id === U.layerIds[0] && (U.bucketInstanceId || (U.bucketInstanceId = ++this.maxBucketInstanceId), b.addBucket($.tileID, U, this.crossTileIDs) && (E = !0), D[U.bucketInstanceId] = !0) } return b.removeStaleBuckets(D) && (E = !0), E } pruneUnusedLayers(l) { const h = {}; l.forEach(g => { h[g] = !0 }); for (const g in this.layerIndexes) h[g] || delete this.layerIndexes[g] } } var bn = o.createLayout([{ name: "a_pos", type: "Int16", components: 2 }]); class un extends o.Evented { constructor(l) { super(), this.sourceCache = l, this._tiles = {}, this._renderableTilesKeys = [], this._sourceTileCache = {}, this.renderHistory = [], this.minzoom = 0, this.maxzoom = 22, this.tileSize = 512, this.deltaZoom = 1, this.renderHistorySize = l._cache.max, l.usedForTerrain = !0, l.tileSize = this.tileSize * 2 ** this.deltaZoom } destruct() { this.sourceCache.usedForTerrain = !1, this.sourceCache.tileSize = null; for (const l in this._tiles) { const h = this._tiles[l]; h.textures.forEach(g => g.destroy()), h.textures = [] } } update(l, h) { this.sourceCache.update(l, h), this._renderableTilesKeys = []; for (const g of l.coveringTiles({ tileSize: this.tileSize, minzoom: this.minzoom, maxzoom: this.maxzoom, reparseOverscaled: !1, terrain: h })) this._renderableTilesKeys.push(g.key), this._tiles[g.key] || (g.posMatrix = new Float64Array(16), o.ortho(g.posMatrix, 0, o.EXTENT, 0, o.EXTENT, 0, 1), this._tiles[g.key] = new Oe(g, this.tileSize)) } removeOutdated(l) { const h = {}; this.renderHistory = this.renderHistory.filter((g, b) => this.renderHistory.indexOf(g) === b).slice(0, this.renderHistorySize); for (const g of this._renderableTilesKeys) h[g] = !0; for (const g of this.renderHistory) h[g] = !0; for (const g in this._tiles) h[g] || (this._tiles[g].clearTextures(l), delete this._tiles[g]) } getRenderableTiles() { return this._renderableTilesKeys.map(l => this.getTileByID(l)) } getTileByID(l) { return this._tiles[l] } getTerrainCoords(l) { const h = {}; for (const g of this._renderableTilesKeys) { const b = this._tiles[g].tileID; if (b.canonical.equals(l.canonical)) { const E = l.clone(); E.posMatrix = new Float64Array(16), o.ortho(E.posMatrix, 0, o.EXTENT, 0, o.EXTENT, 0, 1), h[g] = E } else if (b.canonical.isChildOf(l.canonical)) { const E = l.clone(); E.posMatrix = new Float64Array(16); const D = b.canonical.z - l.canonical.z, $ = b.canonical.x - (b.canonical.x >> D << D), U = b.canonical.y - (b.canonical.y >> D << D), W = o.EXTENT >> D; o.ortho(E.posMatrix, 0, W, 0, W, 0, 1), o.translate(E.posMatrix, E.posMatrix, [-$ * W, -U * W, 0]), h[g] = E } else if (l.canonical.isChildOf(b.canonical)) { const E = l.clone(); E.posMatrix = new Float64Array(16); const D = l.canonical.z - b.canonical.z, $ = l.canonical.x - (l.canonical.x >> D << D), U = l.canonical.y - (l.canonical.y >> D << D), W = o.EXTENT >> D; o.ortho(E.posMatrix, 0, o.EXTENT, 0, o.EXTENT, 0, 1), o.translate(E.posMatrix, E.posMatrix, [$ * W, U * W, 0]), o.scale(E.posMatrix, E.posMatrix, [1 / 2 ** D, 1 / 2 ** D, 0]), h[g] = E } } return h } getSourceTile(l, h) { const g = this.sourceCache._source; let b = l.overscaledZ - this.deltaZoom; if (b > g.maxzoom && (b = g.maxzoom), b < g.minzoom) return null; this._sourceTileCache[l.key] || (this._sourceTileCache[l.key] = l.scaledTo(b).key); let E = this.sourceCache.getTileByID(this._sourceTileCache[l.key]); if ((!E || !E.dem) && h) for (; b >= g.minzoom && (!E || !E.dem);)E = this.sourceCache.getTileByID(l.scaledTo(b--).key); return E } tilesAfterTime(l = Date.now()) { return Object.values(this._tiles).filter(h => h.timeLoaded >= l) } } class wn { constructor(l, h, g) { this.style = l, this.sourceCache = new un(h), this.options = g, this.exaggeration = typeof g.exaggeration == "number" ? g.exaggeration : 1, this.elevationOffset = typeof g.elevationOffset == "number" ? g.elevationOffset : 450, this.qualityFactor = 2, this.meshSize = 128, this._demMatrixCache = {}, this.coordsIndex = [], this._coordsTextureSize = 1024, this.clearRerenderCache() } getDEMElevation(l, h, g, b = o.EXTENT) { if (!(h >= 0 && h < b && g >= 0 && g < b)) return this.elevationOffset; let E = 0; const D = this.getTerrainData(l); if (D.tile && D.tile.dem) { const $ = o.transformMat4$1([], [h / b * o.EXTENT, g / b * o.EXTENT], D.u_terrain_matrix), U = [$[0] * D.tile.dem.dim, $[1] * D.tile.dem.dim], W = [Math.floor(U[0]), Math.floor(U[1])], te = D.tile.dem.get(W[0], W[1]), ae = D.tile.dem.get(W[0], W[1] + 1), fe = D.tile.dem.get(W[0] + 1, W[1]), Se = D.tile.dem.get(W[0] + 1, W[1] + 1); E = o.number(o.number(te, ae, U[0] - W[0]), o.number(fe, Se, U[0] - W[0]), U[1] - W[1]) } return E } rememberForRerender(l, h) { for (const g in this.sourceCache._tiles) { const b = this.sourceCache._tiles[g]; (b.tileID.equals(h) || b.tileID.isChildOf(h)) && (l === this.sourceCache.sourceCache.id && (b.timeLoaded = Date.now()), this._rerender[l] = this._rerender[l] || {}, this._rerender[l][b.tileID.key] = !0) } } needsRerender(l, h) { return this._rerender[l] && this._rerender[l][h.key] } clearRerenderCache() { this._rerender = {} } getElevation(l, h, g, b = o.EXTENT) { return (this.getDEMElevation(l, h, g, b) + this.elevationOffset) * this.exaggeration } getTerrainData(l) { if (!this._emptyDemTexture) { const b = this.style.map.painter.context, E = new o.RGBAImage({ width: 1, height: 1 }, new Uint8Array(4)); this._emptyDepthTexture = new A(b, E, b.gl.RGBA, { premultiply: !1 }), this._emptyDemUnpack = [0, 0, 0, 0], this._emptyDemTexture = new A(b, new o.RGBAImage({ width: 1, height: 1 }), b.gl.RGBA, { premultiply: !1 }), this._emptyDemTexture.bind(b.gl.NEAREST, b.gl.CLAMP_TO_EDGE), this._emptyDemMatrix = o.identity([]) } const h = this.sourceCache.getSourceTile(l, !0); if (h && h.dem && (!h.demTexture || h.needsTerrainPrepare)) { const b = this.style.map.painter.context; h.demTexture = this.style.map.painter.getTileTexture(h.dem.stride), h.demTexture ? h.demTexture.update(h.dem.getPixels(), { premultiply: !1 }) : h.demTexture = new A(b, h.dem.getPixels(), b.gl.RGBA, { premultiply: !1 }), h.demTexture.bind(b.gl.NEAREST, b.gl.CLAMP_TO_EDGE), h.needsTerrainPrepare = !1 } const g = h && h + h.tileID.key + l.key; if (g && !this._demMatrixCache[g]) { const b = this.sourceCache.sourceCache._source.maxzoom; let E = l.canonical.z - h.tileID.canonical.z; l.overscaledZ > l.canonical.z && (l.canonical.z >= b ? E = l.canonical.z - b : o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom")); const D = l.canonical.x - (l.canonical.x >> E << E), $ = l.canonical.y - (l.canonical.y >> E << E), U = o.fromScaling(new Float64Array(16), [1 / (o.EXTENT << E), 1 / (o.EXTENT << E), 0]); o.translate(U, U, [D * o.EXTENT, $ * o.EXTENT, 0]), this._demMatrixCache[l.key] = { matrix: U, coord: l } } return { u_depth: 2, u_terrain: 3, u_terrain_dim: h && h.dem && h.dem.dim || 1, u_terrain_matrix: g ? this._demMatrixCache[l.key].matrix : this._emptyDemMatrix, u_terrain_unpack: h && h.dem && h.dem.getUnpackVector() || this._emptyDemUnpack, u_terrain_offset: this.elevationOffset, u_terrain_exaggeration: this.exaggeration, texture: (h && h.demTexture || this._emptyDemTexture).texture, depthTexture: (this._fboDepthTexture || this._emptyDepthTexture).texture, tile: h } } getRTTFramebuffer() { const l = this.style.map.painter; if (!this._rttFramebuffer) { const h = this.sourceCache.tileSize * this.qualityFactor; this._rttFramebuffer = l.context.createFramebuffer(h, h, !0), this._rttFramebuffer.depthAttachment.set(l.context.createRenderbuffer(l.context.gl.DEPTH_COMPONENT16, h, h)) } return this._rttFramebuffer } getFramebuffer(l) { const h = this.style.map.painter, g = h.width / devicePixelRatio, b = h.height / devicePixelRatio; return !this._fbo || this._fbo.width === g && this._fbo.height === b || (this._fbo.destroy(), this._fboCoordsTexture.destroy(), this._fboDepthTexture.destroy(), delete this._fbo, delete this._fboDepthTexture, delete this._fboCoordsTexture), this._fboCoordsTexture || (this._fboCoordsTexture = new A(h.context, { width: g, height: b, data: null }, h.context.gl.RGBA, { premultiply: !1 }), this._fboCoordsTexture.bind(h.context.gl.NEAREST, h.context.gl.CLAMP_TO_EDGE)), this._fboDepthTexture || (this._fboDepthTexture = new A(h.context, { width: g, height: b, data: null }, h.context.gl.RGBA, { premultiply: !1 }), this._fboDepthTexture.bind(h.context.gl.NEAREST, h.context.gl.CLAMP_TO_EDGE)), this._fbo || (this._fbo = h.context.createFramebuffer(g, b, !0), this._fbo.depthAttachment.set(h.context.createRenderbuffer(h.context.gl.DEPTH_COMPONENT16, g, b))), this._fbo.colorAttachment.set(l === "coords" ? this._fboCoordsTexture.texture : this._fboDepthTexture.texture), this._fbo } getCoordsTexture() { const l = this.style.map.painter.context; if (this._coordsTexture) return this._coordsTexture; const h = new Uint8Array(this._coordsTextureSize * this._coordsTextureSize * 4); for (let E = 0, D = 0; E < this._coordsTextureSize; E++)for (let $ = 0; $ < this._coordsTextureSize; $++, D += 4)h[D + 0] = 255 & $, h[D + 1] = 255 & E, h[D + 2] = $ >> 8 << 4 | E >> 8, h[D + 3] = 0; const g = new o.RGBAImage({ width: this._coordsTextureSize, height: this._coordsTextureSize }, new Uint8Array(h.buffer)), b = new A(l, g, l.gl.RGBA, { premultiply: !1 }); return b.bind(l.gl.NEAREST, l.gl.CLAMP_TO_EDGE), this._coordsTexture = b, b } pointCoordinate(l) { const h = new Uint8Array(4), g = this.style.map.painter, b = g.context, E = b.gl; b.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer), E.readPixels(l.x, g.height / devicePixelRatio - l.y - 1, 1, 1, E.RGBA, E.UNSIGNED_BYTE, h), b.bindFramebuffer.set(null); const D = h[0] + (h[2] >> 4 << 8), $ = h[1] + ((15 & h[2]) << 8), U = this.coordsIndex[255 - h[3]], W = U && this.sourceCache.getTileByID(U); if (!W) return null; const te = this._coordsTextureSize, ae = (1 << W.tileID.canonical.z) * te; return new o.MercatorCoordinate((W.tileID.canonical.x * te + D) / ae, (W.tileID.canonical.y * te + $) / ae, this.getElevation(W.tileID, D, $, te)) } getTerrainMesh() { if (this._mesh) return this._mesh; const l = this.style.map.painter.context, h = new o.PosArray, g = new o.TriangleIndexArray, b = this.meshSize, E = o.EXTENT / b, D = b * b; for (let $ = 0; $ <= b; $++)for (let U = 0; U <= b; U++)h.emplaceBack(U * E, $ * E); for (let $ = 0; $ < D; $ += b + 1)for (let U = 0; U < b; U++)g.emplaceBack(U + $, b + U + $ + 1, b + U + $ + 2), g.emplaceBack(U + $, b + U + $ + 2, U + $ + 1); return this._mesh = { indexBuffer: l.createIndexBuffer(g), vertexBuffer: l.createVertexBuffer(h, bn.members), segments: o.SegmentVector.simpleSegment(0, 0, h.length, g.length) }, this._mesh } getMinMaxElevation(l) { const h = this.getTerrainData(l).tile, g = { minElevation: null, maxElevation: null }; return h && h.dem && (g.minElevation = (h.dem.min + this.elevationOffset) * this.exaggeration, g.maxElevation = (h.dem.max + this.elevationOffset) * this.exaggeration), g } } const Vn = (x, l) => o.emitValidationErrors(x, l && l.filter(h => h.identifier !== "source.canvas")), rr = o.pick(ut, ["addLayer", "removeLayer", "setPaintProperty", "setLayoutProperty", "setFilter", "addSource", "removeSource", "setLayerZoomRange", "setLight", "setTransition", "setGeoJSONSourceData"]), $r = o.pick(ut, ["setCenter", "setZoom", "setBearing", "setPitch"]), sr = function () { const x = {}, l = o.spec.$version; for (const h in o.spec.$root) { const g = o.spec.$root[h]; if (g.required) { let b = null; b = h === "version" ? l : g.type === "array" ? [] : {}, b != null && (x[h] = b) } } return x }(); class Mr extends o.Evented { constructor(l, h = {}) { super(), this.map = l, this.dispatcher = new Y(Rt(), this), this.imageManager = new R, this.imageManager.setEventedParent(this), this.glyphManager = new B(l._requestManager, h.localIdeographFontFamily), this.lineAtlas = new X(256, 512), this.crossTileSymbolIndex = new Vt, this._layers = {}, this._serializedLayers = {}, this._order = [], this.sourceCaches = {}, this.zoomHistory = new o.ZoomHistory, this._loaded = !1, this._availableImages = [], this._resetUpdates(), this.dispatcher.broadcast("setReferrer", o.getReferrer()); const g = this; this._rtlTextPluginCallback = Mr.registerForPluginStateChange(b => { g.dispatcher.broadcast("syncRTLPluginState", { pluginStatus: b.pluginStatus, pluginURL: b.pluginURL }, (E, D) => { if (o.triggerPluginCompletionEvent(E), D && D.every($ => $)) for (const $ in g.sourceCaches) g.sourceCaches[$].reload() }) }), this.on("data", b => { if (b.dataType !== "source" || b.sourceDataType !== "metadata") return; const E = this.sourceCaches[b.sourceId]; if (!E) return; const D = E.getSource(); if (D && D.vectorLayerIds) for (const $ in this._layers) { const U = this._layers[$]; U.source === D.id && this._validateLayer(U) } }) } loadURL(l, h = {}) { this.fire(new o.Event("dataloading", { dataType: "style" })); const g = typeof h.validate != "boolean" || h.validate, b = this.map._requestManager.transformRequest(l, o.ResourceType.Style); this._request = o.getJSON(b, (E, D) => { this._request = null, E ? this.fire(new o.ErrorEvent(E)) : D && this._load(D, g) }) } loadJSON(l, h = {}) { this.fire(new o.Event("dataloading", { dataType: "style" })), this._request = o.exported.frame(() => { this._request = null, this._load(l, h.validate !== !1) }) } loadEmpty() { this.fire(new o.Event("dataloading", { dataType: "style" })), this._load(sr, !1) } _load(l, h) { if (h && Vn(this, o.validateStyle(l))) return; this._loaded = !0, this.stylesheet = l; for (const b in l.sources) this.addSource(b, l.sources[b], { validate: !1 }); l.sprite ? this._loadSprite(l.sprite) : this.imageManager.setLoaded(!0), this.glyphManager.setURL(l.glyphs); const g = Mt(this.stylesheet.layers); this._order = g.map(b => b.id), this._layers = {}, this._serializedLayers = {}; for (let b of g) b = o.createStyleLayer(b), b.setEventedParent(this, { layer: { id: b.id } }), this._layers[b.id] = b, this._serializedLayers[b.id] = b.serialize(); this.dispatcher.broadcast("setLayers", this._serializeLayers(this._order)), this.light = new j(this.stylesheet.light), this.setTerrain(this.stylesheet.terrain), this.fire(new o.Event("data", { dataType: "style" })), this.fire(new o.Event("style.load")) } _loadSprite(l) { this._spriteRequest = function (h, g, b, E) { let D, $, U; const W = b > 1 ? "@2x" : ""; let te = o.getJSON(g.transformRequest(g.normalizeSpriteURL(h, W, ".json"), o.ResourceType.SpriteJSON), (Se, _e) => { te = null, U || (U = Se, D = _e, fe()) }), ae = o.getImage(g.transformRequest(g.normalizeSpriteURL(h, W, ".png"), o.ResourceType.SpriteImage), (Se, _e) => { ae = null, U || (U = Se, $ = _e, fe()) }); function fe() { if (U) E(U); else if (D && $) { const Se = o.exported.getImageData($), _e = {}; for (const we in D) { const { width: Be, height: je, x: et, y: Me, sdf: at, pixelRatio: nt, stretchX: xt, stretchY: _t, content: Ft } = D[we], vt = new o.RGBAImage({ width: Be, height: je }); o.RGBAImage.copy(Se, vt, { x: et, y: Me }, { x: 0, y: 0 }, { width: Be, height: je }), _e[we] = { data: vt, pixelRatio: nt, sdf: at, stretchX: xt, stretchY: _t, content: Ft } } E(null, _e) } } return { cancel() { te && (te.cancel(), te = null), ae && (ae.cancel(), ae = null) } } }(l, this.map._requestManager, this.map.getPixelRatio(), (h, g) => { if (this._spriteRequest = null, h) this.fire(new o.ErrorEvent(h)); else if (g) for (const b in g) this.imageManager.addImage(b, g[b]); this.imageManager.setLoaded(!0), this._availableImages = this.imageManager.listImages(), this.dispatcher.broadcast("setImages", this._availableImages), this.fire(new o.Event("data", { dataType: "style" })) }) } _validateLayer(l) { const h = this.sourceCaches[l.source]; if (!h) return; const g = l.sourceLayer; if (!g) return; const b = h.getSource(); (b.type === "geojson" || b.vectorLayerIds && b.vectorLayerIds.indexOf(g) === -1) && this.fire(new o.ErrorEvent(new Error(`Source layer "${g}" does not exist on source "${b.id}" as specified by style layer "${l.id}".`))) } loaded() { if (!this._loaded || Object.keys(this._updatedSources).length) return !1; for (const l in this.sourceCaches) if (!this.sourceCaches[l].loaded()) return !1; return !!this.imageManager.isLoaded() } _serializeLayers(l) { const h = []; for (const g of l) { const b = this._layers[g]; b.type !== "custom" && h.push(b.serialize()) } return h } hasTransitions() { if (this.light && this.light.hasTransition()) return !0; for (const l in this.sourceCaches) if (this.sourceCaches[l].hasTransition()) return !0; for (const l in this._layers) if (this._layers[l].hasTransition()) return !0; return !1 } _checkLoaded() { if (!this._loaded) throw new Error("Style is not done loading.") } update(l) { if (!this._loaded) return; const h = this._changed; if (this._changed) { const b = Object.keys(this._updatedLayers), E = Object.keys(this._removedLayers); (b.length || E.length) && this._updateWorkerLayers(b, E); for (const D in this._updatedSources) { const $ = this._updatedSources[D]; if ($ === "reload") this._reloadSource(D); else { if ($ !== "clear") throw new Error(`Invalid action ${$}`); this._clearSource(D) } } this._updateTilesForChangedImages(); for (const D in this._updatedPaintProps) this._layers[D].updateTransitions(l); this.light.updateTransitions(l), this._resetUpdates() } const g = {}; for (const b in this.sourceCaches) { const E = this.sourceCaches[b]; g[b] = E.used, E.used = !1 } for (const b of this._order) { const E = this._layers[b]; E.recalculate(l, this._availableImages), !E.isHidden(l.zoom) && E.source && (this.sourceCaches[E.source].used = !0) } for (const b in g) { const E = this.sourceCaches[b]; g[b] !== E.used && E.fire(new o.Event("data", { sourceDataType: "visibility", dataType: "source", sourceId: b })) } this.light.recalculate(l), this.z = l.zoom, h && this.fire(new o.Event("data", { dataType: "style" })) } _updateTilesForChangedImages() { const l = Object.keys(this._changedImages); if (l.length) { for (const h in this.sourceCaches) this.sourceCaches[h].reloadTilesForDependencies(["icons", "patterns"], l); this._changedImages = {} } } _updateWorkerLayers(l, h) { this.dispatcher.broadcast("updateLayers", { layers: this._serializeLayers(l), removedIds: h }) } _resetUpdates() { this._changed = !1, this._updatedLayers = {}, this._removedLayers = {}, this._updatedSources = {}, this._updatedPaintProps = {}, this._changedImages = {} } setTerrain(l) { if (this._checkLoaded(), this._terrainDataCallback && this.off("data", this._terrainDataCallback), this._terrainfreezeElevationCallback && this.map.off("freezeElevation", this._terrainfreezeElevationCallback), l) { const h = this.sourceCaches[l.source]; if (!h) throw new Error(`cannot load terrain, because there exists no source with ID: ${l.source}`); this.terrain = new wn(this, h, l), this.map.transform.updateElevation(this.terrain), this._terrainfreezeElevationCallback = g => { g.freeze ? this.map.transform.freezeElevation = !0 : (this.map.transform.freezeElevation = !1, this.map.transform.recalculateZoom(this.terrain)) }, this._terrainDataCallback = g => { g.tile && (g.sourceId === l.source ? (this.map.transform.updateElevation(this.terrain), this.terrain.rememberForRerender(g.sourceId, g.tile.tileID)) : g.source.type === "geojson" && this.terrain.rememberForRerender(g.sourceId, g.tile.tileID)) }, this.on("data", this._terrainDataCallback), this.map.on("freezeElevation", this._terrainfreezeElevationCallback) } else this.terrain && this.terrain.sourceCache.destruct(), this.terrain = null, this.map.transform.updateElevation(this.terrain); this.map.fire(new o.Event("terrain", { terrain: l })) } setState(l) { if (this._checkLoaded(), Vn(this, o.validateStyle(l))) return !1; (l = o.clone$1(l)).layers = Mt(l.layers); const h = function (b, E) { if (!b) return [{ command: ut.setStyle, args: [E] }]; let D = []; try { if (!y(b.version, E.version)) return [{ command: ut.setStyle, args: [E] }]; y(b.center, E.center) || D.push({ command: ut.setCenter, args: [E.center] }), y(b.zoom, E.zoom) || D.push({ command: ut.setZoom, args: [E.zoom] }), y(b.bearing, E.bearing) || D.push({ command: ut.setBearing, args: [E.bearing] }), y(b.pitch, E.pitch) || D.push({ command: ut.setPitch, args: [E.pitch] }), y(b.sprite, E.sprite) || D.push({ command: ut.setSprite, args: [E.sprite] }), y(b.glyphs, E.glyphs) || D.push({ command: ut.setGlyphs, args: [E.glyphs] }), y(b.transition, E.transition) || D.push({ command: ut.setTransition, args: [E.transition] }), y(b.light, E.light) || D.push({ command: ut.setLight, args: [E.light] }); const $ = {}, U = []; (function (te, ae, fe, Se) { let _e; for (_e in ae = ae || {}, te = te || {}) Object.prototype.hasOwnProperty.call(te, _e) && (Object.prototype.hasOwnProperty.call(ae, _e) || ct(_e, fe, Se)); for (_e in ae) Object.prototype.hasOwnProperty.call(ae, _e) && (Object.prototype.hasOwnProperty.call(te, _e) ? y(te[_e], ae[_e]) || (te[_e].type === "geojson" && ae[_e].type === "geojson" && ht(te, ae, _e) ? fe.push({ command: ut.setGeoJSONSourceData, args: [_e, ae[_e].data] }) : rt(_e, ae, fe, Se)) : dt(_e, ae, fe)) })(b.sources, E.sources, U, $); const W = []; b.layers && b.layers.forEach(te => { $[te.source] ? D.push({ command: ut.removeLayer, args: [te.id] }) : W.push(te) }), D = D.concat(U), function (te, ae, fe) { ae = ae || []; const Se = (te = te || []).map(Wt), _e = ae.map(Wt), we = te.reduce(Ut, {}), Be = ae.reduce(Ut, {}), je = Se.slice(), et = Object.create(null); let Me, at, nt, xt, _t, Ft, vt; for (Me = 0, at = 0; Me < Se.length; Me++)nt = Se[Me], Object.prototype.hasOwnProperty.call(Be, nt) ? at++ : (fe.push({ command: ut.removeLayer, args: [nt] }), je.splice(je.indexOf(nt, at), 1)); for (Me = 0, at = 0; Me < _e.length; Me++)nt = _e[_e.length - 1 - Me], je[je.length - 1 - Me] !== nt && (Object.prototype.hasOwnProperty.call(we, nt) ? (fe.push({ command: ut.removeLayer, args: [nt] }), je.splice(je.lastIndexOf(nt, je.length - at), 1)) : at++, Ft = je[je.length - Me], fe.push({ command: ut.addLayer, args: [Be[nt], Ft] }), je.splice(je.length - Me, 0, nt), et[nt] = !0); for (Me = 0; Me < _e.length; Me++)if (nt = _e[Me], xt = we[nt], _t = Be[nt], !et[nt] && !y(xt, _t)) if (y(xt.source, _t.source) && y(xt["source-layer"], _t["source-layer"]) && y(xt.type, _t.type)) { for (vt in bt(xt.layout, _t.layout, fe, nt, null, ut.setLayoutProperty), bt(xt.paint, _t.paint, fe, nt, null, ut.setPaintProperty), y(xt.filter, _t.filter) || fe.push({ command: ut.setFilter, args: [nt, _t.filter] }), y(xt.minzoom, _t.minzoom) && y(xt.maxzoom, _t.maxzoom) || fe.push({ command: ut.setLayerZoomRange, args: [nt, _t.minzoom, _t.maxzoom] }), xt) Object.prototype.hasOwnProperty.call(xt, vt) && vt !== "layout" && vt !== "paint" && vt !== "filter" && vt !== "metadata" && vt !== "minzoom" && vt !== "maxzoom" && (vt.indexOf("paint.") === 0 ? bt(xt[vt], _t[vt], fe, nt, vt.slice(6), ut.setPaintProperty) : y(xt[vt], _t[vt]) || fe.push({ command: ut.setLayerProperty, args: [nt, vt, _t[vt]] })); for (vt in _t) Object.prototype.hasOwnProperty.call(_t, vt) && !Object.prototype.hasOwnProperty.call(xt, vt) && vt !== "layout" && vt !== "paint" && vt !== "filter" && vt !== "metadata" && vt !== "minzoom" && vt !== "maxzoom" && (vt.indexOf("paint.") === 0 ? bt(xt[vt], _t[vt], fe, nt, vt.slice(6), ut.setPaintProperty) : y(xt[vt], _t[vt]) || fe.push({ command: ut.setLayerProperty, args: [nt, vt, _t[vt]] })) } else fe.push({ command: ut.removeLayer, args: [nt] }), Ft = je[je.lastIndexOf(nt) + 1], fe.push({ command: ut.addLayer, args: [_t, Ft] }) }(W, E.layers, D) } catch ($) { console.warn("Unable to compute style diff:", $), D = [{ command: ut.setStyle, args: [E] }] } return D }(this.serialize(), l).filter(b => !(b.command in $r)); if (h.length === 0) return !1; const g = h.filter(b => !(b.command in rr)); if (g.length > 0) throw new Error(`Unimplemented: ${g.map(b => b.command).join(", ")}.`); return h.forEach(b => { b.command !== "setTransition" && this[b.command].apply(this, b.args) }), this.stylesheet = l, !0 } addImage(l, h) { if (this.getImage(l)) return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" already exists.`))); this.imageManager.addImage(l, h), this._afterImageUpdated(l) } updateImage(l, h) { this.imageManager.updateImage(l, h) } getImage(l) { return this.imageManager.getImage(l) } removeImage(l) { if (!this.getImage(l)) return this.fire(new o.ErrorEvent(new Error(`An image named "${l}" does not exist.`))); this.imageManager.removeImage(l), this._afterImageUpdated(l) } _afterImageUpdated(l) { this._availableImages = this.imageManager.listImages(), this._changedImages[l] = !0, this._changed = !0, this.dispatcher.broadcast("setImages", this._availableImages), this.fire(new o.Event("data", { dataType: "style" })) } listImages() { return this._checkLoaded(), this.imageManager.listImages() } addSource(l, h, g = {}) { if (this._checkLoaded(), this.sourceCaches[l] !== void 0) throw new Error(`Source "${l}" already exists.`); if (!h.type) throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`); if (["vector", "raster", "geojson", "video", "image"].indexOf(h.type) >= 0 && this._validate(o.validateStyle.source, `sources.${l}`, h, null, g)) return; this.map && this.map._collectResourceTiming && (h.collectResourceTiming = !0); const b = this.sourceCaches[l] = new Ue(l, h, this.dispatcher); b.style = this, b.setEventedParent(this, () => ({ isSourceLoaded: this.loaded(), source: b.serialize(), sourceId: l })), b.onAdd(this.map), this._changed = !0 } removeSource(l) { if (this._checkLoaded(), this.sourceCaches[l] === void 0) throw new Error("There is no source with this ID"); for (const g in this._layers) if (this._layers[g].source === l) return this.fire(new o.ErrorEvent(new Error(`Source "${l}" cannot be removed while layer "${g}" is using it.`))); const h = this.sourceCaches[l]; delete this.sourceCaches[l], delete this._updatedSources[l], h.fire(new o.Event("data", { sourceDataType: "metadata", dataType: "source", sourceId: l })), h.setEventedParent(null), h.onRemove(this.map), this._changed = !0 } setGeoJSONSourceData(l, h) { if (this._checkLoaded(), this.sourceCaches[l] === void 0) throw new Error(`There is no source with this ID=${l}`); const g = this.sourceCaches[l].getSource(); if (g.type !== "geojson") throw new Error(`geojsonSource.type is ${g.type}, which is !== 'geojson`); g.setData(h), this._changed = !0 } getSource(l) { return this.sourceCaches[l] && this.sourceCaches[l].getSource() } addLayer(l, h, g = {}) { this._checkLoaded(); const b = l.id; if (this.getLayer(b)) return void this.fire(new o.ErrorEvent(new Error(`Layer "${b}" already exists on this map.`))); let E; if (l.type === "custom") { if (Vn(this, o.validateCustomStyleLayer(l))) return; E = o.createStyleLayer(l) } else { if (typeof l.source == "object" && (this.addSource(b, l.source), l = o.clone$1(l), l = o.extend(l, { source: b })), this._validate(o.validateStyle.layer, `layers.${b}`, l, { arrayIndex: -1 }, g)) return; E = o.createStyleLayer(l), this._validateLayer(E), E.setEventedParent(this, { layer: { id: b } }), this._serializedLayers[E.id] = E.serialize() } const D = h ? this._order.indexOf(h) : this._order.length; if (h && D === -1) this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${b}" before non-existing layer "${h}".`))); else { if (this._order.splice(D, 0, b), this._layerOrderChanged = !0, this._layers[b] = E, this._removedLayers[b] && E.source && E.type !== "custom") { const $ = this._removedLayers[b]; delete this._removedLayers[b], $.type !== E.type ? this._updatedSources[E.source] = "clear" : (this._updatedSources[E.source] = "reload", this.sourceCaches[E.source].pause()) } this._updateLayer(E), E.onAdd && E.onAdd(this.map) } } moveLayer(l, h) { if (this._checkLoaded(), this._changed = !0, !this._layers[l]) return void this.fire(new o.ErrorEvent(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`))); if (l === h) return; const g = this._order.indexOf(l); this._order.splice(g, 1); const b = h ? this._order.indexOf(h) : this._order.length; h && b === -1 ? this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${l}" before non-existing layer "${h}".`))) : (this._order.splice(b, 0, l), this._layerOrderChanged = !0) } removeLayer(l) { this._checkLoaded(); const h = this._layers[l]; if (!h) return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${l}".`))); h.setEventedParent(null); const g = this._order.indexOf(l); this._order.splice(g, 1), this._layerOrderChanged = !0, this._changed = !0, this._removedLayers[l] = h, delete this._layers[l], delete this._serializedLayers[l], delete this._updatedLayers[l], delete this._updatedPaintProps[l], h.onRemove && h.onRemove(this.map) } getLayer(l) { return this._layers[l] } hasLayer(l) { return l in this._layers } setLayerZoomRange(l, h, g) { this._checkLoaded(); const b = this.getLayer(l); b ? b.minzoom === h && b.maxzoom === g || (h != null && (b.minzoom = h), g != null && (b.maxzoom = g), this._updateLayer(b)) : this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${l}".`))) } setFilter(l, h, g = {}) { this._checkLoaded(); const b = this.getLayer(l); if (b) { if (!y(b.filter, h)) return h == null ? (b.filter = void 0, void this._updateLayer(b)) : void (this._validate(o.validateStyle.filter, `layers.${b.id}.filter`, h, null, g) || (b.filter = o.clone$1(h), this._updateLayer(b))) } else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${l}".`))) } getFilter(l) { return o.clone$1(this.getLayer(l).filter) } setLayoutProperty(l, h, g, b = {}) { this._checkLoaded(); const E = this.getLayer(l); E ? y(E.getLayoutProperty(h), g) || (E.setLayoutProperty(h, g, b), this._updateLayer(E)) : this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`))) } getLayoutProperty(l, h) { const g = this.getLayer(l); if (g) return g.getLayoutProperty(h); this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${l}".`))) } setPaintProperty(l, h, g, b = {}) { this._checkLoaded(); const E = this.getLayer(l); E ? y(E.getPaintProperty(h), g) || (E.setPaintProperty(h, g, b) && this._updateLayer(E), this._changed = !0, this._updatedPaintProps[l] = !0) : this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${l}".`))) } getPaintProperty(l, h) { return this.getLayer(l).getPaintProperty(h) } setFeatureState(l, h) { this._checkLoaded(); const g = l.source, b = l.sourceLayer, E = this.sourceCaches[g]; if (E === void 0) return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`))); const D = E.getSource().type; D === "geojson" && b ? this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))) : D !== "vector" || b ? (l.id === void 0 && this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))), E.setFeatureState(b, l.id, h)) : this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))) } removeFeatureState(l, h) { this._checkLoaded(); const g = l.source, b = this.sourceCaches[g]; if (b === void 0) return void this.fire(new o.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`))); const E = b.getSource().type, D = E === "vector" ? l.sourceLayer : void 0; E !== "vector" || D ? h && typeof l.id != "string" && typeof l.id != "number" ? this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))) : b.removeFeatureState(D, l.id, h) : this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))) } getFeatureState(l) { this._checkLoaded(); const h = l.source, g = l.sourceLayer, b = this.sourceCaches[h]; if (b !== void 0) return b.getSource().type !== "vector" || g ? (l.id === void 0 && this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))), b.getFeatureState(g, l.id)) : void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))); this.fire(new o.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`))) } getTransition() { return o.extend({ duration: 300, delay: 0 }, this.stylesheet && this.stylesheet.transition) } serialize() { return o.filterObject({ version: this.stylesheet.version, name: this.stylesheet.name, metadata: this.stylesheet.metadata, light: this.stylesheet.light, center: this.stylesheet.center, zoom: this.stylesheet.zoom, bearing: this.stylesheet.bearing, pitch: this.stylesheet.pitch, sprite: this.stylesheet.sprite, glyphs: this.stylesheet.glyphs, transition: this.stylesheet.transition, sources: o.mapObject(this.sourceCaches, l => l.serialize()), layers: this._serializeLayers(this._order) }, l => l !== void 0) } _updateLayer(l) { this._updatedLayers[l.id] = !0, l.source && !this._updatedSources[l.source] && this.sourceCaches[l.source].getSource().type !== "raster" && (this._updatedSources[l.source] = "reload", this.sourceCaches[l.source].pause()), this._changed = !0 } _flattenAndSortRenderedFeatures(l) { const h = D => this._layers[D].type === "fill-extrusion", g = {}, b = []; for (let D = this._order.length - 1; D >= 0; D--) { const $ = this._order[D]; if (h($)) { g[$] = D; for (const U of l) { const W = U[$]; if (W) for (const te of W) b.push(te) } } } b.sort((D, $) => $.intersectionZ - D.intersectionZ); const E = []; for (let D = this._order.length - 1; D >= 0; D--) { const $ = this._order[D]; if (h($)) for (let U = b.length - 1; U >= 0; U--) { const W = b[U].feature; if (g[W.layer.id] < D) break; E.push(W), b.pop() } else for (const U of l) { const W = U[$]; if (W) for (const te of W) E.push(te.feature) } } return E } queryRenderedFeatures(l, h, g) { h && h.filter && this._validate(o.validateStyle.filter, "queryRenderedFeatures.filter", h.filter, null, h); const b = {}; if (h && h.layers) { if (!Array.isArray(h.layers)) return this.fire(new o.ErrorEvent(new Error("parameters.layers must be an Array."))), []; for (const D of h.layers) { const $ = this._layers[D]; if (!$) return this.fire(new o.ErrorEvent(new Error(`The layer '${D}' does not exist in the map's style and cannot be queried for features.`))), []; b[$.source] = !0 } } const E = []; h.availableImages = this._availableImages; for (const D in this.sourceCaches) h.layers && !b[D] || E.push(Re(this.sourceCaches[D], this._layers, this._serializedLayers, l, h, g)); return this.placement && E.push(function (D, $, U, W, te, ae, fe) { const Se = {}, _e = ae.queryRenderedSymbols(W), we = []; for (const Be of Object.keys(_e).map(Number)) we.push(fe[Be]); we.sort(ke); for (const Be of we) { const je = Be.featureIndex.lookupSymbolFeatures(_e[Be.bucketInstanceId], $, Be.bucketIndex, Be.sourceLayerIndex, te.filter, te.layers, te.availableImages, D); for (const et in je) { const Me = Se[et] = Se[et] || [], at = je[et]; at.sort((nt, xt) => { const _t = Be.featureSortOrder; if (_t) { const Ft = _t.indexOf(nt.featureIndex); return _t.indexOf(xt.featureIndex) - Ft } return xt.featureIndex - nt.featureIndex }); for (const nt of at) Me.push(nt) } } for (const Be in Se) Se[Be].forEach(je => { const et = je.feature, Me = U[D[Be].source].getFeatureState(et.layer["source-layer"], et.id); et.source = et.layer.source, et.layer["source-layer"] && (et.sourceLayer = et.layer["source-layer"]), et.state = Me }); return Se }(this._layers, this._serializedLayers, this.sourceCaches, l, h, this.placement.collisionIndex, this.placement.retainedQueryData)), this._flattenAndSortRenderedFeatures(E) } querySourceFeatures(l, h) { h && h.filter && this._validate(o.validateStyle.filter, "querySourceFeatures.filter", h.filter, null, h); const g = this.sourceCaches[l]; return g ? function (b, E) { const D = b.getRenderableIds().map(W => b.getTileByID(W)), $ = [], U = {}; for (let W = 0; W < D.length; W++) { const te = D[W], ae = te.tileID.canonical.key; U[ae] || (U[ae] = !0, te.querySourceFeatures($, E)) } return $ }(g, h) : [] } addSourceType(l, h, g) { return Mr.getSourceType(l) ? g(new Error(`A source type called "${l}" already exists.`)) : (Mr.setSourceType(l, h), h.workerSourceURL ? void this.dispatcher.broadcast("loadWorkerSource", { name: l, url: h.workerSourceURL }, g) : g(null, null)) } getLight() { return this.light.getLight() } setLight(l, h = {}) { this._checkLoaded(); const g = this.light.getLight(); let b = !1; for (const D in l) if (!y(l[D], g[D])) { b = !0; break } if (!b) return; const E = { now: o.exported.now(), transition: o.extend({ duration: 300, delay: 0 }, this.stylesheet.transition) }; this.light.setLight(l, h), this.light.updateTransitions(E) } _validate(l, h, g, b, E = {}) { return (!E || E.validate !== !1) && Vn(this, l.call(o.validateStyle, o.extend({ key: h, style: this.serialize(), value: g, styleSpec: o.spec }, b))) } _remove() { this._request && (this._request.cancel(), this._request = null), this._spriteRequest && (this._spriteRequest.cancel(), this._spriteRequest = null), o.evented.off("pluginStateChange", this._rtlTextPluginCallback); for (const l in this._layers) this._layers[l].setEventedParent(null); for (const l in this.sourceCaches) { const h = this.sourceCaches[l]; h.setEventedParent(null), h.onRemove(this.map) } this.imageManager.setEventedParent(null), this.setEventedParent(null), this.dispatcher.remove() } _clearSource(l) { this.sourceCaches[l].clearTiles() } _reloadSource(l) { this.sourceCaches[l].resume(), this.sourceCaches[l].reload() } _updateSources(l) { for (const h in this.sourceCaches) this.sourceCaches[h].update(l, this.terrain) } _generateCollisionBoxes() { for (const l in this.sourceCaches) this._reloadSource(l) } _updatePlacement(l, h, g, b, E = !1) { let D = !1, $ = !1; const U = {}; for (const W of this._order) { const te = this._layers[W]; if (te.type !== "symbol") continue; if (!U[te.source]) { const fe = this.sourceCaches[te.source]; U[te.source] = fe.getRenderableIds(!0).map(Se => fe.getTileByID(Se)).sort((Se, _e) => _e.tileID.overscaledZ - Se.tileID.overscaledZ || (Se.tileID.isLessThan(_e.tileID) ? -1 : 1)) } const ae = this.crossTileSymbolIndex.addLayer(te, U[te.source], l.center.lng); D = D || ae } if (this.crossTileSymbolIndex.pruneUnusedLayers(this._order), ((E = E || this._layerOrderChanged || g === 0) || !this.pauseablePlacement || this.pauseablePlacement.isDone() && !this.placement.stillRecent(o.exported.now(), l.zoom)) && (this.pauseablePlacement = new Ve(l, this.terrain, this._order, E, h, g, b, this.placement), this._layerOrderChanged = !1), this.pauseablePlacement.isDone() ? this.placement.setStale() : (this.pauseablePlacement.continuePlacement(this._order, this._layers, U), this.pauseablePlacement.isDone() && (this.placement = this.pauseablePlacement.commit(o.exported.now()), $ = !0), D && this.pauseablePlacement.placement.setStale()), $ || D) for (const W of this._order) { const te = this._layers[W]; te.type === "symbol" && this.placement.updateLayerOpacities(te, U[te.source]) } return !this.pauseablePlacement.isDone() || this.placement.hasTransitions(o.exported.now()) } _releaseSymbolFadeTiles() { for (const l in this.sourceCaches) this.sourceCaches[l].releaseSymbolFadeTiles() } getImages(l, h, g) { this.imageManager.getImages(h.icons, g), this._updateTilesForChangedImages(); const b = this.sourceCaches[h.source]; b && b.setDependencies(h.tileID.key, h.type, h.icons) } getGlyphs(l, h, g) { this.glyphManager.getGlyphs(h.stacks, g) } getResource(l, h, g) { return o.makeRequest(h, g) } } Mr.getSourceType = function (x) { return Pe[x] }, Mr.setSourceType = function (x, l) { Pe[x] = l }, Mr.registerForPluginStateChange = o.registerForPluginStateChange; var Mn = "attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}"; const kn = {
|
|
|
prelude: Dn(`#ifdef GL_ES
|
|
|
precision mediump float;
|
|
|
#else
|
|
|
#if !defined(lowp)
|
|
|
#define lowp
|
|
|
#endif
|
|
|
#if !defined(mediump)
|
|
|
#define mediump
|
|
|
#endif
|
|
|
#if !defined(highp)
|
|
|
#define highp
|
|
|
#endif
|
|
|
#endif`, `#ifdef GL_ES
|
|
|
precision highp float;
|
|
|
#else
|
|
|
#if !defined(lowp)
|
|
|
#define lowp
|
|
|
#endif
|
|
|
#if !defined(mediump)
|
|
|
#define mediump
|
|
|
#endif
|
|
|
#if !defined(highp)
|
|
|
#define highp
|
|
|
#endif
|
|
|
#endif
|
|
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
|
|
|
#ifdef TERRAIN3D
|
|
|
uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
|
|
|
#endif
|
|
|
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
|
|
|
#ifdef TERRAIN3D
|
|
|
highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
|
|
|
#else
|
|
|
return 1.0;
|
|
|
#endif
|
|
|
}float calculate_visibility(vec4 pos) {
|
|
|
#ifdef TERRAIN3D
|
|
|
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
|
|
|
#else
|
|
|
return 1.0;
|
|
|
#endif
|
|
|
}float ele(vec2 pos) {
|
|
|
#ifdef TERRAIN3D
|
|
|
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
|
|
#else
|
|
|
return 0.0;
|
|
|
#endif
|
|
|
}float get_elevation(vec2 pos) {
|
|
|
#ifdef TERRAIN3D
|
|
|
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration;
|
|
|
#else
|
|
|
return 0.0;
|
|
|
#endif
|
|
|
}`), background: Dn(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), backgroundPattern: Dn(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, "uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"), circle: Dn(`varying vec3 v_data;varying float v_visibility;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define mediump float radius
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
|
#pragma mapbox: define mediump float stroke_width
|
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize mediump float radius
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define mediump float radius
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
|
#pragma mapbox: define mediump float stroke_width
|
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
|
void main(void) {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize mediump float radius
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
|
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`), clippingMask: Dn("void main() {gl_FragColor=vec4(1.0);}", "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), heatmap: Dn(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
|
#pragma mapbox: define highp float weight
|
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp float weight
|
|
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|
|
#pragma mapbox: define highp float weight
|
|
|
#pragma mapbox: define mediump float radius
|
|
|
const highp float ZERO=1.0/255.0/16.0;
|
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
|
void main(void) {
|
|
|
#pragma mapbox: initialize highp float weight
|
|
|
#pragma mapbox: initialize mediump float radius
|
|
|
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`), heatmapTexture: Dn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(0.0);
|
|
|
#endif
|
|
|
}`, "uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"), collisionBox: Dn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}", "attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"), collisionCircle: Dn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}", "attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"), debug: Dn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}", "attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"), fill: Dn(`#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
gl_FragColor=color*opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `attribute vec2 a_pos;uniform mat4 u_matrix;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);}`), fillOutline: Dn(`varying vec2 v_pos;
|
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`), fillOutlinePattern: Dn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`), fillPattern: Dn(`#ifdef GL_ES
|
|
|
precision highp float;
|
|
|
#endif
|
|
|
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`), fillExtrusion: Dn(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
|
|
|
#ifdef TERRAIN3D
|
|
|
attribute vec2 a_centroid;
|
|
|
#endif
|
|
|
varying vec4 v_color;
|
|
|
#pragma mapbox: define highp float base
|
|
|
#pragma mapbox: define highp float height
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp float base
|
|
|
#pragma mapbox: initialize highp float height
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
vec3 normal=a_normal_ed.xyz;
|
|
|
#ifdef TERRAIN3D
|
|
|
float baseDelta=10.0;float ele=get_elevation(a_centroid);
|
|
|
#else
|
|
|
float baseDelta=0.0;float ele=0.0;
|
|
|
#endif
|
|
|
base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`), fillExtrusionPattern: Dn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
|
#pragma mapbox: define lowp float base
|
|
|
#pragma mapbox: define lowp float height
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float base
|
|
|
#pragma mapbox: initialize lowp float height
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
|
|
|
#ifdef TERRAIN3D
|
|
|
attribute vec2 a_centroid;
|
|
|
#endif
|
|
|
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
|
#pragma mapbox: define lowp float base
|
|
|
#pragma mapbox: define lowp float height
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float base
|
|
|
#pragma mapbox: initialize lowp float height
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
|
|
|
#ifdef TERRAIN3D
|
|
|
float baseDelta=10.0;float ele=get_elevation(a_centroid);
|
|
|
#else
|
|
|
float baseDelta=0.0;float ele=0.0;
|
|
|
#endif
|
|
|
base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
|
? a_pos
|
|
|
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`), hillshadePrepare: Dn(`#ifdef GL_ES
|
|
|
precision highp float;
|
|
|
#endif
|
|
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, "uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"), hillshade: Dn(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
|
#define PI 3.141592653589793
|
|
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, "uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"), line: Dn(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `
|
|
|
#define scale 0.015873016
|
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define mediump float gapwidth
|
|
|
#pragma mapbox: define lowp float offset
|
|
|
#pragma mapbox: define mediump float width
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
|
#pragma mapbox: initialize lowp float offset
|
|
|
#pragma mapbox: initialize mediump float width
|
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|
|
#ifdef TERRAIN3D
|
|
|
v_gamma_scale=1.0;
|
|
|
#else
|
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
|
#endif
|
|
|
v_width2=vec2(outset,inset);}`), lineGradient: Dn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `
|
|
|
#define scale 0.015873016
|
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define mediump float gapwidth
|
|
|
#pragma mapbox: define lowp float offset
|
|
|
#pragma mapbox: define mediump float width
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
|
#pragma mapbox: initialize lowp float offset
|
|
|
#pragma mapbox: initialize mediump float width
|
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|
|
#ifdef TERRAIN3D
|
|
|
v_gamma_scale=1.0;
|
|
|
#else
|
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
|
#endif
|
|
|
v_width2=vec2(outset,inset);}`), linePattern: Dn(`#ifdef GL_ES
|
|
|
precision highp float;
|
|
|
#endif
|
|
|
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `
|
|
|
#define scale 0.015873016
|
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp float offset
|
|
|
#pragma mapbox: define mediump float gapwidth
|
|
|
#pragma mapbox: define mediump float width
|
|
|
#pragma mapbox: define lowp float floorwidth
|
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize lowp float offset
|
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
|
#pragma mapbox: initialize mediump float width
|
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|
|
#ifdef TERRAIN3D
|
|
|
v_gamma_scale=1.0;
|
|
|
#else
|
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
|
#endif
|
|
|
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`), lineSDF: Dn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define mediump float width
|
|
|
#pragma mapbox: define lowp float floorwidth
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump float width
|
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `
|
|
|
#define scale 0.015873016
|
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
|
#pragma mapbox: define highp vec4 color
|
|
|
#pragma mapbox: define lowp float blur
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define mediump float gapwidth
|
|
|
#pragma mapbox: define lowp float offset
|
|
|
#pragma mapbox: define mediump float width
|
|
|
#pragma mapbox: define lowp float floorwidth
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 color
|
|
|
#pragma mapbox: initialize lowp float blur
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
|
#pragma mapbox: initialize lowp float offset
|
|
|
#pragma mapbox: initialize mediump float width
|
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|
|
#ifdef TERRAIN3D
|
|
|
v_gamma_scale=1.0;
|
|
|
#else
|
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
|
#endif
|
|
|
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`), raster: Dn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, "uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"), symbolIcon: Dn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`), symbolSDF: Dn(`#define SDF_PX 8.0
|
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp float halo_width
|
|
|
#pragma mapbox: define lowp float halo_blur
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
|
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp float halo_width
|
|
|
#pragma mapbox: define lowp float halo_blur
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`), symbolTextAndIcon: Dn(`#define SDF_PX 8.0
|
|
|
#define SDF 1.0
|
|
|
#define ICON 0.0
|
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp float halo_width
|
|
|
#pragma mapbox: define lowp float halo_blur
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
|
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
|
gl_FragColor=vec4(1.0);
|
|
|
#endif
|
|
|
}`, `const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
|
#pragma mapbox: define lowp float opacity
|
|
|
#pragma mapbox: define lowp float halo_width
|
|
|
#pragma mapbox: define lowp float halo_blur
|
|
|
void main() {
|
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
|
#pragma mapbox: initialize lowp float opacity
|
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`), terrain: Dn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}", Mn), terrainDepth: Dn("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}", Mn), terrainCoords: Dn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}", Mn)
|
|
|
}; function Dn(x, l) {
|
|
|
const h = /#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g, g = l.match(/attribute ([\w]+) ([\w]+)/g), b = x.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), E = l.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), D = E ? E.concat(b) : b, $ = {}; return {
|
|
|
fragmentSource: x = x.replace(h, (U, W, te, ae, fe) => ($[fe] = !0, W === "define" ? `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
varying ${te} ${ae} ${fe};
|
|
|
#else
|
|
|
uniform ${te} ${ae} u_${fe};
|
|
|
#endif
|
|
|
`: `
|
|
|
#ifdef HAS_UNIFORM_u_${fe}
|
|
|
${te} ${ae} ${fe} = u_${fe};
|
|
|
#endif
|
|
|
`)), vertexSource: l = l.replace(h, (U, W, te, ae, fe) => {
|
|
|
const Se = ae === "float" ? "vec2" : "vec4", _e = fe.match(/color/) ? "color" : Se; return $[fe] ? W === "define" ? `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
uniform lowp float u_${fe}_t;
|
|
|
attribute ${te} ${Se} a_${fe};
|
|
|
varying ${te} ${ae} ${fe};
|
|
|
#else
|
|
|
uniform ${te} ${ae} u_${fe};
|
|
|
#endif
|
|
|
`: _e === "vec4" ? `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
${fe} = a_${fe};
|
|
|
#else
|
|
|
${te} ${ae} ${fe} = u_${fe};
|
|
|
#endif
|
|
|
`: `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t);
|
|
|
#else
|
|
|
${te} ${ae} ${fe} = u_${fe};
|
|
|
#endif
|
|
|
`: W === "define" ? `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
uniform lowp float u_${fe}_t;
|
|
|
attribute ${te} ${Se} a_${fe};
|
|
|
#else
|
|
|
uniform ${te} ${ae} u_${fe};
|
|
|
#endif
|
|
|
`: _e === "vec4" ? `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
${te} ${ae} ${fe} = a_${fe};
|
|
|
#else
|
|
|
${te} ${ae} ${fe} = u_${fe};
|
|
|
#endif
|
|
|
`: `
|
|
|
#ifndef HAS_UNIFORM_u_${fe}
|
|
|
${te} ${ae} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t);
|
|
|
#else
|
|
|
${te} ${ae} ${fe} = u_${fe};
|
|
|
#endif
|
|
|
`}), staticAttributes: g, staticUniforms: D
|
|
|
}
|
|
|
} class Gr { constructor() { this.boundProgram = null, this.boundLayoutVertexBuffer = null, this.boundPaintVertexBuffers = [], this.boundIndexBuffer = null, this.boundVertexOffset = null, this.boundDynamicVertexBuffer = null, this.vao = null } bind(l, h, g, b, E, D, $, U, W) { this.context = l; let te = this.boundPaintVertexBuffers.length !== b.length; for (let ae = 0; !te && ae < b.length; ae++)this.boundPaintVertexBuffers[ae] !== b[ae] && (te = !0); l.extVertexArrayObject && this.vao && this.boundProgram === h && this.boundLayoutVertexBuffer === g && !te && this.boundIndexBuffer === E && this.boundVertexOffset === D && this.boundDynamicVertexBuffer === $ && this.boundDynamicVertexBuffer2 === U && this.boundDynamicVertexBuffer3 === W ? (l.bindVertexArrayOES.set(this.vao), $ && $.bind(), E && E.dynamicDraw && E.bind(), U && U.bind(), W && W.bind()) : this.freshBind(h, g, b, E, D, $, U, W) } freshBind(l, h, g, b, E, D, $, U) { let W; const te = l.numAttributes, ae = this.context, fe = ae.gl; if (ae.extVertexArrayObject) this.vao && this.destroy(), this.vao = ae.extVertexArrayObject.createVertexArrayOES(), ae.bindVertexArrayOES.set(this.vao), W = 0, this.boundProgram = l, this.boundLayoutVertexBuffer = h, this.boundPaintVertexBuffers = g, this.boundIndexBuffer = b, this.boundVertexOffset = E, this.boundDynamicVertexBuffer = D, this.boundDynamicVertexBuffer2 = $, this.boundDynamicVertexBuffer3 = U; else { W = ae.currentNumAttributes || 0; for (let Se = te; Se < W; Se++)fe.disableVertexAttribArray(Se) } h.enableAttributes(fe, l); for (const Se of g) Se.enableAttributes(fe, l); D && D.enableAttributes(fe, l), $ && $.enableAttributes(fe, l), U && U.enableAttributes(fe, l), h.bind(), h.setVertexAttribPointers(fe, l, E); for (const Se of g) Se.bind(), Se.setVertexAttribPointers(fe, l, E); D && (D.bind(), D.setVertexAttribPointers(fe, l, E)), b && b.bind(), $ && ($.bind(), $.setVertexAttribPointers(fe, l, E)), U && (U.bind(), U.setVertexAttribPointers(fe, l, E)), ae.currentNumAttributes = te } destroy() { this.vao && (this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao), this.vao = null) } } function yr(x) { const l = []; for (let h = 0; h < x.length; h++) { if (x[h] === null) continue; const g = x[h].split(" "); l.push(g.pop()) } return l } class Kn {
|
|
|
constructor(l, h, g, b, E, D, $) {
|
|
|
const U = l.gl; this.program = U.createProgram(); const W = yr(g.staticAttributes), te = b ? b.getBinderAttributes() : [], ae = W.concat(te), fe = kn.prelude.staticUniforms ? yr(kn.prelude.staticUniforms) : [], Se = g.staticUniforms ? yr(g.staticUniforms) : [], _e = b ? b.getBinderUniforms() : [], we = fe.concat(Se).concat(_e), Be = []; for (const _t of we) Be.indexOf(_t) < 0 && Be.push(_t); const je = b ? b.defines() : []; D && je.push("#define OVERDRAW_INSPECTOR;"), $ && je.push("#define TERRAIN3D;"); const et = je.concat(kn.prelude.fragmentSource, g.fragmentSource).join(`
|
|
|
`), Me = je.concat(kn.prelude.vertexSource, g.vertexSource).join(`
|
|
|
`), at = U.createShader(U.FRAGMENT_SHADER); if (U.isContextLost()) return void (this.failedToCreate = !0); U.shaderSource(at, et), U.compileShader(at), U.attachShader(this.program, at); const nt = U.createShader(U.VERTEX_SHADER); if (U.isContextLost()) return void (this.failedToCreate = !0); U.shaderSource(nt, Me), U.compileShader(nt), U.attachShader(this.program, nt), this.attributes = {}; const xt = {}; this.numAttributes = ae.length; for (let _t = 0; _t < this.numAttributes; _t++)ae[_t] && (U.bindAttribLocation(this.program, _t, ae[_t]), this.attributes[ae[_t]] = _t); U.linkProgram(this.program), U.deleteShader(nt), U.deleteShader(at); for (let _t = 0; _t < Be.length; _t++) { const Ft = Be[_t]; if (Ft && !xt[Ft]) { const vt = U.getUniformLocation(this.program, Ft); vt && (xt[Ft] = vt) } } this.fixedUniforms = E(l, xt), this.terrainUniforms = ((_t, Ft) => ({ u_depth: new o.Uniform1i(_t, Ft.u_depth), u_terrain: new o.Uniform1i(_t, Ft.u_terrain), u_terrain_dim: new o.Uniform1f(_t, Ft.u_terrain_dim), u_terrain_matrix: new o.UniformMatrix4f(_t, Ft.u_terrain_matrix), u_terrain_unpack: new o.Uniform4f(_t, Ft.u_terrain_unpack), u_terrain_offset: new o.Uniform1f(_t, Ft.u_terrain_offset), u_terrain_exaggeration: new o.Uniform1f(_t, Ft.u_terrain_exaggeration) }))(l, xt), this.binderUniforms = b ? b.getUniforms(l, xt) : []
|
|
|
} draw(l, h, g, b, E, D, $, U, W, te, ae, fe, Se, _e, we, Be, je, et) { const Me = l.gl; if (this.failedToCreate) return; if (l.program.set(this.program), l.setDepthMode(g), l.setStencilMode(b), l.setColorMode(E), l.setCullFace(D), U) { l.activeTexture.set(Me.TEXTURE2), Me.bindTexture(Me.TEXTURE_2D, U.depthTexture), l.activeTexture.set(Me.TEXTURE3), Me.bindTexture(Me.TEXTURE_2D, U.texture); for (const nt in this.terrainUniforms) this.terrainUniforms[nt].set(U[nt]) } for (const nt in this.fixedUniforms) this.fixedUniforms[nt].set($[nt]); we && we.setUniforms(l, this.binderUniforms, Se, { zoom: _e }); let at = 0; switch (h) { case Me.LINES: at = 2; break; case Me.TRIANGLES: at = 3; break; case Me.LINE_STRIP: at = 1 }for (const nt of fe.get()) { const xt = nt.vaos || (nt.vaos = {}); (xt[W] || (xt[W] = new Gr)).bind(l, this, te, we ? we.getPaintVertexBuffers() : [], ae, nt.vertexOffset, Be, je, et), Me.drawElements(h, nt.primitiveLength * at, Me.UNSIGNED_SHORT, nt.primitiveOffset * at * 2) } }
|
|
|
} function $n(x, l, h) { const g = 1 / zt(h, 1, l.transform.tileZoom), b = Math.pow(2, h.tileID.overscaledZ), E = h.tileSize * Math.pow(2, l.transform.tileZoom) / b, D = E * (h.tileID.canonical.x + h.tileID.wrap * b), $ = E * h.tileID.canonical.y; return { u_image: 0, u_texsize: h.imageAtlasTexture.size, u_scale: [g, x.fromScale, x.toScale], u_fade: x.t, u_pixel_coord_upper: [D >> 16, $ >> 16], u_pixel_coord_lower: [65535 & D, 65535 & $] } } const Jn = (x, l, h, g) => { const b = l.style.light, E = b.properties.get("position"), D = [E.x, E.y, E.z], $ = o.create$1(); b.properties.get("anchor") === "viewport" && o.fromRotation($, -l.transform.angle), o.transformMat3(D, D, $); const U = b.properties.get("color"); return { u_matrix: x, u_lightpos: D, u_lightintensity: b.properties.get("intensity"), u_lightcolor: [U.r, U.g, U.b], u_vertical_gradient: +h, u_opacity: g } }, br = (x, l, h, g, b, E, D) => o.extend(Jn(x, l, h, g), $n(E, l, D), { u_height_factor: -Math.pow(2, b.overscaledZ) / D.tileSize / 8 }), Cr = x => ({ u_matrix: x }), Br = (x, l, h, g) => o.extend(Cr(x), $n(h, l, g)), so = (x, l) => ({ u_matrix: x, u_world: l }), gl = (x, l, h, g, b) => o.extend(Br(x, l, h, g), { u_world: b }), Bc = (x, l, h, g) => { const b = x.transform; let E, D; if (g.paint.get("circle-pitch-alignment") === "map") { const $ = zt(h, 1, b.zoom); E = !0, D = [$, $] } else E = !1, D = b.pixelsToGLUnits; return { u_camera_to_center_distance: b.cameraToCenterDistance, u_scale_with_map: +(g.paint.get("circle-pitch-scale") === "map"), u_matrix: x.translatePosMatrix(l.posMatrix, h, g.paint.get("circle-translate"), g.paint.get("circle-translate-anchor")), u_pitch_with_map: +E, u_device_pixel_ratio: x.pixelRatio, u_extrude_scale: D } }, Ea = (x, l, h) => { const g = zt(h, 1, l.zoom), b = Math.pow(2, l.zoom - h.tileID.overscaledZ), E = h.tileID.overscaleFactor(); return { u_matrix: x, u_camera_to_center_distance: l.cameraToCenterDistance, u_pixels_to_tile_units: g, u_extrude_scale: [l.pixelsToGLUnits[0] / (g * b), l.pixelsToGLUnits[1] / (g * b)], u_overscale_factor: E } }, Bn = (x, l, h = 1) => ({ u_matrix: x, u_color: l, u_overlay: 0, u_overlay_scale: h }), Yn = x => ({ u_matrix: x }), Ar = (x, l, h, g) => ({ u_matrix: x, u_extrude_scale: zt(l, 1, h), u_intensity: g }); function Ei(x, l) { const h = Math.pow(2, l.canonical.z), g = l.canonical.y; return [new o.MercatorCoordinate(0, g / h).toLngLat().lat, new o.MercatorCoordinate(0, (g + 1) / h).toLngLat().lat] } const Xa = (x, l, h, g) => { const b = x.transform; return { u_matrix: Ta(x, l, h, g), u_ratio: 1 / zt(l, 1, b.zoom), u_device_pixel_ratio: x.pixelRatio, u_units_to_pixels: [1 / b.pixelsToGLUnits[0], 1 / b.pixelsToGLUnits[1]] } }, To = (x, l, h, g, b) => o.extend(Xa(x, l, h, b), { u_image: 0, u_image_height: g }), Es = (x, l, h, g, b) => { const E = x.transform, D = xr(l, E); return { u_matrix: Ta(x, l, h, b), u_texsize: l.imageAtlasTexture.size, u_ratio: 1 / zt(l, 1, E.zoom), u_device_pixel_ratio: x.pixelRatio, u_image: 0, u_scale: [D, g.fromScale, g.toScale], u_fade: g.t, u_units_to_pixels: [1 / E.pixelsToGLUnits[0], 1 / E.pixelsToGLUnits[1]] } }, Pa = (x, l, h, g, b, E) => { const D = x.lineAtlas, $ = xr(l, x.transform), U = h.layout.get("line-cap") === "round", W = D.getDash(g.from, U), te = D.getDash(g.to, U), ae = W.width * b.fromScale, fe = te.width * b.toScale; return o.extend(Xa(x, l, h, E), { u_patternscale_a: [$ / ae, -W.height / 2], u_patternscale_b: [$ / fe, -te.height / 2], u_sdfgamma: D.width / (256 * Math.min(ae, fe) * x.pixelRatio) / 2, u_image: 0, u_tex_y_a: W.y, u_tex_y_b: te.y, u_mix: b.t }) }; function xr(x, l) { return 1 / zt(x, 1, l.tileZoom) } function Ta(x, l, h, g) { return x.translatePosMatrix(g ? g.posMatrix : l.tileID.posMatrix, l, h.paint.get("line-translate"), h.paint.get("line-translate-anchor")) } const Lm = (x, l, h, g, b) => { return { u_matrix: x, u_tl_parent: l, u_scale_parent: h, u_buffer_scale: 1, u_fade_t: g.mix, u_opacity: g.opacity * b.paint.get("raster-opacity"), u_image0: 0, u_image1: 1, u_brightness_low: b.paint.get("raster-brightness-min"), u_brightness_high: b.paint.get("raster-brightness-max"), u_saturation_factor: (D = b.paint.get("raster-saturation"), D > 0 ? 1 - 1 / (1.001 - D) : -D), u_contrast_factor: (E = b.paint.get("raster-contrast"), E > 0 ? 1 / (1 - E) : 1 + E), u_spin_weights: zm(b.paint.get("raster-hue-rotate")) }; var E, D }; function zm(x) { x *= Math.PI / 180; const l = Math.sin(x), h = Math.cos(x); return [(2 * h + 1) / 3, (-Math.sqrt(3) * l - h + 1) / 3, (Math.sqrt(3) * l - h + 1) / 3] } const Ff = (x, l, h, g, b, E, D, $, U, W) => { const te = b.transform; return { u_is_size_zoom_constant: +(x === "constant" || x === "source"), u_is_size_feature_constant: +(x === "constant" || x === "camera"), u_size_t: l ? l.uSizeT : 0, u_size: l ? l.uSize : 0, u_camera_to_center_distance: te.cameraToCenterDistance, u_pitch: te.pitch / 360 * 2 * Math.PI, u_rotate_symbol: +h, u_aspect_ratio: te.width / te.height, u_fade_change: b.options.fadeDuration ? b.symbolFadeChange : 1, u_matrix: E, u_label_plane_matrix: D, u_coord_matrix: $, u_is_text: +U, u_pitch_with_map: +g, u_texsize: W, u_texture: 0 } }, Vc = (x, l, h, g, b, E, D, $, U, W, te) => { const ae = b.transform; return o.extend(Ff(x, l, h, g, b, E, D, $, U, W), { u_gamma_scale: g ? Math.cos(ae._pitch) * ae.cameraToCenterDistance : 1, u_device_pixel_ratio: b.pixelRatio, u_is_halo: +te }) }, Fm = (x, l, h, g, b, E, D, $, U, W) => o.extend(Vc(x, l, h, g, b, E, D, $, !0, U, !0), { u_texsize_icon: W, u_texture_icon: 1 }), Rx = (x, l, h) => ({ u_matrix: x, u_opacity: l, u_color: h }), Mx = (x, l, h, g, b, E) => o.extend(function (D, $, U, W) { const te = U.imageManager.getPattern(D.from.toString()), ae = U.imageManager.getPattern(D.to.toString()), { width: fe, height: Se } = U.imageManager.getPixelSize(), _e = Math.pow(2, W.tileID.overscaledZ), we = W.tileSize * Math.pow(2, U.transform.tileZoom) / _e, Be = we * (W.tileID.canonical.x + W.tileID.wrap * _e), je = we * W.tileID.canonical.y; return { u_image: 0, u_pattern_tl_a: te.tl, u_pattern_br_a: te.br, u_pattern_tl_b: ae.tl, u_pattern_br_b: ae.br, u_texsize: [fe, Se], u_mix: $.t, u_pattern_size_a: te.displaySize, u_pattern_size_b: ae.displaySize, u_scale_a: $.fromScale, u_scale_b: $.toScale, u_tile_units_to_pixels: 1 / zt(W, 1, U.transform.tileZoom), u_pixel_coord_upper: [Be >> 16, je >> 16], u_pixel_coord_lower: [65535 & Be, 65535 & je] } }(g, E, h, b), { u_matrix: x, u_opacity: l }), $f = { fillExtrusion: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_lightpos: new o.Uniform3f(x, l.u_lightpos), u_lightintensity: new o.Uniform1f(x, l.u_lightintensity), u_lightcolor: new o.Uniform3f(x, l.u_lightcolor), u_vertical_gradient: new o.Uniform1f(x, l.u_vertical_gradient), u_opacity: new o.Uniform1f(x, l.u_opacity) }), fillExtrusionPattern: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_lightpos: new o.Uniform3f(x, l.u_lightpos), u_lightintensity: new o.Uniform1f(x, l.u_lightintensity), u_lightcolor: new o.Uniform3f(x, l.u_lightcolor), u_vertical_gradient: new o.Uniform1f(x, l.u_vertical_gradient), u_height_factor: new o.Uniform1f(x, l.u_height_factor), u_image: new o.Uniform1i(x, l.u_image), u_texsize: new o.Uniform2f(x, l.u_texsize), u_pixel_coord_upper: new o.Uniform2f(x, l.u_pixel_coord_upper), u_pixel_coord_lower: new o.Uniform2f(x, l.u_pixel_coord_lower), u_scale: new o.Uniform3f(x, l.u_scale), u_fade: new o.Uniform1f(x, l.u_fade), u_opacity: new o.Uniform1f(x, l.u_opacity) }), fill: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix) }), fillPattern: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_image: new o.Uniform1i(x, l.u_image), u_texsize: new o.Uniform2f(x, l.u_texsize), u_pixel_coord_upper: new o.Uniform2f(x, l.u_pixel_coord_upper), u_pixel_coord_lower: new o.Uniform2f(x, l.u_pixel_coord_lower), u_scale: new o.Uniform3f(x, l.u_scale), u_fade: new o.Uniform1f(x, l.u_fade) }), fillOutline: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_world: new o.Uniform2f(x, l.u_world) }), fillOutlinePattern: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_world: new o.Uniform2f(x, l.u_world), u_image: new o.Uniform1i(x, l.u_image), u_texsize: new o.Uniform2f(x, l.u_texsize), u_pixel_coord_upper: new o.Uniform2f(x, l.u_pixel_coord_upper), u_pixel_coord_lower: new o.Uniform2f(x, l.u_pixel_coord_lower), u_scale: new o.Uniform3f(x, l.u_scale), u_fade: new o.Uniform1f(x, l.u_fade) }), circle: (x, l) => ({ u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_scale_with_map: new o.Uniform1i(x, l.u_scale_with_map), u_pitch_with_map: new o.Uniform1i(x, l.u_pitch_with_map), u_extrude_scale: new o.Uniform2f(x, l.u_extrude_scale), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_matrix: new o.UniformMatrix4f(x, l.u_matrix) }), collisionBox: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_pixels_to_tile_units: new o.Uniform1f(x, l.u_pixels_to_tile_units), u_extrude_scale: new o.Uniform2f(x, l.u_extrude_scale), u_overscale_factor: new o.Uniform1f(x, l.u_overscale_factor) }), collisionCircle: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_inv_matrix: new o.UniformMatrix4f(x, l.u_inv_matrix), u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_viewport_size: new o.Uniform2f(x, l.u_viewport_size) }), debug: (x, l) => ({ u_color: new o.UniformColor(x, l.u_color), u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_overlay: new o.Uniform1i(x, l.u_overlay), u_overlay_scale: new o.Uniform1f(x, l.u_overlay_scale) }), clippingMask: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix) }), heatmap: (x, l) => ({ u_extrude_scale: new o.Uniform1f(x, l.u_extrude_scale), u_intensity: new o.Uniform1f(x, l.u_intensity), u_matrix: new o.UniformMatrix4f(x, l.u_matrix) }), heatmapTexture: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_world: new o.Uniform2f(x, l.u_world), u_image: new o.Uniform1i(x, l.u_image), u_color_ramp: new o.Uniform1i(x, l.u_color_ramp), u_opacity: new o.Uniform1f(x, l.u_opacity) }), hillshade: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_image: new o.Uniform1i(x, l.u_image), u_latrange: new o.Uniform2f(x, l.u_latrange), u_light: new o.Uniform2f(x, l.u_light), u_shadow: new o.UniformColor(x, l.u_shadow), u_highlight: new o.UniformColor(x, l.u_highlight), u_accent: new o.UniformColor(x, l.u_accent) }), hillshadePrepare: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_image: new o.Uniform1i(x, l.u_image), u_dimension: new o.Uniform2f(x, l.u_dimension), u_zoom: new o.Uniform1f(x, l.u_zoom), u_unpack: new o.Uniform4f(x, l.u_unpack) }), line: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_ratio: new o.Uniform1f(x, l.u_ratio), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_units_to_pixels: new o.Uniform2f(x, l.u_units_to_pixels) }), lineGradient: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_ratio: new o.Uniform1f(x, l.u_ratio), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_units_to_pixels: new o.Uniform2f(x, l.u_units_to_pixels), u_image: new o.Uniform1i(x, l.u_image), u_image_height: new o.Uniform1f(x, l.u_image_height) }), linePattern: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_texsize: new o.Uniform2f(x, l.u_texsize), u_ratio: new o.Uniform1f(x, l.u_ratio), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_image: new o.Uniform1i(x, l.u_image), u_units_to_pixels: new o.Uniform2f(x, l.u_units_to_pixels), u_scale: new o.Uniform3f(x, l.u_scale), u_fade: new o.Uniform1f(x, l.u_fade) }), lineSDF: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_ratio: new o.Uniform1f(x, l.u_ratio), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_units_to_pixels: new o.Uniform2f(x, l.u_units_to_pixels), u_patternscale_a: new o.Uniform2f(x, l.u_patternscale_a), u_patternscale_b: new o.Uniform2f(x, l.u_patternscale_b), u_sdfgamma: new o.Uniform1f(x, l.u_sdfgamma), u_image: new o.Uniform1i(x, l.u_image), u_tex_y_a: new o.Uniform1f(x, l.u_tex_y_a), u_tex_y_b: new o.Uniform1f(x, l.u_tex_y_b), u_mix: new o.Uniform1f(x, l.u_mix) }), raster: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_tl_parent: new o.Uniform2f(x, l.u_tl_parent), u_scale_parent: new o.Uniform1f(x, l.u_scale_parent), u_buffer_scale: new o.Uniform1f(x, l.u_buffer_scale), u_fade_t: new o.Uniform1f(x, l.u_fade_t), u_opacity: new o.Uniform1f(x, l.u_opacity), u_image0: new o.Uniform1i(x, l.u_image0), u_image1: new o.Uniform1i(x, l.u_image1), u_brightness_low: new o.Uniform1f(x, l.u_brightness_low), u_brightness_high: new o.Uniform1f(x, l.u_brightness_high), u_saturation_factor: new o.Uniform1f(x, l.u_saturation_factor), u_contrast_factor: new o.Uniform1f(x, l.u_contrast_factor), u_spin_weights: new o.Uniform3f(x, l.u_spin_weights) }), symbolIcon: (x, l) => ({ u_is_size_zoom_constant: new o.Uniform1i(x, l.u_is_size_zoom_constant), u_is_size_feature_constant: new o.Uniform1i(x, l.u_is_size_feature_constant), u_size_t: new o.Uniform1f(x, l.u_size_t), u_size: new o.Uniform1f(x, l.u_size), u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_pitch: new o.Uniform1f(x, l.u_pitch), u_rotate_symbol: new o.Uniform1i(x, l.u_rotate_symbol), u_aspect_ratio: new o.Uniform1f(x, l.u_aspect_ratio), u_fade_change: new o.Uniform1f(x, l.u_fade_change), u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_label_plane_matrix: new o.UniformMatrix4f(x, l.u_label_plane_matrix), u_coord_matrix: new o.UniformMatrix4f(x, l.u_coord_matrix), u_is_text: new o.Uniform1i(x, l.u_is_text), u_pitch_with_map: new o.Uniform1i(x, l.u_pitch_with_map), u_texsize: new o.Uniform2f(x, l.u_texsize), u_texture: new o.Uniform1i(x, l.u_texture) }), symbolSDF: (x, l) => ({ u_is_size_zoom_constant: new o.Uniform1i(x, l.u_is_size_zoom_constant), u_is_size_feature_constant: new o.Uniform1i(x, l.u_is_size_feature_constant), u_size_t: new o.Uniform1f(x, l.u_size_t), u_size: new o.Uniform1f(x, l.u_size), u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_pitch: new o.Uniform1f(x, l.u_pitch), u_rotate_symbol: new o.Uniform1i(x, l.u_rotate_symbol), u_aspect_ratio: new o.Uniform1f(x, l.u_aspect_ratio), u_fade_change: new o.Uniform1f(x, l.u_fade_change), u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_label_plane_matrix: new o.UniformMatrix4f(x, l.u_label_plane_matrix), u_coord_matrix: new o.UniformMatrix4f(x, l.u_coord_matrix), u_is_text: new o.Uniform1i(x, l.u_is_text), u_pitch_with_map: new o.Uniform1i(x, l.u_pitch_with_map), u_texsize: new o.Uniform2f(x, l.u_texsize), u_texture: new o.Uniform1i(x, l.u_texture), u_gamma_scale: new o.Uniform1f(x, l.u_gamma_scale), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_is_halo: new o.Uniform1i(x, l.u_is_halo) }), symbolTextAndIcon: (x, l) => ({ u_is_size_zoom_constant: new o.Uniform1i(x, l.u_is_size_zoom_constant), u_is_size_feature_constant: new o.Uniform1i(x, l.u_is_size_feature_constant), u_size_t: new o.Uniform1f(x, l.u_size_t), u_size: new o.Uniform1f(x, l.u_size), u_camera_to_center_distance: new o.Uniform1f(x, l.u_camera_to_center_distance), u_pitch: new o.Uniform1f(x, l.u_pitch), u_rotate_symbol: new o.Uniform1i(x, l.u_rotate_symbol), u_aspect_ratio: new o.Uniform1f(x, l.u_aspect_ratio), u_fade_change: new o.Uniform1f(x, l.u_fade_change), u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_label_plane_matrix: new o.UniformMatrix4f(x, l.u_label_plane_matrix), u_coord_matrix: new o.UniformMatrix4f(x, l.u_coord_matrix), u_is_text: new o.Uniform1i(x, l.u_is_text), u_pitch_with_map: new o.Uniform1i(x, l.u_pitch_with_map), u_texsize: new o.Uniform2f(x, l.u_texsize), u_texsize_icon: new o.Uniform2f(x, l.u_texsize_icon), u_texture: new o.Uniform1i(x, l.u_texture), u_texture_icon: new o.Uniform1i(x, l.u_texture_icon), u_gamma_scale: new o.Uniform1f(x, l.u_gamma_scale), u_device_pixel_ratio: new o.Uniform1f(x, l.u_device_pixel_ratio), u_is_halo: new o.Uniform1i(x, l.u_is_halo) }), background: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_opacity: new o.Uniform1f(x, l.u_opacity), u_color: new o.UniformColor(x, l.u_color) }), backgroundPattern: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_opacity: new o.Uniform1f(x, l.u_opacity), u_image: new o.Uniform1i(x, l.u_image), u_pattern_tl_a: new o.Uniform2f(x, l.u_pattern_tl_a), u_pattern_br_a: new o.Uniform2f(x, l.u_pattern_br_a), u_pattern_tl_b: new o.Uniform2f(x, l.u_pattern_tl_b), u_pattern_br_b: new o.Uniform2f(x, l.u_pattern_br_b), u_texsize: new o.Uniform2f(x, l.u_texsize), u_mix: new o.Uniform1f(x, l.u_mix), u_pattern_size_a: new o.Uniform2f(x, l.u_pattern_size_a), u_pattern_size_b: new o.Uniform2f(x, l.u_pattern_size_b), u_scale_a: new o.Uniform1f(x, l.u_scale_a), u_scale_b: new o.Uniform1f(x, l.u_scale_b), u_pixel_coord_upper: new o.Uniform2f(x, l.u_pixel_coord_upper), u_pixel_coord_lower: new o.Uniform2f(x, l.u_pixel_coord_lower), u_tile_units_to_pixels: new o.Uniform1f(x, l.u_tile_units_to_pixels) }), terrain: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_texture: new o.Uniform1i(x, l.u_texture) }), terrainDepth: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix) }), terrainCoords: (x, l) => ({ u_matrix: new o.UniformMatrix4f(x, l.u_matrix), u_texture: new o.Uniform1i(x, l.u_texture), u_terrain_coords_id: new o.Uniform1f(x, l.u_terrain_coords_id) }) }; class Bf { constructor(l, h, g) { this.context = l; const b = l.gl; this.buffer = b.createBuffer(), this.dynamicDraw = Boolean(g), this.context.unbindVAO(), l.bindElementBuffer.set(this.buffer), b.bufferData(b.ELEMENT_ARRAY_BUFFER, h.arrayBuffer, this.dynamicDraw ? b.DYNAMIC_DRAW : b.STATIC_DRAW), this.dynamicDraw || delete h.arrayBuffer } bind() { this.context.bindElementBuffer.set(this.buffer) } updateData(l) { const h = this.context.gl; if (!this.dynamicDraw) throw new Error("Attempted to update data while not in dynamic mode."); this.context.unbindVAO(), this.bind(), h.bufferSubData(h.ELEMENT_ARRAY_BUFFER, 0, l.arrayBuffer) } destroy() { this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer) } } const Vf = { Int8: "BYTE", Uint8: "UNSIGNED_BYTE", Int16: "SHORT", Uint16: "UNSIGNED_SHORT", Int32: "INT", Uint32: "UNSIGNED_INT", Float32: "FLOAT" }; class Uf { constructor(l, h, g, b) { this.length = h.length, this.attributes = g, this.itemSize = h.bytesPerElement, this.dynamicDraw = b, this.context = l; const E = l.gl; this.buffer = E.createBuffer(), l.bindVertexBuffer.set(this.buffer), E.bufferData(E.ARRAY_BUFFER, h.arrayBuffer, this.dynamicDraw ? E.DYNAMIC_DRAW : E.STATIC_DRAW), this.dynamicDraw || delete h.arrayBuffer } bind() { this.context.bindVertexBuffer.set(this.buffer) } updateData(l) { if (l.length !== this.length) throw new Error(`Length of new data is ${l.length}, which doesn't match current length of ${this.length}`); const h = this.context.gl; this.bind(), h.bufferSubData(h.ARRAY_BUFFER, 0, l.arrayBuffer) } enableAttributes(l, h) { for (let g = 0; g < this.attributes.length; g++) { const b = h.attributes[this.attributes[g].name]; b !== void 0 && l.enableVertexAttribArray(b) } } setVertexAttribPointers(l, h, g) { for (let b = 0; b < this.attributes.length; b++) { const E = this.attributes[b], D = h.attributes[E.name]; D !== void 0 && l.vertexAttribPointer(D, E.components, l[Vf[E.type]], !1, this.itemSize, E.offset + this.itemSize * (g || 0)) } } destroy() { this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer) } } class lr { constructor(l) { this.gl = l.gl, this.default = this.getDefault(), this.current = this.default, this.dirty = !1 } get() { return this.current } set(l) { } getDefault() { return this.default } setDefault() { this.set(this.default) } } class $m extends lr { getDefault() { return o.Color.transparent } set(l) { const h = this.current; (l.r !== h.r || l.g !== h.g || l.b !== h.b || l.a !== h.a || this.dirty) && (this.gl.clearColor(l.r, l.g, l.b, l.a), this.current = l, this.dirty = !1) } } class Ax extends lr { getDefault() { return 1 } set(l) { (l !== this.current || this.dirty) && (this.gl.clearDepth(l), this.current = l, this.dirty = !1) } } class bu extends lr { getDefault() { return 0 } set(l) { (l !== this.current || this.dirty) && (this.gl.clearStencil(l), this.current = l, this.dirty = !1) } } class wu extends lr { getDefault() { return [!0, !0, !0, !0] } set(l) { const h = this.current; (l[0] !== h[0] || l[1] !== h[1] || l[2] !== h[2] || l[3] !== h[3] || this.dirty) && (this.gl.colorMask(l[0], l[1], l[2], l[3]), this.current = l, this.dirty = !1) } } class Bm extends lr { getDefault() { return !0 } set(l) { (l !== this.current || this.dirty) && (this.gl.depthMask(l), this.current = l, this.dirty = !1) } } class lo extends lr { getDefault() { return 255 } set(l) { (l !== this.current || this.dirty) && (this.gl.stencilMask(l), this.current = l, this.dirty = !1) } } class jf extends lr { getDefault() { return { func: this.gl.ALWAYS, ref: 0, mask: 255 } } set(l) { const h = this.current; (l.func !== h.func || l.ref !== h.ref || l.mask !== h.mask || this.dirty) && (this.gl.stencilFunc(l.func, l.ref, l.mask), this.current = l, this.dirty = !1) } } class Uc extends lr { getDefault() { const l = this.gl; return [l.KEEP, l.KEEP, l.KEEP] } set(l) { const h = this.current; (l[0] !== h[0] || l[1] !== h[1] || l[2] !== h[2] || this.dirty) && (this.gl.stencilOp(l[0], l[1], l[2]), this.current = l, this.dirty = !1) } } class jc extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; l ? h.enable(h.STENCIL_TEST) : h.disable(h.STENCIL_TEST), this.current = l, this.dirty = !1 } } class Kf extends lr { getDefault() { return [0, 1] } set(l) { const h = this.current; (l[0] !== h[0] || l[1] !== h[1] || this.dirty) && (this.gl.depthRange(l[0], l[1]), this.current = l, this.dirty = !1) } } class Hf extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; l ? h.enable(h.DEPTH_TEST) : h.disable(h.DEPTH_TEST), this.current = l, this.dirty = !1 } } class Kc extends lr { getDefault() { return this.gl.LESS } set(l) { (l !== this.current || this.dirty) && (this.gl.depthFunc(l), this.current = l, this.dirty = !1) } } class Wf extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; l ? h.enable(h.BLEND) : h.disable(h.BLEND), this.current = l, this.dirty = !1 } } class Gf extends lr { getDefault() { const l = this.gl; return [l.ONE, l.ZERO] } set(l) { const h = this.current; (l[0] !== h[0] || l[1] !== h[1] || this.dirty) && (this.gl.blendFunc(l[0], l[1]), this.current = l, this.dirty = !1) } } class Hc extends lr { getDefault() { return o.Color.transparent } set(l) { const h = this.current; (l.r !== h.r || l.g !== h.g || l.b !== h.b || l.a !== h.a || this.dirty) && (this.gl.blendColor(l.r, l.g, l.b, l.a), this.current = l, this.dirty = !1) } } class Vm extends lr { getDefault() { return this.gl.FUNC_ADD } set(l) { (l !== this.current || this.dirty) && (this.gl.blendEquation(l), this.current = l, this.dirty = !1) } } class Um extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; l ? h.enable(h.CULL_FACE) : h.disable(h.CULL_FACE), this.current = l, this.dirty = !1 } } class yl extends lr { getDefault() { return this.gl.BACK } set(l) { (l !== this.current || this.dirty) && (this.gl.cullFace(l), this.current = l, this.dirty = !1) } } class Nx extends lr { getDefault() { return this.gl.CCW } set(l) { (l !== this.current || this.dirty) && (this.gl.frontFace(l), this.current = l, this.dirty = !1) } } class Ox extends lr { getDefault() { return null } set(l) { (l !== this.current || this.dirty) && (this.gl.useProgram(l), this.current = l, this.dirty = !1) } } class Dx extends lr { getDefault() { return this.gl.TEXTURE0 } set(l) { (l !== this.current || this.dirty) && (this.gl.activeTexture(l), this.current = l, this.dirty = !1) } } class Lx extends lr { getDefault() { const l = this.gl; return [0, 0, l.drawingBufferWidth, l.drawingBufferHeight] } set(l) { const h = this.current; (l[0] !== h[0] || l[1] !== h[1] || l[2] !== h[2] || l[3] !== h[3] || this.dirty) && (this.gl.viewport(l[0], l[1], l[2], l[3]), this.current = l, this.dirty = !1) } } class zx extends lr { getDefault() { return null } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.bindFramebuffer(h.FRAMEBUFFER, l), this.current = l, this.dirty = !1 } } class Fx extends lr { getDefault() { return null } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.bindRenderbuffer(h.RENDERBUFFER, l), this.current = l, this.dirty = !1 } } class qf extends lr { getDefault() { return null } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.bindTexture(h.TEXTURE_2D, l), this.current = l, this.dirty = !1 } } class Wc extends lr { getDefault() { return null } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.bindBuffer(h.ARRAY_BUFFER, l), this.current = l, this.dirty = !1 } } class Zf extends lr { getDefault() { return null } set(l) { const h = this.gl; h.bindBuffer(h.ELEMENT_ARRAY_BUFFER, l), this.current = l, this.dirty = !1 } } class Xf extends lr { constructor(l) { super(l), this.vao = l.extVertexArrayObject } getDefault() { return null } set(l) { this.vao && (l !== this.current || this.dirty) && (this.vao.bindVertexArrayOES(l), this.current = l, this.dirty = !1) } } class xl extends lr { getDefault() { return 4 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.pixelStorei(h.UNPACK_ALIGNMENT, l), this.current = l, this.dirty = !1 } } class jm extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL, l), this.current = l, this.dirty = !1 } } class Km extends lr { getDefault() { return !1 } set(l) { if (l === this.current && !this.dirty) return; const h = this.gl; h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL, l), this.current = l, this.dirty = !1 } } class Gc extends lr { constructor(l, h) { super(l), this.context = l, this.parent = h } getDefault() { return null } } class Ps extends Gc { setDirty() { this.dirty = !0 } set(l) { if (l === this.current && !this.dirty) return; this.context.bindFramebuffer.set(this.parent); const h = this.gl; h.framebufferTexture2D(h.FRAMEBUFFER, h.COLOR_ATTACHMENT0, h.TEXTURE_2D, l, 0), this.current = l, this.dirty = !1 } } class Hm extends Gc { set(l) { if (l === this.current && !this.dirty) return; this.context.bindFramebuffer.set(this.parent); const h = this.gl; h.framebufferRenderbuffer(h.FRAMEBUFFER, h.DEPTH_ATTACHMENT, h.RENDERBUFFER, l), this.current = l, this.dirty = !1 } } class _l { constructor(l, h, g, b) { this.context = l, this.width = h, this.height = g; const E = l.gl, D = this.framebuffer = E.createFramebuffer(); if (this.colorAttachment = new Ps(l, D), b && (this.depthAttachment = new Hm(l, D)), E.checkFramebufferStatus(E.FRAMEBUFFER) !== E.FRAMEBUFFER_COMPLETE) throw new Error("Framebuffer is not complete") } destroy() { const l = this.context.gl, h = this.colorAttachment.get(); if (h && l.deleteTexture(h), this.depthAttachment) { const g = this.depthAttachment.get(); g && l.deleteRenderbuffer(g) } l.deleteFramebuffer(this.framebuffer) } } class Tr { constructor(l, h, g) { this.blendFunction = l, this.blendColor = h, this.mask = g } } Tr.Replace = [1, 0], Tr.disabled = new Tr(Tr.Replace, o.Color.transparent, [!1, !1, !1, !1]), Tr.unblended = new Tr(Tr.Replace, o.Color.transparent, [!0, !0, !0, !0]), Tr.alphaBlended = new Tr([1, 771], o.Color.transparent, [!0, !0, !0, !0]); class Wm { constructor(l) { this.gl = l, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new $m(this), this.clearDepth = new Ax(this), this.clearStencil = new bu(this), this.colorMask = new wu(this), this.depthMask = new Bm(this), this.stencilMask = new lo(this), this.stencilFunc = new jf(this), this.stencilOp = new Uc(this), this.stencilTest = new jc(this), this.depthRange = new Kf(this), this.depthTest = new Hf(this), this.depthFunc = new Kc(this), this.blend = new Wf(this), this.blendFunc = new Gf(this), this.blendColor = new Hc(this), this.blendEquation = new Vm(this), this.cullFace = new Um(this), this.cullFaceSide = new yl(this), this.frontFace = new Nx(this), this.program = new Ox(this), this.activeTexture = new Dx(this), this.viewport = new Lx(this), this.bindFramebuffer = new zx(this), this.bindRenderbuffer = new Fx(this), this.bindTexture = new qf(this), this.bindVertexBuffer = new Wc(this), this.bindElementBuffer = new Zf(this), this.bindVertexArrayOES = this.extVertexArrayObject && new Xf(this), this.pixelStoreUnpack = new xl(this), this.pixelStoreUnpackPremultiplyAlpha = new jm(this), this.pixelStoreUnpackFlipY = new Km(this), this.extTextureFilterAnisotropic = l.getExtension("EXT_texture_filter_anisotropic") || l.getExtension("MOZ_EXT_texture_filter_anisotropic") || l.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = l.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureHalfFloat = l.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (l.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = l.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = l.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = l.getParameter(l.MAX_TEXTURE_SIZE) } setDefault() { this.unbindVAO(), this.clearColor.setDefault(), this.clearDepth.setDefault(), this.clearStencil.setDefault(), this.colorMask.setDefault(), this.depthMask.setDefault(), this.stencilMask.setDefault(), this.stencilFunc.setDefault(), this.stencilOp.setDefault(), this.stencilTest.setDefault(), this.depthRange.setDefault(), this.depthTest.setDefault(), this.depthFunc.setDefault(), this.blend.setDefault(), this.blendFunc.setDefault(), this.blendColor.setDefault(), this.blendEquation.setDefault(), this.cullFace.setDefault(), this.cullFaceSide.setDefault(), this.frontFace.setDefault(), this.program.setDefault(), this.activeTexture.setDefault(), this.bindFramebuffer.setDefault(), this.pixelStoreUnpack.setDefault(), this.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.pixelStoreUnpackFlipY.setDefault() } setDirty() { this.clearColor.dirty = !0, this.clearDepth.dirty = !0, this.clearStencil.dirty = !0, this.colorMask.dirty = !0, this.depthMask.dirty = !0, this.stencilMask.dirty = !0, this.stencilFunc.dirty = !0, this.stencilOp.dirty = !0, this.stencilTest.dirty = !0, this.depthRange.dirty = !0, this.depthTest.dirty = !0, this.depthFunc.dirty = !0, this.blend.dirty = !0, this.blendFunc.dirty = !0, this.blendColor.dirty = !0, this.blendEquation.dirty = !0, this.cullFace.dirty = !0, this.cullFaceSide.dirty = !0, this.frontFace.dirty = !0, this.program.dirty = !0, this.activeTexture.dirty = !0, this.viewport.dirty = !0, this.bindFramebuffer.dirty = !0, this.bindRenderbuffer.dirty = !0, this.bindTexture.dirty = !0, this.bindVertexBuffer.dirty = !0, this.bindElementBuffer.dirty = !0, this.extVertexArrayObject && (this.bindVertexArrayOES.dirty = !0), this.pixelStoreUnpack.dirty = !0, this.pixelStoreUnpackPremultiplyAlpha.dirty = !0, this.pixelStoreUnpackFlipY.dirty = !0 } createIndexBuffer(l, h) { return new Bf(this, l, h) } createVertexBuffer(l, h, g) { return new Uf(this, l, h, g) } createRenderbuffer(l, h, g) { const b = this.gl, E = b.createRenderbuffer(); return this.bindRenderbuffer.set(E), b.renderbufferStorage(b.RENDERBUFFER, l, h, g), this.bindRenderbuffer.set(null), E } createFramebuffer(l, h, g) { return new _l(this, l, h, g) } clear({ color: l, depth: h }) { const g = this.gl; let b = 0; l && (b |= g.COLOR_BUFFER_BIT, this.clearColor.set(l), this.colorMask.set([!0, !0, !0, !0])), h !== void 0 && (b |= g.DEPTH_BUFFER_BIT, this.depthRange.set([0, 1]), this.clearDepth.set(h), this.depthMask.set(!0)), g.clear(b) } setCullFace(l) { l.enable === !1 ? this.cullFace.set(!1) : (this.cullFace.set(!0), this.cullFaceSide.set(l.mode), this.frontFace.set(l.frontFace)) } setDepthMode(l) { l.func !== this.gl.ALWAYS || l.mask ? (this.depthTest.set(!0), this.depthFunc.set(l.func), this.depthMask.set(l.mask), this.depthRange.set(l.range)) : this.depthTest.set(!1) } setStencilMode(l) { l.test.func !== this.gl.ALWAYS || l.mask ? (this.stencilTest.set(!0), this.stencilMask.set(l.mask), this.stencilOp.set([l.fail, l.depthFail, l.pass]), this.stencilFunc.set({ func: l.test.func, ref: l.ref, mask: l.test.mask })) : this.stencilTest.set(!1) } setColorMode(l) { y(l.blendFunction, Tr.Replace) ? this.blend.set(!1) : (this.blend.set(!0), this.blendFunc.set(l.blendFunction), this.blendColor.set(l.blendColor)), this.colorMask.set(l.mask) } unbindVAO() { this.extVertexArrayObject && this.bindVertexArrayOES.set(null) } } class Qn { constructor(l, h, g) { this.func = l, this.mask = h, this.range = g } } Qn.ReadOnly = !1, Qn.ReadWrite = !0, Qn.disabled = new Qn(519, Qn.ReadOnly, [0, 1]); const ur = 7680; class Sr { constructor(l, h, g, b, E, D) { this.test = l, this.ref = h, this.mask = g, this.fail = b, this.depthFail = E, this.pass = D } } Sr.disabled = new Sr({ func: 519, mask: 0 }, 0, 0, ur, ur, ur); class Nr { constructor(l, h, g) { this.enable = l, this.mode = h, this.frontFace = g } } let Cu; function bl(x, l, h, g, b, E, D) { const $ = x.context, U = $.gl, W = x.useProgram("collisionBox"), te = []; let ae = 0, fe = 0; for (let Me = 0; Me < g.length; Me++) { const at = g[Me], nt = l.getTile(at), xt = nt.getBucket(h); if (!xt) continue; let _t = at.posMatrix; b[0] === 0 && b[1] === 0 || (_t = x.translatePosMatrix(at.posMatrix, nt, b, E)); const Ft = D ? xt.textCollisionBox : xt.iconCollisionBox, vt = xt.collisionCircleArray; if (vt.length > 0) { const sn = o.create(), Yt = _t; o.mul(sn, xt.placementInvProjMatrix, x.transform.glCoordMatrix), o.mul(sn, sn, xt.placementViewportMatrix), te.push({ circleArray: vt, circleOffset: fe, transform: Yt, invTransform: sn, coord: at }), ae += vt.length / 4, fe = ae } Ft && W.draw($, U.LINES, Qn.disabled, Sr.disabled, x.colorModeForRenderPass(), Nr.disabled, Ea(_t, x.transform, nt), x.style.terrain && x.style.terrain.getTerrainData(at), h.id, Ft.layoutVertexBuffer, Ft.indexBuffer, Ft.segments, null, x.transform.zoom, null, null, Ft.collisionVertexBuffer) } if (!D || !te.length) return; const Se = x.useProgram("collisionCircle"), _e = new o.CollisionCircleLayoutArray; _e.resize(4 * ae), _e._trim(); let we = 0; for (const Me of te) for (let at = 0; at < Me.circleArray.length / 4; at++) { const nt = 4 * at, xt = Me.circleArray[nt + 0], _t = Me.circleArray[nt + 1], Ft = Me.circleArray[nt + 2], vt = Me.circleArray[nt + 3]; _e.emplace(we++, xt, _t, Ft, vt, 0), _e.emplace(we++, xt, _t, Ft, vt, 1), _e.emplace(we++, xt, _t, Ft, vt, 2), _e.emplace(we++, xt, _t, Ft, vt, 3) } (!Cu || Cu.length < 2 * ae) && (Cu = function (Me) { const at = 2 * Me, nt = new o.QuadTriangleArray; nt.resize(at), nt._trim(); for (let xt = 0; xt < at; xt++) { const _t = 6 * xt; nt.uint16[_t + 0] = 4 * xt + 0, nt.uint16[_t + 1] = 4 * xt + 1, nt.uint16[_t + 2] = 4 * xt + 2, nt.uint16[_t + 3] = 4 * xt + 2, nt.uint16[_t + 4] = 4 * xt + 3, nt.uint16[_t + 5] = 4 * xt + 0 } return nt }(ae)); const Be = $.createIndexBuffer(Cu, !0), je = $.createVertexBuffer(_e, o.collisionCircleLayout.members, !0); for (const Me of te) { const at = { u_matrix: Me.transform, u_inv_matrix: Me.invTransform, u_camera_to_center_distance: (et = x.transform).cameraToCenterDistance, u_viewport_size: [et.width, et.height] }; Se.draw($, U.TRIANGLES, Qn.disabled, Sr.disabled, x.colorModeForRenderPass(), Nr.disabled, at, x.style.terrain && x.style.terrain.getTerrainData(Me.coord), h.id, je, Be, o.SegmentVector.simpleSegment(0, 2 * Me.circleOffset, Me.circleArray.length, Me.circleArray.length / 2), null, x.transform.zoom, null, null, null) } var et; je.destroy(), Be.destroy() } Nr.disabled = new Nr(!1, 1029, 2305), Nr.backCCW = new Nr(!0, 1029, 2305); const $x = o.identity(new Float32Array(16)); function Bx(x, l, h, g, b, E) { const { horizontalAlign: D, verticalAlign: $ } = o.getAnchorAlignment(x), U = -(D - .5) * l, W = -($ - .5) * h, te = o.evaluateVariableOffset(x, g); return new o.pointGeometry((U / b + te[0]) * E, (W / b + te[1]) * E) } function Gm(x, l, h, g, b, E, D, $, U, W, te) { const ae = x.text.placedSymbolArray, fe = x.text.dynamicLayoutVertexArray, Se = x.icon.dynamicLayoutVertexArray, _e = {}; fe.clear(); for (let we = 0; we < ae.length; we++) { const Be = ae.get(we), je = x.allowVerticalPlacement && !Be.placedOrientation, et = Be.hidden || !Be.crossTileID || je ? null : g[Be.crossTileID]; if (et) { const Me = new o.pointGeometry(Be.anchorX, Be.anchorY), at = jt(Me, h ? D : E, te), nt = Kt(b.cameraToCenterDistance, at.signedDistanceFromCamera); let xt = o.evaluateSizeForFeature(x.textSizeData, U, Be) * nt / o.ONE_EM; h && (xt *= x.tilePixelRatio / $); const { width: _t, height: Ft, anchor: vt, textOffset: sn, textBoxScale: Yt } = et, fn = Bx(vt, _t, Ft, sn, Yt, xt), Fn = h ? jt(Me.add(fn), E, te).point : at.point.add(l ? fn.rotate(-b.angle) : fn), Un = x.allowVerticalPlacement && Be.placedOrientation === o.WritingMode.vertical ? Math.PI / 2 : 0; for (let Pn = 0; Pn < Be.numGlyphs; Pn++)o.addDynamicAttributes(fe, Fn, Un); W && Be.associatedIconIndex >= 0 && (_e[Be.associatedIconIndex] = { shiftedAnchor: Fn, angle: Un }) } else gt(Be.numGlyphs, fe) } if (W) { Se.clear(); const we = x.icon.placedSymbolArray; for (let Be = 0; Be < we.length; Be++) { const je = we.get(Be); if (je.hidden) gt(je.numGlyphs, Se); else { const et = _e[Be]; if (et) for (let Me = 0; Me < je.numGlyphs; Me++)o.addDynamicAttributes(Se, et.shiftedAnchor, et.angle); else gt(je.numGlyphs, Se) } } x.icon.dynamicLayoutVertexBuffer.updateData(Se) } x.text.dynamicLayoutVertexBuffer.updateData(fe) } function Vx(x, l, h) { return h.iconsInText && l ? "symbolTextAndIcon" : x ? "symbolSDF" : "symbolIcon" } function qc(x, l, h, g, b, E, D, $, U, W, te, ae) { const fe = x.context, Se = fe.gl, _e = x.transform, we = $ === "map", Be = U === "map", je = $ !== "viewport" && h.layout.get("symbol-placement") !== "point", et = we && !Be && !je, Me = !h.layout.get("symbol-sort-key").isConstant(); let at = !1; const nt = x.depthModeForSublayer(0, Qn.ReadOnly), xt = h.layout.get("text-variable-anchor"), _t = []; for (const Ft of g) { const vt = l.getTile(Ft), sn = vt.getBucket(h); if (!sn) continue; const Yt = b ? sn.text : sn.icon; if (!Yt || !Yt.segments.get().length) continue; const fn = Yt.programConfigurations.get(h.id), Fn = b || sn.sdfIcons, Un = b ? sn.textSizeData : sn.iconSizeData, Pn = Be || _e.pitch !== 0, fr = x.useProgram(Vx(Fn, b, sn), fn), hr = o.evaluateSizeForZoom(Un, _e.zoom), er = x.style.terrain && x.style.terrain.getTerrainData(Ft); let ir, vr, gi, sa, Vo = [0, 0], la = null; if (b) { if (vr = vt.glyphAtlasTexture, gi = Se.LINEAR, ir = vt.glyphAtlasTexture.size, sn.iconsInText) { Vo = vt.imageAtlasTexture.size, la = vt.imageAtlasTexture; const Ro = Un.kind === "composite" || Un.kind === "camera"; sa = Pn || x.options.rotating || x.options.zooming || Ro ? Se.LINEAR : Se.NEAREST } } else { const Ro = h.layout.get("icon-size").constantOr(0) !== 1 || sn.iconsNeedLinear; vr = vt.imageAtlasTexture, gi = Fn || x.options.rotating || x.options.zooming || Ro || Pn ? Se.LINEAR : Se.NEAREST, ir = vt.imageAtlasTexture.size } const rs = zt(vt, 1, x.transform.zoom), Io = Zt(Ft.posMatrix, Be, we, x.transform, rs), Yi = cn(Ft.posMatrix, Be, we, x.transform, rs), Ra = xt && sn.hasTextData(), nd = h.layout.get("icon-text-fit") !== "none" && Ra && sn.hasIconData(); if (je) { const Ro = x.style.terrain ? (dh, Tl) => x.style.terrain.getElevation(Ft, dh, Tl) : null, Rs = h.layout.get("text-rotation-alignment") === "map"; Cn(sn, Ft.posMatrix, x, b, Io, Yi, Be, W, Rs, Ro) } const di = x.translatePosMatrix(Ft.posMatrix, vt, E, D), Wn = je || b && xt || nd ? $x : Io, dr = x.translatePosMatrix(Yi, vt, E, D, !0), yi = Fn && h.paint.get(b ? "text-halo-width" : "icon-halo-width").constantOr(1) !== 0; let xi; xi = Fn ? sn.iconsInText ? Fm(Un.kind, hr, et, Be, x, di, Wn, dr, ir, Vo) : Vc(Un.kind, hr, et, Be, x, di, Wn, dr, b, ir, !0) : Ff(Un.kind, hr, et, Be, x, di, Wn, dr, b, ir); const Dr = { program: fr, buffers: Yt, uniformValues: xi, atlasTexture: vr, atlasTextureIcon: la, atlasInterpolation: gi, atlasInterpolationIcon: sa, isSDF: Fn, hasHalo: yi }; if (Me && sn.canOverlap) { at = !0; const Ro = Yt.segments.get(); for (const Rs of Ro) _t.push({ segments: new o.SegmentVector([Rs]), sortKey: Rs.sortKey, state: Dr, terrainData: er }) } else _t.push({ segments: Yt.segments, sortKey: 0, state: Dr, terrainData: er }) } at && _t.sort((Ft, vt) => Ft.sortKey - vt.sortKey); for (const Ft of _t) { const vt = Ft.state; if (fe.activeTexture.set(Se.TEXTURE0), vt.atlasTexture.bind(vt.atlasInterpolation, Se.CLAMP_TO_EDGE), vt.atlasTextureIcon && (fe.activeTexture.set(Se.TEXTURE1), vt.atlasTextureIcon && vt.atlasTextureIcon.bind(vt.atlasInterpolationIcon, Se.CLAMP_TO_EDGE)), vt.isSDF) { const sn = vt.uniformValues; vt.hasHalo && (sn.u_is_halo = 1, Su(vt.buffers, Ft.segments, h, x, vt.program, nt, te, ae, sn, Ft.terrainData)), sn.u_is_halo = 0 } Su(vt.buffers, Ft.segments, h, x, vt.program, nt, te, ae, vt.uniformValues, Ft.terrainData) } } function Su(x, l, h, g, b, E, D, $, U, W) { const te = g.context; b.draw(te, te.gl.TRIANGLES, E, D, $, Nr.disabled, U, W, h.id, x.layoutVertexBuffer, x.indexBuffer, l, h.paint, g.transform.zoom, x.programConfigurations.get(h.id), x.dynamicLayoutVertexBuffer, x.opacityVertexBuffer) } function Eu(x, l, h, g, b, E, D) { const $ = x.context.gl, U = h.paint.get("fill-pattern"), W = U && U.constantOr(1), te = h.getCrossfadeParameters(); let ae, fe, Se, _e, we; D ? (fe = W && !h.getPaintProperty("fill-outline-color") ? "fillOutlinePattern" : "fillOutline", ae = $.LINES) : (fe = W ? "fillPattern" : "fill", ae = $.TRIANGLES); for (const Be of g) { const je = l.getTile(Be); if (W && !je.patternsLoaded()) continue; const et = je.getBucket(h); if (!et) continue; const Me = et.programConfigurations.get(h.id), at = x.useProgram(fe, Me), nt = x.style.terrain && x.style.terrain.getTerrainData(Be); W && (x.context.activeTexture.set($.TEXTURE0), je.imageAtlasTexture.bind($.LINEAR, $.CLAMP_TO_EDGE), Me.updatePaintBuffers(te)); const xt = U.constantOr(null); if (xt && je.imageAtlas) { const vt = je.imageAtlas, sn = vt.patternPositions[xt.to.toString()], Yt = vt.patternPositions[xt.from.toString()]; sn && Yt && Me.setConstantPatternPositions(sn, Yt) } const _t = nt ? Be : null, Ft = x.translatePosMatrix(_t ? _t.posMatrix : Be.posMatrix, je, h.paint.get("fill-translate"), h.paint.get("fill-translate-anchor")); if (D) { _e = et.indexBuffer2, we = et.segments2; const vt = [$.drawingBufferWidth, $.drawingBufferHeight]; Se = fe === "fillOutlinePattern" && W ? gl(Ft, x, te, je, vt) : so(Ft, vt) } else _e = et.indexBuffer, we = et.segments, Se = W ? Br(Ft, x, te, je) : Cr(Ft); at.draw(x.context, ae, b, x.stencilModeForClipping(Be), E, Nr.disabled, Se, nt, h.id, et.layoutVertexBuffer, _e, we, h.paint, x.transform.zoom, Me) } } function Pu(x, l, h, g, b, E, D) { const $ = x.context, U = $.gl, W = h.paint.get("fill-extrusion-pattern"), te = W.constantOr(1), ae = h.getCrossfadeParameters(), fe = h.paint.get("fill-extrusion-opacity"); for (const Se of g) { const _e = l.getTile(Se), we = _e.getBucket(h); if (!we) continue; const Be = x.style.terrain && x.style.terrain.getTerrainData(Se), je = we.programConfigurations.get(h.id), et = x.useProgram(te ? "fillExtrusionPattern" : "fillExtrusion", je); te && (x.context.activeTexture.set(U.TEXTURE0), _e.imageAtlasTexture.bind(U.LINEAR, U.CLAMP_TO_EDGE), je.updatePaintBuffers(ae)); const Me = W.constantOr(null); if (Me && _e.imageAtlas) { const _t = _e.imageAtlas, Ft = _t.patternPositions[Me.to.toString()], vt = _t.patternPositions[Me.from.toString()]; Ft && vt && je.setConstantPatternPositions(Ft, vt) } const at = x.translatePosMatrix(Se.posMatrix, _e, h.paint.get("fill-extrusion-translate"), h.paint.get("fill-extrusion-translate-anchor")), nt = h.paint.get("fill-extrusion-vertical-gradient"), xt = te ? br(at, x, nt, fe, Se, ae, _e) : Jn(at, x, nt, fe); et.draw($, $.gl.TRIANGLES, b, E, D, Nr.backCCW, xt, Be, h.id, we.layoutVertexBuffer, we.indexBuffer, we.segments, h.paint, x.transform.zoom, je, x.style.terrain && we.centroidVertexBuffer) } } function Yf(x, l, h, g, b, E, D) { const $ = x.context, U = $.gl, W = h.fbo; if (!W) return; const te = x.useProgram("hillshade"), ae = x.style.terrain && x.style.terrain.getTerrainData(l); $.activeTexture.set(U.TEXTURE0), U.bindTexture(U.TEXTURE_2D, W.colorAttachment.get()), te.draw($, U.TRIANGLES, b, E, D, Nr.disabled, ((fe, Se, _e, we) => { const Be = _e.paint.get("hillshade-shadow-color"), je = _e.paint.get("hillshade-highlight-color"), et = _e.paint.get("hillshade-accent-color"); let Me = _e.paint.get("hillshade-illumination-direction") * (Math.PI / 180); _e.paint.get("hillshade-illumination-anchor") === "viewport" && (Me -= fe.transform.angle); const at = !fe.options.moving; return { u_matrix: we ? we.posMatrix : fe.transform.calculatePosMatrix(Se.tileID.toUnwrapped(), at), u_image: 0, u_latrange: Ei(0, Se.tileID), u_light: [_e.paint.get("hillshade-exaggeration"), Me], u_shadow: Be, u_highlight: je, u_accent: et } })(x, h, g, ae ? l : null), ae, g.id, x.rasterBoundsBuffer, x.quadTriangleIndexBuffer, x.rasterBoundsSegments) } function qm(x, l, h, g, b, E) { const D = x.context, $ = D.gl, U = l.dem; if (U && U.data) { const W = U.dim, te = U.stride, ae = U.getPixels(); if (D.activeTexture.set($.TEXTURE1), D.pixelStoreUnpackPremultiplyAlpha.set(!1), l.demTexture = l.demTexture || x.getTileTexture(te), l.demTexture) { const Se = l.demTexture; Se.update(ae, { premultiply: !1 }), Se.bind($.NEAREST, $.CLAMP_TO_EDGE) } else l.demTexture = new A(D, ae, $.RGBA, { premultiply: !1 }), l.demTexture.bind($.NEAREST, $.CLAMP_TO_EDGE); D.activeTexture.set($.TEXTURE0); let fe = l.fbo; if (!fe) { const Se = new A(D, { width: W, height: W, data: null }, $.RGBA); Se.bind($.LINEAR, $.CLAMP_TO_EDGE), fe = l.fbo = D.createFramebuffer(W, W, !0), fe.colorAttachment.set(Se.texture) } D.bindFramebuffer.set(fe.framebuffer), D.viewport.set([0, 0, W, W]), x.useProgram("hillshadePrepare").draw(D, $.TRIANGLES, g, b, E, Nr.disabled, ((Se, _e) => { const we = _e.stride, Be = o.create(); return o.ortho(Be, 0, o.EXTENT, -o.EXTENT, 0, 0, 1), o.translate(Be, Be, [0, -o.EXTENT, 0]), { u_matrix: Be, u_image: 1, u_dimension: [we, we], u_zoom: Se.overscaledZ, u_unpack: _e.getUnpackVector() } })(l.tileID, U), null, h.id, x.rasterBoundsBuffer, x.quadTriangleIndexBuffer, x.rasterBoundsSegments), l.needsHillshadePrepare = !1 } } function Zc(x, l, h, g, b, E) { const D = g.paint.get("raster-fade-duration"); if (!E && D > 0) { const $ = o.exported.now(), U = ($ - x.timeAdded) / D, W = l ? ($ - l.timeAdded) / D : -1, te = h.getSource(), ae = b.coveringZoomLevel({ tileSize: te.tileSize, roundZoom: te.roundZoom }), fe = !l || Math.abs(l.tileID.overscaledZ - ae) > Math.abs(x.tileID.overscaledZ - ae), Se = fe && x.refreshedUponExpiration ? 1 : o.clamp(fe ? U : 1 - W, 0, 1); return x.refreshedUponExpiration && U >= 1 && (x.refreshedUponExpiration = !1), l ? { opacity: 1, mix: 1 - Se } : { opacity: Se, mix: 0 } } return { opacity: 1, mix: 0 } } const Xc = new o.Color(1, 0, 0, 1), Bo = new o.Color(0, 1, 0, 1), Zm = new o.Color(0, 0, 1, 1), Qf = new o.Color(1, 0, 1, 1), Xm = new o.Color(0, 1, 1, 1); function Ts(x, l, h, g) { wl(x, 0, l + h / 2, x.transform.width, h, g) } function Tu(x, l, h, g) { wl(x, l - h / 2, 0, h, x.transform.height, g) } function wl(x, l, h, g, b, E) { const D = x.context, $ = D.gl; $.enable($.SCISSOR_TEST), $.scissor(l * x.pixelRatio, h * x.pixelRatio, g * x.pixelRatio, b * x.pixelRatio), D.clear({ color: E }), $.disable($.SCISSOR_TEST) } function Ux(x, l, h) { const g = x.context, b = g.gl, E = h.posMatrix, D = x.useProgram("debug"), $ = Qn.disabled, U = Sr.disabled, W = x.colorModeForRenderPass(), te = "$debug", ae = x.style.terrain && x.style.terrain.getTerrainData(h); g.activeTexture.set(b.TEXTURE0), x.emptyTexture.bind(b.LINEAR, b.CLAMP_TO_EDGE); const fe = l.getTileByID(h.key).latestRawTileData, Se = Math.floor((fe && fe.byteLength || 0) / 1024), _e = l.getTile(h).tileSize, we = 512 / Math.min(_e, 512) * (h.overscaledZ / x.transform.zoom) * .5; let Be = h.canonical.toString(); h.overscaledZ !== h.canonical.z && (Be += ` => ${h.overscaledZ}`), function (je, et) { je.initDebugOverlayCanvas(); const Me = je.debugOverlayCanvas, at = je.context.gl, nt = je.debugOverlayCanvas.getContext("2d"); nt.clearRect(0, 0, Me.width, Me.height), nt.shadowColor = "white", nt.shadowBlur = 2, nt.lineWidth = 1.5, nt.strokeStyle = "white", nt.textBaseline = "top", nt.font = "bold 36px Open Sans, sans-serif", nt.fillText(et, 5, 5), nt.strokeText(et, 5, 5), je.debugOverlayTexture.update(Me), je.debugOverlayTexture.bind(at.LINEAR, at.CLAMP_TO_EDGE) }(x, `${Be} ${Se}kB`), D.draw(g, b.TRIANGLES, $, U, Tr.alphaBlended, Nr.disabled, Bn(E, o.Color.transparent, we), null, te, x.debugBuffer, x.quadTriangleIndexBuffer, x.debugSegments), D.draw(g, b.LINE_STRIP, $, U, W, Nr.disabled, Bn(E, o.Color.red), ae, te, x.debugBuffer, x.tileBorderIndexBuffer, x.debugSegments) } function Yc(x, l, h) { const g = x.context, b = g.gl, E = x.colorModeForRenderPass(), D = new Qn(b.LEQUAL, Qn.ReadWrite, x.depthRangeFor3D), $ = x.useProgram("terrain"), U = l.getTerrainMesh(), W = l.getTerrainData(h.tileID); g.bindFramebuffer.set(null), g.viewport.set([0, 0, x.width, x.height]), g.activeTexture.set(b.TEXTURE0), b.bindTexture(b.TEXTURE_2D, l.getRTTFramebuffer().colorAttachment.get()); const te = x.transform.calculatePosMatrix(h.tileID.toUnwrapped()); $.draw(g, b.TRIANGLES, D, Sr.disabled, E, Nr.backCCW, { u_matrix: te, u_texture: 0 }, W, "terrain", U.vertexBuffer, U.indexBuffer, U.segments) } function Ym(x, l, h, g) { const b = x.context, E = h.tileSize * l.qualityFactor; h.textures[g] || (h.textures[g] = x.getTileTexture(E) || new A(b, { width: E, height: E, data: null }, b.gl.RGBA), h.textures[g].bind(b.gl.LINEAR, b.gl.CLAMP_TO_EDGE), g === 0 && l.sourceCache.renderHistory.unshift(h.tileID.key)); const D = l.getRTTFramebuffer(); D.colorAttachment.set(h.textures[g].texture), b.bindFramebuffer.set(D.framebuffer), b.viewport.set([0, 0, E, E]) } class Qm { constructor(l) { this._coordsDescendingInv = {}, this._coordsDescendingInvStr = {}, this.painter = l, this._renderToTexture = { background: !0, fill: !0, line: !0, raster: !0 }, this._coordsDescendingInv = {}, this._coordsDescendingInvStr = {}, this._stacks = [], this._prevType = null, this._rerender = {}, this._renderableTiles = l.style.terrain.sourceCache.getRenderableTiles(), this._init() } _init() { const l = this.painter.style, h = l.terrain; for (const g in l.sourceCaches) { this._coordsDescendingInv[g] = {}; const b = l.sourceCaches[g].getVisibleCoordinates(); for (const E of b) { const D = h.sourceCache.getTerrainCoords(E); for (const $ in D) this._coordsDescendingInv[g][$] || (this._coordsDescendingInv[g][$] = []), this._coordsDescendingInv[g][$].push(D[$]) } } for (const g of l._order) { const b = l._layers[g], E = b.source; if (this._renderToTexture[b.type] && !this._coordsDescendingInvStr[E]) { this._coordsDescendingInvStr[E] = {}; for (const D in this._coordsDescendingInv[E]) this._coordsDescendingInvStr[E][D] = this._coordsDescendingInv[E][D].map($ => $.key).sort().join() } } return this._renderableTiles.forEach(g => { for (const b in this._coordsDescendingInvStr) { const E = this._coordsDescendingInvStr[b][g.tileID.key]; E && E !== g.textureCoords[b] && g.clearTextures(this.painter), h.needsRerender(b, g.tileID) && g.clearTextures(this.painter) } this._rerender[g.tileID.key] = !g.textures.length }), h.clearRerenderCache(), h.sourceCache.removeOutdated(this.painter), this } renderLayer(l) { const h = l.type, g = this.painter, b = g.style._order, E = g.currentLayer, D = E + 1 === b.length; if (this._renderToTexture[h] && (this._prevType && this._renderToTexture[this._prevType] || this._stacks.push([]), this._prevType = h, this._stacks[this._stacks.length - 1].push(b[E]), !D)) return !0; if (this._renderToTexture[this._prevType] || h === "hillshade" || this._renderToTexture[h] && D) { this._prevType = h; const $ = this._stacks.length - 1, U = this._stacks[$] || []; for (const W of this._renderableTiles) { if (Ym(g, g.style.terrain, W, $), this._rerender[W.tileID.key]) { g.context.clear({ color: o.Color.transparent }); for (let te = 0; te < U.length; te++) { const ae = g.style._layers[U[te]], fe = ae.source ? this._coordsDescendingInv[ae.source][W.tileID.key] : [W.tileID]; g._renderTileClippingMasks(ae, fe), g.renderLayer(g, g.style.sourceCaches[ae.source], ae, fe), ae.source && (W.textureCoords[ae.source] = this._coordsDescendingInvStr[ae.source][W.tileID.key]) } } Yc(g, g.style.terrain, W) } if (h === "hillshade") { this._stacks.push([b[E]]); for (const W of this._renderableTiles) { const te = this._coordsDescendingInv[l.source][W.tileID.key]; Ym(g, g.style.terrain, W, this._stacks.length - 1), g.context.clear({ color: o.Color.transparent }), g._renderTileClippingMasks(l, te), g.renderLayer(g, g.style.sourceCaches[l.source], l, te), Yc(g, g.style.terrain, W) } return !0 } return this._renderToTexture[h] } return !1 } } const ku = { symbol: function (x, l, h, g, b) { if (x.renderPass !== "translucent") return; const E = Sr.disabled, D = x.colorModeForRenderPass(); h.layout.get("text-variable-anchor") && function ($, U, W, te, ae, fe, Se) { const _e = U.transform, we = ae === "map", Be = fe === "map"; for (const je of $) { const et = te.getTile(je), Me = et.getBucket(W); if (!Me || !Me.text || !Me.text.segments.get().length) continue; const at = o.evaluateSizeForZoom(Me.textSizeData, _e.zoom), nt = zt(et, 1, U.transform.zoom), xt = Zt(je.posMatrix, Be, we, U.transform, nt), _t = W.layout.get("icon-text-fit") !== "none" && Me.hasIconData(); if (at) { const Ft = Math.pow(2, _e.zoom - et.tileID.overscaledZ); Gm(Me, we, Be, Se, _e, xt, je.posMatrix, Ft, at, _t, U.style.terrain ? (vt, sn) => U.style.terrain.getElevation(je, vt, sn) : null) } } }(g, x, h, l, h.layout.get("text-rotation-alignment"), h.layout.get("text-pitch-alignment"), b), h.paint.get("icon-opacity").constantOr(1) !== 0 && qc(x, l, h, g, !1, h.paint.get("icon-translate"), h.paint.get("icon-translate-anchor"), h.layout.get("icon-rotation-alignment"), h.layout.get("icon-pitch-alignment"), h.layout.get("icon-keep-upright"), E, D), h.paint.get("text-opacity").constantOr(1) !== 0 && qc(x, l, h, g, !0, h.paint.get("text-translate"), h.paint.get("text-translate-anchor"), h.layout.get("text-rotation-alignment"), h.layout.get("text-pitch-alignment"), h.layout.get("text-keep-upright"), E, D), l.map.showCollisionBoxes && (bl(x, l, h, g, h.paint.get("text-translate"), h.paint.get("text-translate-anchor"), !0), bl(x, l, h, g, h.paint.get("icon-translate"), h.paint.get("icon-translate-anchor"), !1)) }, circle: function (x, l, h, g) { if (x.renderPass !== "translucent") return; const b = h.paint.get("circle-opacity"), E = h.paint.get("circle-stroke-width"), D = h.paint.get("circle-stroke-opacity"), $ = !h.layout.get("circle-sort-key").isConstant(); if (b.constantOr(1) === 0 && (E.constantOr(1) === 0 || D.constantOr(1) === 0)) return; const U = x.context, W = U.gl, te = x.depthModeForSublayer(0, Qn.ReadOnly), ae = Sr.disabled, fe = x.colorModeForRenderPass(), Se = []; for (let _e = 0; _e < g.length; _e++) { const we = g[_e], Be = l.getTile(we), je = Be.getBucket(h); if (!je) continue; const et = je.programConfigurations.get(h.id), Me = x.useProgram("circle", et), at = je.layoutVertexBuffer, nt = je.indexBuffer, xt = x.style.terrain && x.style.terrain.getTerrainData(we), _t = { programConfiguration: et, program: Me, layoutVertexBuffer: at, indexBuffer: nt, uniformValues: Bc(x, we, Be, h), terrainData: xt }; if ($) { const Ft = je.segments.get(); for (const vt of Ft) Se.push({ segments: new o.SegmentVector([vt]), sortKey: vt.sortKey, state: _t }) } else Se.push({ segments: je.segments, sortKey: 0, state: _t }) } $ && Se.sort((_e, we) => _e.sortKey - we.sortKey); for (const _e of Se) { const { programConfiguration: we, program: Be, layoutVertexBuffer: je, indexBuffer: et, uniformValues: Me, terrainData: at } = _e.state; Be.draw(U, W.TRIANGLES, te, ae, fe, Nr.disabled, Me, at, h.id, je, et, _e.segments, h.paint, x.transform.zoom, we) } }, heatmap: function (x, l, h, g) { if (h.paint.get("heatmap-opacity") !== 0) if (x.renderPass === "offscreen") { const b = x.context, E = b.gl, D = Sr.disabled, $ = new Tr([E.ONE, E.ONE], o.Color.transparent, [!0, !0, !0, !0]); (function (U, W, te) { const ae = U.gl; U.activeTexture.set(ae.TEXTURE1), U.viewport.set([0, 0, W.width / 4, W.height / 4]); let fe = te.heatmapFbo; if (fe) ae.bindTexture(ae.TEXTURE_2D, fe.colorAttachment.get()), U.bindFramebuffer.set(fe.framebuffer); else { const Se = ae.createTexture(); ae.bindTexture(ae.TEXTURE_2D, Se), ae.texParameteri(ae.TEXTURE_2D, ae.TEXTURE_WRAP_S, ae.CLAMP_TO_EDGE), ae.texParameteri(ae.TEXTURE_2D, ae.TEXTURE_WRAP_T, ae.CLAMP_TO_EDGE), ae.texParameteri(ae.TEXTURE_2D, ae.TEXTURE_MIN_FILTER, ae.LINEAR), ae.texParameteri(ae.TEXTURE_2D, ae.TEXTURE_MAG_FILTER, ae.LINEAR), fe = te.heatmapFbo = U.createFramebuffer(W.width / 4, W.height / 4, !1), function (_e, we, Be, je) { const et = _e.gl; et.texImage2D(et.TEXTURE_2D, 0, et.RGBA, we.width / 4, we.height / 4, 0, et.RGBA, _e.extRenderToTextureHalfFloat ? _e.extTextureHalfFloat.HALF_FLOAT_OES : et.UNSIGNED_BYTE, null), je.colorAttachment.set(Be) }(U, W, Se, fe) } })(b, x, h), b.clear({ color: o.Color.transparent }); for (let U = 0; U < g.length; U++) { const W = g[U]; if (l.hasRenderableParent(W)) continue; const te = l.getTile(W), ae = te.getBucket(h); if (!ae) continue; const fe = ae.programConfigurations.get(h.id), Se = x.useProgram("heatmap", fe), { zoom: _e } = x.transform; Se.draw(b, E.TRIANGLES, Qn.disabled, D, $, Nr.disabled, Ar(W.posMatrix, te, _e, h.paint.get("heatmap-intensity")), null, h.id, ae.layoutVertexBuffer, ae.indexBuffer, ae.segments, h.paint, x.transform.zoom, fe) } b.viewport.set([0, 0, x.width, x.height]) } else x.renderPass === "translucent" && (x.context.setColorMode(x.colorModeForRenderPass()), function (b, E) { const D = b.context, $ = D.gl, U = E.heatmapFbo; if (!U) return; D.activeTexture.set($.TEXTURE0), $.bindTexture($.TEXTURE_2D, U.colorAttachment.get()), D.activeTexture.set($.TEXTURE1); let W = E.colorRampTexture; W || (W = E.colorRampTexture = new A(D, E.colorRamp, $.RGBA)), W.bind($.LINEAR, $.CLAMP_TO_EDGE), b.useProgram("heatmapTexture").draw(D, $.TRIANGLES, Qn.disabled, Sr.disabled, b.colorModeForRenderPass(), Nr.disabled, ((te, ae, fe, Se) => { const _e = o.create(); o.ortho(_e, 0, te.width, te.height, 0, 0, 1); const we = te.context.gl; return { u_matrix: _e, u_world: [we.drawingBufferWidth, we.drawingBufferHeight], u_image: 0, u_color_ramp: 1, u_opacity: ae.paint.get("heatmap-opacity") } })(b, E), null, E.id, b.viewportBuffer, b.quadTriangleIndexBuffer, b.viewportSegments, E.paint, b.transform.zoom) }(x, h)) }, line: function (x, l, h, g) { if (x.renderPass !== "translucent") return; const b = h.paint.get("line-opacity"), E = h.paint.get("line-width"); if (b.constantOr(1) === 0 || E.constantOr(1) === 0) return; const D = x.depthModeForSublayer(0, Qn.ReadOnly), $ = x.colorModeForRenderPass(), U = h.paint.get("line-dasharray"), W = h.paint.get("line-pattern"), te = W.constantOr(1), ae = h.paint.get("line-gradient"), fe = h.getCrossfadeParameters(), Se = te ? "linePattern" : U ? "lineSDF" : ae ? "lineGradient" : "line", _e = x.context, we = _e.gl; let Be = !0; for (const je of g) { const et = l.getTile(je); if (te && !et.patternsLoaded()) continue; const Me = et.getBucket(h); if (!Me) continue; const at = Me.programConfigurations.get(h.id), nt = x.context.program.get(), xt = x.useProgram(Se, at), _t = Be || xt.program !== nt, Ft = x.style.terrain && x.style.terrain.getTerrainData(je), vt = W.constantOr(null); if (vt && et.imageAtlas) { const fn = et.imageAtlas, Fn = fn.patternPositions[vt.to.toString()], Un = fn.patternPositions[vt.from.toString()]; Fn && Un && at.setConstantPatternPositions(Fn, Un) } const sn = Ft ? je : null, Yt = te ? Es(x, et, h, fe, sn) : U ? Pa(x, et, h, U, fe, sn) : ae ? To(x, et, h, Me.lineClipsArray.length, sn) : Xa(x, et, h, sn); if (te) _e.activeTexture.set(we.TEXTURE0), et.imageAtlasTexture.bind(we.LINEAR, we.CLAMP_TO_EDGE), at.updatePaintBuffers(fe); else if (U && (_t || x.lineAtlas.dirty)) _e.activeTexture.set(we.TEXTURE0), x.lineAtlas.bind(_e); else if (ae) { const fn = Me.gradients[h.id]; let Fn = fn.texture; if (h.gradientVersion !== fn.version) { let Un = 256; if (h.stepInterpolant) { const Pn = l.getSource().maxzoom, fr = je.canonical.z === Pn ? Math.ceil(1 << x.transform.maxZoom - je.canonical.z) : 1; Un = o.clamp(o.nextPowerOfTwo(Me.maxLineLength / o.EXTENT * 1024 * fr), 256, _e.maxTextureSize) } fn.gradient = o.renderColorRamp({ expression: h.gradientExpression(), evaluationKey: "lineProgress", resolution: Un, image: fn.gradient || void 0, clips: Me.lineClipsArray }), fn.texture ? fn.texture.update(fn.gradient) : fn.texture = new A(_e, fn.gradient, we.RGBA), fn.version = h.gradientVersion, Fn = fn.texture } _e.activeTexture.set(we.TEXTURE0), Fn.bind(h.stepInterpolant ? we.NEAREST : we.LINEAR, we.CLAMP_TO_EDGE) } xt.draw(_e, we.TRIANGLES, D, x.stencilModeForClipping(je), $, Nr.disabled, Yt, Ft, h.id, Me.layoutVertexBuffer, Me.indexBuffer, Me.segments, h.paint, x.transform.zoom, at, Me.layoutVertexBuffer2), Be = !1 } }, fill: function (x, l, h, g) { const b = h.paint.get("fill-color"), E = h.paint.get("fill-opacity"); if (E.constantOr(1) === 0) return; const D = x.colorModeForRenderPass(), $ = h.paint.get("fill-pattern"), U = x.opaquePassEnabledForLayer() && !$.constantOr(1) && b.constantOr(o.Color.transparent).a === 1 && E.constantOr(0) === 1 ? "opaque" : "translucent"; if (x.renderPass === U) { const W = x.depthModeForSublayer(1, x.renderPass === "opaque" ? Qn.ReadWrite : Qn.ReadOnly); Eu(x, l, h, g, W, D, !1) } if (x.renderPass === "translucent" && h.paint.get("fill-antialias")) { const W = x.depthModeForSublayer(h.getPaintProperty("fill-outline-color") ? 2 : 0, Qn.ReadOnly); Eu(x, l, h, g, W, D, !0) } }, "fill-extrusion": function (x, l, h, g) { const b = h.paint.get("fill-extrusion-opacity"); if (b !== 0 && x.renderPass === "translucent") { const E = new Qn(x.context.gl.LEQUAL, Qn.ReadWrite, x.depthRangeFor3D); if (b !== 1 || h.paint.get("fill-extrusion-pattern").constantOr(1)) Pu(x, l, h, g, E, Sr.disabled, Tr.disabled), Pu(x, l, h, g, E, x.stencilModeFor3D(), x.colorModeForRenderPass()); else { const D = x.colorModeForRenderPass(); Pu(x, l, h, g, E, Sr.disabled, D) } } }, hillshade: function (x, l, h, g) { if (x.renderPass !== "offscreen" && x.renderPass !== "translucent") return; const b = x.context, E = x.depthModeForSublayer(0, Qn.ReadOnly), D = x.colorModeForRenderPass(), [$, U] = x.renderPass === "translucent" ? x.stencilConfigForOverlap(g) : [{}, g]; for (const W of U) { const te = l.getTile(W); te.needsHillshadePrepare !== void 0 && te.needsHillshadePrepare && x.renderPass === "offscreen" ? qm(x, te, h, E, Sr.disabled, D) : x.renderPass === "translucent" && Yf(x, W, te, h, E, $[W.overscaledZ], D) } b.viewport.set([0, 0, x.width, x.height]) }, raster: function (x, l, h, g) { if (x.renderPass !== "translucent" || h.paint.get("raster-opacity") === 0 || !g.length) return; const b = x.context, E = b.gl, D = l.getSource(), $ = x.useProgram("raster"), U = x.colorModeForRenderPass(), [W, te] = D instanceof ye ? [{}, g] : x.stencilConfigForOverlap(g), ae = te[te.length - 1].overscaledZ, fe = !x.options.moving; for (const Se of te) { const _e = x.depthModeForSublayer(Se.overscaledZ - ae, h.paint.get("raster-opacity") === 1 ? Qn.ReadWrite : Qn.ReadOnly, E.LESS), we = l.getTile(Se); we.registerFadeDuration(h.paint.get("raster-fade-duration")); const Be = l.findLoadedParent(Se, 0), je = Zc(we, Be, l, h, x.transform, x.style.terrain); let et, Me; const at = h.paint.get("raster-resampling") === "nearest" ? E.NEAREST : E.LINEAR; b.activeTexture.set(E.TEXTURE0), we.texture.bind(at, E.CLAMP_TO_EDGE, E.LINEAR_MIPMAP_NEAREST), b.activeTexture.set(E.TEXTURE1), Be ? (Be.texture.bind(at, E.CLAMP_TO_EDGE, E.LINEAR_MIPMAP_NEAREST), et = Math.pow(2, Be.tileID.overscaledZ - we.tileID.overscaledZ), Me = [we.tileID.canonical.x * et % 1, we.tileID.canonical.y * et % 1]) : we.texture.bind(at, E.CLAMP_TO_EDGE, E.LINEAR_MIPMAP_NEAREST); const nt = x.style.terrain && x.style.terrain.getTerrainData(Se), xt = nt ? Se : null, _t = xt ? xt.posMatrix : x.transform.calculatePosMatrix(Se.toUnwrapped(), fe), Ft = Lm(_t, Me || [0, 0], et || 1, je, h); D instanceof ye ? $.draw(b, E.TRIANGLES, _e, Sr.disabled, U, Nr.disabled, Ft, nt, h.id, D.boundsBuffer, x.quadTriangleIndexBuffer, D.boundsSegments) : $.draw(b, E.TRIANGLES, _e, W[Se.overscaledZ], U, Nr.disabled, Ft, nt, h.id, x.rasterBoundsBuffer, x.quadTriangleIndexBuffer, x.rasterBoundsSegments) } }, background: function (x, l, h, g) { const b = h.paint.get("background-color"), E = h.paint.get("background-opacity"); if (E === 0) return; const D = x.context, $ = D.gl, U = x.transform, W = U.tileSize, te = h.paint.get("background-pattern"); if (x.isPatternMissing(te)) return; const ae = !te && b.a === 1 && E === 1 && x.opaquePassEnabledForLayer() ? "opaque" : "translucent"; if (x.renderPass !== ae) return; const fe = Sr.disabled, Se = x.depthModeForSublayer(0, ae === "opaque" ? Qn.ReadWrite : Qn.ReadOnly), _e = x.colorModeForRenderPass(), we = x.useProgram(te ? "backgroundPattern" : "background"), Be = g || U.coveringTiles({ tileSize: W, terrain: x.style.terrain }); te && (D.activeTexture.set($.TEXTURE0), x.imageManager.bind(x.context)); const je = h.getCrossfadeParameters(); for (const et of Be) { const Me = g ? et.posMatrix : x.transform.calculatePosMatrix(et.toUnwrapped()), at = te ? Mx(Me, E, x, te, { tileID: et, tileSize: W }, je) : Rx(Me, E, b), nt = x.style.terrain && x.style.terrain.getTerrainData(et); we.draw(D, $.TRIANGLES, Se, fe, _e, Nr.disabled, at, nt, h.id, x.tileExtentBuffer, x.quadTriangleIndexBuffer, x.tileExtentSegments) } }, debug: function (x, l, h) { for (let g = 0; g < h.length; g++)Ux(x, l, h[g]) }, custom: function (x, l, h) { const g = x.context, b = h.implementation; if (x.renderPass === "offscreen") { const E = b.prerender; E && (x.setCustomLayerDefaults(), g.setColorMode(x.colorModeForRenderPass()), E.call(b, g.gl, x.transform.customLayerMatrix()), g.setDirty(), x.setBaseState()) } else if (x.renderPass === "translucent") { x.setCustomLayerDefaults(), g.setColorMode(x.colorModeForRenderPass()), g.setStencilMode(Sr.disabled); const E = b.renderingMode === "3d" ? new Qn(x.context.gl.LEQUAL, Qn.ReadWrite, x.depthRangeFor3D) : x.depthModeForSublayer(0, Qn.ReadOnly); g.setDepthMode(E), b.render(g.gl, x.transform.customLayerMatrix()), g.setDirty(), x.setBaseState(), g.bindFramebuffer.set(null) } } }; class Jf { constructor(l, h) { this.context = new Wm(l), this.transform = h, this._tileTextures = {}, this.terrainFacilitator = { dirty: !0, matrix: o.create(), renderTime: 0 }, this.setup(), this.numSublayers = Ue.maxUnderzooming + Ue.maxOverzooming + 1, this.depthEpsilon = 1 / Math.pow(2, 16), this.crossTileSymbolIndex = new Vt, this.gpuTimers = {} } resize(l, h, g) { if (this.width = l * g, this.height = h * g, this.pixelRatio = g, this.context.viewport.set([0, 0, this.width, this.height]), this.style) for (const b of this.style._order) this.style._layers[b].resize() } setup() { const l = this.context, h = new o.PosArray; h.emplaceBack(0, 0), h.emplaceBack(o.EXTENT, 0), h.emplaceBack(0, o.EXTENT), h.emplaceBack(o.EXTENT, o.EXTENT), this.tileExtentBuffer = l.createVertexBuffer(h, bn.members), this.tileExtentSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2); const g = new o.PosArray; g.emplaceBack(0, 0), g.emplaceBack(o.EXTENT, 0), g.emplaceBack(0, o.EXTENT), g.emplaceBack(o.EXTENT, o.EXTENT), this.debugBuffer = l.createVertexBuffer(g, bn.members), this.debugSegments = o.SegmentVector.simpleSegment(0, 0, 4, 5); const b = new o.RasterBoundsArray; b.emplaceBack(0, 0, 0, 0), b.emplaceBack(o.EXTENT, 0, o.EXTENT, 0), b.emplaceBack(0, o.EXTENT, 0, o.EXTENT), b.emplaceBack(o.EXTENT, o.EXTENT, o.EXTENT, o.EXTENT), this.rasterBoundsBuffer = l.createVertexBuffer(b, oe.members), this.rasterBoundsSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2); const E = new o.PosArray; E.emplaceBack(0, 0), E.emplaceBack(1, 0), E.emplaceBack(0, 1), E.emplaceBack(1, 1), this.viewportBuffer = l.createVertexBuffer(E, bn.members), this.viewportSegments = o.SegmentVector.simpleSegment(0, 0, 4, 2); const D = new o.LineStripIndexArray; D.emplaceBack(0), D.emplaceBack(1), D.emplaceBack(3), D.emplaceBack(2), D.emplaceBack(0), this.tileBorderIndexBuffer = l.createIndexBuffer(D); const $ = new o.TriangleIndexArray; $.emplaceBack(0, 1, 2), $.emplaceBack(2, 1, 3), this.quadTriangleIndexBuffer = l.createIndexBuffer($), this.emptyTexture = new A(l, { width: 1, height: 1, data: new Uint8Array([0, 0, 0, 0]) }, l.gl.RGBA); const U = this.context.gl; this.stencilClearMode = new Sr({ func: U.ALWAYS, mask: 0 }, 0, 255, U.ZERO, U.ZERO, U.ZERO) } clearStencil() { const l = this.context, h = l.gl; this.nextStencilID = 1, this.currentStencilSource = void 0; const g = o.create(); o.ortho(g, 0, this.width, this.height, 0, 0, 1), o.scale(g, g, [h.drawingBufferWidth, h.drawingBufferHeight, 0]), this.useProgram("clippingMask").draw(l, h.TRIANGLES, Qn.disabled, this.stencilClearMode, Tr.disabled, Nr.disabled, Yn(g), null, "$clipping", this.viewportBuffer, this.quadTriangleIndexBuffer, this.viewportSegments) } _renderTileClippingMasks(l, h) { if (this.currentStencilSource === l.source || !l.isTileClipped() || !h || !h.length) return; this.currentStencilSource = l.source; const g = this.context, b = g.gl; this.nextStencilID + h.length > 256 && this.clearStencil(), g.setColorMode(Tr.disabled), g.setDepthMode(Qn.disabled); const E = this.useProgram("clippingMask"); this._tileClippingMaskIDs = {}; for (const D of h) { const $ = this._tileClippingMaskIDs[D.key] = this.nextStencilID++, U = this.style.terrain && this.style.terrain.getTerrainData(D); E.draw(g, b.TRIANGLES, Qn.disabled, new Sr({ func: b.ALWAYS, mask: 0 }, $, 255, b.KEEP, b.KEEP, b.REPLACE), Tr.disabled, Nr.disabled, Yn(D.posMatrix), U, "$clipping", this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments) } } stencilModeFor3D() { this.currentStencilSource = void 0, this.nextStencilID + 1 > 256 && this.clearStencil(); const l = this.nextStencilID++, h = this.context.gl; return new Sr({ func: h.NOTEQUAL, mask: 255 }, l, 255, h.KEEP, h.KEEP, h.REPLACE) } stencilModeForClipping(l) { const h = this.context.gl; return new Sr({ func: h.EQUAL, mask: 255 }, this._tileClippingMaskIDs[l.key], 0, h.KEEP, h.KEEP, h.REPLACE) } stencilConfigForOverlap(l) { const h = this.context.gl, g = l.sort((D, $) => $.overscaledZ - D.overscaledZ), b = g[g.length - 1].overscaledZ, E = g[0].overscaledZ - b + 1; if (E > 1) { this.currentStencilSource = void 0, this.nextStencilID + E > 256 && this.clearStencil(); const D = {}; for (let $ = 0; $ < E; $++)D[$ + b] = new Sr({ func: h.GEQUAL, mask: 255 }, $ + this.nextStencilID, 255, h.KEEP, h.KEEP, h.REPLACE); return this.nextStencilID += E, [D, g] } return [{ [b]: Sr.disabled }, g] } colorModeForRenderPass() { const l = this.context.gl; return this._showOverdrawInspector ? new Tr([l.CONSTANT_COLOR, l.ONE], new o.Color(.125, .125, .125, 0), [!0, !0, !0, !0]) : this.renderPass === "opaque" ? Tr.unblended : Tr.alphaBlended } depthModeForSublayer(l, h, g) { if (!this.opaquePassEnabledForLayer()) return Qn.disabled; const b = 1 - ((1 + this.currentLayer) * this.numSublayers + l) * this.depthEpsilon; return new Qn(g || this.context.gl.LEQUAL, h, [b, b]) } opaquePassEnabledForLayer() { return this.currentLayer < this.opaquePassCutoff } render(l, h) { this.style = l, this.options = h, this.lineAtlas = l.lineAtlas, this.imageManager = l.imageManager, this.glyphManager = l.glyphManager, this.symbolFadeChange = l.placement.symbolFadeChange(o.exported.now()), this.imageManager.beginFrame(); const g = this.style._order, b = this.style.sourceCaches, E = this.style.terrain && new Qm(this); for (const W in b) { const te = b[W]; te.used && te.prepare(this.context) } const D = {}, $ = {}, U = {}; for (const W in b) { const te = b[W]; D[W] = te.getVisibleCoordinates(), $[W] = D[W].slice().reverse(), U[W] = te.getVisibleCoordinates(!0).reverse() } this.opaquePassCutoff = 1 / 0; for (let W = 0; W < g.length; W++)if (this.style._layers[g[W]].is3D()) { this.opaquePassCutoff = W; break } if (E) { this.opaquePassCutoff = 0; const W = this.style.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime); (this.terrainFacilitator.dirty || !o.equals(this.terrainFacilitator.matrix, this.transform.projMatrix) || W.length) && (o.copy(this.terrainFacilitator.matrix, this.transform.projMatrix), this.terrainFacilitator.renderTime = Date.now(), this.terrainFacilitator.dirty = !1, function (te, ae) { const fe = te.context, Se = fe.gl, _e = Tr.unblended, we = new Qn(Se.LEQUAL, Qn.ReadWrite, [0, 1]), Be = ae.getTerrainMesh(), je = ae.sourceCache.getRenderableTiles(), et = te.useProgram("terrainDepth"); fe.bindFramebuffer.set(ae.getFramebuffer("depth").framebuffer), fe.viewport.set([0, 0, te.width / devicePixelRatio, te.height / devicePixelRatio]), fe.clear({ color: o.Color.transparent, depth: 1 }); for (const Me of je) { const at = ae.getTerrainData(Me.tileID), nt = te.transform.calculatePosMatrix(Me.tileID.toUnwrapped()); et.draw(fe, Se.TRIANGLES, we, Sr.disabled, _e, Nr.backCCW, { u_matrix: nt }, at, "terrain", Be.vertexBuffer, Be.indexBuffer, Be.segments) } fe.bindFramebuffer.set(null), fe.viewport.set([0, 0, te.width, te.height]) }(this, this.style.terrain), function (te, ae) { const fe = te.context, Se = fe.gl, _e = Tr.unblended, we = new Qn(Se.LEQUAL, Qn.ReadWrite, [0, 1]), Be = ae.getTerrainMesh(), je = ae.getCoordsTexture(), et = ae.sourceCache.getRenderableTiles(), Me = te.useProgram("terrainCoords"); fe.bindFramebuffer.set(ae.getFramebuffer("coords").framebuffer), fe.viewport.set([0, 0, te.width / devicePixelRatio, te.height / devicePixelRatio]), fe.clear({ color: o.Color.transparent, depth: 1 }), ae.coordsIndex = []; for (const at of et) { const nt = ae.getTerrainData(at.tileID); fe.activeTexture.set(Se.TEXTURE0), Se.bindTexture(Se.TEXTURE_2D, je.texture); const xt = te.transform.calculatePosMatrix(at.tileID.toUnwrapped()); Me.draw(fe, Se.TRIANGLES, we, Sr.disabled, _e, Nr.backCCW, { u_matrix: xt, u_terrain_coords_id: (255 - ae.coordsIndex.length) / 255, u_texture: 0 }, nt, "terrain", Be.vertexBuffer, Be.indexBuffer, Be.segments), ae.coordsIndex.push(at.tileID.key) } fe.bindFramebuffer.set(null), fe.viewport.set([0, 0, te.width, te.height]) }(this, this.style.terrain)) } this.renderPass = "offscreen"; for (const W of g) { const te = this.style._layers[W]; if (!te.hasOffscreenPass() || te.isHidden(this.transform.zoom)) continue; const ae = $[te.source]; (te.type === "custom" || ae.length) && this.renderLayer(this, b[te.source], te, ae) } if (this.context.bindFramebuffer.set(null), this.context.clear({ color: h.showOverdrawInspector ? o.Color.black : o.Color.transparent, depth: 1 }), this.clearStencil(), this._showOverdrawInspector = h.showOverdrawInspector, this.depthRangeFor3D = [0, 1 - (l._order.length + 2) * this.numSublayers * this.depthEpsilon], !E) for (this.renderPass = "opaque", this.currentLayer = g.length - 1; this.currentLayer >= 0; this.currentLayer--) { const W = this.style._layers[g[this.currentLayer]], te = b[W.source], ae = D[W.source]; this._renderTileClippingMasks(W, ae), this.renderLayer(this, te, W, ae) } for (this.renderPass = "translucent", this.currentLayer = 0; this.currentLayer < g.length; this.currentLayer++) { const W = this.style._layers[g[this.currentLayer]], te = b[W.source]; if (E && E.renderLayer(W)) continue; const ae = (W.type === "symbol" ? U : $)[W.source]; this._renderTileClippingMasks(W, D[W.source]), this.renderLayer(this, te, W, ae) } if (this.options.showTileBoundaries) { let W, te; Object.values(this.style._layers).forEach(ae => { ae.source && !ae.isHidden(this.transform.zoom) && (ae.source !== (te && te.id) && (te = this.style.sourceCaches[ae.source]), (!W || W.getSource().maxzoom < te.getSource().maxzoom) && (W = te)) }), W && ku.debug(this, W, W.getVisibleCoordinates()) } this.options.showPadding && function (W) { const te = W.transform.padding; Ts(W, W.transform.height - (te.top || 0), 3, Xc), Ts(W, te.bottom || 0, 3, Bo), Tu(W, te.left || 0, 3, Zm), Tu(W, W.transform.width - (te.right || 0), 3, Qf); const ae = W.transform.centerPoint; (function (fe, Se, _e, we) { wl(fe, Se - 1, _e - 10, 2, 20, we), wl(fe, Se - 10, _e - 1, 20, 2, we) })(W, ae.x, W.transform.height - ae.y, Xm) }(this), this.context.setDefault() } renderLayer(l, h, g, b) { g.isHidden(this.transform.zoom) || (g.type === "background" || g.type === "custom" || (b || []).length) && (this.id = g.id, this.gpuTimingStart(g), ku[g.type](l, h, g, b, this.style.placement.variableOffsets), this.gpuTimingEnd()) } gpuTimingStart(l) { if (!this.options.gpuTiming) return; const h = this.context.extTimerQuery; let g = this.gpuTimers[l.id]; g || (g = this.gpuTimers[l.id] = { calls: 0, cpuTime: 0, query: h.createQueryEXT() }), g.calls++, h.beginQueryEXT(h.TIME_ELAPSED_EXT, g.query) } gpuTimingEnd() { if (!this.options.gpuTiming) return; const l = this.context.extTimerQuery; l.endQueryEXT(l.TIME_ELAPSED_EXT) } collectGpuTimers() { const l = this.gpuTimers; return this.gpuTimers = {}, l } queryGpuTimers(l) { const h = {}; for (const g in l) { const b = l[g], E = this.context.extTimerQuery, D = E.getQueryObjectEXT(b.query, E.QUERY_RESULT_EXT) / 1e6; E.deleteQueryEXT(b.query), h[g] = D } return h } translatePosMatrix(l, h, g, b, E) { if (!g[0] && !g[1]) return l; const D = E ? b === "map" ? this.transform.angle : 0 : b === "viewport" ? -this.transform.angle : 0; if (D) { const W = Math.sin(D), te = Math.cos(D); g = [g[0] * te - g[1] * W, g[0] * W + g[1] * te] } const $ = [E ? g[0] : zt(h, g[0], this.transform.zoom), E ? g[1] : zt(h, g[1], this.transform.zoom), 0], U = new Float32Array(16); return o.translate(U, l, $), U } saveTileTexture(l) { const h = this._tileTextures[l.size[0]]; h ? h.push(l) : this._tileTextures[l.size[0]] = [l] } getTileTexture(l) { const h = this._tileTextures[l]; return h && h.length > 0 ? h.pop() : null } isPatternMissing(l) { if (!l) return !1; if (!l.from || !l.to) return !0; const h = this.imageManager.getPattern(l.from.toString()), g = this.imageManager.getPattern(l.to.toString()); return !h || !g } useProgram(l, h) { this.cache = this.cache || {}; const g = l + (h ? h.cacheKey : "") + (this._showOverdrawInspector ? "/overdraw" : "") + (this.style.terrain ? "/terrain" : ""); return this.cache[g] || (this.cache[g] = new Kn(this.context, l, kn[l], h, $f[l], this._showOverdrawInspector, this.style.terrain)), this.cache[g] } setCustomLayerDefaults() { this.context.unbindVAO(), this.context.cullFace.setDefault(), this.context.activeTexture.setDefault(), this.context.pixelStoreUnpack.setDefault(), this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.context.pixelStoreUnpackFlipY.setDefault() } setBaseState() { const l = this.context.gl; this.context.cullFace.set(!1), this.context.viewport.set([0, 0, this.width, this.height]), this.context.blendEquation.set(l.FUNC_ADD) } initDebugOverlayCanvas() { this.debugOverlayCanvas == null && (this.debugOverlayCanvas = document.createElement("canvas"), this.debugOverlayCanvas.width = 512, this.debugOverlayCanvas.height = 512, this.debugOverlayTexture = new A(this.context, this.debugOverlayCanvas, this.context.gl.RGBA)) } destroy() { this.emptyTexture.destroy(), this.debugOverlayTexture && this.debugOverlayTexture.destroy() } } class Qc { constructor(l, h) { this.points = l, this.planes = h } static fromInvProjectionMatrix(l, h, g) { const b = Math.pow(2, g), E = [[-1, 1, -1, 1], [1, 1, -1, 1], [1, -1, -1, 1], [-1, -1, -1, 1], [-1, 1, 1, 1], [1, 1, 1, 1], [1, -1, 1, 1], [-1, -1, 1, 1]].map($ => { const U = 1 / ($ = o.transformMat4([], $, l))[3] / h * b; return o.mul$1($, $, [U, U, 1 / $[3], U]) }), D = [[0, 1, 2], [6, 5, 4], [0, 3, 7], [2, 1, 5], [3, 2, 6], [0, 4, 5]].map($ => { const U = o.sub([], E[$[0]], E[$[1]]), W = o.sub([], E[$[2]], E[$[1]]), te = o.normalize([], o.cross([], U, W)), ae = -o.dot(te, E[$[1]]); return te.concat(ae) }); return new Qc(E, D) } } class Iu { constructor(l, h) { this.min = l, this.max = h, this.center = o.scale$1([], o.add([], this.min, this.max), .5) } quadrant(l) { const h = [l % 2 == 0, l < 2], g = o.clone$2(this.min), b = o.clone$2(this.max); for (let E = 0; E < h.length; E++)g[E] = h[E] ? this.min[E] : this.center[E], b[E] = h[E] ? this.center[E] : this.max[E]; return b[2] = this.max[2], new Iu(g, b) } distanceX(l) { return Math.max(Math.min(this.max[0], l[0]), this.min[0]) - l[0] } distanceY(l) { return Math.max(Math.min(this.max[1], l[1]), this.min[1]) - l[1] } intersects(l) { const h = [[this.min[0], this.min[1], this.min[2], 1], [this.max[0], this.min[1], this.min[2], 1], [this.max[0], this.max[1], this.min[2], 1], [this.min[0], this.max[1], this.min[2], 1], [this.min[0], this.min[1], this.max[2], 1], [this.max[0], this.min[1], this.max[2], 1], [this.max[0], this.max[1], this.max[2], 1], [this.min[0], this.max[1], this.max[2], 1]]; let g = !0; for (let b = 0; b < l.planes.length; b++) { const E = l.planes[b]; let D = 0; for (let $ = 0; $ < h.length; $++)o.dot$1(E, h[$]) >= 0 && D++; if (D === 0) return 0; D !== h.length && (g = !1) } if (g) return 2; for (let b = 0; b < 3; b++) { let E = Number.MAX_VALUE, D = -Number.MAX_VALUE; for (let $ = 0; $ < l.points.length; $++) { const U = l.points[$][b] - this.min[b]; E = Math.min(E, U), D = Math.max(D, U) } if (D < 0 || E > this.max[b] - this.min[b]) return 0 } return 1 } } class Cl { constructor(l = 0, h = 0, g = 0, b = 0) { if (isNaN(l) || l < 0 || isNaN(h) || h < 0 || isNaN(g) || g < 0 || isNaN(b) || b < 0) throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers"); this.top = l, this.bottom = h, this.left = g, this.right = b } interpolate(l, h, g) { return h.top != null && l.top != null && (this.top = o.number(l.top, h.top, g)), h.bottom != null && l.bottom != null && (this.bottom = o.number(l.bottom, h.bottom, g)), h.left != null && l.left != null && (this.left = o.number(l.left, h.left, g)), h.right != null && l.right != null && (this.right = o.number(l.right, h.right, g)), this } getCenter(l, h) { const g = o.clamp((this.left + l - this.right) / 2, 0, l), b = o.clamp((this.top + h - this.bottom) / 2, 0, h); return new o.pointGeometry(g, b) } equals(l) { return this.top === l.top && this.bottom === l.bottom && this.left === l.left && this.right === l.right } clone() { return new Cl(this.top, this.bottom, this.left, this.right) } toJSON() { return { top: this.top, bottom: this.bottom, left: this.left, right: this.right } } } class Ru { constructor(l, h, g, b, E) { this.tileSize = 512, this.maxValidLatitude = 85.051129, this.freezeElevation = !1, this._renderWorldCopies = E === void 0 || !!E, this._minZoom = l || 0, this._maxZoom = h || 22, this._minPitch = g == null ? 0 : g, this._maxPitch = b == null ? 60 : b, this.setMaxBounds(), this.width = 0, this.height = 0, this._center = new o.LngLat(0, 0), this._elevation = 0, this.zoom = 0, this.angle = 0, this._fov = .6435011087932844, this._pitch = 0, this._unmodified = !0, this._edgeInsets = new Cl, this._posMatrixCache = {}, this._alignedPosMatrixCache = {} } clone() { const l = new Ru(this._minZoom, this._maxZoom, this._minPitch, this.maxPitch, this._renderWorldCopies); return l.tileSize = this.tileSize, l.latRange = this.latRange, l.width = this.width, l.height = this.height, l._center = this._center, l._elevation = this._elevation, l.zoom = this.zoom, l.angle = this.angle, l._fov = this._fov, l._pitch = this._pitch, l._unmodified = this._unmodified, l._edgeInsets = this._edgeInsets.clone(), l._calcMatrices(), l } get minZoom() { return this._minZoom } set minZoom(l) { this._minZoom !== l && (this._minZoom = l, this.zoom = Math.max(this.zoom, l)) } get maxZoom() { return this._maxZoom } set maxZoom(l) { this._maxZoom !== l && (this._maxZoom = l, this.zoom = Math.min(this.zoom, l)) } get minPitch() { return this._minPitch } set minPitch(l) { this._minPitch !== l && (this._minPitch = l, this.pitch = Math.max(this.pitch, l)) } get maxPitch() { return this._maxPitch } set maxPitch(l) { this._maxPitch !== l && (this._maxPitch = l, this.pitch = Math.min(this.pitch, l)) } get renderWorldCopies() { return this._renderWorldCopies } set renderWorldCopies(l) { l === void 0 ? l = !0 : l === null && (l = !1), this._renderWorldCopies = l } get worldSize() { return this.tileSize * this.scale } get centerOffset() { return this.centerPoint._sub(this.size._div(2)) } get size() { return new o.pointGeometry(this.width, this.height) } get bearing() { return -this.angle / Math.PI * 180 } set bearing(l) { const h = -o.wrap(l, -180, 180) * Math.PI / 180; var g; this.angle !== h && (this._unmodified = !1, this.angle = h, this._calcMatrices(), this.rotationMatrix = (g = new o.ARRAY_TYPE(4), o.ARRAY_TYPE != Float32Array && (g[1] = 0, g[2] = 0), g[0] = 1, g[3] = 1, g), function (b, E, D) { var $ = E[0], U = E[1], W = E[2], te = E[3], ae = Math.sin(D), fe = Math.cos(D); b[0] = $ * fe + W * ae, b[1] = U * fe + te * ae, b[2] = $ * -ae + W * fe, b[3] = U * -ae + te * fe }(this.rotationMatrix, this.rotationMatrix, this.angle)) } get pitch() { return this._pitch / Math.PI * 180 } set pitch(l) { const h = o.clamp(l, this.minPitch, this.maxPitch) / 180 * Math.PI; this._pitch !== h && (this._unmodified = !1, this._pitch = h, this._calcMatrices()) } get fov() { return this._fov / Math.PI * 180 } set fov(l) { l = Math.max(.01, Math.min(60, l)), this._fov !== l && (this._unmodified = !1, this._fov = l / 180 * Math.PI, this._calcMatrices()) } get zoom() { return this._zoom } set zoom(l) { const h = Math.min(Math.max(l, this.minZoom), this.maxZoom); this._zoom !== h && (this._unmodified = !1, this._zoom = h, this.scale = this.zoomScale(h), this.tileZoom = Math.floor(h), this.zoomFraction = h - this.tileZoom, this._constrain(), this._calcMatrices()) } get center() { return this._center } set center(l) { l.lat === this._center.lat && l.lng === this._center.lng || (this._unmodified = !1, this._center = l, this._constrain(), this._calcMatrices()) } get elevation() { return this._elevation } set elevation(l) { l !== this._elevation && (this._elevation = l, this._constrain(), this._calcMatrices()) } get padding() { return this._edgeInsets.toJSON() } set padding(l) { this._edgeInsets.equals(l) || (this._unmodified = !1, this._edgeInsets.interpolate(this._edgeInsets, l, 1), this._calcMatrices()) } get centerPoint() { return this._edgeInsets.getCenter(this.width, this.height) } isPaddingEqual(l) { return this._edgeInsets.equals(l) } interpolatePadding(l, h, g) { this._unmodified = !1, this._edgeInsets.interpolate(l, h, g), this._constrain(), this._calcMatrices() } coveringZoomLevel(l) { const h = (l.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / l.tileSize)); return Math.max(0, h) } getVisibleUnwrappedCoordinates(l) { const h = [new o.UnwrappedTileID(0, l)]; if (this._renderWorldCopies) { const g = this.pointCoordinate(new o.pointGeometry(0, 0)), b = this.pointCoordinate(new o.pointGeometry(this.width, 0)), E = this.pointCoordinate(new o.pointGeometry(this.width, this.height)), D = this.pointCoordinate(new o.pointGeometry(0, this.height)), $ = Math.floor(Math.min(g.x, b.x, E.x, D.x)), U = Math.floor(Math.max(g.x, b.x, E.x, D.x)), W = 1; for (let te = $ - W; te <= U + W; te++)te !== 0 && h.push(new o.UnwrappedTileID(te, l)) } return h } coveringTiles(l) { var h, g; let b = this.coveringZoomLevel(l); const E = b; if (l.minzoom !== void 0 && b < l.minzoom) return []; l.maxzoom !== void 0 && b > l.maxzoom && (b = l.maxzoom); const D = this.pointCoordinate(this.getCameraPoint()), $ = o.MercatorCoordinate.fromLngLat(this.center), U = Math.pow(2, b), W = [U * D.x, U * D.y, 0], te = [U * $.x, U * $.y, 0], ae = Qc.fromInvProjectionMatrix(this.invProjMatrix, this.worldSize, b); let fe = l.minzoom || 0; !l.terrain && this.pitch <= 60 && this._edgeInsets.top < .1 && (fe = b); const Se = l.terrain ? 2 / Math.min(this.tileSize, l.tileSize) * this.tileSize : 3, _e = Me => ({ aabb: new Iu([Me * U, 0, 0], [(Me + 1) * U, U, 0]), zoom: 0, x: 0, y: 0, wrap: Me, fullyVisible: !1 }), we = [], Be = [], je = b, et = l.reparseOverscaled ? E : b; if (this._renderWorldCopies) for (let Me = 1; Me <= 3; Me++)we.push(_e(-Me)), we.push(_e(Me)); for (we.push(_e(0)); we.length > 0;) { const Me = we.pop(), at = Me.x, nt = Me.y; let xt = Me.fullyVisible; if (!xt) { const fn = Me.aabb.intersects(ae); if (fn === 0) continue; xt = fn === 2 } const _t = l.terrain ? W : te, Ft = Me.aabb.distanceX(_t), vt = Me.aabb.distanceY(_t), sn = Math.max(Math.abs(Ft), Math.abs(vt)), Yt = Se + (1 << je - Me.zoom) - 2; if (Me.zoom === je || sn > Yt && Me.zoom >= fe) { const fn = je - Me.zoom, Fn = W[0] - .5 - (at << fn), Un = W[1] - .5 - (nt << fn); Be.push({ tileID: new o.OverscaledTileID(Me.zoom === je ? et : Me.zoom, Me.wrap, Me.zoom, at, nt), distanceSq: o.sqrLen([te[0] - .5 - at, te[1] - .5 - nt]), tileDistanceToCamera: Math.sqrt(Fn * Fn + Un * Un) }) } else for (let fn = 0; fn < 4; fn++) { const Fn = (at << 1) + fn % 2, Un = (nt << 1) + (fn >> 1), Pn = Me.zoom + 1; let fr = Me.aabb.quadrant(fn); if (l.terrain) { const hr = new o.OverscaledTileID(Pn, Me.wrap, Pn, Fn, Un), er = l.terrain.getMinMaxElevation(hr), ir = (h = er.minElevation) !== null && h !== void 0 ? h : this.elevation, vr = (g = er.maxElevation) !== null && g !== void 0 ? g : this.elevation; fr = new Iu([fr.min[0], fr.min[1], ir], [fr.max[0], fr.max[1], vr]) } we.push({ aabb: fr, zoom: Pn, x: Fn, y: Un, wrap: Me.wrap, fullyVisible: xt }) } } return Be.sort((Me, at) => Me.distanceSq - at.distanceSq).map(Me => Me.tileID) } resize(l, h) { this.width = l, this.height = h, this.pixelsToGLUnits = [2 / l, -2 / h], this._constrain(), this._calcMatrices() } get unmodified() { return this._unmodified } zoomScale(l) { return Math.pow(2, l) } scaleZoom(l) { return Math.log(l) / Math.LN2 } project(l) { const h = o.clamp(l.lat, -this.maxValidLatitude, this.maxValidLatitude); return new o.pointGeometry(o.mercatorXfromLng(l.lng) * this.worldSize, o.mercatorYfromLat(h) * this.worldSize) } unproject(l) { return new o.MercatorCoordinate(l.x / this.worldSize, l.y / this.worldSize).toLngLat() } get point() { return this.project(this.center) } updateElevation(l) { this.freezeElevation || (this.elevation = l ? this.getElevation(this._center, l) : 0) } getElevation(l, h) { const g = o.MercatorCoordinate.fromLngLat(l), b = (1 << this.tileZoom) * o.EXTENT, E = g.x * b, D = g.y * b, $ = Math.floor(E / o.EXTENT), U = Math.floor(D / o.EXTENT), W = new o.OverscaledTileID(this.tileZoom, 0, this.tileZoom, $, U); return h.getElevation(W, E % o.EXTENT, D % o.EXTENT, o.EXTENT) } getCameraPosition() { return { lngLat: this.pointLocation(this.getCameraPoint()), altitude: Math.cos(this._pitch) * this.cameraToCenterDistance / this._pixelPerMeter + this.elevation } } recalculateZoom(l) { const h = this.pointLocation(this.centerPoint, l), g = this.getElevation(h, l); if (!(this.elevation - g)) return; const b = this.getCameraPosition(), E = o.MercatorCoordinate.fromLngLat(b.lngLat, b.altitude), D = o.MercatorCoordinate.fromLngLat(h, g), $ = E.x - D.x, U = E.y - D.y, W = E.z - D.z, te = Math.sqrt($ * $ + U * U + W * W), ae = this.scaleZoom(this.cameraToCenterDistance / te / this.tileSize); this._elevation = g, this._center = h, this.zoom = ae } setLocationAtPoint(l, h) { const g = this.pointCoordinate(h), b = this.pointCoordinate(this.centerPoint), E = this.locationCoordinate(l), D = new o.MercatorCoordinate(E.x - (g.x - b.x), E.y - (g.y - b.y)); this.center = this.coordinateLocation(D), this._renderWorldCopies && (this.center = this.center.wrap()) } locationPoint(l, h) { return h ? this.coordinatePoint(this.locationCoordinate(l), this.getElevation(l, h), this.pixelMatrix3D) : this.coordinatePoint(this.locationCoordinate(l)) } pointLocation(l, h) { return this.coordinateLocation(this.pointCoordinate(l, h)) } locationCoordinate(l) { return o.MercatorCoordinate.fromLngLat(l) } coordinateLocation(l) { return l && l.toLngLat() } pointCoordinate(l, h) { if (h) { const fe = h.pointCoordinate(l); if (fe != null) return fe } const g = [l.x, l.y, 0, 1], b = [l.x, l.y, 1, 1]; o.transformMat4(g, g, this.pixelMatrixInverse), o.transformMat4(b, b, this.pixelMatrixInverse); const E = g[3], D = b[3], $ = g[1] / E, U = b[1] / D, W = g[2] / E, te = b[2] / D, ae = W === te ? 0 : (0 - W) / (te - W); return new o.MercatorCoordinate(o.number(g[0] / E, b[0] / D, ae) / this.worldSize, o.number($, U, ae) / this.worldSize) } coordinatePoint(l, h = 0, g = this.pixelMatrix) { const b = [l.x * this.worldSize, l.y * this.worldSize, h, 1]; return o.transformMat4(b, b, g), new o.pointGeometry(b[0] / b[3], b[1] / b[3]) } getBounds() { const l = Math.max(0, this.height / 2 - this.getHorizon()); return new o.LngLatBounds().extend(this.pointLocation(new o.pointGeometry(0, l))).extend(this.pointLocation(new o.pointGeometry(this.width, l))).extend(this.pointLocation(new o.pointGeometry(this.width, this.height))).extend(this.pointLocation(new o.pointGeometry(0, this.height))) } getMaxBounds() { return this.latRange && this.latRange.length === 2 && this.lngRange && this.lngRange.length === 2 ? new o.LngLatBounds([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]) : null } getHorizon() { return Math.tan(Math.PI / 2 - this._pitch) * this.cameraToCenterDistance * .85 } setMaxBounds(l) { l ? (this.lngRange = [l.getWest(), l.getEast()], this.latRange = [l.getSouth(), l.getNorth()], this._constrain()) : (this.lngRange = null, this.latRange = [-this.maxValidLatitude, this.maxValidLatitude]) } calculatePosMatrix(l, h = !1) { const g = l.key, b = h ? this._alignedPosMatrixCache : this._posMatrixCache; if (b[g]) return b[g]; const E = l.canonical, D = this.worldSize / this.zoomScale(E.z), $ = E.x + Math.pow(2, E.z) * l.wrap, U = o.identity(new Float64Array(16)); return o.translate(U, U, [$ * D, E.y * D, 0]), o.scale(U, U, [D / o.EXTENT, D / o.EXTENT, 1]), o.multiply(U, h ? this.alignedProjMatrix : this.projMatrix, U), b[g] = new Float32Array(U), b[g] } customLayerMatrix() { return this.mercatorMatrix.slice() } _constrain() { if (!this.center || !this.width || !this.height || this._constraining) return; this._constraining = !0; let l, h, g, b, E = -90, D = 90, $ = -180, U = 180; const W = this.size, te = this._unmodified; if (this.latRange) { const Se = this.latRange; E = o.mercatorYfromLat(Se[1]) * this.worldSize, D = o.mercatorYfromLat(Se[0]) * this.worldSize, l = D - E < W.y ? W.y / (D - E) : 0 } if (this.lngRange) { const Se = this.lngRange; $ = o.wrap(o.mercatorXfromLng(Se[0]) * this.worldSize, 0, this.worldSize), U = o.wrap(o.mercatorXfromLng(Se[1]) * this.worldSize, 0, this.worldSize), U < $ && (U += this.worldSize), h = U - $ < W.x ? W.x / (U - $) : 0 } const ae = this.point, fe = Math.max(h || 0, l || 0); if (fe) return this.center = this.unproject(new o.pointGeometry(h ? (U + $) / 2 : ae.x, l ? (D + E) / 2 : ae.y)), this.zoom += this.scaleZoom(fe), this._unmodified = te, void (this._constraining = !1); if (this.latRange) { const Se = ae.y, _e = W.y / 2; Se - _e < E && (b = E + _e), Se + _e > D && (b = D - _e) } if (this.lngRange) { const Se = ($ + U) / 2, _e = o.wrap(ae.x, Se - this.worldSize / 2, Se + this.worldSize / 2), we = W.x / 2; _e - we < $ && (g = $ + we), _e + we > U && (g = U - we) } g === void 0 && b === void 0 || (this.center = this.unproject(new o.pointGeometry(g !== void 0 ? g : ae.x, b !== void 0 ? b : ae.y)).wrap()), this._unmodified = te, this._constraining = !1 } _calcMatrices() { if (!this.height) return; const l = this.centerOffset, h = this.point.x, g = this.point.y; this.cameraToCenterDistance = .5 / Math.tan(this._fov / 2) * this.height, this._pixelPerMeter = o.mercatorZfromAltitude(1, this.center.lat) * this.worldSize; let b = o.identity(new Float64Array(16)); o.scale(b, b, [this.width / 2, -this.height / 2, 1]), o.translate(b, b, [1, -1, 0]), this.labelPlaneMatrix = b, b = o.identity(new Float64Array(16)), o.scale(b, b, [1, -1, 1]), o.translate(b, b, [-1, -1, 0]), o.scale(b, b, [2 / this.width, 2 / this.height, 1]), this.glCoordMatrix = b, this.cameraToSeaLevelDistance = this.cameraToCenterDistance + this._elevation * this._pixelPerMeter / Math.cos(this._pitch); const E = Math.PI / 2 + this._pitch, D = this._fov * (.5 + l.y / this.height), $ = Math.sin(D) * this.cameraToSeaLevelDistance / Math.sin(o.clamp(Math.PI - E - D, .01, Math.PI - .01)), U = this.getHorizon(), W = 2 * Math.atan(U / this.cameraToCenterDistance) * (.5 + l.y / (2 * U)), te = Math.sin(W) * this.cameraToSeaLevelDistance / Math.sin(o.clamp(Math.PI - E - W, .01, Math.PI - .01)), ae = Math.cos(Math.PI / 2 - this._pitch) * $ + this.cameraToSeaLevelDistance, fe = Math.cos(Math.PI / 2 - this._pitch) * te + this.cameraToSeaLevelDistance, Se = 1.01 * Math.min(ae, fe), _e = this.height / 50; b = new Float64Array(16), o.perspective(b, this._fov, this.width / this.height, _e, Se), b[8] = 2 * -l.x / this.width, b[9] = 2 * l.y / this.height, o.scale(b, b, [1, -1, 1]), o.translate(b, b, [0, 0, -this.cameraToCenterDistance]), o.rotateX(b, b, this._pitch), o.rotateZ(b, b, this.angle), o.translate(b, b, [-h, -g, 0]), this.mercatorMatrix = o.scale([], b, [this.worldSize, this.worldSize, this.worldSize]), o.scale(b, b, [1, 1, this._pixelPerMeter]), this.pixelMatrix = o.multiply(new Float64Array(16), this.labelPlaneMatrix, b), o.translate(b, b, [0, 0, -this.elevation]), this.projMatrix = b, this.invProjMatrix = o.invert([], b), this.pixelMatrix3D = o.multiply(new Float64Array(16), this.labelPlaneMatrix, b); const we = this.width % 2 / 2, Be = this.height % 2 / 2, je = Math.cos(this.angle), et = Math.sin(this.angle), Me = h - Math.round(h) + je * we + et * Be, at = g - Math.round(g) + je * Be + et * we, nt = new Float64Array(b); if (o.translate(nt, nt, [Me > .5 ? Me - 1 : Me, at > .5 ? at - 1 : at, 0]), this.alignedProjMatrix = nt, b = o.invert(new Float64Array(16), this.pixelMatrix), !b) throw new Error("failed to invert matrix"); this.pixelMatrixInverse = b, this._posMatrixCache = {}, this._alignedPosMatrixCache = {} } maxPitchScaleFactor() { if (!this.pixelMatrixInverse) return 1; const l = this.pointCoordinate(new o.pointGeometry(0, 0)), h = [l.x * this.worldSize, l.y * this.worldSize, 0, 1]; return o.transformMat4(h, h, this.pixelMatrix)[3] / this.cameraToCenterDistance } getCameraPoint() { const l = Math.tan(this._pitch) * (this.cameraToCenterDistance || 1); return this.centerPoint.add(new o.pointGeometry(0, l)) } getCameraQueryGeometry(l) { const h = this.getCameraPoint(); if (l.length === 1) return [l[0], h]; { let g = h.x, b = h.y, E = h.x, D = h.y; for (const $ of l) g = Math.min(g, $.x), b = Math.min(b, $.y), E = Math.max(E, $.x), D = Math.max(D, $.y); return [new o.pointGeometry(g, b), new o.pointGeometry(E, b), new o.pointGeometry(E, D), new o.pointGeometry(g, D), new o.pointGeometry(g, b)] } } } class Jm { constructor(l) { this._hashName = l && encodeURIComponent(l), o.bindAll(["_getCurrentHash", "_onHashChange", "_updateHash"], this), this._updateHash = function (h, g) { let b = !1, E = null; const D = () => { E = null, b && (h(), E = setTimeout(D, 300), b = !1) }; return () => (b = !0, E || D(), E) }(this._updateHashUnthrottled.bind(this)) } addTo(l) { return this._map = l, addEventListener("hashchange", this._onHashChange, !1), this._map.on("moveend", this._updateHash), this } remove() { return removeEventListener("hashchange", this._onHashChange, !1), this._map.off("moveend", this._updateHash), clearTimeout(this._updateHash()), delete this._map, this } getHashString(l) { const h = this._map.getCenter(), g = Math.round(100 * this._map.getZoom()) / 100, b = Math.ceil((g * Math.LN2 + Math.log(512 / 360 / .5)) / Math.LN10), E = Math.pow(10, b), D = Math.round(h.lng * E) / E, $ = Math.round(h.lat * E) / E, U = this._map.getBearing(), W = this._map.getPitch(); let te = ""; if (te += l ? `/${D}/${$}/${g}` : `${g}/${$}/${D}`, (U || W) && (te += "/" + Math.round(10 * U) / 10), W && (te += `/${Math.round(W)}`), this._hashName) { const ae = this._hashName; let fe = !1; const Se = window.location.hash.slice(1).split("&").map(_e => { const we = _e.split("=")[0]; return we === ae ? (fe = !0, `${we}=${te}`) : _e }).filter(_e => _e); return fe || Se.push(`${ae}=${te}`), `#${Se.join("&")}` } return `#${te}` } _getCurrentHash() { const l = window.location.hash.replace("#", ""); if (this._hashName) { let h; return l.split("&").map(g => g.split("=")).forEach(g => { g[0] === this._hashName && (h = g) }), (h && h[1] || "").split("/") } return l.split("/") } _onHashChange() { const l = this._getCurrentHash(); if (l.length >= 3 && !l.some(h => isNaN(h))) { const h = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(l[3] || 0) : this._map.getBearing(); return this._map.jumpTo({ center: [+l[2], +l[1]], zoom: +l[0], bearing: h, pitch: +(l[4] || 0) }), !0 } return !1 } _updateHashUnthrottled() { const l = window.location.href.replace(/(#.+)?$/, this.getHashString()); try { window.history.replaceState(window.history.state, null, l) } catch { } } } const Mu = { linearity: .3, easing: o.bezier(0, 0, .3, 1) }, ev = o.extend({ deceleration: 2500, maxSpeed: 1400 }, Mu), tv = o.extend({ deceleration: 20, maxSpeed: 1400 }, Mu), nv = o.extend({ deceleration: 1e3, maxSpeed: 360 }, Mu), Sl = o.extend({ deceleration: 1e3, maxSpeed: 90 }, Mu); class rv { constructor(l) { this._map = l, this.clear() } clear() { this._inertiaBuffer = [] } record(l) { this._drainInertiaBuffer(), this._inertiaBuffer.push({ time: o.exported.now(), settings: l }) } _drainInertiaBuffer() { const l = this._inertiaBuffer, h = o.exported.now(); for (; l.length > 0 && h - l[0].time > 160;)l.shift() } _onMoveEnd(l) { if (this._drainInertiaBuffer(), this._inertiaBuffer.length < 2) return; const h = { zoom: 0, bearing: 0, pitch: 0, pan: new o.pointGeometry(0, 0), pinchAround: void 0, around: void 0 }; for (const { settings: E } of this._inertiaBuffer) h.zoom += E.zoomDelta || 0, h.bearing += E.bearingDelta || 0, h.pitch += E.pitchDelta || 0, E.panDelta && h.pan._add(E.panDelta), E.around && (h.around = E.around), E.pinchAround && (h.pinchAround = E.pinchAround); const g = this._inertiaBuffer[this._inertiaBuffer.length - 1].time - this._inertiaBuffer[0].time, b = {}; if (h.pan.mag()) { const E = Nu(h.pan.mag(), g, o.extend({}, ev, l || {})); b.offset = h.pan.mult(E.amount / h.pan.mag()), b.center = this._map.transform.center, Au(b, E) } if (h.zoom) { const E = Nu(h.zoom, g, tv); b.zoom = this._map.transform.zoom + E.amount, Au(b, E) } if (h.bearing) { const E = Nu(h.bearing, g, nv); b.bearing = this._map.transform.bearing + o.clamp(E.amount, -179, 179), Au(b, E) } if (h.pitch) { const E = Nu(h.pitch, g, Sl); b.pitch = this._map.transform.pitch + E.amount, Au(b, E) } if (b.zoom || b.bearing) { const E = h.pinchAround === void 0 ? h.around : h.pinchAround; b.around = E ? this._map.unproject(E) : this._map.getCenter() } return this.clear(), o.extend(b, { noMoveStart: !0 }) } } function Au(x, l) { (!x.duration || x.duration < l.duration) && (x.duration = l.duration, x.easing = l.easing) } function Nu(x, l, h) { const { maxSpeed: g, linearity: b, deceleration: E } = h, D = o.clamp(x * b / (l / 1e3), -g, g), $ = Math.abs(D) / (E * b); return { easing: h.easing, duration: 1e3 * $, amount: D * ($ / 2) } } class uo extends o.Event { constructor(l, h, g, b = {}) { const E = w.mousePos(h.getCanvasContainer(), g), D = h.unproject(E); super(l, o.extend({ point: E, lngLat: D, originalEvent: g }, b)), this._defaultPrevented = !1, this.target = h } preventDefault() { this._defaultPrevented = !0 } get defaultPrevented() { return this._defaultPrevented } } class Ou extends o.Event { constructor(l, h, g) { const b = l === "touchend" ? g.changedTouches : g.touches, E = w.touchPos(h.getCanvasContainer(), b), D = E.map(U => h.unproject(U)), $ = E.reduce((U, W, te, ae) => U.add(W.div(ae.length)), new o.pointGeometry(0, 0)); super(l, { points: E, point: $, lngLats: D, lngLat: h.unproject($), originalEvent: g }), this._defaultPrevented = !1 } preventDefault() { this._defaultPrevented = !0 } get defaultPrevented() { return this._defaultPrevented } } class co extends o.Event { constructor(l, h, g) { super(l, { originalEvent: g }), this._defaultPrevented = !1 } preventDefault() { this._defaultPrevented = !0 } get defaultPrevented() { return this._defaultPrevented } } class jx { constructor(l, h) { this._map = l, this._clickTolerance = h.clickTolerance } reset() { delete this._mousedownPos } wheel(l) { return this._firePreventable(new co(l.type, this._map, l)) } mousedown(l, h) { return this._mousedownPos = h, this._firePreventable(new uo(l.type, this._map, l)) } mouseup(l) { this._map.fire(new uo(l.type, this._map, l)) } click(l, h) { this._mousedownPos && this._mousedownPos.dist(h) >= this._clickTolerance || this._map.fire(new uo(l.type, this._map, l)) } dblclick(l) { return this._firePreventable(new uo(l.type, this._map, l)) } mouseover(l) { this._map.fire(new uo(l.type, this._map, l)) } mouseout(l) { this._map.fire(new uo(l.type, this._map, l)) } touchstart(l) { return this._firePreventable(new Ou(l.type, this._map, l)) } touchmove(l) { this._map.fire(new Ou(l.type, this._map, l)) } touchend(l) { this._map.fire(new Ou(l.type, this._map, l)) } touchcancel(l) { this._map.fire(new Ou(l.type, this._map, l)) } _firePreventable(l) { if (this._map.fire(l), l.defaultPrevented) return {} } isEnabled() { return !0 } isActive() { return !1 } enable() { } disable() { } } class Ya { constructor(l) { this._map = l } reset() { this._delayContextMenu = !1, this._ignoreContextMenu = !0, delete this._contextMenuEvent } mousemove(l) { this._map.fire(new uo(l.type, this._map, l)) } mousedown() { this._delayContextMenu = !0, this._ignoreContextMenu = !1 } mouseup() { this._delayContextMenu = !1, this._contextMenuEvent && (this._map.fire(new uo("contextmenu", this._map, this._contextMenuEvent)), delete this._contextMenuEvent) } contextmenu(l) { this._delayContextMenu ? this._contextMenuEvent = l : this._ignoreContextMenu || this._map.fire(new uo(l.type, this._map, l)), this._map.listens("contextmenu") && l.preventDefault() } isEnabled() { return !0 } isActive() { return !1 } enable() { } disable() { } } class iv { constructor(l, h) { this._map = l, this._el = l.getCanvasContainer(), this._container = l.getContainer(), this._clickTolerance = h.clickTolerance || 1 } isEnabled() { return !!this._enabled } isActive() { return !!this._active } enable() { this.isEnabled() || (this._enabled = !0) } disable() { this.isEnabled() && (this._enabled = !1) } mousedown(l, h) { this.isEnabled() && l.shiftKey && l.button === 0 && (w.disableDrag(), this._startPos = this._lastPos = h, this._active = !0) } mousemoveWindow(l, h) { if (!this._active) return; const g = h; if (this._lastPos.equals(g) || !this._box && g.dist(this._startPos) < this._clickTolerance) return; const b = this._startPos; this._lastPos = g, this._box || (this._box = w.create("div", "maplibregl-boxzoom mapboxgl-boxzoom", this._container), this._container.classList.add("maplibregl-crosshair", "mapboxgl-crosshair"), this._fireEvent("boxzoomstart", l)); const E = Math.min(b.x, g.x), D = Math.max(b.x, g.x), $ = Math.min(b.y, g.y), U = Math.max(b.y, g.y); w.setTransform(this._box, `translate(${E}px,${$}px)`), this._box.style.width = D - E + "px", this._box.style.height = U - $ + "px" } mouseupWindow(l, h) { if (!this._active || l.button !== 0) return; const g = this._startPos, b = h; if (this.reset(), w.suppressClick(), g.x !== b.x || g.y !== b.y) return this._map.fire(new o.Event("boxzoomend", { originalEvent: l })), { cameraAnimation: E => E.fitScreenCoordinates(g, b, this._map.getBearing(), { linear: !0 }) }; this._fireEvent("boxzoomcancel", l) } keydown(l) { this._active && l.keyCode === 27 && (this.reset(), this._fireEvent("boxzoomcancel", l)) } reset() { this._active = !1, this._container.classList.remove("maplibregl-crosshair", "mapboxgl-crosshair"), this._box && (w.remove(this._box), this._box = null), w.enableDrag(), delete this._startPos, delete this._lastPos } _fireEvent(l, h) { return this._map.fire(new o.Event(l, { originalEvent: h })) } } function ka(x, l) { if (x.length !== l.length) throw new Error(`The number of touches and points are not equal - touches ${x.length}, points ${l.length}`); const h = {}; for (let g = 0; g < x.length; g++)h[x[g].identifier] = l[g]; return h } class Du { constructor(l) { this.reset(), this.numTouches = l.numTouches } reset() { delete this.centroid, delete this.startTime, delete this.touches, this.aborted = !1 } touchstart(l, h, g) { (this.centroid || g.length > this.numTouches) && (this.aborted = !0), this.aborted || (this.startTime === void 0 && (this.startTime = l.timeStamp), g.length === this.numTouches && (this.centroid = function (b) { const E = new o.pointGeometry(0, 0); for (const D of b) E._add(D); return E.div(b.length) }(h), this.touches = ka(g, h))) } touchmove(l, h, g) { if (this.aborted || !this.centroid) return; const b = ka(g, h); for (const E in this.touches) { const D = this.touches[E], $ = b[E]; (!$ || $.dist(D) > 30) && (this.aborted = !0) } } touchend(l, h, g) { if ((!this.centroid || l.timeStamp - this.startTime > 500) && (this.aborted = !0), g.length === 0) { const b = !this.aborted && this.centroid; if (this.reset(), b) return b } } } class eh { constructor(l) { this.singleTap = new Du(l), this.numTaps = l.numTaps, this.reset() } reset() { this.lastTime = 1 / 0, delete this.lastTap, this.count = 0, this.singleTap.reset() } touchstart(l, h, g) { this.singleTap.touchstart(l, h, g) } touchmove(l, h, g) { this.singleTap.touchmove(l, h, g) } touchend(l, h, g) { const b = this.singleTap.touchend(l, h, g); if (b) { const E = l.timeStamp - this.lastTime < 500, D = !this.lastTap || this.lastTap.dist(b) < 30; if (E && D || this.reset(), this.count++, this.lastTime = l.timeStamp, this.lastTap = b, this.count === this.numTaps) return this.reset(), b } } } class Kx { constructor() { this._zoomIn = new eh({ numTouches: 1, numTaps: 2 }), this._zoomOut = new eh({ numTouches: 2, numTaps: 1 }), this.reset() } reset() { this._active = !1, this._zoomIn.reset(), this._zoomOut.reset() } touchstart(l, h, g) { this._zoomIn.touchstart(l, h, g), this._zoomOut.touchstart(l, h, g) } touchmove(l, h, g) { this._zoomIn.touchmove(l, h, g), this._zoomOut.touchmove(l, h, g) } touchend(l, h, g) { const b = this._zoomIn.touchend(l, h, g), E = this._zoomOut.touchend(l, h, g); return b ? (this._active = !0, l.preventDefault(), setTimeout(() => this.reset(), 0), { cameraAnimation: D => D.easeTo({ duration: 300, zoom: D.getZoom() + 1, around: D.unproject(b) }, { originalEvent: l }) }) : E ? (this._active = !0, l.preventDefault(), setTimeout(() => this.reset(), 0), { cameraAnimation: D => D.easeTo({ duration: 300, zoom: D.getZoom() - 1, around: D.unproject(E) }, { originalEvent: l }) }) : void 0 } touchcancel() { this.reset() } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } const Hx = { 0: 1, 2: 2 }; class Jc { constructor(l) { this.reset(), this._clickTolerance = l.clickTolerance || 1 } reset() { this._active = !1, this._moved = !1, delete this._lastPoint, delete this._eventButton } _correctButton(l, h) { return !1 } _move(l, h) { return {} } mousedown(l, h) { if (this._lastPoint) return; const g = w.mouseButton(l); this._correctButton(l, g) && (this._lastPoint = h, this._eventButton = g) } mousemoveWindow(l, h) { const g = this._lastPoint; if (g) { if (l.preventDefault(), function (b, E) { const D = Hx[E]; return b.buttons === void 0 || (b.buttons & D) !== D }(l, this._eventButton)) this.reset(); else if (this._moved || !(h.dist(g) < this._clickTolerance)) return this._moved = !0, this._lastPoint = h, this._move(g, h) } } mouseupWindow(l) { this._lastPoint && w.mouseButton(l) === this._eventButton && (this._moved && w.suppressClick(), this.reset()) } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } class Lu extends Jc { mousedown(l, h) { super.mousedown(l, h), this._lastPoint && (this._active = !0) } _correctButton(l, h) { return h === 0 && !l.ctrlKey } _move(l, h) { return { around: h, panDelta: h.sub(l) } } } class Ia extends Jc { _correctButton(l, h) { return h === 0 && l.ctrlKey || h === 2 } _move(l, h) { const g = .8 * (h.x - l.x); if (g) return this._active = !0, { bearingDelta: g } } contextmenu(l) { l.preventDefault() } } class mn extends Jc { _correctButton(l, h) { return h === 0 && l.ctrlKey || h === 2 } _move(l, h) { const g = -.5 * (h.y - l.y); if (g) return this._active = !0, { pitchDelta: g } } contextmenu(l) { l.preventDefault() } } class ov { constructor(l, h) { this._minTouches = l.cooperativeGestures ? 2 : 1, this._clickTolerance = l.clickTolerance || 1, this._map = h, this.reset() } reset() { this._active = !1, this._touches = {}, this._sum = new o.pointGeometry(0, 0), setTimeout(() => { this._cancelCooperativeMessage = !1 }, 200) } touchstart(l, h, g) { return this._calculateTransform(l, h, g) } touchmove(l, h, g) { if (this._map._cooperativeGestures && (this._minTouches === 2 && g.length < 2 && !this._cancelCooperativeMessage ? this._map._onCooperativeGesture(l, !1, g.length) : this._cancelCooperativeMessage || (this._cancelCooperativeMessage = !0)), this._active && !(g.length < this._minTouches)) return l.preventDefault(), this._calculateTransform(l, h, g) } touchend(l, h, g) { this._calculateTransform(l, h, g), this._active && g.length < this._minTouches && this.reset() } touchcancel() { this.reset() } _calculateTransform(l, h, g) { g.length > 0 && (this._active = !0); const b = ka(g, h), E = new o.pointGeometry(0, 0), D = new o.pointGeometry(0, 0); let $ = 0; for (const W in b) { const te = b[W], ae = this._touches[W]; ae && (E._add(te), D._add(te.sub(ae)), $++, b[W] = te) } if (this._touches = b, $ < this._minTouches || !D.mag()) return; const U = D.div($); return this._sum._add(U), this._sum.mag() < this._clickTolerance ? void 0 : { around: E.div($), panDelta: U } } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } class ks { constructor() { this.reset() } reset() { this._active = !1, delete this._firstTwoTouches } _start(l) { } _move(l, h, g) { return {} } touchstart(l, h, g) { this._firstTwoTouches || g.length < 2 || (this._firstTwoTouches = [g[0].identifier, g[1].identifier], this._start([h[0], h[1]])) } touchmove(l, h, g) { if (!this._firstTwoTouches) return; l.preventDefault(); const [b, E] = this._firstTwoTouches, D = Qa(g, h, b), $ = Qa(g, h, E); if (!D || !$) return; const U = this._aroundCenter ? null : D.add($).div(2); return this._move([D, $], U, l) } touchend(l, h, g) { if (!this._firstTwoTouches) return; const [b, E] = this._firstTwoTouches, D = Qa(g, h, b), $ = Qa(g, h, E); D && $ || (this._active && w.suppressClick(), this.reset()) } touchcancel() { this.reset() } enable(l) { this._enabled = !0, this._aroundCenter = !!l && l.around === "center" } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } function Qa(x, l, h) { for (let g = 0; g < x.length; g++)if (x[g].identifier === h) return l[g] } function th(x, l) { return Math.log(x / l) / Math.LN2 } class rn extends ks { reset() { super.reset(), delete this._distance, delete this._startDistance } _start(l) { this._startDistance = this._distance = l[0].dist(l[1]) } _move(l, h) { const g = this._distance; if (this._distance = l[0].dist(l[1]), this._active || !(Math.abs(th(this._distance, this._startDistance)) < .1)) return this._active = !0, { zoomDelta: th(this._distance, g), pinchAround: h } } } function ed(x, l) { return 180 * x.angleWith(l) / Math.PI } class Wx extends ks { reset() { super.reset(), delete this._minDiameter, delete this._startVector, delete this._vector } _start(l) { this._startVector = this._vector = l[0].sub(l[1]), this._minDiameter = l[0].dist(l[1]) } _move(l, h) { const g = this._vector; if (this._vector = l[0].sub(l[1]), this._active || !this._isBelowThreshold(this._vector)) return this._active = !0, { bearingDelta: ed(this._vector, g), pinchAround: h } } _isBelowThreshold(l) { this._minDiameter = Math.min(this._minDiameter, l.mag()); const h = 25 / (Math.PI * this._minDiameter) * 360, g = ed(l, this._startVector); return Math.abs(g) < h } } function nh(x) { return Math.abs(x.y) > Math.abs(x.x) } class rh extends ks { constructor(l) { super(), this._map = l } reset() { super.reset(), this._valid = void 0, delete this._firstMove, delete this._lastPoints } touchstart(l, h, g) { super.touchstart(l, h, g), this._currentTouchCount = g.length } _start(l) { this._lastPoints = l, nh(l[0].sub(l[1])) && (this._valid = !1) } _move(l, h, g) { if (this._map._cooperativeGestures && this._currentTouchCount < 3) return; const b = l[0].sub(this._lastPoints[0]), E = l[1].sub(this._lastPoints[1]); return this._valid = this.gestureBeginsVertically(b, E, g.timeStamp), this._valid ? (this._lastPoints = l, this._active = !0, { pitchDelta: (b.y + E.y) / 2 * -.5 }) : void 0 } gestureBeginsVertically(l, h, g) { if (this._valid !== void 0) return this._valid; const b = l.mag() >= 2, E = h.mag() >= 2; if (!b && !E) return; if (!b || !E) return this._firstMove === void 0 && (this._firstMove = g), g - this._firstMove < 100 && void 0; const D = l.y > 0 == h.y > 0; return nh(l) && nh(h) && D } } const av = { panStep: 100, bearingStep: 15, pitchStep: 10 }; class sv { constructor() { const l = av; this._panStep = l.panStep, this._bearingStep = l.bearingStep, this._pitchStep = l.pitchStep, this._rotationDisabled = !1 } reset() { this._active = !1 } keydown(l) { if (l.altKey || l.ctrlKey || l.metaKey) return; let h = 0, g = 0, b = 0, E = 0, D = 0; switch (l.keyCode) { case 61: case 107: case 171: case 187: h = 1; break; case 189: case 109: case 173: h = -1; break; case 37: l.shiftKey ? g = -1 : (l.preventDefault(), E = -1); break; case 39: l.shiftKey ? g = 1 : (l.preventDefault(), E = 1); break; case 38: l.shiftKey ? b = 1 : (l.preventDefault(), D = -1); break; case 40: l.shiftKey ? b = -1 : (l.preventDefault(), D = 1); break; default: return }return this._rotationDisabled && (g = 0, b = 0), { cameraAnimation: $ => { const U = $.getZoom(); $.easeTo({ duration: 300, easeId: "keyboardHandler", easing: Gx, zoom: h ? Math.round(U) + h * (l.shiftKey ? 2 : 1) : U, bearing: $.getBearing() + g * this._bearingStep, pitch: $.getPitch() + b * this._pitchStep, offset: [-E * this._panStep, -D * this._panStep], center: $.getCenter() }, { originalEvent: l }) } } } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } disableRotation() { this._rotationDisabled = !0 } enableRotation() { this._rotationDisabled = !1 } } function Gx(x) { return x * (2 - x) } const lv = 4.000244140625; class ih { constructor(l, h) { this._map = l, this._el = l.getCanvasContainer(), this._handler = h, this._delta = 0, this._defaultZoomRate = .01, this._wheelZoomRate = .0022222222222222222, o.bindAll(["_onTimeout"], this) } setZoomRate(l) { this._defaultZoomRate = l } setWheelZoomRate(l) { this._wheelZoomRate = l } isEnabled() { return !!this._enabled } isActive() { return !!this._active || this._finishTimeout !== void 0 } isZooming() { return !!this._zooming } enable(l) { this.isEnabled() || (this._enabled = !0, this._aroundCenter = l && l.around === "center") } disable() { this.isEnabled() && (this._enabled = !1) } wheel(l) { if (!this.isEnabled()) return; if (this._map._cooperativeGestures) { if (!this._map._metaPress) return; l.preventDefault() } let h = l.deltaMode === WheelEvent.DOM_DELTA_LINE ? 40 * l.deltaY : l.deltaY; const g = o.exported.now(), b = g - (this._lastWheelEventTime || 0); this._lastWheelEventTime = g, h !== 0 && h % lv == 0 ? this._type = "wheel" : h !== 0 && Math.abs(h) < 4 ? this._type = "trackpad" : b > 400 ? (this._type = null, this._lastValue = h, this._timeout = setTimeout(this._onTimeout, 40, l)) : this._type || (this._type = Math.abs(b * h) < 200 ? "trackpad" : "wheel", this._timeout && (clearTimeout(this._timeout), this._timeout = null, h += this._lastValue)), l.shiftKey && h && (h /= 4), this._type && (this._lastWheelEvent = l, this._delta -= h, this._active || this._start(l)), l.preventDefault() } _onTimeout(l) { this._type = "wheel", this._delta -= this._lastValue, this._active || this._start(l) } _start(l) { if (!this._delta) return; this._frameId && (this._frameId = null), this._active = !0, this.isZooming() || (this._zooming = !0), this._finishTimeout && (clearTimeout(this._finishTimeout), delete this._finishTimeout); const h = w.mousePos(this._el, l); this._around = o.LngLat.convert(this._aroundCenter ? this._map.getCenter() : this._map.unproject(h)), this._aroundPoint = this._map.transform.locationPoint(this._around), this._frameId || (this._frameId = !0, this._handler._triggerRenderFrame()) } renderFrame() { if (!this._frameId || (this._frameId = null, !this.isActive())) return; const l = this._map.transform; if (this._delta !== 0) { const $ = this._type === "wheel" && Math.abs(this._delta) > lv ? this._wheelZoomRate : this._defaultZoomRate; let U = 2 / (1 + Math.exp(-Math.abs(this._delta * $))); this._delta < 0 && U !== 0 && (U = 1 / U); const W = typeof this._targetZoom == "number" ? l.zoomScale(this._targetZoom) : l.scale; this._targetZoom = Math.min(l.maxZoom, Math.max(l.minZoom, l.scaleZoom(W * U))), this._type === "wheel" && (this._startZoom = l.zoom, this._easing = this._smoothOutEasing(200)), this._delta = 0 } const h = typeof this._targetZoom == "number" ? this._targetZoom : l.zoom, g = this._startZoom, b = this._easing; let E, D = !1; if (this._type === "wheel" && g && b) { const $ = Math.min((o.exported.now() - this._lastWheelEventTime) / 200, 1), U = b($); E = o.number(g, h, U), $ < 1 ? this._frameId || (this._frameId = !0) : D = !0 } else E = h, D = !0; return this._active = !0, D && (this._active = !1, this._finishTimeout = setTimeout(() => { this._zooming = !1, this._handler._triggerRenderFrame(), delete this._targetZoom, delete this._finishTimeout }, 200)), { noInertia: !0, needsRenderFrame: !D, zoomDelta: E - l.zoom, around: this._aroundPoint, originalEvent: this._lastWheelEvent } } _smoothOutEasing(l) { let h = o.ease; if (this._prevEase) { const g = this._prevEase, b = (o.exported.now() - g.start) / g.duration, E = g.easing(b + .01) - g.easing(b), D = .27 / Math.sqrt(E * E + 1e-4) * .01, $ = Math.sqrt(.0729 - D * D); h = o.bezier(D, $, .25, 1) } return this._prevEase = { start: o.exported.now(), duration: l, easing: h }, h } reset() { this._active = !1 } } class oh { constructor(l, h) { this._clickZoom = l, this._tapZoom = h } enable() { this._clickZoom.enable(), this._tapZoom.enable() } disable() { this._clickZoom.disable(), this._tapZoom.disable() } isEnabled() { return this._clickZoom.isEnabled() && this._tapZoom.isEnabled() } isActive() { return this._clickZoom.isActive() || this._tapZoom.isActive() } } class ah { constructor() { this.reset() } reset() { this._active = !1 } dblclick(l, h) { return l.preventDefault(), { cameraAnimation: g => { g.easeTo({ duration: 300, zoom: g.getZoom() + (l.shiftKey ? -1 : 1), around: g.unproject(h) }, { originalEvent: l }) } } } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } class sh { constructor() { this._tap = new eh({ numTouches: 1, numTaps: 1 }), this.reset() } reset() { this._active = !1, delete this._swipePoint, delete this._swipeTouch, delete this._tapTime, this._tap.reset() } touchstart(l, h, g) { this._swipePoint || (this._tapTime && l.timeStamp - this._tapTime > 500 && this.reset(), this._tapTime ? g.length > 0 && (this._swipePoint = h[0], this._swipeTouch = g[0].identifier) : this._tap.touchstart(l, h, g)) } touchmove(l, h, g) { if (this._tapTime) { if (this._swipePoint) { if (g[0].identifier !== this._swipeTouch) return; const b = h[0], E = b.y - this._swipePoint.y; return this._swipePoint = b, l.preventDefault(), this._active = !0, { zoomDelta: E / 128 } } } else this._tap.touchmove(l, h, g) } touchend(l, h, g) { this._tapTime ? this._swipePoint && g.length === 0 && this.reset() : this._tap.touchend(l, h, g) && (this._tapTime = l.timeStamp) } touchcancel() { this.reset() } enable() { this._enabled = !0 } disable() { this._enabled = !1, this.reset() } isEnabled() { return this._enabled } isActive() { return this._active } } class Xi { constructor(l, h, g) { this._el = l, this._mousePan = h, this._touchPan = g } enable(l) { this._inertiaOptions = l || {}, this._mousePan.enable(), this._touchPan.enable(), this._el.classList.add("maplibregl-touch-drag-pan", "mapboxgl-touch-drag-pan") } disable() { this._mousePan.disable(), this._touchPan.disable(), this._el.classList.remove("maplibregl-touch-drag-pan", "mapboxgl-touch-drag-pan") } isEnabled() { return this._mousePan.isEnabled() && this._touchPan.isEnabled() } isActive() { return this._mousePan.isActive() || this._touchPan.isActive() } } class Ja { constructor(l, h, g) { this._pitchWithRotate = l.pitchWithRotate, this._mouseRotate = h, this._mousePitch = g } enable() { this._mouseRotate.enable(), this._pitchWithRotate && this._mousePitch.enable() } disable() { this._mouseRotate.disable(), this._mousePitch.disable() } isEnabled() { return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled()) } isActive() { return this._mouseRotate.isActive() || this._mousePitch.isActive() } } class uv { constructor(l, h, g, b) { this._el = l, this._touchZoom = h, this._touchRotate = g, this._tapDragZoom = b, this._rotationDisabled = !1, this._enabled = !0 } enable(l) { this._touchZoom.enable(l), this._rotationDisabled || this._touchRotate.enable(l), this._tapDragZoom.enable(), this._el.classList.add("maplibregl-touch-zoom-rotate", "mapboxgl-touch-zoom-rotate") } disable() { this._touchZoom.disable(), this._touchRotate.disable(), this._tapDragZoom.disable(), this._el.classList.remove("maplibregl-touch-zoom-rotate", "mapboxgl-touch-zoom-rotate") } isEnabled() { return this._touchZoom.isEnabled() && (this._rotationDisabled || this._touchRotate.isEnabled()) && this._tapDragZoom.isEnabled() } isActive() { return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive() } disableRotation() { this._rotationDisabled = !0, this._touchRotate.disable() } enableRotation() { this._rotationDisabled = !1, this._touchZoom.isEnabled() && this._touchRotate.enable() } } const El = x => x.zoom || x.drag || x.pitch || x.rotate; class lh extends o.Event { } function zu(x) { return x.panDelta && x.panDelta.mag() || x.zoomDelta || x.bearingDelta || x.pitchDelta } class cv { constructor(l, h) { this._map = l, this._el = this._map.getCanvasContainer(), this._handlers = [], this._handlersById = {}, this._changes = [], this._inertia = new rv(l), this._bearingSnap = h.bearingSnap, this._previousActiveHandlers = {}, this._eventsInProgress = {}, this._addDefaultHandlers(h), o.bindAll(["handleEvent", "handleWindowEvent"], this); const g = this._el; this._listeners = [[g, "touchstart", { passive: !0 }], [g, "touchmove", { passive: !1 }], [g, "touchend", void 0], [g, "touchcancel", void 0], [g, "mousedown", void 0], [g, "mousemove", void 0], [g, "mouseup", void 0], [document, "mousemove", { capture: !0 }], [document, "mouseup", void 0], [g, "mouseover", void 0], [g, "mouseout", void 0], [g, "dblclick", void 0], [g, "click", void 0], [g, "keydown", { capture: !1 }], [g, "keyup", void 0], [g, "wheel", { passive: !1 }], [g, "contextmenu", void 0], [window, "blur", void 0]]; for (const [b, E, D] of this._listeners) w.addEventListener(b, E, b === document ? this.handleWindowEvent : this.handleEvent, D) } destroy() { for (const [l, h, g] of this._listeners) w.removeEventListener(l, h, l === document ? this.handleWindowEvent : this.handleEvent, g) } _addDefaultHandlers(l) { const h = this._map, g = h.getCanvasContainer(); this._add("mapEvent", new jx(h, l)); const b = h.boxZoom = new iv(h, l); this._add("boxZoom", b); const E = new Kx, D = new ah; h.doubleClickZoom = new oh(D, E), this._add("tapZoom", E), this._add("clickZoom", D); const $ = new sh; this._add("tapDragZoom", $); const U = h.touchPitch = new rh(h); this._add("touchPitch", U); const W = new Ia(l), te = new mn(l); h.dragRotate = new Ja(l, W, te), this._add("mouseRotate", W, ["mousePitch"]), this._add("mousePitch", te, ["mouseRotate"]); const ae = new Lu(l), fe = new ov(l, h); h.dragPan = new Xi(g, ae, fe), this._add("mousePan", ae), this._add("touchPan", fe, ["touchZoom", "touchRotate"]); const Se = new Wx, _e = new rn; h.touchZoomRotate = new uv(g, _e, Se, $), this._add("touchRotate", Se, ["touchPan", "touchZoom"]), this._add("touchZoom", _e, ["touchPan", "touchRotate"]); const we = h.scrollZoom = new ih(h, this); this._add("scrollZoom", we, ["mousePan"]); const Be = h.keyboard = new sv; this._add("keyboard", Be), this._add("blockableMapEvent", new Ya(h)); for (const je of ["boxZoom", "doubleClickZoom", "tapDragZoom", "touchPitch", "dragRotate", "dragPan", "touchZoomRotate", "scrollZoom", "keyboard"]) l.interactive && l[je] && h[je].enable(l[je]) } _add(l, h, g) { this._handlers.push({ handlerName: l, handler: h, allowed: g }), this._handlersById[l] = h } stop(l) { if (!this._updatingCamera) { for (const { handler: h } of this._handlers) h.reset(); this._inertia.clear(), this._fireEvents({}, {}, l), this._changes = [] } } isActive() { for (const { handler: l } of this._handlers) if (l.isActive()) return !0; return !1 } isZooming() { return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming() } isRotating() { return !!this._eventsInProgress.rotate } isMoving() { return Boolean(El(this._eventsInProgress)) || this.isZooming() } _blockedByActive(l, h, g) { for (const b in l) if (b !== g && (!h || h.indexOf(b) < 0)) return !0; return !1 } handleWindowEvent(l) { this.handleEvent(l, `${l.type}Window`) } _getMapTouches(l) { const h = []; for (const g of l) this._el.contains(g.target) && h.push(g); return h } handleEvent(l, h) { if (l.type === "blur") return void this.stop(!0); this._updatingCamera = !0; const g = l.type === "renderFrame" ? void 0 : l, b = { needsRenderFrame: !1 }, E = {}, D = {}, $ = l.touches, U = $ ? this._getMapTouches($) : void 0, W = U ? w.touchPos(this._el, U) : w.mousePos(this._el, l); for (const { handlerName: fe, handler: Se, allowed: _e } of this._handlers) { if (!Se.isEnabled()) continue; let we; this._blockedByActive(D, _e, fe) ? Se.reset() : Se[h || l.type] && (we = Se[h || l.type](l, W, U), this.mergeHandlerResult(b, E, we, fe, g), we && we.needsRenderFrame && this._triggerRenderFrame()), (we || Se.isActive()) && (D[fe] = Se) } const te = {}; for (const fe in this._previousActiveHandlers) D[fe] || (te[fe] = g); this._previousActiveHandlers = D, (Object.keys(te).length || zu(b)) && (this._changes.push([b, E, te]), this._triggerRenderFrame()), (Object.keys(D).length || zu(b)) && this._map._stop(!0), this._updatingCamera = !1; const { cameraAnimation: ae } = b; ae && (this._inertia.clear(), this._fireEvents({}, {}, !0), this._changes = [], ae(this._map)) } mergeHandlerResult(l, h, g, b, E) { if (!g) return; o.extend(l, g); const D = { handlerName: b, originalEvent: g.originalEvent || E }; g.zoomDelta !== void 0 && (h.zoom = D), g.panDelta !== void 0 && (h.drag = D), g.pitchDelta !== void 0 && (h.pitch = D), g.bearingDelta !== void 0 && (h.rotate = D) } _applyChanges() { const l = {}, h = {}, g = {}; for (const [b, E, D] of this._changes) b.panDelta && (l.panDelta = (l.panDelta || new o.pointGeometry(0, 0))._add(b.panDelta)), b.zoomDelta && (l.zoomDelta = (l.zoomDelta || 0) + b.zoomDelta), b.bearingDelta && (l.bearingDelta = (l.bearingDelta || 0) + b.bearingDelta), b.pitchDelta && (l.pitchDelta = (l.pitchDelta || 0) + b.pitchDelta), b.around !== void 0 && (l.around = b.around), b.pinchAround !== void 0 && (l.pinchAround = b.pinchAround), b.noInertia && (l.noInertia = b.noInertia), o.extend(h, E), o.extend(g, D); this._updateMapTransform(l, h, g), this._changes = [] } _updateMapTransform(l, h, g) { const b = this._map, E = b.transform, D = b.style && b.style.terrain; if (!(zu(l) || D && this._drag)) return this._fireEvents(h, g, !0); let { panDelta: $, zoomDelta: U, bearingDelta: W, pitchDelta: te, around: ae, pinchAround: fe } = l; fe !== void 0 && (ae = fe), b._stop(!0), ae = ae || b.transform.centerPoint; const Se = E.pointLocation($ ? ae.sub($) : ae); W && (E.bearing += W), te && (E.pitch += te), U && (E.zoom += U), D ? h.drag && !this._drag ? (this._drag = { center: E.centerPoint, lngLat: E.pointLocation(ae), point: ae, handlerName: h.drag.handlerName }, b.fire(new o.Event("freezeElevation", { freeze: !0 }))) : this._drag && g[this._drag.handlerName] ? (b.fire(new o.Event("freezeElevation", { freeze: !1 })), this._drag = null) : h.drag && this._drag && (E.center = E.pointLocation(E.centerPoint.sub($))) : E.setLocationAtPoint(Se, ae), this._map._update(), l.noInertia || this._inertia.record(l), this._fireEvents(h, g, !0) } _fireEvents(l, h, g) { const b = El(this._eventsInProgress), E = El(l), D = {}; for (const te in l) { const { originalEvent: ae } = l[te]; this._eventsInProgress[te] || (D[`${te}start`] = ae), this._eventsInProgress[te] = l[te] } !b && E && this._fireEvent("movestart", E.originalEvent); for (const te in D) this._fireEvent(te, D[te]); E && this._fireEvent("move", E.originalEvent); for (const te in l) { const { originalEvent: ae } = l[te]; this._fireEvent(te, ae) } const $ = {}; let U; for (const te in this._eventsInProgress) { const { handlerName: ae, originalEvent: fe } = this._eventsInProgress[te]; this._handlersById[ae].isActive() || (delete this._eventsInProgress[te], U = h[ae] || fe, $[`${te}end`] = U) } for (const te in $) this._fireEvent(te, $[te]); const W = El(this._eventsInProgress); if (g && (b || E) && !W) { this._updatingCamera = !0; const te = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions), ae = fe => fe !== 0 && -this._bearingSnap < fe && fe < this._bearingSnap; te ? (ae(te.bearing || this._map.getBearing()) && (te.bearing = 0), this._map.easeTo(te, { originalEvent: U })) : (this._map.fire(new o.Event("moveend", { originalEvent: U })), ae(this._map.getBearing()) && this._map.resetNorth()), this._updatingCamera = !1 } } _fireEvent(l, h) { this._map.fire(new o.Event(l, h ? { originalEvent: h } : {})) } _requestFrame() { return this._map.triggerRepaint(), this._map._renderTaskQueue.add(l => { delete this._frameId, this.handleEvent(new lh("renderFrame", { timeStamp: l })), this._applyChanges() }) } _triggerRenderFrame() { this._frameId === void 0 && (this._frameId = this._requestFrame()) } } const ko = { extend: (x, ...l) => o.extend(x, ...l), run(x) { x() }, logToElement(x, l = !1, h = "log") { const g = window.document.getElementById(h); g && (l && (g.innerHTML = ""), g.innerHTML += `<br>${x}`) } }; class Or extends o.Evented { constructor(l, h) { super(), this._moving = !1, this._zooming = !1, this.transform = l, this._bearingSnap = h.bearingSnap, o.bindAll(["_renderFrameCallback"], this) } getCenter() { return new o.LngLat(this.transform.center.lng, this.transform.center.lat) } setCenter(l, h) { return this.jumpTo({ center: l }, h) } panBy(l, h, g) { return l = o.pointGeometry.convert(l).mult(-1), this.panTo(this.transform.center, o.extend({ offset: l }, h), g) } panTo(l, h, g) { return this.easeTo(o.extend({ center: l }, h), g) } getZoom() { return this.transform.zoom } setZoom(l, h) { return this.jumpTo({ zoom: l }, h), this } zoomTo(l, h, g) { return this.easeTo(o.extend({ zoom: l }, h), g) } zoomIn(l, h) { return this.zoomTo(this.getZoom() + 1, l, h), this } zoomOut(l, h) { return this.zoomTo(this.getZoom() - 1, l, h), this } getBearing() { return this.transform.bearing } setBearing(l, h) { return this.jumpTo({ bearing: l }, h), this } getPadding() { return this.transform.padding } setPadding(l, h) { return this.jumpTo({ padding: l }, h), this } rotateTo(l, h, g) { return this.easeTo(o.extend({ bearing: l }, h), g) } resetNorth(l, h) { return this.rotateTo(0, o.extend({ duration: 1e3 }, l), h), this } resetNorthPitch(l, h) { return this.easeTo(o.extend({ bearing: 0, pitch: 0, duration: 1e3 }, l), h), this } snapToNorth(l, h) { return Math.abs(this.getBearing()) < this._bearingSnap ? this.resetNorth(l, h) : this } getPitch() { return this.transform.pitch } setPitch(l, h) { return this.jumpTo({ pitch: l }, h), this } cameraForBounds(l, h) { l = o.LngLatBounds.convert(l); const g = h && h.bearing || 0; return this._cameraForBoxAndBearing(l.getNorthWest(), l.getSouthEast(), g, h) } _cameraForBoxAndBearing(l, h, g, b) { const E = { top: 0, bottom: 0, right: 0, left: 0 }; if (typeof (b = o.extend({ padding: E, offset: [0, 0], maxZoom: this.transform.maxZoom }, b)).padding == "number") { const nt = b.padding; b.padding = { top: nt, bottom: nt, right: nt, left: nt } } b.padding = o.extend(E, b.padding); const D = this.transform, $ = D.padding, U = D.project(o.LngLat.convert(l)), W = D.project(o.LngLat.convert(h)), te = U.rotate(-g * Math.PI / 180), ae = W.rotate(-g * Math.PI / 180), fe = new o.pointGeometry(Math.max(te.x, ae.x), Math.max(te.y, ae.y)), Se = new o.pointGeometry(Math.min(te.x, ae.x), Math.min(te.y, ae.y)), _e = fe.sub(Se), we = (D.width - ($.left + $.right + b.padding.left + b.padding.right)) / _e.x, Be = (D.height - ($.top + $.bottom + b.padding.top + b.padding.bottom)) / _e.y; if (Be < 0 || we < 0) return void o.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."); const je = Math.min(D.scaleZoom(D.scale * Math.min(we, Be)), b.maxZoom), et = o.pointGeometry.convert(b.offset), Me = new o.pointGeometry((b.padding.left - b.padding.right) / 2, (b.padding.top - b.padding.bottom) / 2).rotate(g * Math.PI / 180), at = et.add(Me).mult(D.scale / D.zoomScale(je)); return { center: D.unproject(U.add(W).div(2).sub(at)), zoom: je, bearing: g } } fitBounds(l, h, g) { return this._fitInternal(this.cameraForBounds(l, h), h, g) } fitScreenCoordinates(l, h, g, b, E) { return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(o.pointGeometry.convert(l)), this.transform.pointLocation(o.pointGeometry.convert(h)), g, b), b, E) } _fitInternal(l, h, g) { return l ? (delete (h = o.extend(l, h)).padding, h.linear ? this.easeTo(h, g) : this.flyTo(h, g)) : this } jumpTo(l, h) { this.stop(); const g = this.transform; let b = !1, E = !1, D = !1; return "zoom" in l && g.zoom !== +l.zoom && (b = !0, g.zoom = +l.zoom), l.center !== void 0 && (g.center = o.LngLat.convert(l.center)), "bearing" in l && g.bearing !== +l.bearing && (E = !0, g.bearing = +l.bearing), "pitch" in l && g.pitch !== +l.pitch && (D = !0, g.pitch = +l.pitch), l.padding == null || g.isPaddingEqual(l.padding) || (g.padding = l.padding), this.fire(new o.Event("movestart", h)).fire(new o.Event("move", h)), b && this.fire(new o.Event("zoomstart", h)).fire(new o.Event("zoom", h)).fire(new o.Event("zoomend", h)), E && this.fire(new o.Event("rotatestart", h)).fire(new o.Event("rotate", h)).fire(new o.Event("rotateend", h)), D && this.fire(new o.Event("pitchstart", h)).fire(new o.Event("pitch", h)).fire(new o.Event("pitchend", h)), this.fire(new o.Event("moveend", h)) } calculateCameraOptionsFromTo(l, h, g, b = 0) { const E = o.MercatorCoordinate.fromLngLat(l, h), D = o.MercatorCoordinate.fromLngLat(g, b), $ = D.x - E.x, U = D.y - E.y, W = D.z - E.z, te = Math.hypot($, U, W); if (te === 0) throw new Error("Can't calculate camera options with same From and To"); const ae = Math.hypot($, U), fe = this.transform.scaleZoom(this.transform.cameraToCenterDistance / te / this.transform.tileSize), Se = 180 * Math.atan2($, -U) / Math.PI; let _e = 180 * Math.acos(ae / te) / Math.PI; return _e = W < 0 ? 90 - _e : 90 + _e, { center: D.toLngLat(), zoom: fe, pitch: _e, bearing: Se } } easeTo(l, h) { this._stop(!1, l.easeId), ((l = o.extend({ offset: [0, 0], duration: 500, easing: o.ease }, l)).animate === !1 || !l.essential && o.exported.prefersReducedMotion) && (l.duration = 0); const g = this.transform, b = this.getZoom(), E = this.getBearing(), D = this.getPitch(), $ = this.getPadding(), U = "zoom" in l ? +l.zoom : b, W = "bearing" in l ? this._normalizeBearing(l.bearing, E) : E, te = "pitch" in l ? +l.pitch : D, ae = "padding" in l ? l.padding : g.padding, fe = o.pointGeometry.convert(l.offset); let Se = g.centerPoint.add(fe); const _e = g.pointLocation(Se), we = o.LngLat.convert(l.center || _e); this._normalizeCenter(we); const Be = g.project(_e), je = g.project(we).sub(Be), et = g.zoomScale(U - b); let Me, at; l.around && (Me = o.LngLat.convert(l.around), at = g.locationPoint(Me)); const nt = { moving: this._moving, zooming: this._zooming, rotating: this._rotating, pitching: this._pitching }; return this._zooming = this._zooming || U !== b, this._rotating = this._rotating || E !== W, this._pitching = this._pitching || te !== D, this._padding = !g.isPaddingEqual(ae), this._easeId = l.easeId, this._prepareEase(h, l.noMoveStart, nt), this._ease(xt => { if (this._zooming && (g.zoom = o.number(b, U, xt)), this._rotating && (g.bearing = o.number(E, W, xt)), this._pitching && (g.pitch = o.number(D, te, xt)), this._padding && (g.interpolatePadding($, ae, xt), Se = g.centerPoint.add(fe)), Me) g.setLocationAtPoint(Me, at); else { const _t = g.zoomScale(g.zoom - b), Ft = U > b ? Math.min(2, et) : Math.max(.5, et), vt = Math.pow(Ft, 1 - xt), sn = g.unproject(Be.add(je.mult(xt * vt)).mult(_t)); g.setLocationAtPoint(g.renderWorldCopies ? sn.wrap() : sn, Se) } this._fireMoveEvents(h) }, xt => { this._afterEase(h, xt) }, l), this } _prepareEase(l, h, g = {}) { this._moving = !0, this.fire(new o.Event("freezeElevation", { freeze: !0 })), h || g.moving || this.fire(new o.Event("movestart", l)), this._zooming && !g.zooming && this.fire(new o.Event("zoomstart", l)), this._rotating && !g.rotating && this.fire(new o.Event("rotatestart", l)), this._pitching && !g.pitching && this.fire(new o.Event("pitchstart", l)) } _fireMoveEvents(l) { this.fire(new o.Event("move", l)), this._zooming && this.fire(new o.Event("zoom", l)), this._rotating && this.fire(new o.Event("rotate", l)), this._pitching && this.fire(new o.Event("pitch", l)) } _afterEase(l, h) { if (this._easeId && h && this._easeId === h) return; delete this._easeId, this.fire(new o.Event("freezeElevation", { freeze: !1 })); const g = this._zooming, b = this._rotating, E = this._pitching; this._moving = !1, this._zooming = !1, this._rotating = !1, this._pitching = !1, this._padding = !1, g && this.fire(new o.Event("zoomend", l)), b && this.fire(new o.Event("rotateend", l)), E && this.fire(new o.Event("pitchend", l)), this.fire(new o.Event("moveend", l)) } flyTo(l, h) { if (!l.essential && o.exported.prefersReducedMotion) { const Pn = o.pick(l, ["center", "zoom", "bearing", "pitch", "around"]); return this.jumpTo(Pn, h) } this.stop(), l = o.extend({ offset: [0, 0], speed: 1.2, curve: 1.42, easing: o.ease }, l); const g = this.transform, b = this.getZoom(), E = this.getBearing(), D = this.getPitch(), $ = this.getPadding(), U = "zoom" in l ? o.clamp(+l.zoom, g.minZoom, g.maxZoom) : b, W = "bearing" in l ? this._normalizeBearing(l.bearing, E) : E, te = "pitch" in l ? +l.pitch : D, ae = "padding" in l ? l.padding : g.padding, fe = g.zoomScale(U - b), Se = o.pointGeometry.convert(l.offset); let _e = g.centerPoint.add(Se); const we = g.pointLocation(_e), Be = o.LngLat.convert(l.center || we); this._normalizeCenter(Be); const je = g.project(we), et = g.project(Be).sub(je); let Me = l.curve; const at = Math.max(g.width, g.height), nt = at / fe, xt = et.mag(); if ("minZoom" in l) { const Pn = o.clamp(Math.min(l.minZoom, b, U), g.minZoom, g.maxZoom), fr = at / g.zoomScale(Pn - b); Me = Math.sqrt(fr / xt * 2) } const _t = Me * Me; function Ft(Pn) { const fr = (nt * nt - at * at + (Pn ? -1 : 1) * _t * _t * xt * xt) / (2 * (Pn ? nt : at) * _t * xt); return Math.log(Math.sqrt(fr * fr + 1) - fr) } function vt(Pn) { return (Math.exp(Pn) - Math.exp(-Pn)) / 2 } function sn(Pn) { return (Math.exp(Pn) + Math.exp(-Pn)) / 2 } const Yt = Ft(0); let fn = function (Pn) { return sn(Yt) / sn(Yt + Me * Pn) }, Fn = function (Pn) { return at * ((sn(Yt) * (vt(fr = Yt + Me * Pn) / sn(fr)) - vt(Yt)) / _t) / xt; var fr }, Un = (Ft(1) - Yt) / Me; if (Math.abs(xt) < 1e-6 || !isFinite(Un)) { if (Math.abs(at - nt) < 1e-6) return this.easeTo(l, h); const Pn = nt < at ? -1 : 1; Un = Math.abs(Math.log(nt / at)) / Me, Fn = function () { return 0 }, fn = function (fr) { return Math.exp(Pn * Me * fr) } } return l.duration = "duration" in l ? +l.duration : 1e3 * Un / ("screenSpeed" in l ? +l.screenSpeed / Me : +l.speed), l.maxDuration && l.duration > l.maxDuration && (l.duration = 0), this._zooming = !0, this._rotating = E !== W, this._pitching = te !== D, this._padding = !g.isPaddingEqual(ae), this._prepareEase(h, !1), this._ease(Pn => { const fr = Pn * Un, hr = 1 / fn(fr); g.zoom = Pn === 1 ? U : b + g.scaleZoom(hr), this._rotating && (g.bearing = o.number(E, W, Pn)), this._pitching && (g.pitch = o.number(D, te, Pn)), this._padding && (g.interpolatePadding($, ae, Pn), _e = g.centerPoint.add(Se)); const er = Pn === 1 ? Be : g.unproject(je.add(et.mult(Fn(fr))).mult(hr)); g.setLocationAtPoint(g.renderWorldCopies ? er.wrap() : er, _e), this._fireMoveEvents(h) }, () => this._afterEase(h), l), this } isEasing() { return !!this._easeFrameId } stop() { return this._stop() } _stop(l, h) { if (this._easeFrameId && (this._cancelRenderFrame(this._easeFrameId), delete this._easeFrameId, delete this._onEaseFrame), this._onEaseEnd) { const g = this._onEaseEnd; delete this._onEaseEnd, g.call(this, h) } if (!l) { const g = this.handlers; g && g.stop(!1) } return this } _ease(l, h, g) { g.animate === !1 || g.duration === 0 ? (l(1), h()) : (this._easeStart = o.exported.now(), this._easeOptions = g, this._onEaseFrame = l, this._onEaseEnd = h, this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback)) } _renderFrameCallback() { const l = Math.min((o.exported.now() - this._easeStart) / this._easeOptions.duration, 1); this._onEaseFrame(this._easeOptions.easing(l)), l < 1 ? this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback) : this.stop() } _normalizeBearing(l, h) { l = o.wrap(l, -180, 180); const g = Math.abs(l - h); return Math.abs(l - 360 - h) < g && (l -= 360), Math.abs(l + 360 - h) < g && (l += 360), l } _normalizeCenter(l) { const h = this.transform; if (!h.renderWorldCopies || h.lngRange) return; const g = l.lng - h.center.lng; l.lng += g > 180 ? -360 : g < -180 ? 360 : 0 } } class Fu { constructor(l = {}) { this.options = l, o.bindAll(["_toggleAttribution", "_updateData", "_updateCompact", "_updateCompactMinimize"], this) } getDefaultPosition() { return "bottom-right" } onAdd(l) { return this._map = l, this._compact = this.options && this.options.compact, this._container = w.create("details", "maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"), this._compactButton = w.create("summary", "maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button", this._container), this._compactButton.addEventListener("click", this._toggleAttribution), this._setElementTitle(this._compactButton, "ToggleAttribution"), this._innerContainer = w.create("div", "maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner", this._container), this._updateAttributions(), this._updateCompact(), this._map.on("styledata", this._updateData), this._map.on("sourcedata", this._updateData), this._map.on("terrain", this._updateData), this._map.on("resize", this._updateCompact), this._map.on("drag", this._updateCompactMinimize), this._container } onRemove() { w.remove(this._container), this._map.off("styledata", this._updateData), this._map.off("sourcedata", this._updateData), this._map.off("terrain", this._updateData), this._map.off("resize", this._updateCompact), this._map.off("drag", this._updateCompactMinimize), this._map = void 0, this._compact = void 0, this._attribHTML = void 0 } _setElementTitle(l, h) { const g = this._map._getUIString(`AttributionControl.${h}`); l.title = g, l.setAttribute("aria-label", g) } _toggleAttribution() { this._container.classList.contains("maplibregl-compact") && (this._container.classList.contains("maplibregl-compact-show") ? (this._container.setAttribute("open", ""), this._container.classList.remove("maplibregl-compact-show", "mapboxgl-compact-show")) : (this._container.classList.add("maplibregl-compact-show", "mapboxgl-compact-show"), this._container.removeAttribute("open"))) } _updateData(l) { !l || l.sourceDataType !== "metadata" && l.sourceDataType !== "visibility" && l.dataType !== "style" && l.type !== "terrain" || this._updateAttributions() } _updateAttributions() { if (!this._map.style) return; let l = []; if (this.options.customAttribution && (Array.isArray(this.options.customAttribution) ? l = l.concat(this.options.customAttribution.map(b => typeof b != "string" ? "" : b)) : typeof this.options.customAttribution == "string" && l.push(this.options.customAttribution)), this._map.style.stylesheet) { const b = this._map.style.stylesheet; this.styleOwner = b.owner, this.styleId = b.id } const h = this._map.style.sourceCaches; for (const b in h) { const E = h[b]; if (E.used || E.usedForTerrain) { const D = E.getSource(); D.attribution && l.indexOf(D.attribution) < 0 && l.push(D.attribution) } } l = l.filter(b => String(b).trim()), l.sort((b, E) => b.length - E.length), l = l.filter((b, E) => { for (let D = E + 1; D < l.length; D++)if (l[D].indexOf(b) >= 0) return !1; return !0 }); const g = l.join(" | "); g !== this._attribHTML && (this._attribHTML = g, l.length ? (this._innerContainer.innerHTML = g, this._container.classList.remove("maplibregl-attrib-empty", "mapboxgl-attrib-empty")) : this._container.classList.add("maplibregl-attrib-empty", "mapboxgl-attrib-empty"), this._updateCompact(), this._editLink = null) } _updateCompact() { this._map.getCanvasContainer().offsetWidth <= 640 || this._compact ? this._compact === !1 ? this._container.setAttribute("open", "") : this._container.classList.contains("maplibregl-compact") || this._container.classList.contains("maplibregl-attrib-empty") || (this._container.setAttribute("open", ""), this._container.classList.add("maplibregl-compact", "mapboxgl-compact", "maplibregl-compact-show", "mapboxgl-compact-show")) : (this._container.setAttribute("open", ""), this._container.classList.contains("maplibregl-compact") && this._container.classList.remove("maplibregl-compact", "maplibregl-compact-show", "mapboxgl-compact", "mapboxgl-compact-show")) } _updateCompactMinimize() { this._container.classList.contains("maplibregl-compact") && this._container.classList.contains("maplibregl-compact-show") && this._container.classList.remove("maplibregl-compact-show", "mapboxgl-compact-show") } } class td { constructor(l = {}) { this.options = l, o.bindAll(["_updateCompact"], this) } getDefaultPosition() { return "bottom-left" } onAdd(l) { this._map = l, this._compact = this.options && this.options.compact, this._container = w.create("div", "maplibregl-ctrl mapboxgl-ctrl"); const h = w.create("a", "maplibregl-ctrl-logo mapboxgl-ctrl-logo"); return h.target = "_blank", h.rel = "noopener nofollow", h.href = "https://maplibre.org/", h.setAttribute("aria-label", this._map._getUIString("LogoControl.Title")), h.setAttribute("rel", "noopener nofollow"), this._container.appendChild(h), this._container.style.display = "block", this._map.on("resize", this._updateCompact), this._updateCompact(), this._container } onRemove() { w.remove(this._container), this._map.off("resize", this._updateCompact), this._map = void 0, this._compact = void 0 } _updateCompact() { const l = this._container.children; if (l.length) { const h = l[0]; this._map.getCanvasContainer().offsetWidth <= 640 || this._compact ? this._compact !== !1 && h.classList.add("maplibregl-compact", "mapboxgl-compact") : h.classList.remove("maplibregl-compact", "mapboxgl-compact") } } } class dv { constructor() { this._queue = [], this._id = 0, this._cleared = !1, this._currentlyRunning = !1 } add(l) { const h = ++this._id; return this._queue.push({ callback: l, id: h, cancelled: !1 }), h } remove(l) { const h = this._currentlyRunning, g = h ? this._queue.concat(h) : this._queue; for (const b of g) if (b.id === l) return void (b.cancelled = !0) } run(l = 0) { if (this._currentlyRunning) throw new Error("Attempting to run(), but is already running."); const h = this._currentlyRunning = this._queue; this._queue = []; for (const g of h) if (!g.cancelled && (g.callback(l), this._cleared)) break; this._cleared = !1, this._currentlyRunning = !1 } clear() { this._currentlyRunning && (this._cleared = !0), this._queue = [] } } const fv = { "AttributionControl.ToggleAttribution": "Toggle attribution", "AttributionControl.MapFeedback": "Map feedback", "FullscreenControl.Enter": "Enter fullscreen", "FullscreenControl.Exit": "Exit fullscreen", "GeolocateControl.FindMyLocation": "Find my location", "GeolocateControl.LocationNotAvailable": "Location not available", "LogoControl.Title": "Mapbox logo", "NavigationControl.ResetBearing": "Reset bearing to north", "NavigationControl.ZoomIn": "Zoom in", "NavigationControl.ZoomOut": "Zoom out", "ScaleControl.Feet": "ft", "ScaleControl.Meters": "m", "ScaleControl.Kilometers": "km", "ScaleControl.Miles": "mi", "ScaleControl.NauticalMiles": "nm", "TerrainControl.enableTerrain": "Enable terrain", "TerrainControl.disableTerrain": "Disable terrain" }, hv = { center: [0, 0], zoom: 0, bearing: 0, pitch: 0, minZoom: -2, maxZoom: 22, minPitch: 0, maxPitch: 60, interactive: !0, scrollZoom: !0, boxZoom: !0, dragRotate: !0, dragPan: !0, keyboard: !0, doubleClickZoom: !0, touchZoomRotate: !0, touchPitch: !0, cooperativeGestures: void 0, bearingSnap: 7, clickTolerance: 3, pitchWithRotate: !0, hash: !1, attributionControl: !0, maplibreLogo: !1, failIfMajorPerformanceCaveat: !1, preserveDrawingBuffer: !1, trackResize: !0, renderWorldCopies: !0, refreshExpiredTiles: !0, maxTileCacheSize: null, localIdeographFontFamily: "sans-serif", transformRequest: null, fadeDuration: 300, crossSourceCollisions: !0 }, qx = { showCompass: !0, showZoom: !0, visualizePitch: !1 }; class oa { constructor(l, h, g = !1) { this._clickTolerance = 10, this.element = h, this.mouseRotate = new Ia({ clickTolerance: l.dragRotate._mouseRotate._clickTolerance }), this.map = l, g && (this.mousePitch = new mn({ clickTolerance: l.dragRotate._mousePitch._clickTolerance })), o.bindAll(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "reset"], this), w.addEventListener(h, "mousedown", this.mousedown), w.addEventListener(h, "touchstart", this.touchstart, { passive: !1 }), w.addEventListener(h, "touchmove", this.touchmove), w.addEventListener(h, "touchend", this.touchend), w.addEventListener(h, "touchcancel", this.reset) } down(l, h) { this.mouseRotate.mousedown(l, h), this.mousePitch && this.mousePitch.mousedown(l, h), w.disableDrag() } move(l, h) { const g = this.map, b = this.mouseRotate.mousemoveWindow(l, h); if (b && b.bearingDelta && g.setBearing(g.getBearing() + b.bearingDelta), this.mousePitch) { const E = this.mousePitch.mousemoveWindow(l, h); E && E.pitchDelta && g.setPitch(g.getPitch() + E.pitchDelta) } } off() { const l = this.element; w.removeEventListener(l, "mousedown", this.mousedown), w.removeEventListener(l, "touchstart", this.touchstart, { passive: !1 }), w.removeEventListener(l, "touchmove", this.touchmove), w.removeEventListener(l, "touchend", this.touchend), w.removeEventListener(l, "touchcancel", this.reset), this.offTemp() } offTemp() { w.enableDrag(), w.removeEventListener(window, "mousemove", this.mousemove), w.removeEventListener(window, "mouseup", this.mouseup) } mousedown(l) { this.down(o.extend({}, l, { ctrlKey: !0, preventDefault: () => l.preventDefault() }), w.mousePos(this.element, l)), w.addEventListener(window, "mousemove", this.mousemove), w.addEventListener(window, "mouseup", this.mouseup) } mousemove(l) { this.move(l, w.mousePos(this.element, l)) } mouseup(l) { this.mouseRotate.mouseupWindow(l), this.mousePitch && this.mousePitch.mouseupWindow(l), this.offTemp() } touchstart(l) { l.targetTouches.length !== 1 ? this.reset() : (this._startPos = this._lastPos = w.touchPos(this.element, l.targetTouches)[0], this.down({ type: "mousedown", button: 0, ctrlKey: !0, preventDefault: () => l.preventDefault() }, this._startPos)) } touchmove(l) { l.targetTouches.length !== 1 ? this.reset() : (this._lastPos = w.touchPos(this.element, l.targetTouches)[0], this.move({ preventDefault: () => l.preventDefault() }, this._lastPos)) } touchend(l) { l.targetTouches.length === 0 && this._startPos && this._lastPos && this._startPos.dist(this._lastPos) < this._clickTolerance && this.element.click(), this.reset() } reset() { this.mouseRotate.reset(), this.mousePitch && this.mousePitch.reset(), delete this._startPos, delete this._lastPos, this.offTemp() } } function $u(x, l, h) { if (x = new o.LngLat(x.lng, x.lat), l) { const g = new o.LngLat(x.lng - 360, x.lat), b = new o.LngLat(x.lng + 360, x.lat), E = h.locationPoint(x).distSqr(l); h.locationPoint(g).distSqr(l) < E ? x = g : h.locationPoint(b).distSqr(l) < E && (x = b) } for (; Math.abs(x.lng - h.center.lng) > 180;) { const g = h.locationPoint(x); if (g.x >= 0 && g.y >= 0 && g.x <= h.width && g.y <= h.height) break; x.lng > h.center.lng ? x.lng -= 360 : x.lng += 360 } return x } const xn = { center: "translate(-50%,-50%)", top: "translate(-50%,0)", "top-left": "translate(0,0)", "top-right": "translate(-100%,0)", bottom: "translate(-50%,-100%)", "bottom-left": "translate(0,-100%)", "bottom-right": "translate(-100%,-100%)", left: "translate(0,-50%)", right: "translate(-100%,-50%)" }; function In(x, l, h) { const g = x.classList; for (const b in xn) g.remove(`maplibregl-${h}-anchor-${b}`, `mapboxgl-${h}-anchor-${b}`); g.add(`maplibregl-${h}-anchor-${l}`, `mapboxgl-${h}-anchor-${l}`) } class Pl extends o.Evented { constructor(l, h) { if (super(), (l instanceof HTMLElement || h) && (l = o.extend({ element: l }, h)), o.bindAll(["_update", "_onMove", "_onUp", "_addDragHandler", "_onMapClick", "_onKeyPress"], this), this._anchor = l && l.anchor || "center", this._color = l && l.color || "#3FB1CE", this._scale = l && l.scale || 1, this._draggable = l && l.draggable || !1, this._clickTolerance = l && l.clickTolerance || 0, this._isDragging = !1, this._state = "inactive", this._rotation = l && l.rotation || 0, this._rotationAlignment = l && l.rotationAlignment || "auto", this._pitchAlignment = l && l.pitchAlignment && l.pitchAlignment !== "auto" ? l.pitchAlignment : this._rotationAlignment, l && l.element) this._element = l.element, this._offset = o.pointGeometry.convert(l && l.offset || [0, 0]); else { this._defaultMarker = !0, this._element = w.create("div"), this._element.setAttribute("aria-label", "Map marker"); const g = w.createNS("http://www.w3.org/2000/svg", "svg"), b = 41, E = 27; g.setAttributeNS(null, "display", "block"), g.setAttributeNS(null, "height", `${b}px`), g.setAttributeNS(null, "width", `${E}px`), g.setAttributeNS(null, "viewBox", `0 0 ${E} ${b}`); const D = w.createNS("http://www.w3.org/2000/svg", "g"); D.setAttributeNS(null, "stroke", "none"), D.setAttributeNS(null, "stroke-width", "1"), D.setAttributeNS(null, "fill", "none"), D.setAttributeNS(null, "fill-rule", "evenodd"); const $ = w.createNS("http://www.w3.org/2000/svg", "g"); $.setAttributeNS(null, "fill-rule", "nonzero"); const U = w.createNS("http://www.w3.org/2000/svg", "g"); U.setAttributeNS(null, "transform", "translate(3.0, 29.0)"), U.setAttributeNS(null, "fill", "#000000"); const W = [{ rx: "10.5", ry: "5.25002273" }, { rx: "10.5", ry: "5.25002273" }, { rx: "9.5", ry: "4.77275007" }, { rx: "8.5", ry: "4.29549936" }, { rx: "7.5", ry: "3.81822308" }, { rx: "6.5", ry: "3.34094679" }, { rx: "5.5", ry: "2.86367051" }, { rx: "4.5", ry: "2.38636864" }]; for (const et of W) { const Me = w.createNS("http://www.w3.org/2000/svg", "ellipse"); Me.setAttributeNS(null, "opacity", "0.04"), Me.setAttributeNS(null, "cx", "10.5"), Me.setAttributeNS(null, "cy", "5.80029008"), Me.setAttributeNS(null, "rx", et.rx), Me.setAttributeNS(null, "ry", et.ry), U.appendChild(Me) } const te = w.createNS("http://www.w3.org/2000/svg", "g"); te.setAttributeNS(null, "fill", this._color); const ae = w.createNS("http://www.w3.org/2000/svg", "path"); ae.setAttributeNS(null, "d", "M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"), te.appendChild(ae); const fe = w.createNS("http://www.w3.org/2000/svg", "g"); fe.setAttributeNS(null, "opacity", "0.25"), fe.setAttributeNS(null, "fill", "#000000"); const Se = w.createNS("http://www.w3.org/2000/svg", "path"); Se.setAttributeNS(null, "d", "M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"), fe.appendChild(Se); const _e = w.createNS("http://www.w3.org/2000/svg", "g"); _e.setAttributeNS(null, "transform", "translate(6.0, 7.0)"), _e.setAttributeNS(null, "fill", "#FFFFFF"); const we = w.createNS("http://www.w3.org/2000/svg", "g"); we.setAttributeNS(null, "transform", "translate(8.0, 8.0)"); const Be = w.createNS("http://www.w3.org/2000/svg", "circle"); Be.setAttributeNS(null, "fill", "#000000"), Be.setAttributeNS(null, "opacity", "0.25"), Be.setAttributeNS(null, "cx", "5.5"), Be.setAttributeNS(null, "cy", "5.5"), Be.setAttributeNS(null, "r", "5.4999962"); const je = w.createNS("http://www.w3.org/2000/svg", "circle"); je.setAttributeNS(null, "fill", "#FFFFFF"), je.setAttributeNS(null, "cx", "5.5"), je.setAttributeNS(null, "cy", "5.5"), je.setAttributeNS(null, "r", "5.4999962"), we.appendChild(Be), we.appendChild(je), $.appendChild(U), $.appendChild(te), $.appendChild(fe), $.appendChild(_e), $.appendChild(we), g.appendChild($), g.setAttributeNS(null, "height", b * this._scale + "px"), g.setAttributeNS(null, "width", E * this._scale + "px"), this._element.appendChild(g), this._offset = o.pointGeometry.convert(l && l.offset || [0, -14]) } this._element.classList.add("maplibregl-marker", "mapboxgl-marker"), this._element.addEventListener("dragstart", g => { g.preventDefault() }), this._element.addEventListener("mousedown", g => { g.preventDefault() }), In(this._element, this._anchor, "marker"), this._popup = null } addTo(l) { return this.remove(), this._map = l, l.getCanvasContainer().appendChild(this._element), l.on("move", this._update), l.on("moveend", this._update), this.setDraggable(this._draggable), this._update(), this._map.on("click", this._onMapClick), this } remove() { return this._opacityTimeout && (clearTimeout(this._opacityTimeout), delete this._opacityTimeout), this._map && (this._map.off("click", this._onMapClick), this._map.off("move", this._update), this._map.off("moveend", this._update), this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler), this._map.off("mouseup", this._onUp), this._map.off("touchend", this._onUp), this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), delete this._map), w.remove(this._element), this._popup && this._popup.remove(), this } getLngLat() { return this._lngLat } setLngLat(l) { return this._lngLat = o.LngLat.convert(l), this._pos = null, this._popup && this._popup.setLngLat(this._lngLat), this._update(), this } getElement() { return this._element } setPopup(l) { if (this._popup && (this._popup.remove(), this._popup = null, this._element.removeEventListener("keypress", this._onKeyPress), this._originalTabIndex || this._element.removeAttribute("tabindex")), l) { if (!("offset" in l.options)) { const b = Math.sqrt(Math.pow(13.5, 2) / 2); l.options.offset = this._defaultMarker ? { top: [0, 0], "top-left": [0, 0], "top-right": [0, 0], bottom: [0, -38.1], "bottom-left": [b, -1 * (38.1 - 13.5 + b)], "bottom-right": [-b, -1 * (38.1 - 13.5 + b)], left: [13.5, -1 * (38.1 - 13.5)], right: [-13.5, -1 * (38.1 - 13.5)] } : this._offset } this._popup = l, this._lngLat && this._popup.setLngLat(this._lngLat), this._originalTabIndex = this._element.getAttribute("tabindex"), this._originalTabIndex || this._element.setAttribute("tabindex", "0"), this._element.addEventListener("keypress", this._onKeyPress) } return this } _onKeyPress(l) { const h = l.code, g = l.charCode || l.keyCode; h !== "Space" && h !== "Enter" && g !== 32 && g !== 13 || this.togglePopup() } _onMapClick(l) { const h = l.originalEvent.target, g = this._element; this._popup && (h === g || g.contains(h)) && this.togglePopup() } getPopup() { return this._popup } togglePopup() { const l = this._popup; return l ? (l.isOpen() ? l.remove() : l.addTo(this._map), this) : this } _update(l) { if (!this._map) return; this._map.transform.renderWorldCopies && (this._lngLat = $u(this._lngLat, this._pos, this._map.transform)), this._pos = this._map.project(this._lngLat)._add(this._offset); let h = ""; this._rotationAlignment === "viewport" || this._rotationAlignment === "auto" ? h = `rotateZ(${this._rotation}deg)` : this._rotationAlignment === "map" && (h = `rotateZ(${this._rotation - this._map.getBearing()}deg)`); let g = ""; this._pitchAlignment === "viewport" || this._pitchAlignment === "auto" ? g = "rotateX(0deg)" : this._pitchAlignment === "map" && (g = `rotateX(${this._map.getPitch()}deg)`), l && l.type !== "moveend" || (this._pos = this._pos.round()), w.setTransform(this._element, `${xn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${h}`), this._map.style && this._map.style.terrain && !this._opacityTimeout && (this._opacityTimeout = setTimeout(() => { const b = this._map.unproject(this._pos), E = 40075016686e-3 * Math.abs(Math.cos(this._lngLat.lat * Math.PI / 180)) / Math.pow(2, this._map.transform.tileZoom + 8); this._element.style.opacity = b.distanceTo(this._lngLat) > 20 * E ? "0.2" : "1.0", this._opacityTimeout = null }, 100)) } getOffset() { return this._offset } setOffset(l) { return this._offset = o.pointGeometry.convert(l), this._update(), this } _onMove(l) { if (!this._isDragging) { const h = this._clickTolerance || this._map._clickTolerance; this._isDragging = l.point.dist(this._pointerdownPos) >= h } this._isDragging && (this._pos = l.point.sub(this._positionDelta), this._lngLat = this._map.unproject(this._pos), this.setLngLat(this._lngLat), this._element.style.pointerEvents = "none", this._state === "pending" && (this._state = "active", this.fire(new o.Event("dragstart"))), this.fire(new o.Event("drag"))) } _onUp() { this._element.style.pointerEvents = "auto", this._positionDelta = null, this._pointerdownPos = null, this._isDragging = !1, this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), this._state === "active" && this.fire(new o.Event("dragend")), this._state = "inactive" } _addDragHandler(l) { this._element.contains(l.originalEvent.target) && (l.preventDefault(), this._positionDelta = l.point.sub(this._pos).add(this._offset), this._pointerdownPos = l.point, this._state = "pending", this._map.on("mousemove", this._onMove), this._map.on("touchmove", this._onMove), this._map.once("mouseup", this._onUp), this._map.once("touchend", this._onUp)) } setDraggable(l) { return this._draggable = !!l, this._map && (l ? (this._map.on("mousedown", this._addDragHandler), this._map.on("touchstart", this._addDragHandler)) : (this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler))), this } isDraggable() { return this._draggable } setRotation(l) { return this._rotation = l || 0, this._update(), this } getRotation() { return this._rotation } setRotationAlignment(l) { return this._rotationAlignment = l || "auto", this._update(), this } getRotationAlignment() { return this._rotationAlignment } setPitchAlignment(l) { return this._pitchAlignment = l && l !== "auto" ? l : this._rotationAlignment, this._update(), this } getPitchAlignment() { return this._pitchAlignment } } const uh = { positionOptions: { enableHighAccuracy: !1, maximumAge: 0, timeout: 6e3 }, fitBoundsOptions: { maxZoom: 15 }, trackUserLocation: !1, showAccuracyCircle: !0, showUserLocation: !0 }; let es, Pi = 0, ts = !1; const aa = { maxWidth: 100, unit: "metric" }; function pv(x, l, h) { const g = h && h.maxWidth || 100, b = x._container.clientHeight / 2, E = x.unproject([0, b]), D = x.unproject([g, b]), $ = E.distanceTo(D); if (h && h.unit === "imperial") { const U = 3.2808 * $; U > 5280 ? ns(l, g, U / 5280, x._getUIString("ScaleControl.Miles")) : ns(l, g, U, x._getUIString("ScaleControl.Feet")) } else h && h.unit === "nautical" ? ns(l, g, $ / 1852, x._getUIString("ScaleControl.NauticalMiles")) : $ >= 1e3 ? ns(l, g, $ / 1e3, x._getUIString("ScaleControl.Kilometers")) : ns(l, g, $, x._getUIString("ScaleControl.Meters")) } function ns(x, l, h, g) { const b = function (E) { const D = Math.pow(10, `${Math.floor(E)}`.length - 1); let $ = E / D; return $ = $ >= 10 ? 10 : $ >= 5 ? 5 : $ >= 3 ? 3 : $ >= 2 ? 2 : $ >= 1 ? 1 : function (U) { const W = Math.pow(10, Math.ceil(-Math.log(U) / Math.LN10)); return Math.round(U * W) / W }($), D * $ }(h); x.style.width = l * (b / h) + "px", x.innerHTML = `${b} ${g}` } const qr = { closeButton: !0, closeOnClick: !0, focusAfterOpen: !0, className: "", maxWidth: "240px" }, ni = ["a[href]", "[tabindex]:not([tabindex='-1'])", "[contenteditable]:not([contenteditable='false'])", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].join(", "); function ch(x) { if (x) { if (typeof x == "number") { const l = Math.round(Math.sqrt(.5 * Math.pow(x, 2))); return { center: new o.pointGeometry(0, 0), top: new o.pointGeometry(0, x), "top-left": new o.pointGeometry(l, l), "top-right": new o.pointGeometry(-l, l), bottom: new o.pointGeometry(0, -x), "bottom-left": new o.pointGeometry(l, -l), "bottom-right": new o.pointGeometry(-l, -l), left: new o.pointGeometry(x, 0), right: new o.pointGeometry(-x, 0) } } if (x instanceof o.pointGeometry || Array.isArray(x)) { const l = o.pointGeometry.convert(x); return { center: l, top: l, "top-left": l, "top-right": l, bottom: l, "bottom-left": l, "bottom-right": l, left: l, right: l } } return { center: o.pointGeometry.convert(x.center || [0, 0]), top: o.pointGeometry.convert(x.top || [0, 0]), "top-left": o.pointGeometry.convert(x["top-left"] || [0, 0]), "top-right": o.pointGeometry.convert(x["top-right"] || [0, 0]), bottom: o.pointGeometry.convert(x.bottom || [0, 0]), "bottom-left": o.pointGeometry.convert(x["bottom-left"] || [0, 0]), "bottom-right": o.pointGeometry.convert(x["bottom-right"] || [0, 0]), left: o.pointGeometry.convert(x.left || [0, 0]), right: o.pointGeometry.convert(x.right || [0, 0]) } } return ch(new o.pointGeometry(0, 0)) } const Is = {
|
|
|
supported: f, setRTLTextPlugin: o.setRTLTextPlugin, getRTLTextPluginStatus: o.getRTLTextPluginStatus, Map: class extends Or {
|
|
|
constructor(x) { var l; if (o.PerformanceUtils.mark(o.PerformanceMarkers.create), (x = o.extend({}, hv, x)).minZoom != null && x.maxZoom != null && x.minZoom > x.maxZoom) throw new Error("maxZoom must be greater than or equal to minZoom"); if (x.minPitch != null && x.maxPitch != null && x.minPitch > x.maxPitch) throw new Error("maxPitch must be greater than or equal to minPitch"); if (x.minPitch != null && x.minPitch < 0) throw new Error("minPitch must be greater than or equal to 0"); if (x.maxPitch != null && x.maxPitch > 85) throw new Error("maxPitch must be less than or equal to 85"); if (super(new Ru(x.minZoom, x.maxZoom, x.minPitch, x.maxPitch, x.renderWorldCopies), { bearingSnap: x.bearingSnap }), this._interactive = x.interactive, this._cooperativeGestures = x.cooperativeGestures, this._maxTileCacheSize = x.maxTileCacheSize, this._failIfMajorPerformanceCaveat = x.failIfMajorPerformanceCaveat, this._preserveDrawingBuffer = x.preserveDrawingBuffer, this._antialias = x.antialias, this._trackResize = x.trackResize, this._bearingSnap = x.bearingSnap, this._refreshExpiredTiles = x.refreshExpiredTiles, this._fadeDuration = x.fadeDuration, this._crossSourceCollisions = x.crossSourceCollisions, this._crossFadingFactor = 1, this._collectResourceTiming = x.collectResourceTiming, this._renderTaskQueue = new dv, this._controls = [], this._mapId = o.uniqueId(), this._locale = o.extend({}, fv, x.locale), this._clickTolerance = x.clickTolerance, this._pixelRatio = (l = x.pixelRatio) !== null && l !== void 0 ? l : devicePixelRatio, this._requestManager = new P(x.transformRequest), typeof x.container == "string") { if (this._container = document.getElementById(x.container), !this._container) throw new Error(`Container '${x.container}' not found.`) } else { if (!(x.container instanceof HTMLElement)) throw new Error("Invalid type: 'container' must be a String or HTMLElement."); this._container = x.container } if (x.maxBounds && this.setMaxBounds(x.maxBounds), o.bindAll(["_onWindowOnline", "_onWindowResize", "_onMapScroll", "_contextLost", "_contextRestored"], this), this._setupContainer(), this._setupPainter(), this.painter === void 0) throw new Error("Failed to initialize WebGL."); this.on("move", () => this._update(!1)), this.on("moveend", () => this._update(!1)), this.on("zoom", () => this._update(!0)), this.on("terrain", () => { this.painter.terrainFacilitator.dirty = !0, this._update(!0) }), typeof window < "u" && (addEventListener("online", this._onWindowOnline, !1), addEventListener("resize", this._onWindowResize, !1), addEventListener("orientationchange", this._onWindowResize, !1)), this.handlers = new cv(this, x), this._cooperativeGestures && this._setupCooperativeGestures(), this._hash = x.hash && new Jm(typeof x.hash == "string" && x.hash || void 0).addTo(this), this._hash && this._hash._onHashChange() || (this.jumpTo({ center: x.center, zoom: x.zoom, bearing: x.bearing, pitch: x.pitch }), x.bounds && (this.resize(), this.fitBounds(x.bounds, o.extend({}, x.fitBoundsOptions, { duration: 0 })))), this.resize(), this._localIdeographFontFamily = x.localIdeographFontFamily, x.style && this.setStyle(x.style, { localIdeographFontFamily: x.localIdeographFontFamily }), x.attributionControl && this.addControl(new Fu({ customAttribution: x.customAttribution })), x.maplibreLogo && this.addControl(new td, x.logoPosition), this.on("style.load", () => { this.transform.unmodified && this.jumpTo(this.style.stylesheet) }), this.on("data", h => { this._update(h.dataType === "style"), this.fire(new o.Event(`${h.dataType}data`, h)) }), this.on("dataloading", h => { this.fire(new o.Event(`${h.dataType}dataloading`, h)) }), this.on("dataabort", h => { this.fire(new o.Event("sourcedataabort", h)) }) } _getMapId() { return this._mapId } addControl(x, l) { if (l === void 0 && (l = x.getDefaultPosition ? x.getDefaultPosition() : "top-right"), !x || !x.onAdd) return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods."))); const h = x.onAdd(this); this._controls.push(x); const g = this._controlPositions[l]; return l.indexOf("bottom") !== -1 ? g.insertBefore(h, g.firstChild) : g.appendChild(h), this } removeControl(x) { if (!x || !x.onRemove) return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods."))); const l = this._controls.indexOf(x); return l > -1 && this._controls.splice(l, 1), x.onRemove(this), this } hasControl(x) { return this._controls.indexOf(x) > -1 } calculateCameraOptionsFromTo(x, l, h, g) { return g == null && this.style.terrain && (g = this.transform.getElevation(h, this.style.terrain)), super.calculateCameraOptionsFromTo(x, l, h, g) } resize(x) { const l = this._containerDimensions(), h = l[0], g = l[1]; this._resizeCanvas(h, g, this.getPixelRatio()), this.transform.resize(h, g), this.painter.resize(h, g, this.getPixelRatio()); const b = !this._moving; return b && (this.stop(), this.fire(new o.Event("movestart", x)).fire(new o.Event("move", x))), this.fire(new o.Event("resize", x)), b && this.fire(new o.Event("moveend", x)), this } getPixelRatio() { return this._pixelRatio } setPixelRatio(x) { const [l, h] = this._containerDimensions(); this._pixelRatio = x, this._resizeCanvas(l, h, x), this.painter.resize(l, h, x) } getBounds() { return this.transform.getBounds() } getMaxBounds() { return this.transform.getMaxBounds() } setMaxBounds(x) { return this.transform.setMaxBounds(o.LngLatBounds.convert(x)), this._update() } setMinZoom(x) { if ((x = x == null ? -2 : x) >= -2 && x <= this.transform.maxZoom) return this.transform.minZoom = x, this._update(), this.getZoom() < x && this.setZoom(x), this; throw new Error("minZoom must be between -2 and the current maxZoom, inclusive") } getMinZoom() { return this.transform.minZoom } setMaxZoom(x) { if ((x = x == null ? 22 : x) >= this.transform.minZoom) return this.transform.maxZoom = x, this._update(), this.getZoom() > x && this.setZoom(x), this; throw new Error("maxZoom must be greater than the current minZoom") } getMaxZoom() { return this.transform.maxZoom } setMinPitch(x) { if ((x = x == null ? 0 : x) < 0) throw new Error("minPitch must be greater than or equal to 0"); if (x >= 0 && x <= this.transform.maxPitch) return this.transform.minPitch = x, this._update(), this.getPitch() < x && this.setPitch(x), this; throw new Error("minPitch must be between 0 and the current maxPitch, inclusive") } getMinPitch() { return this.transform.minPitch } setMaxPitch(x) { if ((x = x == null ? 60 : x) > 85) throw new Error("maxPitch must be less than or equal to 85"); if (x >= this.transform.minPitch) return this.transform.maxPitch = x, this._update(), this.getPitch() > x && this.setPitch(x), this; throw new Error("maxPitch must be greater than the current minPitch") } getMaxPitch() { return this.transform.maxPitch } getRenderWorldCopies() { return this.transform.renderWorldCopies } setRenderWorldCopies(x) { return this.transform.renderWorldCopies = x, this._update() } project(x) { return this.transform.locationPoint(o.LngLat.convert(x), this.style && this.style.terrain) } unproject(x) { return this.transform.pointLocation(o.pointGeometry.convert(x), this.style && this.style.terrain) } isMoving() { return this._moving || this.handlers.isMoving() } isZooming() { return this._zooming || this.handlers.isZooming() } isRotating() { return this._rotating || this.handlers.isRotating() } _createDelegatedListener(x, l, h) { if (x === "mouseenter" || x === "mouseover") { let g = !1; return { layer: l, listener: h, delegates: { mousemove: E => { const D = this.getLayer(l) ? this.queryRenderedFeatures(E.point, { layers: [l] }) : []; D.length ? g || (g = !0, h.call(this, new uo(x, this, E.originalEvent, { features: D }))) : g = !1 }, mouseout: () => { g = !1 } } } } if (x === "mouseleave" || x === "mouseout") { let g = !1; return { layer: l, listener: h, delegates: { mousemove: D => { (this.getLayer(l) ? this.queryRenderedFeatures(D.point, { layers: [l] }) : []).length ? g = !0 : g && (g = !1, h.call(this, new uo(x, this, D.originalEvent))) }, mouseout: D => { g && (g = !1, h.call(this, new uo(x, this, D.originalEvent))) } } } } { const g = b => { const E = this.getLayer(l) ? this.queryRenderedFeatures(b.point, { layers: [l] }) : []; E.length && (b.features = E, h.call(this, b), delete b.features) }; return { layer: l, listener: h, delegates: { [x]: g } } } } on(x, l, h) { if (h === void 0) return super.on(x, l); const g = this._createDelegatedListener(x, l, h); this._delegatedListeners = this._delegatedListeners || {}, this._delegatedListeners[x] = this._delegatedListeners[x] || [], this._delegatedListeners[x].push(g); for (const b in g.delegates) this.on(b, g.delegates[b]); return this } once(x, l, h) { if (h === void 0) return super.once(x, l); const g = this._createDelegatedListener(x, l, h); for (const b in g.delegates) this.once(b, g.delegates[b]); return this } off(x, l, h) { return h === void 0 ? super.off(x, l) : (this._delegatedListeners && this._delegatedListeners[x] && (g => { const b = this._delegatedListeners[x]; for (let E = 0; E < b.length; E++) { const D = b[E]; if (D.layer === l && D.listener === h) { for (const $ in D.delegates) this.off($, D.delegates[$]); return b.splice(E, 1), this } } })(), this) } queryRenderedFeatures(x, l) { if (!this.style) return []; let h; if (l !== void 0 || x === void 0 || x instanceof o.pointGeometry || Array.isArray(x) || (l = x, x = void 0), l = l || {}, (x = x || [[0, 0], [this.transform.width, this.transform.height]]) instanceof o.pointGeometry || typeof x[0] == "number") h = [o.pointGeometry.convert(x)]; else { const g = o.pointGeometry.convert(x[0]), b = o.pointGeometry.convert(x[1]); h = [g, new o.pointGeometry(b.x, g.y), b, new o.pointGeometry(g.x, b.y), g] } return this.style.queryRenderedFeatures(h, l, this.transform) } querySourceFeatures(x, l) { return this.style.querySourceFeatures(x, l) } setStyle(x, l) { return (l = o.extend({}, { localIdeographFontFamily: this._localIdeographFontFamily }, l)).diff !== !1 && l.localIdeographFontFamily === this._localIdeographFontFamily && this.style && x ? (this._diffStyle(x, l), this) : (this._localIdeographFontFamily = l.localIdeographFontFamily, this._updateStyle(x, l)) } setTransformRequest(x) { return this._requestManager.setTransformRequest(x), this } _getUIString(x) { const l = this._locale[x]; if (l == null) throw new Error(`Missing UI string '${x}'`); return l } _updateStyle(x, l) { return this.style && (this.style.setEventedParent(null), this.style._remove()), x ? (this.style = new Mr(this, l || {}), this.style.setEventedParent(this, { style: this.style }), typeof x == "string" ? this.style.loadURL(x) : this.style.loadJSON(x), this) : (delete this.style, this) } _lazyInitEmptyStyle() { this.style || (this.style = new Mr(this, {}), this.style.setEventedParent(this, { style: this.style }), this.style.loadEmpty()) } _diffStyle(x, l) { if (typeof x == "string") { const h = this._requestManager.transformRequest(x, o.ResourceType.Style); o.getJSON(h, (g, b) => { g ? this.fire(new o.ErrorEvent(g)) : b && this._updateDiff(b, l) }) } else typeof x == "object" && this._updateDiff(x, l) } _updateDiff(x, l) { try { this.style.setState(x) && this._update(!0) } catch (h) { o.warnOnce(`Unable to perform style diff: ${h.message || h.error || h}. Rebuilding the style from scratch.`), this._updateStyle(x, l) } } getStyle() { if (this.style) return this.style.serialize() } isStyleLoaded() { return this.style ? this.style.loaded() : o.warnOnce("There is no style added to the map.") } addSource(x, l) { return this._lazyInitEmptyStyle(), this.style.addSource(x, l), this._update(!0) } isSourceLoaded(x) { const l = this.style && this.style.sourceCaches[x]; if (l !== void 0) return l.loaded(); this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${x}'`))) } setTerrain(x) { return this.style.setTerrain(x), this } getTerrain() { return this.style.terrain && this.style.terrain.options } areTilesLoaded() { const x = this.style && this.style.sourceCaches; for (const l in x) { const h = x[l]._tiles; for (const g in h) { const b = h[g]; if (b.state !== "loaded" && b.state !== "errored") return !1 } } return !0 } addSourceType(x, l, h) { return this._lazyInitEmptyStyle(), this.style.addSourceType(x, l, h) } removeSource(x) { return this.style.removeSource(x), this._update(!0) } getSource(x) { return this.style.getSource(x) } addImage(x, l, { pixelRatio: h = 1, sdf: g = !1, stretchX: b, stretchY: E, content: D } = {}) { if (this._lazyInitEmptyStyle(), l instanceof HTMLImageElement || o.isImageBitmap(l)) { const { width: $, height: U, data: W } = o.exported.getImageData(l); this.style.addImage(x, { data: new o.RGBAImage({ width: $, height: U }, W), pixelRatio: h, stretchX: b, stretchY: E, content: D, sdf: g, version: 0 }) } else { if (l.width === void 0 || l.height === void 0) return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))); { const { width: $, height: U, data: W } = l, te = l; this.style.addImage(x, { data: new o.RGBAImage({ width: $, height: U }, new Uint8Array(W)), pixelRatio: h, stretchX: b, stretchY: E, content: D, sdf: g, version: 0, userImage: te }), te.onAdd && te.onAdd(this, x) } } } updateImage(x, l) { const h = this.style.getImage(x); if (!h) return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead."))); const g = l instanceof HTMLImageElement || o.isImageBitmap(l) ? o.exported.getImageData(l) : l, { width: b, height: E, data: D } = g; if (b === void 0 || E === void 0) return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))); if (b !== h.data.width || E !== h.data.height) return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))); const $ = !(l instanceof HTMLImageElement || o.isImageBitmap(l)); h.data.replace(D, $), this.style.updateImage(x, h) } hasImage(x) { return x ? !!this.style.getImage(x) : (this.fire(new o.ErrorEvent(new Error("Missing required image id"))), !1) } removeImage(x) { this.style.removeImage(x) } loadImage(x, l) { o.getImage(this._requestManager.transformRequest(x, o.ResourceType.Image), l) } listImages() { return this.style.listImages() } addLayer(x, l) { return this._lazyInitEmptyStyle(), this.style.addLayer(x, l), this._update(!0) } moveLayer(x, l) { return this.style.moveLayer(x, l), this._update(!0) } removeLayer(x) { return this.style.removeLayer(x), this._update(!0) } getLayer(x) { return this.style.getLayer(x) } setLayerZoomRange(x, l, h) { return this.style.setLayerZoomRange(x, l, h), this._update(!0) } setFilter(x, l, h = {}) { return this.style.setFilter(x, l, h), this._update(!0) } getFilter(x) { return this.style.getFilter(x) } setPaintProperty(x, l, h, g = {}) { return this.style.setPaintProperty(x, l, h, g), this._update(!0) } getPaintProperty(x, l) { return this.style.getPaintProperty(x, l) } setLayoutProperty(x, l, h, g = {}) { return this.style.setLayoutProperty(x, l, h, g), this._update(!0) } getLayoutProperty(x, l) { return this.style.getLayoutProperty(x, l) } setLight(x, l = {}) { return this._lazyInitEmptyStyle(), this.style.setLight(x, l), this._update(!0) } getLight() { return this.style.getLight() } setFeatureState(x, l) { return this.style.setFeatureState(x, l), this._update() } removeFeatureState(x, l) { return this.style.removeFeatureState(x, l), this._update() } getFeatureState(x) { return this.style.getFeatureState(x) } getContainer() { return this._container } getCanvasContainer() { return this._canvasContainer } getCanvas() { return this._canvas } _containerDimensions() { let x = 0, l = 0; return this._container && (x = this._container.clientWidth || 400, l = this._container.clientHeight || 300), [x, l] } _setupContainer() { const x = this._container; x.classList.add("maplibregl-map", "mapboxgl-map"); const l = this._canvasContainer = w.create("div", "maplibregl-canvas-container mapboxgl-canvas-container", x); this._interactive && l.classList.add("maplibregl-interactive", "mapboxgl-interactive"), this._canvas = w.create("canvas", "maplibregl-canvas mapboxgl-canvas", l), this._canvas.addEventListener("webglcontextlost", this._contextLost, !1), this._canvas.addEventListener("webglcontextrestored", this._contextRestored, !1), this._canvas.setAttribute("tabindex", "0"), this._canvas.setAttribute("aria-label", "Map"), this._canvas.setAttribute("role", "region"); const h = this._containerDimensions(); this._resizeCanvas(h[0], h[1], this.getPixelRatio()); const g = this._controlContainer = w.create("div", "maplibregl-control-container mapboxgl-control-container", x), b = this._controlPositions = {};["top-left", "top-right", "bottom-left", "bottom-right"].forEach(E => { b[E] = w.create("div", `maplibregl-ctrl-${E} mapboxgl-ctrl-${E}`, g) }), this._container.addEventListener("scroll", this._onMapScroll, !1) } _setupCooperativeGestures() {
|
|
|
const x = this._container; this._metaPress = !1, this._cooperativeGesturesScreen = w.create("div", "maplibregl-cooperative-gesture-screen", x); let l = "Control", h = typeof this._cooperativeGestures != "boolean" && this._cooperativeGestures.windowsHelpText ? this._cooperativeGestures.windowsHelpText : "Use Ctrl + scroll to zoom the map"; navigator.platform.indexOf("Mac") === 0 && (h = typeof this._cooperativeGestures != "boolean" && this._cooperativeGestures.macHelpText ? this._cooperativeGestures.macHelpText : "Use \u2318 + scroll to zoom the map", l = "Meta"), this._cooperativeGesturesScreen.innerHTML = `
|
|
|
<div class="maplibregl-desktop-message">${h}</div>
|
|
|
<div class="maplibregl-mobile-message">${typeof this._cooperativeGestures != "boolean" && this._cooperativeGestures.mobileHelpText ? this._cooperativeGestures.mobileHelpText : "Use two fingers to move the map"}</div>
|
|
|
`, document.addEventListener("keydown", g => { g.key === l && (this._metaPress = !0) }), document.addEventListener("keyup", g => { g.key === l && (this._metaPress = !1) }), this._canvasContainer.addEventListener("wheel", g => { this._onCooperativeGesture(g, this._metaPress, 1) }, !1), this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan", "maplibregl-touch-drag-pan")
|
|
|
} _resizeCanvas(x, l, h) { this._canvas.width = h * x, this._canvas.height = h * l, this._canvas.style.width = `${x}px`, this._canvas.style.height = `${l}px` } _setupPainter() { const x = o.extend({}, f.webGLContextAttributes, { failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat, preserveDrawingBuffer: this._preserveDrawingBuffer, antialias: this._antialias || !1 }), l = this._canvas.getContext("webgl", x) || this._canvas.getContext("experimental-webgl", x); l ? (this.painter = new Jf(l, this.transform), o.exported$1.testSupport(l)) : this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL"))) } _contextLost(x) { x.preventDefault(), this._frame && (this._frame.cancel(), this._frame = null), this.fire(new o.Event("webglcontextlost", { originalEvent: x })) } _contextRestored(x) { this._setupPainter(), this.resize(), this._update(), this.fire(new o.Event("webglcontextrestored", { originalEvent: x })) } _onMapScroll(x) { if (x.target === this._container) return this._container.scrollTop = 0, this._container.scrollLeft = 0, !1 } _onCooperativeGesture(x, l, h) { return !l && h < 2 && (this._cooperativeGesturesScreen.classList.add("maplibregl-show"), setTimeout(() => { this._cooperativeGesturesScreen.classList.remove("maplibregl-show") }, 100)), !1 } loaded() { return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded() } _update(x) { return this.style ? (this._styleDirty = this._styleDirty || x, this._sourcesDirty = !0, this.triggerRepaint(), this) : this } _requestRenderFrame(x) { return this._update(), this._renderTaskQueue.add(x) } _cancelRenderFrame(x) { this._renderTaskQueue.remove(x) } _render(x) { let l, h = 0; const g = this.painter.context.extTimerQuery; if (this.listens("gpu-timing-frame") && (l = g.createQueryEXT(), g.beginQueryEXT(g.TIME_ELAPSED_EXT, l), h = o.exported.now()), this.painter.context.setDirty(), this.painter.setBaseState(), this._renderTaskQueue.run(x), this._removed) return; let b = !1; if (this.style && this._styleDirty) { this._styleDirty = !1; const D = this.transform.zoom, $ = o.exported.now(); this.style.zoomHistory.update(D, $); const U = new o.EvaluationParameters(D, { now: $, fadeDuration: this._fadeDuration, zoomHistory: this.style.zoomHistory, transition: this.style.getTransition() }), W = U.crossFadingFactor(); W === 1 && W === this._crossFadingFactor || (b = !0, this._crossFadingFactor = W), this.style.update(U) } if (this.style && this._sourcesDirty && (this._sourcesDirty = !1, this.style._updateSources(this.transform)), this.style.terrain && this.style.terrain.sourceCache.update(this.transform, this.style.terrain), this.transform.updateElevation(this.style.terrain), this._placementDirty = this.style && this.style._updatePlacement(this.painter.transform, this.showCollisionBoxes, this._fadeDuration, this._crossSourceCollisions), this.painter.render(this.style, { showTileBoundaries: this.showTileBoundaries, showOverdrawInspector: this._showOverdrawInspector, rotating: this.isRotating(), zooming: this.isZooming(), moving: this.isMoving(), fadeDuration: this._fadeDuration, showPadding: this.showPadding, gpuTiming: !!this.listens("gpu-timing-layer") }), this.fire(new o.Event("render")), this.loaded() && !this._loaded && (this._loaded = !0, o.PerformanceUtils.mark(o.PerformanceMarkers.load), this.fire(new o.Event("load"))), this.style && (this.style.hasTransitions() || b) && (this._styleDirty = !0), this.style && !this._placementDirty && this.style._releaseSymbolFadeTiles(), this.listens("gpu-timing-frame")) { const D = o.exported.now() - h; g.endQueryEXT(g.TIME_ELAPSED_EXT, l), setTimeout(() => { const $ = g.getQueryObjectEXT(l, g.QUERY_RESULT_EXT) / 1e6; g.deleteQueryEXT(l), this.fire(new o.Event("gpu-timing-frame", { cpuTime: D, gpuTime: $ })) }, 50) } if (this.listens("gpu-timing-layer")) { const D = this.painter.collectGpuTimers(); setTimeout(() => { const $ = this.painter.queryGpuTimers(D); this.fire(new o.Event("gpu-timing-layer", { layerTimes: $ })) }, 50) } const E = this._sourcesDirty || this._styleDirty || this._placementDirty; return E || this._repaint ? this.triggerRepaint() : !this.isMoving() && this.loaded() && this.fire(new o.Event("idle")), !this._loaded || this._fullyLoaded || E || (this._fullyLoaded = !0, o.PerformanceUtils.mark(o.PerformanceMarkers.fullLoad)), this } redraw() { return this.style && (this._frame && (this._frame.cancel(), this._frame = null), this._render(0)), this } remove() { this._hash && this._hash.remove(); for (const l of this._controls) l.onRemove(this); this._controls = [], this._frame && (this._frame.cancel(), this._frame = null), this._renderTaskQueue.clear(), this.painter.destroy(), this.handlers.destroy(), delete this.handlers, this.setStyle(null), typeof window < "u" && (removeEventListener("resize", this._onWindowResize, !1), removeEventListener("orientationchange", this._onWindowResize, !1), removeEventListener("online", this._onWindowOnline, !1)); const x = this.painter.context.gl.getExtension("WEBGL_lose_context"); x && x.loseContext(), this._canvas.removeEventListener("webglcontextrestored", this._contextRestored, !1), this._canvas.removeEventListener("webglcontextlost", this._contextLost, !1), w.remove(this._canvasContainer), w.remove(this._controlContainer), this._cooperativeGestures && w.remove(this._cooperativeGesturesScreen), this._container.classList.remove("maplibregl-map", "mapboxgl-map"), o.PerformanceUtils.clearMetrics(), this._removed = !0, this.fire(new o.Event("remove")) } triggerRepaint() { this.style && !this._frame && (this._frame = o.exported.frame(x => { o.PerformanceUtils.frame(x), this._frame = null, this._render(x) })) } _onWindowOnline() { this._update() } _onWindowResize(x) { this._trackResize && this.resize({ originalEvent: x })._update() } get showTileBoundaries() { return !!this._showTileBoundaries } set showTileBoundaries(x) { this._showTileBoundaries !== x && (this._showTileBoundaries = x, this._update()) } get showPadding() { return !!this._showPadding } set showPadding(x) { this._showPadding !== x && (this._showPadding = x, this._update()) } get showCollisionBoxes() { return !!this._showCollisionBoxes } set showCollisionBoxes(x) { this._showCollisionBoxes !== x && (this._showCollisionBoxes = x, x ? this.style._generateCollisionBoxes() : this._update()) } get showOverdrawInspector() { return !!this._showOverdrawInspector } set showOverdrawInspector(x) { this._showOverdrawInspector !== x && (this._showOverdrawInspector = x, this._update()) } get repaint() { return !!this._repaint } set repaint(x) { this._repaint !== x && (this._repaint = x, this.triggerRepaint()) } get vertices() { return !!this._vertices } set vertices(x) { this._vertices = x, this._update() } _setCacheLimits(x, l) { o.setCacheLimits(x, l) } get version() { return "2.4.0" }
|
|
|
}, NavigationControl: class { constructor(x) { this.options = o.extend({}, qx, x), this._container = w.create("div", "maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"), this._container.addEventListener("contextmenu", l => l.preventDefault()), this.options.showZoom && (o.bindAll(["_setButtonTitle", "_updateZoomButtons"], this), this._zoomInButton = this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in", l => this._map.zoomIn({}, { originalEvent: l })), w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", this._zoomInButton).setAttribute("aria-hidden", "true"), this._zoomOutButton = this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out", l => this._map.zoomOut({}, { originalEvent: l })), w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", this._zoomOutButton).setAttribute("aria-hidden", "true")), this.options.showCompass && (o.bindAll(["_rotateCompassArrow"], this), this._compass = this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass", l => { this.options.visualizePitch ? this._map.resetNorthPitch({}, { originalEvent: l }) : this._map.resetNorth({}, { originalEvent: l }) }), this._compassIcon = w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", this._compass), this._compassIcon.setAttribute("aria-hidden", "true")) } _updateZoomButtons() { const x = this._map.getZoom(), l = x === this._map.getMaxZoom(), h = x === this._map.getMinZoom(); this._zoomInButton.disabled = l, this._zoomOutButton.disabled = h, this._zoomInButton.setAttribute("aria-disabled", l.toString()), this._zoomOutButton.setAttribute("aria-disabled", h.toString()) } _rotateCompassArrow() { const x = this.options.visualizePitch ? `scale(${1 / Math.pow(Math.cos(this._map.transform.pitch * (Math.PI / 180)), .5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle * (180 / Math.PI)}deg)` : `rotate(${this._map.transform.angle * (180 / Math.PI)}deg)`; this._compassIcon.style.transform = x } onAdd(x) { return this._map = x, this.options.showZoom && (this._setButtonTitle(this._zoomInButton, "ZoomIn"), this._setButtonTitle(this._zoomOutButton, "ZoomOut"), this._map.on("zoom", this._updateZoomButtons), this._updateZoomButtons()), this.options.showCompass && (this._setButtonTitle(this._compass, "ResetBearing"), this.options.visualizePitch && this._map.on("pitch", this._rotateCompassArrow), this._map.on("rotate", this._rotateCompassArrow), this._rotateCompassArrow(), this._handler = new oa(this._map, this._compass, this.options.visualizePitch)), this._container } onRemove() { w.remove(this._container), this.options.showZoom && this._map.off("zoom", this._updateZoomButtons), this.options.showCompass && (this.options.visualizePitch && this._map.off("pitch", this._rotateCompassArrow), this._map.off("rotate", this._rotateCompassArrow), this._handler.off(), delete this._handler), delete this._map } _createButton(x, l) { const h = w.create("button", x, this._container); return h.type = "button", h.addEventListener("click", l), h } _setButtonTitle(x, l) { const h = this._map._getUIString(`NavigationControl.${l}`); x.title = h, x.setAttribute("aria-label", h) } }, GeolocateControl: class extends o.Evented { constructor(x) { super(), this.options = o.extend({}, uh, x), o.bindAll(["_onSuccess", "_onError", "_onZoom", "_finish", "_setupUI", "_updateCamera", "_updateMarker"], this) } onAdd(x) { var l; return this._map = x, this._container = w.create("div", "maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"), l = this._setupUI, es !== void 0 ? l(es) : window.navigator.permissions !== void 0 ? window.navigator.permissions.query({ name: "geolocation" }).then(h => { es = h.state !== "denied", l(es) }) : (es = !!window.navigator.geolocation, l(es)), this._container } onRemove() { this._geolocationWatchID !== void 0 && (window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0), this.options.showUserLocation && this._userLocationDotMarker && this._userLocationDotMarker.remove(), this.options.showAccuracyCircle && this._accuracyCircleMarker && this._accuracyCircleMarker.remove(), w.remove(this._container), this._map.off("zoom", this._onZoom), this._map = void 0, Pi = 0, ts = !1 } _isOutOfMapMaxBounds(x) { const l = this._map.getMaxBounds(), h = x.coords; return l && (h.longitude < l.getWest() || h.longitude > l.getEast() || h.latitude < l.getSouth() || h.latitude > l.getNorth()) } _setErrorState() { switch (this._watchState) { case "WAITING_ACTIVE": this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error", "mapboxgl-ctrl-geolocate-active-error"); break; case "ACTIVE_LOCK": this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error", "mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"); break; case "BACKGROUND": this._watchState = "BACKGROUND_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error", "mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"); break; case "ACTIVE_ERROR": break; default: throw new Error(`Unexpected watchState ${this._watchState}`) } } _onSuccess(x) { if (this._map) { if (this._isOutOfMapMaxBounds(x)) return this._setErrorState(), this.fire(new o.Event("outofmaxbounds", x)), this._updateMarker(), void this._finish(); if (this.options.trackUserLocation) switch (this._lastKnownPosition = x, this._watchState) { case "WAITING_ACTIVE": case "ACTIVE_LOCK": case "ACTIVE_ERROR": this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error", "mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"); break; case "BACKGROUND": case "BACKGROUND_ERROR": this._watchState = "BACKGROUND", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error", "mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"); break; default: throw new Error(`Unexpected watchState ${this._watchState}`) }this.options.showUserLocation && this._watchState !== "OFF" && this._updateMarker(x), this.options.trackUserLocation && this._watchState !== "ACTIVE_LOCK" || this._updateCamera(x), this.options.showUserLocation && this._dotElement.classList.remove("maplibregl-user-location-dot-stale", "mapboxgl-user-location-dot-stale"), this.fire(new o.Event("geolocate", x)), this._finish() } } _updateCamera(x) { const l = new o.LngLat(x.coords.longitude, x.coords.latitude), h = x.coords.accuracy, g = this._map.getBearing(), b = o.extend({ bearing: g }, this.options.fitBoundsOptions); this._map.fitBounds(l.toBounds(h), b, { geolocateSource: !0 }) } _updateMarker(x) { if (x) { const l = new o.LngLat(x.coords.longitude, x.coords.latitude); this._accuracyCircleMarker.setLngLat(l).addTo(this._map), this._userLocationDotMarker.setLngLat(l).addTo(this._map), this._accuracy = x.coords.accuracy, this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius() } else this._userLocationDotMarker.remove(), this._accuracyCircleMarker.remove() } _updateCircleRadius() { const x = this._map._container.clientHeight / 2, l = this._map.unproject([0, x]), h = this._map.unproject([1, x]), g = l.distanceTo(h), b = Math.ceil(2 * this._accuracy / g); this._circleElement.style.width = `${b}px`, this._circleElement.style.height = `${b}px` } _onZoom() { this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius() } _onError(x) { if (this._map) { if (this.options.trackUserLocation) if (x.code === 1) { this._watchState = "OFF", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error", "mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error", "mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.disabled = !0; const l = this._map._getUIString("GeolocateControl.LocationNotAvailable"); this._geolocateButton.title = l, this._geolocateButton.setAttribute("aria-label", l), this._geolocationWatchID !== void 0 && this._clearWatch() } else { if (x.code === 3 && ts) return; this._setErrorState() } this._watchState !== "OFF" && this.options.showUserLocation && this._dotElement.classList.add("maplibregl-user-location-dot-stale", "mapboxgl-user-location-dot-stale"), this.fire(new o.Event("error", x)), this._finish() } } _finish() { this._timeoutId && clearTimeout(this._timeoutId), this._timeoutId = void 0 } _setupUI(x) { if (this._container.addEventListener("contextmenu", l => l.preventDefault()), this._geolocateButton = w.create("button", "maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate", this._container), w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", this._geolocateButton).setAttribute("aria-hidden", "true"), this._geolocateButton.type = "button", x === !1) { o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled."); const l = this._map._getUIString("GeolocateControl.LocationNotAvailable"); this._geolocateButton.disabled = !0, this._geolocateButton.title = l, this._geolocateButton.setAttribute("aria-label", l) } else { const l = this._map._getUIString("GeolocateControl.FindMyLocation"); this._geolocateButton.title = l, this._geolocateButton.setAttribute("aria-label", l) } this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = w.create("div", "maplibregl-user-location-dot mapboxgl-user-location-dot"), this._userLocationDotMarker = new Pl(this._dotElement), this._circleElement = w.create("div", "maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"), this._accuracyCircleMarker = new Pl({ element: this._circleElement, pitchAlignment: "map" }), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("zoom", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = !0, this.options.trackUserLocation && this._map.on("movestart", l => { l.geolocateSource || this._watchState !== "ACTIVE_LOCK" || l.originalEvent && l.originalEvent.type === "resize" || (this._watchState = "BACKGROUND", this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"), this.fire(new o.Event("trackuserlocationend"))) }) } trigger() { if (!this._setup) return o.warnOnce("Geolocate control triggered before added to a map"), !1; if (this.options.trackUserLocation) { switch (this._watchState) { case "OFF": this._watchState = "WAITING_ACTIVE", this.fire(new o.Event("trackuserlocationstart")); break; case "WAITING_ACTIVE": case "ACTIVE_LOCK": case "ACTIVE_ERROR": case "BACKGROUND_ERROR": Pi--, ts = !1, this._watchState = "OFF", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error", "mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error", "mapboxgl-ctrl-geolocate-background-error"), this.fire(new o.Event("trackuserlocationend")); break; case "BACKGROUND": this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background", "mapboxgl-ctrl-geolocate-background"), this._lastKnownPosition && this._updateCamera(this._lastKnownPosition), this.fire(new o.Event("trackuserlocationstart")); break; default: throw new Error(`Unexpected watchState ${this._watchState}`) }switch (this._watchState) { case "WAITING_ACTIVE": this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"); break; case "ACTIVE_LOCK": this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active", "mapboxgl-ctrl-geolocate-active"); break; case "OFF": break; default: throw new Error(`Unexpected watchState ${this._watchState}`) }if (this._watchState === "OFF" && this._geolocationWatchID !== void 0) this._clearWatch(); else if (this._geolocationWatchID === void 0) { let x; this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "true"), Pi++, Pi > 1 ? (x = { maximumAge: 6e5, timeout: 0 }, ts = !0) : (x = this.options.positionOptions, ts = !1), this._geolocationWatchID = window.navigator.geolocation.watchPosition(this._onSuccess, this._onError, x) } } else window.navigator.geolocation.getCurrentPosition(this._onSuccess, this._onError, this.options.positionOptions), this._timeoutId = setTimeout(this._finish, 1e4); return !0 } _clearWatch() { window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0, this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting", "mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "false"), this.options.showUserLocation && this._updateMarker(null) } }, AttributionControl: Fu, LogoControl: td, ScaleControl: class { constructor(x) { this.options = o.extend({}, aa, x), o.bindAll(["_onMove", "setUnit"], this) } getDefaultPosition() { return "bottom-left" } _onMove() { pv(this._map, this._container, this.options) } onAdd(x) { return this._map = x, this._container = w.create("div", "maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale", x.getContainer()), this._map.on("move", this._onMove), this._onMove(), this._container } onRemove() { w.remove(this._container), this._map.off("move", this._onMove), this._map = void 0 } setUnit(x) { this.options.unit = x, pv(this._map, this._container, this.options) } }, FullscreenControl: class { constructor(x) { this._fullscreen = !1, x && x.container && (x.container instanceof HTMLElement ? this._container = x.container : o.warnOnce("Full screen control 'container' must be a DOM element.")), o.bindAll(["_onClickFullscreen", "_changeIcon"], this), "onfullscreenchange" in document ? this._fullscreenchange = "fullscreenchange" : "onmozfullscreenchange" in document ? this._fullscreenchange = "mozfullscreenchange" : "onwebkitfullscreenchange" in document ? this._fullscreenchange = "webkitfullscreenchange" : "onmsfullscreenchange" in document && (this._fullscreenchange = "MSFullscreenChange") } onAdd(x) { return this._map = x, this._container || (this._container = this._map.getContainer()), this._controlContainer = w.create("div", "maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"), this._checkFullscreenSupport() ? this._setupUI() : (this._controlContainer.style.display = "none", o.warnOnce("This device does not support fullscreen mode.")), this._controlContainer } onRemove() { w.remove(this._controlContainer), this._map = null, window.document.removeEventListener(this._fullscreenchange, this._changeIcon) } _checkFullscreenSupport() { return !!(document.fullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled || document.webkitFullscreenEnabled) } _setupUI() { const x = this._fullscreenButton = w.create("button", "maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen", this._controlContainer); w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", x).setAttribute("aria-hidden", "true"), x.type = "button", this._updateTitle(), this._fullscreenButton.addEventListener("click", this._onClickFullscreen), window.document.addEventListener(this._fullscreenchange, this._changeIcon) } _updateTitle() { const x = this._getTitle(); this._fullscreenButton.setAttribute("aria-label", x), this._fullscreenButton.title = x } _getTitle() { return this._map._getUIString(this._isFullscreen() ? "FullscreenControl.Exit" : "FullscreenControl.Enter") } _isFullscreen() { return this._fullscreen } _changeIcon() { (window.document.fullscreenElement || window.document.mozFullScreenElement || window.document.webkitFullscreenElement || window.document.msFullscreenElement) === this._container !== this._fullscreen && (this._fullscreen = !this._fullscreen, this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"), this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"), this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"), this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"), this._updateTitle()) } _onClickFullscreen() { this._isFullscreen() ? window.document.exitFullscreen ? window.document.exitFullscreen() : window.document.mozCancelFullScreen ? window.document.mozCancelFullScreen() : window.document.msExitFullscreen ? window.document.msExitFullscreen() : window.document.webkitCancelFullScreen && window.document.webkitCancelFullScreen() : this._container.requestFullscreen ? this._container.requestFullscreen() : this._container.mozRequestFullScreen ? this._container.mozRequestFullScreen() : this._container.msRequestFullscreen ? this._container.msRequestFullscreen() : this._container.webkitRequestFullscreen && this._container.webkitRequestFullscreen() } }, TerrainControl: class { constructor(x) { this.options = x, o.bindAll(["_toggleTerrain", "_updateTerrainIcon"], this) } onAdd(x) { return this._map = x, this._container = w.create("div", "maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"), this._terrainButton = w.create("button", "maplibregl-ctrl-terrain mapboxgl-ctrl-terrain", this._container), w.create("span", "maplibregl-ctrl-icon mapboxgl-ctrl-icon", this._terrainButton).setAttribute("aria-hidden", "true"), this._terrainButton.type = "button", this._terrainButton.addEventListener("click", this._toggleTerrain), this._updateTerrainIcon(), this._map.on("terrain", this._updateTerrainIcon), this._container } onRemove() { w.remove(this._container), this._map.off("terrain", this._updateTerrainIcon), this._map = void 0 } _toggleTerrain() { this._map.getTerrain() ? this._map.setTerrain(null) : this._map.setTerrain(this.options), this._updateTerrainIcon() } _updateTerrainIcon() { this._terrainButton.classList.remove("maplibregl-ctrl-terrain", "mapboxgl-ctrl-terrain"), this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled", "mapboxgl-ctrl-terrain-enabled"), this._map.style.terrain ? (this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled", "mapboxgl-ctrl-terrain-enabled"), this._terrainButton.title = this._map._getUIString("TerrainControl.disableTerrain")) : (this._terrainButton.classList.add("maplibregl-ctrl-terrain", "mapboxgl-ctrl-terrain"), this._terrainButton.title = this._map._getUIString("TerrainControl.enableTerrain")) } }, Popup: class extends o.Evented { constructor(x) { super(), this.options = o.extend(Object.create(qr), x), o.bindAll(["_update", "_onClose", "remove", "_onMouseMove", "_onMouseUp", "_onDrag"], this) } addTo(x) { return this._map && this.remove(), this._map = x, this.options.closeOnClick && this._map.on("click", this._onClose), this.options.closeOnMove && this._map.on("move", this._onClose), this._map.on("remove", this.remove), this._update(), this._focusFirstElement(), this._trackPointer ? (this._map.on("mousemove", this._onMouseMove), this._map.on("mouseup", this._onMouseUp), this._container && this._container.classList.add("maplibregl-popup-track-pointer", "mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("maplibregl-track-pointer", "mapboxgl-track-pointer")) : this._map.on("move", this._update), this.fire(new o.Event("open")), this } isOpen() { return !!this._map } remove() { return this._content && w.remove(this._content), this._container && (w.remove(this._container), delete this._container), this._map && (this._map.off("move", this._update), this._map.off("move", this._onClose), this._map.off("click", this._onClose), this._map.off("remove", this.remove), this._map.off("mousemove", this._onMouseMove), this._map.off("mouseup", this._onMouseUp), this._map.off("drag", this._onDrag), delete this._map), this.fire(new o.Event("close")), this } getLngLat() { return this._lngLat } setLngLat(x) { return this._lngLat = o.LngLat.convert(x), this._pos = null, this._trackPointer = !1, this._update(), this._map && (this._map.on("move", this._update), this._map.off("mousemove", this._onMouseMove), this._container && this._container.classList.remove("maplibregl-popup-track-pointer", "mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.remove("maplibregl-track-pointer", "mapboxgl-track-pointer")), this } trackPointer() { return this._trackPointer = !0, this._pos = null, this._update(), this._map && (this._map.off("move", this._update), this._map.on("mousemove", this._onMouseMove), this._map.on("drag", this._onDrag), this._container && this._container.classList.add("maplibregl-popup-track-pointer", "mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("maplibregl-track-pointer", "mapboxgl-track-pointer")), this } getElement() { return this._container } setText(x) { return this.setDOMContent(document.createTextNode(x)) } setHTML(x) { const l = document.createDocumentFragment(), h = document.createElement("body"); let g; for (h.innerHTML = x; g = h.firstChild, g;)l.appendChild(g); return this.setDOMContent(l) } getMaxWidth() { return this._container && this._container.style.maxWidth } setMaxWidth(x) { return this.options.maxWidth = x, this._update(), this } setDOMContent(x) { if (this._content) for (; this._content.hasChildNodes();)this._content.firstChild && this._content.removeChild(this._content.firstChild); else this._content = w.create("div", "maplibregl-popup-content mapboxgl-popup-content", this._container); return this._content.appendChild(x), this._createCloseButton(), this._update(), this._focusFirstElement(), this } addClassName(x) { this._container && this._container.classList.add(x) } removeClassName(x) { this._container && this._container.classList.remove(x) } setOffset(x) { return this.options.offset = x, this._update(), this } toggleClassName(x) { if (this._container) return this._container.classList.toggle(x) } _createCloseButton() { this.options.closeButton && (this._closeButton = w.create("button", "maplibregl-popup-close-button mapboxgl-popup-close-button", this._content), this._closeButton.type = "button", this._closeButton.setAttribute("aria-label", "Close popup"), this._closeButton.innerHTML = "×", this._closeButton.addEventListener("click", this._onClose)) } _onMouseUp(x) { this._update(x.point) } _onMouseMove(x) { this._update(x.point) } _onDrag(x) { this._update(x.point) } _update(x) { if (!this._map || !this._lngLat && !this._trackPointer || !this._content || (this._container || (this._container = w.create("div", "maplibregl-popup mapboxgl-popup", this._map.getContainer()), this._tip = w.create("div", "maplibregl-popup-tip mapboxgl-popup-tip", this._container), this._container.appendChild(this._content), this.options.className && this.options.className.split(" ").forEach(E => this._container.classList.add(E)), this._trackPointer && this._container.classList.add("maplibregl-popup-track-pointer", "mapboxgl-popup-track-pointer")), this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth && (this._container.style.maxWidth = this.options.maxWidth), this._map.transform.renderWorldCopies && !this._trackPointer && (this._lngLat = $u(this._lngLat, this._pos, this._map.transform)), this._trackPointer && !x)) return; const l = this._pos = this._trackPointer && x ? x : this._map.project(this._lngLat); let h = this.options.anchor; const g = ch(this.options.offset); if (!h) { const E = this._container.offsetWidth, D = this._container.offsetHeight; let $; $ = l.y + g.bottom.y < D ? ["top"] : l.y > this._map.transform.height - D ? ["bottom"] : [], l.x < E / 2 ? $.push("left") : l.x > this._map.transform.width - E / 2 && $.push("right"), h = $.length === 0 ? "bottom" : $.join("-") } const b = l.add(g[h]).round(); w.setTransform(this._container, `${xn[h]} translate(${b.x}px,${b.y}px)`), In(this._container, h, "popup") } _focusFirstElement() { if (!this.options.focusAfterOpen || !this._container) return; const x = this._container.querySelector(ni); x && x.focus() } _onClose() { this.remove() } }, Marker: Pl, Style: Mr, LngLat: o.LngLat, LngLatBounds: o.LngLatBounds, Point: o.pointGeometry, MercatorCoordinate: o.MercatorCoordinate, Evented: o.Evented, AJAXError: o.AJAXError, config: o.config, CanvasSource: Te, GeoJSONSource: ce, ImageSource: ye, RasterDEMTileSource: ie, RasterTileSource: J, VectorTileSource: Z, VideoSource: Ie, prewarm: function () { Rt().acquire(It) }, clearPrewarmedResources: function () { const x = pt; x && (x.isPreloaded() && x.numActive() === 1 ? (x.release(It), pt = null) : console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()")) }, get version() { return "2.4.0" }, get workerCount() { return We.workerCount }, set workerCount(x) { We.workerCount = x }, get maxParallelImageRequests() { return o.config.MAX_PARALLEL_IMAGE_REQUESTS }, set maxParallelImageRequests(x) { o.config.MAX_PARALLEL_IMAGE_REQUESTS = x }, clearStorage(x) { o.clearTileCache(x) }, workerUrl: "", addProtocol(x, l) { o.config.REGISTERED_PROTOCOLS[x] = l }, removeProtocol(x) { delete o.config.REGISTERED_PROTOCOLS[x] }
|
|
|
}; return ko.extend(Is, { isSafari: o.isSafari, getPerformanceMetrics: o.PerformanceUtils.getPerformanceMetrics }), Is
|
|
|
}); var c = i; return c
|
|
|
})
|
|
|
})(I6); const Pde = I6.exports, Tde = "modulepreload", kde = function (e) { return "/" + e }, yR = {}, Ide = function (t, n, r) { if (!n || n.length === 0) return t(); const i = document.getElementsByTagName("link"); return Promise.all(n.map(s => { if (s = kde(s), s in yR) return; yR[s] = !0; const c = s.endsWith(".css"), o = c ? '[rel="stylesheet"]' : ""; if (!!r) for (let v = i.length - 1; v >= 0; v--) { const y = i[v]; if (y.href === s && (!c || y.rel === "stylesheet")) return } else if (document.querySelector(`link[href="${s}"]${o}`)) return; const p = document.createElement("link"); if (p.rel = c ? "stylesheet" : Tde, c || (p.as = "script", p.crossOrigin = ""), p.href = s, document.head.appendChild(p), c) return new Promise((v, y) => { p.addEventListener("load", v), p.addEventListener("error", () => y(new Error(`Unable to preload CSS for ${s}`))) }) })).then(() => t()) }, ME = C.exports.createContext(null), Rde = e => { const [t, n] = C.exports.useState({}), r = C.exports.useCallback((s, c = "default") => { n(o => { if (c === "current") throw new Error("'current' cannot be used as map id"); if (o[c]) throw new Error(`Multiple maps with the same id: ${c}`); return { ...o, [c]: s } }) }, []), i = C.exports.useCallback((s = "default") => { n(c => { if (c[s]) { const o = { ...c }; return delete o[s], o } return c }) }, []); return I(ME.Provider, { value: { maps: t, onMapMount: r, onMapUnmount: i }, children: e.children }) }; function AE() { var e; const t = (e = C.exports.useContext(ME)) === null || e === void 0 ? void 0 : e.maps, n = C.exports.useContext(Dc); return C.exports.useMemo(() => ({ ...t, current: n == null ? void 0 : n.map }), [t, n]) } function Mde(e) { const t = e.clone(); return t.pixelsToGLUnits = e.pixelsToGLUnits, t } function xR(e) { return { longitude: e.center.lng, latitude: e.center.lat, zoom: e.zoom, pitch: e.pitch, bearing: e.bearing, padding: e.padding } } function _R(e, t) { const n = t.viewState || t; let r = !1; if ("longitude" in n && "latitude" in n) { const i = e.center; e.center = new i.constructor(n.longitude, n.latitude), r = r || i !== e.center } if ("zoom" in n) { const i = e.zoom; e.zoom = n.zoom, r = r || i !== e.zoom } if ("bearing" in n) { const i = e.bearing; e.bearing = n.bearing, r = r || i !== e.bearing } if ("pitch" in n) { const i = e.pitch; e.pitch = n.pitch, r = r || i !== e.pitch } return n.padding && !e.isPaddingEqual(n.padding) && (r = !0, e.padding = n.padding), r } const Ade = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"]; function bR(e) { if (!e) return null; if (typeof e == "string" || ("toJS" in e && (e = e.toJS()), !e.layers)) return e; const t = {}; for (const r of e.layers) t[r.id] = r; const n = e.layers.map(r => { const i = t[r.ref]; let s = null; if ("interactive" in r && (s = { ...r }, delete s.interactive), i) { s = s || { ...r }, delete s.ref; for (const c of Ade) c in i && (s[c] = i[c]) } return s || r }); return { ...e, layers: n } } function Nde(e, t) { const n = Array.isArray(e) ? e[0] : e ? e.x : 0, r = Array.isArray(e) ? e[1] : e ? e.y : 0, i = Array.isArray(t) ? t[0] : t ? t.x : 0, s = Array.isArray(t) ? t[1] : t ? t.y : 0; return n === i && r === s } function xa(e, t) { if (e === t) return !0; if (!e || !t) return !1; if (Array.isArray(e)) { if (!Array.isArray(t) || e.length !== t.length) return !1; for (let n = 0; n < e.length; n++)if (!xa(e[n], t[n])) return !1; return !0 } else if (Array.isArray(t)) return !1; if (typeof e == "object" && typeof t == "object") { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; for (const i of n) if (!t.hasOwnProperty(i) || !xa(e[i], t[i])) return !1; return !0 } return !1 } const wR = { mousedown: "onMouseDown", mouseup: "onMouseUp", mouseover: "onMouseOver", mousemove: "onMouseMove", click: "onClick", dblclick: "onDblClick", mouseenter: "onMouseEnter", mouseleave: "onMouseLeave", mouseout: "onMouseOut", contextmenu: "onContextMenu", touchstart: "onTouchStart", touchend: "onTouchEnd", touchmove: "onTouchMove", touchcancel: "onTouchCancel" }, lb = { movestart: "onMoveStart", move: "onMove", moveend: "onMoveEnd", dragstart: "onDragStart", drag: "onDrag", dragend: "onDragEnd", zoomstart: "onZoomStart", zoom: "onZoom", zoomend: "onZoomEnd", rotatestart: "onRotateStart", rotate: "onRotate", rotateend: "onRotateEnd", pitchstart: "onPitchStart", pitch: "onPitch", pitchend: "onPitchEnd" }, CR = { wheel: "onWheel", boxzoomstart: "onBoxZoomStart", boxzoomend: "onBoxZoomEnd", boxzoomcancel: "onBoxZoomCancel", resize: "onResize", load: "onLoad", render: "onRender", idle: "onIdle", remove: "onRemove", data: "onData", styledata: "onStyleData", sourcedata: "onSourceData", error: "onError" }, Ode = ["minZoom", "maxZoom", "minPitch", "maxPitch", "maxBounds", "projection", "renderWorldCopies"], Dde = ["scrollZoom", "boxZoom", "dragRotate", "dragPan", "keyboard", "doubleClickZoom", "touchZoomRotate", "touchPitch"]; class hf { constructor(t, n, r) { this._map = null, this._internalUpdate = !1, this._inRender = !1, this._hoveredFeatures = null, this._deferredEvents = { move: !1, zoom: !1, pitch: !1, rotate: !1 }, this._onEvent = i => { const s = this.props[CR[i.type]]; s && s(i) }, this._onPointerEvent = i => { (i.type === "mousemove" || i.type === "mouseout") && this._updateHover(i); const s = this.props[wR[i.type]]; if (s) { if (this.props.interactiveLayerIds && i.type !== "mouseover" && i.type !== "mouseout") { const c = this._hoveredFeatures || this._map.queryRenderedFeatures(i.point, { layers: this.props.interactiveLayerIds }); i.features = c } s(i), delete i.features } }, this._onCameraEvent = i => { if (!this._internalUpdate) { const s = this.props[lb[i.type]]; s && s(i) } i.type in this._deferredEvents && (this._deferredEvents[i.type] = !1) }, this._MapClass = t, this.props = n, this._initialize(r) } get map() { return this._map } get transform() { return this._renderTransform } setProps(t) { const n = this.props; this.props = t; const r = this._updateSettings(t, n); r && this._createShadowTransform(this._map); const i = this._updateSize(t), s = this._updateViewState(t, !0); this._updateStyle(t, n), this._updateStyleComponents(t, n), this._updateHandlers(t, n), (r || i || s && !this._map.isMoving()) && this.redraw() } static reuse(t, n) { const r = hf.savedMaps.pop(); if (!r) return null; const i = r.map, s = i.getContainer(); for (n.className = s.className; s.childNodes.length > 0;)n.appendChild(s.childNodes[0]); i._container = n, r.setProps({ ...t, styleDiffing: !1 }), i.resize(); const { initialViewState: c } = t; return c && (c.bounds ? i.fitBounds(c.bounds, { ...c.fitBoundsOptions, duration: 0 }) : r._updateViewState(c, !1)), i.isStyleLoaded() ? i.fire("load") : i.once("styledata", () => i.fire("load")), r } _initialize(t) { const { props: n } = this, r = { ...n, ...n.initialViewState, accessToken: n.mapboxAccessToken || Lde() || null, container: t, style: bR(n.mapStyle) }, i = r.initialViewState || r.viewState || r; if (Object.assign(r, { center: [i.longitude || 0, i.latitude || 0], zoom: i.zoom || 0, pitch: i.pitch || 0, bearing: i.bearing || 0 }), n.gl) { const p = HTMLCanvasElement.prototype.getContext; HTMLCanvasElement.prototype.getContext = () => (HTMLCanvasElement.prototype.getContext = p, n.gl) } const s = new this._MapClass(r); i.padding && s.setPadding(i.padding), n.cursor && (s.getCanvas().style.cursor = n.cursor), this._createShadowTransform(s); const c = s._render; s._render = p => { this._inRender = !0, c.call(s, p), this._inRender = !1 }; const o = s._renderTaskQueue.run; s._renderTaskQueue.run = p => { o.call(s._renderTaskQueue, p), this._onBeforeRepaint() }, s.on("render", () => this._onAfterRepaint()); const f = s.fire; s.fire = this._fireEvent.bind(this, f), s.on("resize", () => { this._renderTransform.resize(s.transform.width, s.transform.height) }), s.on("styledata", () => this._updateStyleComponents(this.props, {})), s.on("sourcedata", () => this._updateStyleComponents(this.props, {})); for (const p in wR) s.on(p, this._onPointerEvent); for (const p in lb) s.on(p, this._onCameraEvent); for (const p in CR) s.on(p, this._onEvent); this._map = s } recycle() { const n = this.map.getContainer().querySelector("[mapboxgl-children]"); n == null || n.remove(), hf.savedMaps.push(this) } destroy() { this._map.remove() } redraw() { const t = this._map; !this._inRender && t.style && (t._frame && (t._frame.cancel(), t._frame = null), t._render()) } _createShadowTransform(t) { const n = Mde(t.transform); t.painter.transform = n, this._renderTransform = n } _updateSize(t) { const { viewState: n } = t; if (n) { const r = this._map; if (n.width !== r.transform.width || n.height !== r.transform.height) return r.resize(), !0 } return !1 } _updateViewState(t, n) { if (this._internalUpdate) return !1; const r = this._map, i = this._renderTransform, { zoom: s, pitch: c, bearing: o } = i, f = r.isMoving(); f && (i.cameraElevationReference = "sea"); const p = _R(i, { ...xR(r.transform), ...t }); if (f && (i.cameraElevationReference = "ground"), p && n) { const v = this._deferredEvents; v.move = !0, v.zoom || (v.zoom = s !== i.zoom), v.rotate || (v.rotate = o !== i.bearing), v.pitch || (v.pitch = c !== i.pitch) } return f || _R(r.transform, t), p } _updateSettings(t, n) { const r = this._map; let i = !1; for (const s of Ode) s in t && !xa(t[s], n[s]) && (i = !0, r[`set${s[0].toUpperCase()}${s.slice(1)}`](t[s])); return i } _updateStyle(t, n) { if (t.cursor !== n.cursor && (this._map.getCanvas().style.cursor = t.cursor), t.mapStyle !== n.mapStyle) { const r = { diff: t.styleDiffing }; return "localIdeographFontFamily" in t && (r.localIdeographFontFamily = t.localIdeographFontFamily), this._map.setStyle(bR(t.mapStyle), r), !0 } return !1 } _updateStyleComponents(t, n) { const r = this._map; let i = !1; return r.style.loaded() && ("light" in t && !xa(t.light, n.light) && (i = !0, r.setLight(t.light)), "fog" in t && !xa(t.fog, n.fog) && (i = !0, r.setFog(t.fog)), "terrain" in t && !xa(t.terrain, n.terrain) && (!t.terrain || r.getSource(t.terrain.source)) && (i = !0, r.setTerrain(t.terrain))), i } _updateHandlers(t, n) { const r = this._map; let i = !1; for (const s of Dde) { const c = t[s]; xa(c, n[s]) || (i = !0, c ? r[s].enable(c) : r[s].disable()) } return i } _updateHover(t) { var n; const { props: r } = this; if (r.interactiveLayerIds && (r.onMouseMove || r.onMouseEnter || r.onMouseLeave)) { const s = t.type, c = ((n = this._hoveredFeatures) === null || n === void 0 ? void 0 : n.length) > 0; let o; if (s === "mousemove") try { o = this._map.queryRenderedFeatures(t.point, { layers: r.interactiveLayerIds }) } catch { o = [] } else o = []; const f = o.length > 0; !f && c && (t.type = "mouseleave", this._onPointerEvent(t)), this._hoveredFeatures = o, f && !c && (t.type = "mouseenter", this._onPointerEvent(t)), t.type = s } else this._hoveredFeatures = null } _fireEvent(t, n, r) { const i = this._map, s = i.transform, c = typeof n == "string" ? n : n.type; return c === "move" && this._updateViewState(this.props, !1), c in lb && (typeof n == "object" && (n.viewState = xR(s)), this._map.isMoving()) ? (i.transform = this._renderTransform, t.call(i, n, r), i.transform = s, i) : (t.call(i, n, r), i) } _onBeforeRepaint() { const t = this._map; this._internalUpdate = !0; for (const r in this._deferredEvents) this._deferredEvents[r] && t.fire(r); this._internalUpdate = !1; const n = this._map.transform; this._map.transform = this._renderTransform, this._onAfterRepaint = () => { this._map.transform = n } } } hf.savedMaps = []; function Lde() { let e = null; if (typeof location < "u") { const t = /access_token=([^&\/]*)/.exec(location.search); e = t && t[1] } try { e = e || {}.MapboxAccessToken } catch { } try { e = e || {}.REACT_APP_MAPBOX_ACCESS_TOKEN } catch { } return e } const zde = ["setMaxBounds", "setMinZoom", "setMaxZoom", "setMinPitch", "setMaxPitch", "setRenderWorldCopies", "setProjection", "setStyle", "addSource", "removeSource", "addLayer", "removeLayer", "setLayerZoomRange", "setFilter", "setPaintProperty", "setLayoutProperty", "setLight", "setTerrain", "setFog", "remove"]; function Fde(e, t) { if (!e) return null; const n = e.map, r = { getMap: () => n, getCenter: () => e.transform.center, getZoom: () => e.transform.zoom, getBearing: () => e.transform.bearing, getPitch: () => e.transform.pitch, getPadding: () => e.transform.padding, getBounds: () => e.transform.getBounds(), project: i => e.transform.locationPoint(t.LngLat.convert(i)), unproject: i => e.transform.pointLocation(t.Point.convert(i)), queryTerrainElevation: (i, s) => { const c = n.transform; n.transform = e.transform; const o = n.queryTerrainElevation(i, s); return n.transform = c, o } }; for (const i of $de(n)) !(i in r) && !zde.includes(i) && (r[i] = n[i].bind(n)); return r } function $de(e) { const t = new Set; let n = e; for (; n;) { for (const r of Object.getOwnPropertyNames(n)) r[0] !== "_" && typeof e[r] == "function" && r !== "fire" && r !== "setEventedParent" && t.add(r); n = Object.getPrototypeOf(n) } return Array.from(t) } const Bde = typeof document < "u" ? C.exports.useLayoutEffect : C.exports.useEffect, Vde = ["baseApiUrl", "maxParallelImageRequests", "workerClass", "workerCount", "workerUrl"]; function Ude(e, t) { for (const n of Vde) n in t && (e[n] = t[n]); t.RTLTextPlugin && e.getRTLTextPluginStatus && e.getRTLTextPluginStatus() === "unavailable" && e.setRTLTextPlugin(t.RTLTextPlugin, n => { n && console.error(n) }, !1) } const Dc = C.exports.createContext(null), jde = { minZoom: 0, maxZoom: 22, minPitch: 0, maxPitch: 60, scrollZoom: !0, boxZoom: !0, dragRotate: !0, dragPan: !0, keyboard: !0, doubleClickZoom: !0, touchZoomRotate: !0, touchPitch: !0, mapStyle: { version: 8, sources: {}, layers: [] }, styleDiffing: !0, projection: "mercator", renderWorldCopies: !0, onError: e => console.error(e.error), RTLTextPlugin: "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js" }, NE = C.exports.forwardRef((e, t) => { const n = C.exports.useContext(ME), [r, i] = C.exports.useState(null), s = C.exports.useRef(), { current: c } = C.exports.useRef({ mapLib: null, map: null }); C.exports.useEffect(() => { const f = e.mapLib; let p = !0, v; return Promise.resolve(f || Ide(() => import("./index.764e1a39.js").then(y => y.i), [])).then(y => { if (!!p) { if (y.Map || (y = y.default), !y || !y.Map) throw new Error("Invalid mapLib"); if (y.supported(e)) Ude(y, e), e.reuseMaps && (v = hf.reuse(e, s.current)), v || (v = new hf(y.Map, e, s.current)), c.map = Fde(v, y), c.mapLib = y, i(v), n == null || n.onMapMount(c.map, e.id); else throw new Error("Map is not supported by this browser") } }).catch(y => { e.onError({ type: "error", target: null, originalEvent: null, error: y }) }), () => { p = !1, v && (n == null || n.onMapUnmount(e.id), e.reuseMaps ? v.recycle() : v.destroy()) } }, []), Bde(() => { r && r.setProps(e) }), C.exports.useImperativeHandle(t, () => c.map, [r]); const o = C.exports.useMemo(() => ({ position: "relative", width: "100%", height: "100%", ...e.style }), [e.style]); return I("div", { id: e.id, ref: s, style: o, children: r && I(Dc.Provider, { value: c, children: I("div", { "mapboxgl-children": "", children: e.children }) }) }) }); NE.displayName = "Map"; NE.defaultProps = jde; const Kde = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/; function Lc(e, t) { if (!e || !t) return; const n = e.style; for (const r in t) { const i = t[r]; Number.isFinite(i) && !Kde.test(r) ? n[r] = `${i}px` : n[r] = i } } const Hde = { draggable: !1, popup: null, rotation: 0, rotationAlignment: "auto", pitchAlignment: "auto" }; function M6(e) { const { map: t, mapLib: n } = C.exports.useContext(Dc), r = C.exports.useRef({ props: e }); r.current.props = e; const i = C.exports.useMemo(() => { let s = !1; C.exports.Children.forEach(e.children, f => { f && (s = !0) }); const c = { ...e, element: s ? document.createElement("div") : null }, o = new n.Marker(c).setLngLat([e.longitude, e.latitude]); return o.getElement().addEventListener("click", f => { var p, v; (v = (p = r.current.props).onClick) === null || v === void 0 || v.call(p, { type: "click", target: o, originalEvent: f }) }), o.on("dragstart", f => { var p, v; const y = f; y.lngLat = i.getLngLat(), (v = (p = r.current.props).onDragStart) === null || v === void 0 || v.call(p, y) }), o.on("drag", f => { var p, v; const y = f; y.lngLat = i.getLngLat(), (v = (p = r.current.props).onDrag) === null || v === void 0 || v.call(p, y) }), o.on("dragend", f => { var p, v; const y = f; y.lngLat = i.getLngLat(), (v = (p = r.current.props).onDragEnd) === null || v === void 0 || v.call(p, y) }), o }, []); return C.exports.useEffect(() => (i.addTo(t.getMap()), () => { i.remove() }), []), C.exports.useEffect(() => { Lc(i.getElement(), e.style) }, [e.style]), (i.getLngLat().lng !== e.longitude || i.getLngLat().lat !== e.latitude) && i.setLngLat([e.longitude, e.latitude]), e.offset && !Nde(i.getOffset(), e.offset) && i.setOffset(e.offset), i.isDraggable() !== e.draggable && i.setDraggable(e.draggable), i.getRotation() !== e.rotation && i.setRotation(e.rotation), i.getRotationAlignment() !== e.rotationAlignment && i.setRotationAlignment(e.rotationAlignment), i.getPitchAlignment() !== e.pitchAlignment && i.setPitchAlignment(e.pitchAlignment), i.getPopup() !== e.popup && i.setPopup(e.popup), pu.exports.createPortal(e.children, i.getElement()) } M6.defaultProps = Hde; C.exports.memo(M6); function SR(e) { return new Set(e ? e.trim().split(/\s+/) : []) } function Wde(e) { const { map: t, mapLib: n } = C.exports.useContext(Dc), r = C.exports.useMemo(() => document.createElement("div"), []), i = C.exports.useRef({ props: e }); i.current.props = e; const s = C.exports.useMemo(() => { const c = { ...e }, o = new n.Popup(c).setLngLat([e.longitude, e.latitude]); return o.once("open", f => { var p, v; (v = (p = i.current.props).onOpen) === null || v === void 0 || v.call(p, f) }), o }, []); if (C.exports.useEffect(() => { const c = o => { var f, p; (p = (f = i.current.props).onClose) === null || p === void 0 || p.call(f, o) }; return s.on("close", c), s.setDOMContent(r).addTo(t.getMap()), () => { s.off("close", c), s.isOpen() && s.remove() } }, []), C.exports.useEffect(() => { Lc(s.getElement(), e.style) }, [e.style]), s.isOpen() && ((s.getLngLat().lng !== e.longitude || s.getLngLat().lat !== e.latitude) && s.setLngLat([e.longitude, e.latitude]), e.offset && !xa(s.options.offset, e.offset) && s.setOffset(e.offset), (s.options.anchor !== e.anchor || s.options.maxWidth !== e.maxWidth) && (s.options.anchor = e.anchor, s.setMaxWidth(e.maxWidth)), s.options.className !== e.className)) { const c = SR(s.options.className), o = SR(e.className); for (const f of c) o.has(f) || s.removeClassName(f); for (const f of o) c.has(f) || s.addClassName(f); s.options.className = e.className } return pu.exports.createPortal(e.children, r) } const Gde = C.exports.memo(Wde); function Nm(e, t, n, r) { const i = C.exports.useContext(Dc), s = C.exports.useMemo(() => e(i), []); return C.exports.useEffect(() => { const c = r || n || t, o = typeof t == "function" && typeof n == "function" ? t : null, f = typeof n == "function" ? n : typeof t == "function" ? t : null, { map: p } = i; return p.hasControl(s) || (p.addControl(s, c == null ? void 0 : c.position), o && o(i)), () => { f && f(i), p.hasControl(s) && p.removeControl(s) } }, []), s } function qde(e) { const t = Nm(({ mapLib: n }) => new n.AttributionControl(e), { position: e.position }); return C.exports.useEffect(() => { Lc(t._container, e.style) }, [e.style]), null } C.exports.memo(qde); function Zde(e) { const t = Nm(({ mapLib: n }) => new n.FullscreenControl({ container: e.containerId && document.getElementById(e.containerId) }), { position: e.position }); return C.exports.useEffect(() => { Lc(t._controlContainer, e.style) }, [e.style]), null } C.exports.memo(Zde); const A6 = C.exports.forwardRef((e, t) => { const n = C.exports.useRef({ props: e }), r = Nm(({ mapLib: i }) => { const s = new i.GeolocateControl(e), c = s._setupUI; return s._setupUI = o => { s._container.hasChildNodes() || c(o) }, s.on("geolocate", o => { var f, p; (p = (f = n.current.props).onGeolocate) === null || p === void 0 || p.call(f, o) }), s.on("error", o => { var f, p; (p = (f = n.current.props).onError) === null || p === void 0 || p.call(f, o) }), s.on("outofmaxbounds", o => { var f, p; (p = (f = n.current.props).onOutOfMaxBounds) === null || p === void 0 || p.call(f, o) }), s.on("trackuserlocationstart", o => { var f, p; (p = (f = n.current.props).onTrackUserLocationStart) === null || p === void 0 || p.call(f, o) }), s.on("trackuserlocationend", o => { var f, p; (p = (f = n.current.props).onTrackUserLocationEnd) === null || p === void 0 || p.call(f, o) }), s }, { position: e.position }); return n.current.props = e, C.exports.useImperativeHandle(t, () => ({ trigger: () => r.trigger() }), []), C.exports.useEffect(() => { Lc(r._container, e.style) }, [e.style]), null }); A6.displayName = "GeolocateControl"; C.exports.memo(A6); function Xde(e) { const t = Nm(({ mapLib: n }) => new n.NavigationControl(e), { position: e.position }); return C.exports.useEffect(() => { Lc(t._container, e.style) }, [e.style]), null } C.exports.memo(Xde); const Yde = { unit: "metric", maxWidth: 100 }; function N6(e) { const t = Nm(({ mapLib: n }) => new n.ScaleControl(e), { position: e.position }); return (t.options.unit !== e.unit || t.options.maxWidth !== e.maxWidth) && (t.options.maxWidth = e.maxWidth, t.setUnit(e.unit)), C.exports.useEffect(() => { Lc(t._container, e.style) }, [e.style]), null } N6.defaultProps = Yde; C.exports.memo(N6); function l0(e, t) { if (!e) throw new Error(t) } let Qde = 0; function Jde(e, t, n) { if (e.style && e.style._loaded) { const r = { ...n }; return delete r.id, delete r.children, e.addSource(t, r), e.getSource(t) } return null } function efe(e, t, n) { l0(t.id === n.id, "source id changed"), l0(t.type === n.type, "source type changed"); let r = "", i = 0; for (const c in t) c !== "children" && c !== "id" && !xa(n[c], t[c]) && (r = c, i++); if (!i) return; const s = t.type; if (s === "geojson") e.setData(t.data); else if (s === "image") e.updateImage({ url: t.url, coordinates: t.coordinates }); else if ((s === "canvas" || s === "video") && i === 1 && r === "coordinates") e.setCoordinates(t.coordinates); else if (s === "vector" && "setUrl" in e) switch (r) { case "url": e.setUrl(t.url); break; case "tiles": e.setTiles(t.tiles); break } else console.warn(`Unable to update <Source> prop: ${r}`) } function qd(e) { const t = C.exports.useContext(Dc).map.getMap(), n = C.exports.useRef(e), [, r] = C.exports.useState(0), i = C.exports.useMemo(() => e.id || `jsx-source-${Qde++}`, []); C.exports.useEffect(() => { if (t) { const c = () => setTimeout(() => r(o => o + 1), 0); return t.on("styledata", c), c(), () => { var o; if (t.off("styledata", c), t.style && t.style._loaded && t.getSource(i)) { const f = (o = t.getStyle()) === null || o === void 0 ? void 0 : o.layers; if (f) for (const p of f) p.source === i && t.removeLayer(p.id); t.removeSource(i) } } } }, [t]); let s = t && t.style && t.getSource(i); return s ? efe(s, e, n.current) : s = Jde(t, i, e), n.current = e, s && C.exports.Children.map(e.children, c => c && C.exports.cloneElement(c, { source: i })) || null } function tfe(e, t, n, r) { if (l0(n.id === r.id, "layer id changed"), l0(n.type === r.type, "layer type changed"), n.type === "custom" || r.type === "custom") return; const { layout: i = {}, paint: s = {}, filter: c, minzoom: o, maxzoom: f, beforeId: p } = n; if (p !== r.beforeId && e.moveLayer(t, p), i !== r.layout) { const v = r.layout || {}; for (const y in i) xa(i[y], v[y]) || e.setLayoutProperty(t, y, i[y]); for (const y in v) i.hasOwnProperty(y) || e.setLayoutProperty(t, y, void 0) } if (s !== r.paint) { const v = r.paint || {}; for (const y in s) xa(s[y], v[y]) || e.setPaintProperty(t, y, s[y]); for (const y in v) s.hasOwnProperty(y) || e.setPaintProperty(t, y, void 0) } xa(c, r.filter) || e.setFilter(t, c), (o !== r.minzoom || f !== r.maxzoom) && e.setLayerZoomRange(t, o, f) } function nfe(e, t, n) { if (e.style && e.style._loaded && (!("source" in n) || e.getSource(n.source))) { const r = { ...n, id: t }; delete r.beforeId, e.addLayer(r, n.beforeId) } } let rfe = 0; function $o(e) { const t = C.exports.useContext(Dc).map.getMap(), n = C.exports.useRef(e), [, r] = C.exports.useState(0), i = C.exports.useMemo(() => e.id || `jsx-layer-${rfe++}`, []); if (C.exports.useEffect(() => { if (t) { const c = () => r(o => o + 1); return t.on("styledata", c), c(), () => { t.off("styledata", c), t.style && t.style._loaded && t.getLayer(i) && t.removeLayer(i) } } }, [t]), t && t.style && t.getLayer(i)) try { tfe(t, i, e, n.current) } catch (c) { console.warn(c) } else nfe(t, i, e); return n.current = e, null } const ife = e => ({ mode: Ur.PENDING, setMode: t => { e(n => { n.mode = t }) } }), Ss = bs(Mm(ws(ife), { name: "postnet/mode" })); function ofe() { for (var e = 0, t, n, r = ""; e < arguments.length;)(t = arguments[e++]) && (n = O6(t)) && (r && (r += " "), r += n); return r } function O6(e) { if (typeof e == "string") return e; for (var t, n = "", r = 0; r < e.length; r++)e[r] && (t = O6(e[r])) && (n && (n += " "), n += t); return n } var OE = "-"; function afe(e) { var t = lfe(e); function n(i) { var s = i.split(OE); return s[0] === "" && s.length !== 1 && s.shift(), D6(s, t) || sfe(i) } function r(i) { return e.conflictingClassGroups[i] || [] } return { getClassGroupId: n, getConflictingClassGroupIds: r } } function D6(e, t) { var c; if (e.length === 0) return t.classGroupId; var n = e[0], r = t.nextPart.get(n), i = r ? D6(e.slice(1), r) : void 0; if (i) return i; if (t.validators.length !== 0) { var s = e.join(OE); return (c = t.validators.find(function (o) { var f = o.validator; return f(s) })) == null ? void 0 : c.classGroupId } } var ER = /^\[(.+)\]$/; function sfe(e) { if (ER.test(e)) { var t = ER.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":")); if (n) return "arbitrary.." + n } } function lfe(e) { var t = e.theme, n = e.prefix, r = { nextPart: new Map, validators: [] }, i = cfe(Object.entries(e.classGroups), n); return i.forEach(function (s) { var c = s[0], o = s[1]; UC(o, r, c, t) }), r } function UC(e, t, n, r) { e.forEach(function (i) { if (typeof i == "string") { var s = i === "" ? t : PR(t, i); s.classGroupId = n; return } if (typeof i == "function") { if (ufe(i)) { UC(i(r), t, n, r); return } t.validators.push({ validator: i, classGroupId: n }); return } Object.entries(i).forEach(function (c) { var o = c[0], f = c[1]; UC(f, PR(t, o), n, r) }) }) } function PR(e, t) { var n = e; return t.split(OE).forEach(function (r) { n.nextPart.has(r) || n.nextPart.set(r, { nextPart: new Map, validators: [] }), n = n.nextPart.get(r) }), n } function ufe(e) { return e.isThemeGetter } function cfe(e, t) { return t ? e.map(function (n) { var r = n[0], i = n[1], s = i.map(function (c) { return typeof c == "string" ? t + c : typeof c == "object" ? Object.fromEntries(Object.entries(c).map(function (o) { var f = o[0], p = o[1]; return [t + f, p] })) : c }); return [r, s] }) : e } function dfe(e) { if (e < 1) return { get: function () { }, set: function () { } }; var t = 0, n = new Map, r = new Map; function i(s, c) { n.set(s, c), t++, t > e && (t = 0, r = n, n = new Map) } return { get: function (c) { var o = n.get(c); if (o !== void 0) return o; if ((o = r.get(c)) !== void 0) return i(c, o), o }, set: function (c, o) { n.has(c) ? n.set(c, o) : i(c, o) } } } var L6 = "!"; function ffe(e) { var t = e.separator || ":"; return function (r) { for (var i = 0, s = [], c = 0, o = 0; o < r.length; o++) { var f = r[o]; i === 0 && f === t[0] && (t.length === 1 || r.slice(o, o + t.length) === t) && (s.push(r.slice(c, o)), c = o + t.length), f === "[" ? i++ : f === "]" && i-- } var p = s.length === 0 ? r : r.substring(c), v = p.startsWith(L6), y = v ? p.substring(1) : p; return { modifiers: s, hasImportantModifier: v, baseClassName: y } } } function hfe(e) { if (e.length <= 1) return e; var t = [], n = []; return e.forEach(function (r) { var i = r[0] === "["; i ? (t.push.apply(t, n.sort().concat([r])), n = []) : n.push(r) }), t.push.apply(t, n.sort()), t } function pfe(e) { return { cache: dfe(e.cacheSize), splitModifiers: ffe(e), ...afe(e) } } var mfe = /\s+/; function vfe(e, t) { var n = t.splitModifiers, r = t.getClassGroupId, i = t.getConflictingClassGroupIds, s = new Set; return e.trim().split(mfe).map(function (c) { var o = n(c), f = o.modifiers, p = o.hasImportantModifier, v = o.baseClassName, y = r(v); if (!y) return { isTailwindClass: !1, originalClassName: c }; var w = hfe(f).join(":"), P = p ? w + L6 : w; return { isTailwindClass: !0, modifierId: P, classGroupId: y, originalClassName: c } }).reverse().filter(function (c) { if (!c.isTailwindClass) return !0; var o = c.modifierId, f = c.classGroupId, p = o + f; return s.has(p) ? !1 : (s.add(p), i(f).forEach(function (v) { return s.add(o + v) }), !0) }).reverse().map(function (c) { return c.originalClassName }).join(" ") } function gfe() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)t[n] = arguments[n]; var r, i, s, c = o; function o(p) { var v = t[0], y = t.slice(1), w = y.reduce(function (P, k) { return k(P) }, v()); return r = pfe(w), i = r.cache.get, s = r.cache.set, c = f, f(p) } function f(p) { var v = i(p); if (v) return v; var y = vfe(p, r); return s(p, y), y } return function () { return c(ofe.apply(null, arguments)) } } function Xr(e) { var t = function (r) { return r[e] || [] }; return t.isThemeGetter = !0, t } var z6 = /^\[(?:([a-z-]+):)?(.+)\]$/i, yfe = /^\d+\/\d+$/, xfe = new Set(["px", "full", "screen"]), _fe = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, bfe = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh)/, wfe = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; function La(e) { return bp(e) || xfe.has(e) || yfe.test(e) || Ju(e) } function Ju(e) { return zc(e, "length", Tfe) } function Cfe(e) { return zc(e, "size", F6) } function Sfe(e) { return zc(e, "position", F6) } function Efe(e) { return zc(e, "url", kfe) } function ub(e) { return zc(e, "number", bp) } function bp(e) { return !Number.isNaN(Number(e)) } function Kh(e) { return TR(e) || zc(e, "number", TR) } function wi(e) { return z6.test(e) } function Hh() { return !0 } function Ll(e) { return _fe.test(e) } function Pfe(e) { return zc(e, "", Ife) } function zc(e, t, n) { var r = z6.exec(e); return r ? r[1] ? r[1] === t : n(r[2]) : !1 } function Tfe(e) { return bfe.test(e) } function F6() { return !1 } function kfe(e) { return e.startsWith("url(") } function TR(e) { return Number.isInteger(Number(e)) } function Ife(e) { return wfe.test(e) } function Rfe() { var e = Xr("colors"), t = Xr("spacing"), n = Xr("blur"), r = Xr("brightness"), i = Xr("borderColor"), s = Xr("borderRadius"), c = Xr("borderSpacing"), o = Xr("borderWidth"), f = Xr("contrast"), p = Xr("grayscale"), v = Xr("hueRotate"), y = Xr("invert"), w = Xr("gap"), P = Xr("gradientColorStops"), k = Xr("inset"), A = Xr("margin"), N = Xr("opacity"), R = Xr("padding"), M = Xr("saturate"), O = Xr("scale"), z = Xr("sepia"), B = Xr("skew"), V = Xr("space"), G = Xr("translate"), j = function () { return ["auto", "contain", "none"] }, X = function () { return ["auto", "hidden", "clip", "visible", "scroll"] }, Y = function () { return ["auto", t] }, se = function () { return ["", La] }, ee = function () { return ["auto", bp, wi] }, Z = function () { return ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"] }, J = function () { return ["solid", "dashed", "dotted", "double", "none"] }, ve = function () { return ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"] }, ie = function () { return ["start", "end", "center", "between", "around", "evenly"] }, ce = function () { return ["", "0", wi] }, oe = function () { return ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"] }, ye = function () { return [bp, ub] }, Ie = function () { return [bp, wi] }; return { cacheSize: 500, theme: { colors: [Hh], spacing: [La], blur: ["none", "", Ll, Ju], brightness: ye(), borderColor: [e], borderRadius: ["none", "", "full", Ll, Ju], borderSpacing: [t], borderWidth: se(), contrast: ye(), grayscale: ce(), hueRotate: Ie(), invert: ce(), gap: [t], gradientColorStops: [e], inset: Y(), margin: Y(), opacity: ye(), padding: [t], saturate: ye(), scale: ye(), sepia: ce(), skew: Ie(), space: [t], translate: [t] }, classGroups: { aspect: [{ aspect: ["auto", "square", "video", wi] }], container: ["container"], columns: [{ columns: [Ll] }], "break-after": [{ "break-after": oe() }], "break-before": [{ "break-before": oe() }], "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], "box-decoration": [{ "box-decoration": ["slice", "clone"] }], box: [{ box: ["border", "content"] }], display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"], float: [{ float: ["right", "left", "none"] }], clear: [{ clear: ["left", "right", "both", "none"] }], isolation: ["isolate", "isolation-auto"], "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], "object-position": [{ object: [].concat(Z(), [wi]) }], overflow: [{ overflow: X() }], "overflow-x": [{ "overflow-x": X() }], "overflow-y": [{ "overflow-y": X() }], overscroll: [{ overscroll: j() }], "overscroll-x": [{ "overscroll-x": j() }], "overscroll-y": [{ "overscroll-y": j() }], position: ["static", "fixed", "absolute", "relative", "sticky"], inset: [{ inset: [k] }], "inset-x": [{ "inset-x": [k] }], "inset-y": [{ "inset-y": [k] }], top: [{ top: [k] }], right: [{ right: [k] }], bottom: [{ bottom: [k] }], left: [{ left: [k] }], visibility: ["visible", "invisible", "collapse"], z: [{ z: ["auto", Kh] }], basis: [{ basis: [t] }], "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], flex: [{ flex: ["1", "auto", "initial", "none", wi] }], grow: [{ grow: ce() }], shrink: [{ shrink: ce() }], order: [{ order: ["first", "last", "none", Kh] }], "grid-cols": [{ "grid-cols": [Hh] }], "col-start-end": [{ col: ["auto", { span: [Kh] }, wi] }], "col-start": [{ "col-start": ee() }], "col-end": [{ "col-end": ee() }], "grid-rows": [{ "grid-rows": [Hh] }], "row-start-end": [{ row: ["auto", { span: [Kh] }, wi] }], "row-start": [{ "row-start": ee() }], "row-end": [{ "row-end": ee() }], "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", wi] }], "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", wi] }], gap: [{ gap: [w] }], "gap-x": [{ "gap-x": [w] }], "gap-y": [{ "gap-y": [w] }], "justify-content": [{ justify: ie() }], "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], "align-content": [{ content: [].concat(ie(), ["baseline"]) }], "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], "place-content": [{ "place-content": [].concat(ie(), ["baseline", "stretch"]) }], "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], p: [{ p: [R] }], px: [{ px: [R] }], py: [{ py: [R] }], pt: [{ pt: [R] }], pr: [{ pr: [R] }], pb: [{ pb: [R] }], pl: [{ pl: [R] }], m: [{ m: [A] }], mx: [{ mx: [A] }], my: [{ my: [A] }], mt: [{ mt: [A] }], mr: [{ mr: [A] }], mb: [{ mb: [A] }], ml: [{ ml: [A] }], "space-x": [{ "space-x": [V] }], "space-x-reverse": ["space-x-reverse"], "space-y": [{ "space-y": [V] }], "space-y-reverse": ["space-y-reverse"], w: [{ w: ["auto", "min", "max", "fit", t] }], "min-w": [{ "min-w": ["min", "max", "fit", La] }], "max-w": [{ "max-w": ["0", "none", "full", "min", "max", "fit", "prose", { screen: [Ll] }, Ll, Ju] }], h: [{ h: [t, "auto", "min", "max", "fit"] }], "min-h": [{ "min-h": ["min", "max", "fit", La] }], "max-h": [{ "max-h": [t, "min", "max", "fit"] }], "font-size": [{ text: ["base", Ll, Ju] }], "font-smoothing": ["antialiased", "subpixel-antialiased"], "font-style": ["italic", "not-italic"], "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", ub] }], "font-family": [{ font: [Hh] }], "fvn-normal": ["normal-nums"], "fvn-ordinal": ["ordinal"], "fvn-slashed-zero": ["slashed-zero"], "fvn-figure": ["lining-nums", "oldstyle-nums"], "fvn-spacing": ["proportional-nums", "tabular-nums"], "fvn-fraction": ["diagonal-fractions", "stacked-fractons"], tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", Ju] }], leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", La] }], "list-style-type": [{ list: ["none", "disc", "decimal", wi] }], "list-style-position": [{ list: ["inside", "outside"] }], "placeholder-color": [{ placeholder: [e] }], "placeholder-opacity": [{ "placeholder-opacity": [N] }], "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], "text-color": [{ text: [e] }], "text-opacity": [{ "text-opacity": [N] }], "text-decoration": ["underline", "overline", "line-through", "no-underline"], "text-decoration-style": [{ decoration: [].concat(J(), ["wavy"]) }], "text-decoration-thickness": [{ decoration: ["auto", "from-font", La] }], "underline-offset": [{ "underline-offset": ["auto", La] }], "text-decoration-color": [{ decoration: [e] }], "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], "text-overflow": ["truncate", "text-ellipsis", "text-clip"], indent: [{ indent: [t] }], "vertical-align": [{ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Ju] }], whitespace: [{ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap"] }], break: [{ break: ["normal", "words", "all", "keep"] }], content: [{ content: ["none", wi] }], "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }], "bg-opacity": [{ "bg-opacity": [N] }], "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }], "bg-position": [{ bg: [].concat(Z(), [Sfe]) }], "bg-repeat": [{ bg: ["no-repeat", { repeat: ["", "x", "y", "round", "space"] }] }], "bg-size": [{ bg: ["auto", "cover", "contain", Cfe] }], "bg-image": [{ bg: ["none", { "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, Efe] }], "bg-color": [{ bg: [e] }], "gradient-from": [{ from: [P] }], "gradient-via": [{ via: [P] }], "gradient-to": [{ to: [P] }], rounded: [{ rounded: [s] }], "rounded-t": [{ "rounded-t": [s] }], "rounded-r": [{ "rounded-r": [s] }], "rounded-b": [{ "rounded-b": [s] }], "rounded-l": [{ "rounded-l": [s] }], "rounded-tl": [{ "rounded-tl": [s] }], "rounded-tr": [{ "rounded-tr": [s] }], "rounded-br": [{ "rounded-br": [s] }], "rounded-bl": [{ "rounded-bl": [s] }], "border-w": [{ border: [o] }], "border-w-x": [{ "border-x": [o] }], "border-w-y": [{ "border-y": [o] }], "border-w-t": [{ "border-t": [o] }], "border-w-r": [{ "border-r": [o] }], "border-w-b": [{ "border-b": [o] }], "border-w-l": [{ "border-l": [o] }], "border-opacity": [{ "border-opacity": [N] }], "border-style": [{ border: [].concat(J(), ["hidden"]) }], "divide-x": [{ "divide-x": [o] }], "divide-x-reverse": ["divide-x-reverse"], "divide-y": [{ "divide-y": [o] }], "divide-y-reverse": ["divide-y-reverse"], "divide-opacity": [{ "divide-opacity": [N] }], "divide-style": [{ divide: J() }], "border-color": [{ border: [i] }], "border-color-x": [{ "border-x": [i] }], "border-color-y": [{ "border-y": [i] }], "border-color-t": [{ "border-t": [i] }], "border-color-r": [{ "border-r": [i] }], "border-color-b": [{ "border-b": [i] }], "border-color-l": [{ "border-l": [i] }], "divide-color": [{ divide: [i] }], "outline-style": [{ outline: [""].concat(J()) }], "outline-offset": [{ "outline-offset": [La] }], "outline-w": [{ outline: [La] }], "outline-color": [{ outline: [e] }], "ring-w": [{ ring: se() }], "ring-w-inset": ["ring-inset"], "ring-color": [{ ring: [e] }], "ring-opacity": [{ "ring-opacity": [N] }], "ring-offset-w": [{ "ring-offset": [La] }], "ring-offset-color": [{ "ring-offset": [e] }], shadow: [{ shadow: ["", "inner", "none", Ll, Pfe] }], "shadow-color": [{ shadow: [Hh] }], opacity: [{ opacity: [N] }], "mix-blend": [{ "mix-blend": ve() }], "bg-blend": [{ "bg-blend": ve() }], filter: [{ filter: ["", "none"] }], blur: [{ blur: [n] }], brightness: [{ brightness: [r] }], contrast: [{ contrast: [f] }], "drop-shadow": [{ "drop-shadow": ["", "none", Ll, wi] }], grayscale: [{ grayscale: [p] }], "hue-rotate": [{ "hue-rotate": [v] }], invert: [{ invert: [y] }], saturate: [{ saturate: [M] }], sepia: [{ sepia: [z] }], "backdrop-filter": [{ "backdrop-filter": ["", "none"] }], "backdrop-blur": [{ "backdrop-blur": [n] }], "backdrop-brightness": [{ "backdrop-brightness": [r] }], "backdrop-contrast": [{ "backdrop-contrast": [f] }], "backdrop-grayscale": [{ "backdrop-grayscale": [p] }], "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [v] }], "backdrop-invert": [{ "backdrop-invert": [y] }], "backdrop-opacity": [{ "backdrop-opacity": [N] }], "backdrop-saturate": [{ "backdrop-saturate": [M] }], "backdrop-sepia": [{ "backdrop-sepia": [z] }], "border-collapse": [{ border: ["collapse", "separate"] }], "border-spacing": [{ "border-spacing": [c] }], "border-spacing-x": [{ "border-spacing-x": [c] }], "border-spacing-y": [{ "border-spacing-y": [c] }], "table-layout": [{ table: ["auto", "fixed"] }], transition: [{ transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", wi] }], duration: [{ duration: Ie() }], ease: [{ ease: ["linear", "in", "out", "in-out", wi] }], delay: [{ delay: Ie() }], animate: [{ animate: ["none", "spin", "ping", "pulse", "bounce", wi] }], transform: [{ transform: ["", "gpu", "none"] }], scale: [{ scale: [O] }], "scale-x": [{ "scale-x": [O] }], "scale-y": [{ "scale-y": [O] }], rotate: [{ rotate: [Kh, wi] }], "translate-x": [{ "translate-x": [G] }], "translate-y": [{ "translate-y": [G] }], "skew-x": [{ "skew-x": [B] }], "skew-y": [{ "skew-y": [B] }], "transform-origin": [{ origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", wi] }], accent: [{ accent: ["auto", e] }], appearance: ["appearance-none"], cursor: [{ cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", wi] }], "caret-color": [{ caret: [e] }], "pointer-events": [{ "pointer-events": ["none", "auto"] }], resize: [{ resize: ["none", "y", "x", ""] }], "scroll-behavior": [{ scroll: ["auto", "smooth"] }], "scroll-m": [{ "scroll-m": [t] }], "scroll-mx": [{ "scroll-mx": [t] }], "scroll-my": [{ "scroll-my": [t] }], "scroll-mt": [{ "scroll-mt": [t] }], "scroll-mr": [{ "scroll-mr": [t] }], "scroll-mb": [{ "scroll-mb": [t] }], "scroll-ml": [{ "scroll-ml": [t] }], "scroll-p": [{ "scroll-p": [t] }], "scroll-px": [{ "scroll-px": [t] }], "scroll-py": [{ "scroll-py": [t] }], "scroll-pt": [{ "scroll-pt": [t] }], "scroll-pr": [{ "scroll-pr": [t] }], "scroll-pb": [{ "scroll-pb": [t] }], "scroll-pl": [{ "scroll-pl": [t] }], "snap-align": [{ snap: ["start", "end", "center", "align-none"] }], "snap-stop": [{ snap: ["normal", "always"] }], "snap-type": [{ snap: ["none", "x", "y", "both"] }], "snap-strictness": [{ snap: ["mandatory", "proximity"] }], touch: [{ touch: ["auto", "none", "pinch-zoom", "manipulation", { pan: ["x", "left", "right", "y", "up", "down"] }] }], select: [{ select: ["none", "text", "all", "auto"] }], "will-change": [{ "will-change": ["auto", "scroll", "contents", "transform", wi] }], fill: [{ fill: [e, "none"] }], "stroke-w": [{ stroke: [La, ub] }], stroke: [{ stroke: [e, "none"] }], sr: ["sr-only", "not-sr-only"] }, conflictingClassGroups: { overflow: ["overflow-x", "overflow-y"], overscroll: ["overscroll-x", "overscroll-y"], inset: ["inset-x", "inset-y", "top", "right", "bottom", "left"], "inset-x": ["right", "left"], "inset-y": ["top", "bottom"], flex: ["basis", "grow", "shrink"], gap: ["gap-x", "gap-y"], p: ["px", "py", "pt", "pr", "pb", "pl"], px: ["pr", "pl"], py: ["pt", "pb"], m: ["mx", "my", "mt", "mr", "mb", "ml"], mx: ["mr", "ml"], my: ["mt", "mb"], "font-size": ["leading"], "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"], "fvn-ordinal": ["fvn-normal"], "fvn-slashed-zero": ["fvn-normal"], "fvn-figure": ["fvn-normal"], "fvn-spacing": ["fvn-normal"], "fvn-fraction": ["fvn-normal"], rounded: ["rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"], "rounded-t": ["rounded-tl", "rounded-tr"], "rounded-r": ["rounded-tr", "rounded-br"], "rounded-b": ["rounded-br", "rounded-bl"], "rounded-l": ["rounded-tl", "rounded-bl"], "border-spacing": ["border-spacing-x", "border-spacing-y"], "border-w": ["border-w-t", "border-w-r", "border-w-b", "border-w-l"], "border-w-x": ["border-w-r", "border-w-l"], "border-w-y": ["border-w-t", "border-w-b"], "border-color": ["border-color-t", "border-color-r", "border-color-b", "border-color-l"], "border-color-x": ["border-color-r", "border-color-l"], "border-color-y": ["border-color-t", "border-color-b"], "scroll-m": ["scroll-mx", "scroll-my", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"], "scroll-mx": ["scroll-mr", "scroll-ml"], "scroll-my": ["scroll-mt", "scroll-mb"], "scroll-p": ["scroll-px", "scroll-py", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"], "scroll-px": ["scroll-pr", "scroll-pl"], "scroll-py": ["scroll-pt", "scroll-pb"] } } } var Pc = gfe(Rfe); const Mfe = ({ onSelectedChange: e }) => { const { data: t, isInitialLoading: n } = pde(), { data: r, isInitialLoading: i } = mde(), { selection: { excluded: s } } = ml(); return C.exports.useEffect(() => e(r - s.size), [r, s]), Qe("div", { className: "flex items-center justify-between", children: [I("span", { children: "\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439" }), n || i ? I(Pf, {}) : I("span", { children: `${r - s.size} / ${t}` })] }) }, Afe = e => ({ updateCounter: -1, toggleUpdateCounter: () => { e(t => { t.updateCounter = t.updateCounter === -1 ? 1 : -1 }) } }), $6 = bs(ws(Afe)), Px = ({ onSuccess: e }) => { const { toggleUpdateCounter: t } = $6(); return b6({ mutationFn: n => Co.put(`https://postamates.spatialsystems.ru/api/placement_points/update_status?${n.toString()}`), onSuccess: () => { t(), e == null || e() } }) }, { Text: Nfe } = P5, fu = ({ text: e, className: t, classNameText: n }) => I("div", { className: Pc("mb-1", t), children: I(Nfe, { type: "secondary", className: Pc("uppercase text-xs", n), children: e }) }), Ofe = ({ disabled: e }) => { const { filters: t } = Cs(), { prediction: n, categories: r, region: i } = t, { selection: s } = ml(), c = Oc(), [o, f] = C.exports.useState(!1), { mutate: p, isLoading: v, isSuccess: y } = Px({ onSuccess: () => { c.invalidateQueries(["table", 1, t]) } }), w = () => { const k = new URLSearchParams({ status: Gn.onApproval, "prediction_current[]": n, "categories[]": r, "included[]": [...s.included], "excluded[]": [...s.excluded] }); i && (i.type === "ao" && k.append("district[]", i.id), i.type === "rayon" && k.append("area[]", i.id)), p(k) }; return Qe(An, { children: [Qe(gr, { type: "primary", block: !0, className: "mt-2", onClick: () => f(!0), disabled: e, children: [I("span", { className: "mr-1", children: "\u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443" }), I(O5, {})] }), Qe(vz, { title: " ", centered: !0, open: o, onCancel: () => f(!1), closable: !0, footer: (() => y ? [I(gr, { type: "primary", onClick: () => f(!1), children: "\u0425\u043E\u0440\u043E\u0448\u043E" }, "ok-button")] : v ? null : Qe("div", { className: "flex items-center justify-center gap-x-4", children: [I(gr, { onClick: () => f(!1), children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), I(gr, { type: "primary", onClick: w, children: "\u0414\u0430" })] }))(), children: [y ? I(v2, { message: "\u0423\u0441\u043F\u0435\u0448\u043D\u043E", description: "\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435. \u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043D\u0430 \u043D\u0438\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E \u0432\u0442\u043E\u0440\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435", type: "success", showIcon: !0 }) : I(fu, { text: "\u0423\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0432\u0437\u044F\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0431\u043E\u0442\u0443?", className: "text-center" }), v && I("div", { className: "flex justify-center py-2", children: I(Pf, { tip: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435...", size: "large" }) })] })] }) }; function Dfe(e, t, n) { n === void 0 && (n = {}); var r = { type: "Feature" }; return (n.id === 0 || n.id) && (r.id = n.id), n.bbox && (r.bbox = n.bbox), r.properties = t || {}, r.geometry = e, r } function Lfe(e, t, n) { n === void 0 && (n = {}); for (var r = 0, i = e; r < i.length; r++) { var s = i[r]; if (s.length < 4) throw new Error("Each LinearRing of a Polygon must have 4 or more Positions."); for (var c = 0; c < s[s.length - 1].length; c++)if (s[s.length - 1][c] !== s[0][c]) throw new Error("First and last Position are not equivalent.") } var o = { type: "Polygon", coordinates: e }; return Dfe(o, t, n) } function B6(e, t, n) { if (e !== null) for (var r, i, s, c, o, f, p, v = 0, y = 0, w, P = e.type, k = P === "FeatureCollection", A = P === "Feature", N = k ? e.features.length : 1, R = 0; R < N; R++) { p = k ? e.features[R].geometry : A ? e.geometry : e, w = p ? p.type === "GeometryCollection" : !1, o = w ? p.geometries.length : 1; for (var M = 0; M < o; M++) { var O = 0, z = 0; if (c = w ? p.geometries[M] : p, c !== null) { f = c.coordinates; var B = c.type; switch (v = n && (B === "Polygon" || B === "MultiPolygon") ? 1 : 0, B) { case null: break; case "Point": if (t(f, y, R, O, z) === !1) return !1; y++, O++; break; case "LineString": case "MultiPoint": for (r = 0; r < f.length; r++) { if (t(f[r], y, R, O, z) === !1) return !1; y++, B === "MultiPoint" && O++ } B === "LineString" && O++; break; case "Polygon": case "MultiLineString": for (r = 0; r < f.length; r++) { for (i = 0; i < f[r].length - v; i++) { if (t(f[r][i], y, R, O, z) === !1) return !1; y++ } B === "MultiLineString" && O++, B === "Polygon" && z++ } B === "Polygon" && O++; break; case "MultiPolygon": for (r = 0; r < f.length; r++) { for (z = 0, i = 0; i < f[r].length; i++) { for (s = 0; s < f[r][i].length - v; s++) { if (t(f[r][i][s], y, R, O, z) === !1) return !1; y++ } z++ } O++ } break; case "GeometryCollection": for (r = 0; r < c.geometries.length; r++)if (B6(c.geometries[r], t, n) === !1) return !1; break; default: throw new Error("Unknown Geometry Type") } } } } } function jC(e) { var t = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; return B6(e, function (n) { t[0] > n[0] && (t[0] = n[0]), t[1] > n[1] && (t[1] = n[1]), t[2] < n[0] && (t[2] = n[0]), t[3] < n[1] && (t[3] = n[1]) }), t } jC.default = jC; var zf = { exports: {} }; zf.exports = V6; zf.exports.parse = V6; zf.exports.stringify = U6; var kR = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/, IR = new RegExp("^" + kR.source + "(\\s" + kR.source + "){1,}"); function V6(e) { var t = e.split(";"), n = t.pop(), r = (t.shift() || "").split("=").pop(), i = 0; function s(M) { var O = n.substring(i).match(M); return O ? (i += O[0].length, O[0]) : null } function c(M) { return M && r.match(/\d+/) && (M.crs = { type: "name", properties: { name: "urn:ogc:def:crs:EPSG::" + r } }), M } function o() { s(/^\s*/) } function f() { o(); for (var M = 0, O = [], z = [O], B = O, V; V = s(/^(\()/) || s(/^(\))/) || s(/^(,)/) || s(IR);) { if (V === "(") z.push(B), B = [], z[z.length - 1].push(B), M++; else if (V === ")") { if (B.length === 0 || (B = z.pop(), !B)) return null; if (M--, M === 0) break } else if (V === ",") B = [], z[z.length - 1].push(B); else if (!V.split(/\s/g).some(isNaN)) Array.prototype.push.apply(B, V.split(/\s/g).map(parseFloat)); else return null; o() } return M !== 0 ? null : O } function p() { for (var M = [], O, z; z = s(IR) || s(/^(,)/);)z === "," ? (M.push(O), O = []) : z.split(/\s/g).some(isNaN) || (O || (O = []), Array.prototype.push.apply(O, z.split(/\s/g).map(parseFloat))), o(); if (O) M.push(O); else return null; return M.length ? M : null } function v() { if (!s(/^(point(\sz)?)/i) || (o(), !s(/^(\()/))) return null; var M = p(); return !M || (o(), !s(/^(\))/)) ? null : { type: "Point", coordinates: M[0] } } function y() { if (!s(/^(multipoint)/i)) return null; o(); var M = n.substring(n.indexOf("(") + 1, n.length - 1).replace(/\(/g, "").replace(/\)/g, ""); n = "MULTIPOINT (" + M + ")"; var O = f(); return O ? (o(), { type: "MultiPoint", coordinates: O }) : null } function w() { if (!s(/^(multilinestring)/i)) return null; o(); var M = f(); return M ? (o(), { type: "MultiLineString", coordinates: M }) : null } function P() { if (!s(/^(linestring(\sz)?)/i) || (o(), !s(/^(\()/))) return null; var M = p(); return !M || !s(/^(\))/) ? null : { type: "LineString", coordinates: M } } function k() { if (!s(/^(polygon(\sz)?)/i)) return null; o(); var M = f(); return M ? { type: "Polygon", coordinates: M } : null } function A() { if (!s(/^(multipolygon)/i)) return null; o(); var M = f(); return M ? { type: "MultiPolygon", coordinates: M } : null } function N() { var M = [], O; if (!s(/^(geometrycollection)/i) || (o(), !s(/^(\()/))) return null; for (; O = R();)M.push(O), o(), s(/^(,)/), o(); return s(/^(\))/) ? { type: "GeometryCollection", geometries: M } : null } function R() { return v() || P() || k() || y() || w() || A() || N() } return c(R()) } function U6(e) { e.type === "Feature" && (e = e.geometry); function t(c) { return c.join(" ") } function n(c) { return c.map(t).join(", ") } function r(c) { return c.map(n).map(s).join(", ") } function i(c) { return c.map(r).map(s).join(", ") } function s(c) { return "(" + c + ")" } switch (e.type) { case "Point": return "POINT (" + t(e.coordinates) + ")"; case "LineString": return "LINESTRING (" + n(e.coordinates) + ")"; case "Polygon": return "POLYGON (" + r(e.coordinates) + ")"; case "MultiPoint": return "MULTIPOINT (" + n(e.coordinates) + ")"; case "MultiPolygon": return "MULTIPOLYGON (" + i(e.coordinates) + ")"; case "MultiLineString": return "MULTILINESTRING (" + r(e.coordinates) + ")"; case "GeometryCollection": return "GEOMETRYCOLLECTION (" + e.geometries.map(U6).join(", ") + ")"; default: throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input") } } const { TreeNode: RR } = _5, zfe = e => e.reduce((t, n) => (t[n.id] = n, t[n.id].type = "ao", n.rayons && n.rayons.forEach(r => { t[r.id] = r, t[r.id].type = "rayon" }), t), {}), Tx = () => ao(["regions"], async () => { const { data: e } = await Co.get("https://postamates.spatialsystems.ru/api/ao_rayons"); return e }, { select: e => ({ raw: e, normalized: zfe(e) }) }), DE = ({ disabled: e, value: t, onChange: n }) => { const { map: r } = AE(), { data: i, isInitialLoading: s } = Tx(); return Qe("div", { children: [I(fu, { text: "\u0410\u041E / \u0440\u0430\u0439\u043E\u043D" }), I(_5, { showSearch: !0, style: { width: "100%" }, value: t, dropdownStyle: { maxHeight: 400, overflow: "auto" }, placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D", allowClear: !0, treeDefaultExpandAll: !1, onChange: f => { if (!f) return; const p = i.normalized[f], v = zf.exports(p.polygon), y = Lfe(v.coordinates[0]), w = jC(y); n({ id: f, geometry: y, type: p.type }), r.fitBounds([[w[0], w[1]], [w[2], w[3]]], { padding: 20 }) }, loading: s, treeNodeFilterProp: "title", onClear: () => n(null), notFoundContent: I(cs, { image: cs.PRESENTED_IMAGE_SIMPLE, description: "\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E" }), disabled: e, children: i == null ? void 0 : i.raw.map(f => { var p; return I(RR, { value: f.id, title: f.name, children: (p = f.rayons) == null ? void 0 : p.map(v => I(RR, { value: v.id, title: v.name }, v.id)) }, f.id) }) })] }) }, Ffe = Object.entries(_E).map(([e, t]) => ({ value: t, label: t })), $fe = ({ disabled: e }) => { const { filters: { categories: t }, setCategories: n } = Cs(); return Qe("div", { children: [I(fu, { text: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438" }), I(sl, { mode: "tags", style: { width: "100%" }, placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439", onChange: n, options: Ffe, allowClear: !0, value: t, disabled: e })] }) }, Ws = ({ value: e }) => I("span", { className: "text-grey text-xs bg-white-background-light", children: e }), MR = (e, t) => { if (Array.isArray(t)) { const [n, r] = t; return { ...e, [n]: I(Ws, { value: n }), [r]: I(Ws, { value: r }) } } else return { ...e, [t]: I(Ws, { value: t }) } }, kx = ({ title: e, value: t, onChange: n, onAfterChange: r, min: i = 0, max: s = 100, range: c = !1, step: o = 1, disabled: f = !1, onMouseEnter: p, onMouseLeave: v, showZeroMark: y = !1 }) => { const w = { [i]: I(Ws, { value: i }), [s]: I(Ws, { value: s }) }, [P, k] = C.exports.useState(t), [A, N] = C.exports.useState(MR(w, t)); C.exports.useEffect(() => { k(t), N(MR(w, t)) }, [t]); const R = z => { if (Array.isArray(z)) { const [B, V] = z; N({ ...w, [B]: I(Ws, { value: B }), [V]: I(Ws, { value: V }) }) } else N({ ...w, [z]: I(Ws, { value: z }) }); r == null || r(z) }, M = z => { k(z), n == null || n(z) }, O = y ? { ...A, 0: I(Ws, { value: 0 }) } : A; return Qe("div", { onMouseEnter: p, onMouseLeave: v, children: [I(fu, { text: e }), I(YQ, { range: c, value: P, marks: O, onChange: M, onAfterChange: R, min: i, max: s, step: o, disabled: f })] }) }, Bfe = ({ disabled: e, fullRange: t, isLoading: n }) => { const { filters: { prediction: r }, setPrediction: i } = Cs(), s = c => i(c); return C.exports.useEffect(() => { if (!t) return; const c = t.prediction[0], o = t.prediction[1]; r[0] === xp.prediction[0] && r[1] === xp.prediction[1] && i([c, o]) }, [t]), n ? I("div", { className: "flex justify-center items-center", children: I(Pf, {}) }) : I(kx, { title: "\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A", value: r, onAfterChange: s, min: t.prediction[0], max: t.prediction[1], range: !0, disabled: e }) }, LE = ({ onClick: e, disabled: t }) => I(gr, { block: !0, className: "mt-2", onClick: e, disabled: t, children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }), j6 = (e, t, n) => { if (!t || !n) return !1; const r = {}; return n.forEach(i => { r[i] = e[i][0] !== t[i][0] || e[i][1] !== t[i][1] }), r }, Vfe = () => ao(["prediction-max-min"], async () => { const { data: e } = await Co.get(`https://postamates.spatialsystems.ru/api/placement_points/filters?status[]=${Gn.pending}`); return e }, { select: e => ({ prediction: [e.prediction_current[0], e.prediction_current[1]] }) }), Ufe = () => { var M; const e = lde(), { reset: t } = ml(), { filters: n, setRegion: r, clear: i } = Cs(), { data: s, isInitialLoading: c } = Vfe(), [o, f] = C.exports.useState(!1), p = O => { f(O === 0) }, [v, y] = C.exports.useState(!1); C.exports.useEffect(() => { const O = setTimeout(() => y(!1), 1500); return () => clearTimeout(O) }, [v]); const w = () => { y(!0) }, P = () => { y(!1) }, k = j6(n, s, ["prediction"]), A = () => i(s), N = n.region || k.prediction || n.categories.length !== 0, R = Am(); return Qe("div", { className: "flex flex-col flex-1 justify-between", children: [Qe("div", { children: [Qe(io, { title: Ace, placement: "right", open: e && v, onMouseEnter: w, onMouseLeave: P, children: [Qe("div", { className: "space-y-5", children: [I(DE, { disabled: e, value: (M = n.region) == null ? void 0 : M.id, onChange: r }), I($fe, { disabled: e }), I(Bfe, { disabled: e, fullRange: s, isLoading: c })] }), N && I(LE, { onClick: A, disabled: e })] }), e ? I(gr, { block: !0, className: "mt-2", onClick: t, children: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435" }) : null] }), Qe("div", { children: [I(Mfe, { onSelectedChange: p }), R && I(Ofe, { disabled: o })] })] }) }, AR = { region: null }, jfe = e => ({ filters: AR, setRegion: t => e(n => { n.filters.region = t }), clear: () => e(t => { t.filters = AR }) }), Fc = bs(Mm(ws(jfe), { name: "postnet/on-approval-filters" })), Kfe = { [gn.initial]: !0, [gn.approve]: !1, [gn.working]: !1, [gn.filteredWorking]: !1, [gn.cancelled]: !1, [gn.pvz]: !0, [gn.other]: !0 }, Hfe = [gn.pvz, gn.other], Wfe = e => ({ isVisible: Kfe, toggleVisibility: t => e(n => { n.isVisible[t] = !n.isVisible[t] }), showLayers: t => e(n => { t.forEach(r => { n.isVisible[r] = !0 }) }), setLayersVisibility: t => e(n => { t.forEach(i => { n.isVisible[i] = !0 }), Object.keys(n.isVisible).filter(i => !t.includes(i) && !Hfe.includes(i)).forEach(i => { n.isVisible[i] = !1 }) }) }), Za = bs(Mm(ws(Wfe), { name: "postnet/layers-visibility" })), Gfe = () => { const { filters: { region: e }, setRegion: t, clear: n } = Fc(), { isVisible: r, toggleVisibility: i, showLayers: s } = Za(), c = e || !r[gn.approve] || !r[gn.working] || !r[gn.cancelled], o = () => { n(), s([gn.approve, gn.working, gn.cancelled]) }; return Qe("div", { className: "space-y-4", children: [I(DE, { value: e == null ? void 0 : e.id, onChange: t }), Qe("div", { children: [I(fu, { text: "\u0421\u0442\u0430\u0442\u0443\u0441\u044B" }), Qe("div", { className: "flex flex-col space-y-2", children: [I(pc, { onChange: () => i(gn.approve), checked: r[gn.approve], children: "\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430" }), I(pc, { className: "!ml-0", onChange: () => i(gn.working), checked: r[gn.working], children: "\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442" }), I(pc, { className: "!ml-0", onChange: () => i(gn.cancelled), checked: r[gn.cancelled], children: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D" })] })] }), c && I(LE, { onClick: o })] }) }, el = { region: null, deltaTraffic: [-1e4, 1e4], factTraffic: [-100, 0], age: [-1, 0] }, qfe = e => ({ filters: el, setDeltaTraffic: t => { e(n => { n.filters.deltaTraffic = t }) }, setFactTraffic: t => { e(n => { n.filters.factTraffic = t }) }, setAge: t => { e(n => { n.filters.age = t }) }, setRegion: t => e(n => { n.filters.region = t }), clear: t => e(n => { if (!t) return n.filters = el, n; const { deltaTraffic: r, factTraffic: i, age: s } = t; n.filters = { ...el, deltaTraffic: r, factTraffic: i, age: s } }) }), _u = bs(Mm(ws(qfe), { name: "postnet/working-filters" })), Zfe = ({ fullRange: e }) => { const { filters: { deltaTraffic: t }, setDeltaTraffic: n } = _u(), r = i => n(i); return C.exports.useEffect(() => { const i = e.deltaTraffic[0], s = e.deltaTraffic[1]; t[0] === el.deltaTraffic[0] && t[1] === el.deltaTraffic[1] && n([i, s]) }, [e, t]), I(kx, { title: "\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u0430 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C, %", value: t, onAfterChange: r, min: e.deltaTraffic[0], max: e.deltaTraffic[1], range: !0, showZeroMark: !0 }) }, Xfe = ({ fullRange: e }) => { const { filters: { factTraffic: t }, setFactTraffic: n } = _u(), r = i => n(i); return C.exports.useEffect(() => { const i = e.factTraffic[0], s = e.factTraffic[1]; t[0] === el.factTraffic[0] && t[1] === el.factTraffic[1] && n([i, s]) }, [e, t]), I(kx, { title: "\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A", value: t, onAfterChange: r, min: e.factTraffic[0], max: e.factTraffic[1], range: !0 }) }, Yfe = ({ fullRange: e }) => { const { filters: { age: t }, setAge: n } = _u(), r = i => n(i); return C.exports.useEffect(() => { const i = e.age[0], s = e.age[1]; t[0] === el.age[0] && t[1] === el.age[1] && n([i, s]) }, [e, t]), I(kx, { title: "\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430, \u0434\u043D\u0435\u0439", value: t, onAfterChange: r, min: e.age[0], max: e.age[1], range: !0 }) }, Qfe = () => ao(["working-max-min"], async () => { const { data: e } = await Co.get(`https://postamates.spatialsystems.ru/api/placement_points/filters?status[]=${Gn.working}`); return e }, { select: e => ({ deltaTraffic: [e.delta_current[0], e.delta_current[1]], factTraffic: [e.fact[0], e.fact[1]], age: [e.age_day[0], e.age_day[1]] }) }), Jfe = () => { var f; const { filters: e, setRegion: t, clear: n } = _u(), { data: r, isInitialLoading: i } = Qfe(), s = j6(e, r, ["deltaTraffic", "factTraffic", "age"]), c = e.region || s.deltaTraffic || s.factTraffic || s.age, o = () => n(r); return Qe("div", { children: [I(DE, { value: (f = e.region) == null ? void 0 : f.id, onChange: t }), I("div", { className: "space-y-12 mt-4", children: i ? I("div", { className: "flex justify-center items-center", children: I(Pf, {}) }) : Qe(An, { children: [I(Zfe, { fullRange: r }), I(Xfe, { fullRange: r }), I(Yfe, { fullRange: r })] }) }), c && I(LE, { onClick: o })] }) }, ehe = C.exports.forwardRef(({ isCollapsed: e }, t) => { const { mode: n } = Ss(), r = () => n === Ur.PENDING ? I(Ufe, {}) : n === Ur.ON_APPROVAL ? I(Gfe, {}) : I(Jfe, {}); return I("div", { className: Pc("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all pt-20", e ? "basis-0 px-0 -translate-x-[320px]" : "basis-[320px]"), ref: t, children: I("div", { className: "flex flex-col flex-1", children: r() }) }) }), the = 5, nhe = 3, K6 = { property: "prediction_current", stops: [[160, "#FDEBF0"], [161, "#F8C7D8"], [186, "#F398BC"], [201, "#EE67A1"], [211, "#B64490"], [226, "#7E237E"], [251, "#46016C"]] }, KC = "#CC2222", H6 = "#ff7d00", rhe = "rgba(196,195,195,0.6)", W6 = "#3f5be8", G6 = "#26a2a2", NR = { type: "circle", paint: { "circle-stroke-width": .4, "circle-stroke-color": "#fff", "circle-opacity": .8 } }, hu = (e = K6, t = the) => ({ ...NR, paint: { ...NR.paint, "circle-color": e, "circle-radius": ["interpolate", ["linear"], ["zoom"], 3, 0, 9, 2, 13, t] } }), Wh = hu(), ihe = hu(rhe, nhe), ohe = hu(H6), u0 = { type: "symbol", layout: { "icon-image": "logo", "icon-size": ["interpolate", ["linear"], ["zoom"], 3, 0, 9, .1, 13, .7] }, paint: { "icon-color": "#E63941" } }, OR = "#ffffff", DR = 16, q6 = { ...hu(OR, DR), paint: { ...hu(OR, DR).paint, "circle-stroke-width": .4, "circle-stroke-color": "#252525" } }, ahe = hu(KC), she = hu(W6), lhe = hu(G6), Z6 = "#676767", LR = { id: "ao", type: "line", source: "ao", "source-layer": "public.service_ao", layout: { "line-join": "round", "line-cap": "round" }, paint: { "line-color": Z6, "line-width": 1.5, "line-opacity": .8 } }, zR = { id: "rayon", type: "line", source: "rayon", "source-layer": "public.service_rayon", layout: { "line-join": "round", "line-cap": "round" }, paint: { "line-color": Z6, "line-width": .5, "line-opacity": .8 } }, uhe = { id: "selected-region", type: "line", source: "selected-region", layout: { "line-join": "round", "line-cap": "round" }, paint: { "line-color": "#CC2222", "line-width": 4 } }, che = { ao: "district_id", rayon: "area_id" }, Om = e => C.exports.useMemo(() => e ? ["==", ["get", che[e.type]], e.id] : null, [e]), FR = ["==", ["get", "status"], Gn.pending], dhe = () => { const { filters: e } = Cs(), { prediction: t, categories: n, region: r } = e, { selection: i } = ml(), s = [...i.included], c = [...i.excluded], o = Om(r), f = ["in", ["get", "id"], ["literal", s]], p = ["in", ["get", "id"], ["literal", c]], v = [[">=", ["get", "prediction_current"], t[0]], ["<=", ["get", "prediction_current"], t[1]]], y = n.length > 0 ? ["in", ["get", "category"], ["literal", n]] : !0, w = ["all", FR, ["!", p], ["any", o ? ["all", ...v, y, o] : ["all", ...v, y], f]], P = ["all", FR, ["!", f], ["any", ["!", o ? ["all", ...v, y, o] : ["all", ...v, y]], p]]; return { match: w, unmatch: P } }, fhe = () => { const { isVisible: e } = Za(), { match: t, unmatch: n } = dhe(); return Qe(An, { children: [I($o, { ...Wh, id: gn["initial-unmatch"], source: "points", "source-layer": "public.service_placementpoint", layout: { ...Wh.layout, visibility: e[gn.initial] ? "visible" : "none" }, filter: n, paint: ihe.paint }), I($o, { ...Wh, id: gn["initial-match"], source: "points", "source-layer": "public.service_placementpoint", layout: { ...Wh.layout, visibility: e[gn.initial] ? "visible" : "none" }, filter: t, paint: Wh.paint })] }) }, $R = ["==", ["get", "status"], Gn.onApproval], hhe = () => { const { isVisible: e } = Za(), { filters: { region: t } } = Fc(), n = Om(t), r = n ? ["all", $R, n] : $R; return I(An, { children: I($o, { ...ohe, id: gn.approve, source: "points", "source-layer": "public.service_placementpoint", layout: { visibility: e[gn.approve] ? "visible" : "none" }, filter: r }) }) }, cb = ["==", ["get", "status"], Gn.working], phe = () => { const { isVisible: e } = Za(), { filters: { region: t } } = Fc(), n = Om(t), { mode: r } = Ss(), i = () => r === Ur.ON_APPROVAL && n ? ["all", cb, n] : cb; return Qe(An, { children: [I($o, { ...q6, id: gn.workingBackground, source: "points", "source-layer": "public.service_placementpoint", layout: { visibility: e[gn.working] ? "visible" : "none" }, filter: i() }), I($o, { ...u0, id: gn.working, source: "points", "source-layer": "public.service_placementpoint", layout: { ...u0.layout, visibility: e[gn.working] ? "visible" : "none" }, filter: i() })] }) }, BR = ["==", ["get", "status"], Gn.working], mhe = () => { const { isVisible: e } = Za(), { filters: { deltaTraffic: t, factTraffic: n, age: r, region: i } } = _u(), s = Om(i), c = [[">=", ["get", "delta_current"], t[0]], ["<=", ["get", "delta_current"], t[1]]], o = [[">=", ["get", "fact"], n[0]], ["<=", ["get", "fact"], n[1]]], f = [[">=", ["get", "age_day"], r[0]], ["<=", ["get", "age_day"], r[1]]], p = s ? ["all", BR, ...c, ...o, ...f, s] : ["all", BR, ...c, ...o, ...f]; return Qe(An, { children: [I($o, { ...q6, id: gn.filteredWorkingBackground, source: "points", "source-layer": "public.service_placementpoint", layout: { visibility: e[gn.filteredWorking] ? "visible" : "none" }, filter: p }), I($o, { ...u0, id: gn.filteredWorking, source: "points", "source-layer": "public.service_placementpoint", layout: { ...u0.layout, visibility: e[gn.filteredWorking] ? "visible" : "none" }, filter: p })] }) }, db = ["==", ["get", "status"], Gn.cancelled], vhe = () => { const { isVisible: e } = Za(), { filters: { region: t } } = Fc(), n = Om(t), { mode: r } = Ss(), i = () => r === Ur.ON_APPROVAL && n ? ["all", db, n] : db; return I(An, { children: I($o, { ...ahe, id: gn.cancelled, source: "points", "source-layer": "public.service_placementpoint", layout: { visibility: e[gn.cancelled] ? "visible" : "none" }, filter: i() }) }) }, ghe = () => { const { updateCounter: e } = $6(); return I(An, { children: Qe(qd, { id: "points", type: "vector", tiles: [`${_p}/martin/public.service_placementpoint/{z}/{x}/{y}.pbf`], children: [I(fhe, {}), I(hhe, {}), I(phe, {}), I(mhe, {}), I(vhe, {})] }, `points-${e}`) }) }, yhe = ["==", ["get", "type"], "pvz"], xhe = () => { const { isVisible: e } = Za(); return I(An, { children: I($o, { ...she, id: gn.pvz, source: "rivals", "source-layer": "public.service_rivals", layout: { visibility: e[gn.pvz] ? "visible" : "none" }, filter: yhe }) }) }, _he = ["==", ["get", "type"], "post"], bhe = () => { const { isVisible: e } = Za(); return I(An, { children: I($o, { ...lhe, id: gn.other, source: "rivals", "source-layer": "public.service_rivals", layout: { visibility: e[gn.other] ? "visible" : "none" }, filter: _he }) }) }, fb = ({ data: e }) => I(qd, { id: "selected-region", type: "geojson", data: e, children: I($o, { ...uhe }) }), whe = () => { const { filters: { region: e } } = Cs(), { filters: { region: t } } = Fc(), { filters: { region: n } } = _u(), { mode: r } = Ss(), i = r === Ur.PENDING && (e == null ? void 0 : e.geometry), s = r === Ur.ON_APPROVAL && (t == null ? void 0 : t.geometry), c = r === Ur.WORKING && (n == null ? void 0 : n.geometry); return Qe(An, { children: [i && I(fb, { data: e.geometry }), s && I(fb, { data: t.geometry }), c && I(fb, { data: n.geometry })] }) }, Che = () => Qe(An, { children: [I(qd, { id: "ao", type: "vector", tiles: [`${_p}/martin/public.service_ao/{z}/{x}/{y}.pbf`], children: I($o, { ...LR, layout: { ...LR.layout } }) }), I(qd, { id: "rayon", type: "vector", tiles: [`${_p}/martin/public.service_rayon/{z}/{x}/{y}.pbf`], children: I($o, { ...zR, layout: { ...zR.layout } }) }), I(whe, {}), Qe(qd, { id: "rivals", type: "vector", tiles: [`${_p}/martin/public.service_rivals/{z}/{x}/{y}.pbf`], children: [I(xhe, {}), I(bhe, {})] }), I(ghe, {})] }), She = ({ lat: e, lng: t, onClose: n, children: r }) => I(Gde, { longitude: t, latitude: e, onClose: n, closeOnClick: !1, style: { minWidth: "300px" }, children: r }), Ehe = e => ({ clickedPointConfig: null, setClickedPointConfig: (t, n = !1) => { e(r => { if (t === null) return r.clickedPointConfig = null, r; r.clickedPointConfig = { id: t, shouldSelect: n } }) } }), vl = bs(ws(Ehe)), pf = (e, t) => { var n, r; return (r = (n = t == null ? void 0 : t[e]) == null ? void 0 : n.name) != null ? r : e }, X6 = [{ name: "\u0410\u0434\u0440\u0435\u0441", field: "address" }, { name: "\u0420\u0430\u0439\u043E\u043D", field: "area_id", fallbackField: "area", render: pf, type: "region" }, { name: "\u041E\u043A\u0440\u0443\u0433", field: "district_id", fallbackField: "district", render: pf, type: "region" }, { name: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", field: "name" }, { name: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F", field: "category" }, { name: "\u0421\u0442\u0430\u0442\u0443\u0441", field: "status", render: e => uc[e] }, { name: "\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A", field: "prediction_current" }], Phe = [...X6, { name: "\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440", field: "flat_cnt" }, { name: "\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438", field: "year_bld" }, { name: "\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439", field: "levels" }, { name: "\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D", field: "mat_nes" }], The = [{ name: "\u041F\u043B\u0430\u043D", field: "plan_current" }, { name: "\u0424\u0430\u043A\u0442", field: "fact" }, { name: "\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C", field: "delta_current" }, { name: "\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C", field: "age_day" }, { name: "id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430", field: "postamat_id", empty: "\u041D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D" }], khe = { pvz: "\u041F\u0412\u0417", post: "\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442" }, Ihe = [{ name: "\u0418\u043D\u0444\u043E", field: "info" }, { name: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F", field: "type", render: e => khe[e] }]; function Rhe(e, t) { const n = window.document.createElement("a"); n.href = window.URL.createObjectURL(new Blob([t], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" })), n.download = e, document.body.appendChild(n), n.click(), document.body.removeChild(n) } const HC = e => e == null || e === "", nm = ({ feature: e, dynamicStatus: t, postamatId: n }) => { var p, v; const { data: r } = Tx(), i = e.properties.category === _E.residential, s = e.properties.status === Gn.working, c = ((p = e.layer) == null ? void 0 : p.id) === gn.pvz || ((v = e.layer) == null ? void 0 : v.id) === gn.other, o = () => { if (c) return Ihe; const y = i ? Phe : X6; return s ? [...y, ...The] : y }, f = ({ field: y, render: w, empty: P, type: k, fallbackField: A }) => { let N = e.properties[y]; return y === "status" && t && (N = t), y === "postamat_id" && n && (N = n), k === "region" ? (N = N || e.properties[A], N = w(N, r == null ? void 0 : r.normalized)) : (N = w ? w(N) : N, N = HC(N) && P ? P : N), N }; return I("div", { children: o().map(y => Qe(AL, { className: Pc("p-1"), children: [I(Gy, { className: "font-semibold", span: 12, children: y.name }), I(Gy, { span: 12, children: f(y) })] }, y.field)) }) }, Mhe = ({ feature: e }) => { const { include: t, selection: n, exclude: r } = ml(), { setClickedPointConfig: i } = vl(), { filters: s } = Cs(), c = () => { const { prediction: y, categories: w, region: P } = s, { prediction_current: k, category: A, area: N, district: R, area_id: M, district_id: O } = e.properties, z = k >= y[0] && k <= y[1], B = w.length > 0 ? w.includes(A) : !0; return z && B && (() => P ? P.type === "ao" ? (R != null ? R : O) === P.id : (N != null ? N : M) === P.id : !0)() }, o = e.properties.id, f = c() && !n.excluded.has(o) || n.included.has(o); C.exports.useEffect(() => i(o, f), [o, f]); const p = () => { f ? r(o) : t(o) }, v = Am(); return Qe(An, { children: [I(nm, { feature: e }), v && I(gr, { type: "primary", className: "mt-2 mx-auto", block: !0, onClick: p, children: f ? "\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u0437 \u0432\u044B\u0431\u043E\u0440\u043A\u0438" : "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0432\u044B\u0431\u043E\u0440\u043A\u0443" })] }) }, Ahe = [{ label: uc[Gn.pending], value: Gn.pending }, { label: uc[Gn.onApproval], value: Gn.onApproval }, { label: uc[Gn.working], value: Gn.working }, { label: uc[Gn.cancelled], value: Gn.cancelled }], Y6 = ({ value: e, onChange: t, disabled: n }) => I(sl, { style: { width: 250 }, value: e, onChange: s => { t(s) }, options: Ahe, disabled: n, placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441", onClick: s => s.stopPropagation() }), Nhe = ({ feature: e }) => { const t = e.properties.id, { setClickedPointConfig: n } = vl(), { status: r, postamat_id: i } = e.properties, [s, c] = C.exports.useState(r), [o, f] = C.exports.useState(i); C.exports.useEffect(() => { c(r), f(i) }, [r, i]); const [p, v] = C.exports.useState(s === Gn.working && HC(o)), [y, w] = C.exports.useState(""); C.exports.useEffect(() => n(t), [t]); const P = Oc(), k = () => { P.invalidateQueries(["on-approval-points"]), P.invalidateQueries(["clicked-point", t]) }, { mutateAsync: A, isLoading: N } = Px({}), { mutateAsync: R, isLoading: M } = T6(), O = N || M, z = async () => { const G = new URLSearchParams({ id: t, postamat_id: o }), j = new URLSearchParams({ status: Gn.working, "location_ids[]": [t] }); try { await R(G) } catch { w("\u0423\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0439 id \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u043E\u0439"); return } await A(j), k(), v(!1) }, B = G => { if (c(G), G === Gn.working) v(!0); else { v(!1); const j = new URLSearchParams({ status: G, "location_ids[]": [t] }); A(j).then(k) } }, V = Am(); return Qe(An, { children: [I(nm, { feature: e, dynamicStatus: s, postamatId: o }), V && I("div", { className: "flex justify-center mt-4", children: Qe("div", { className: "flex flex-col items-center space-y-2", children: [I(fu, { text: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441" }), I(Y6, { value: s, onChange: B }), p && Qe(An, { children: [I(fu, { text: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430" }), I(JL, { className: "w-full", min: 0, precision: 0, value: o, onChange: G => f(G) }), y && I("div", { className: "text-primary text-center", children: y }), I(gr, { type: "primary", disabled: HC(o), onClick: z, loading: O, children: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441" })] })] }) })] }) }, Ohe = ({ feature: e }) => { const t = e.properties.id, { setClickedPointConfig: n } = vl(); return C.exports.useEffect(() => n(t), [e]), I(nm, { feature: e }) }, Dhe = e => ({ popup: null, setPopup: t => { e(n => { if (!t) return n.popup = null, n; n.popup = t }) } }), $c = bs(ws(Dhe)), Lhe = ({ feature: e }) => { var s, c; const { mode: t } = Ss(), n = ((s = e.layer) == null ? void 0 : s.id) === gn.pvz || ((c = e.layer) == null ? void 0 : c.id) === gn.other, r = e.properties.status === Gn.pending, i = e.properties.status === Gn.working; return n ? I(nm, { feature: e }) : t === Ur.ON_APPROVAL && !r ? I(Nhe, { feature: e }) : t === Ur.WORKING && i ? I(Ohe, { feature: e }) : t === Ur.PENDING && r ? I(Mhe, { feature: e }) : I(nm, { feature: e }) }, zhe = ({ features: e }) => { const { setPopup: t } = $c(); return I("div", { className: "space-y-2 p-1", children: e.map(n => { var r; return I(gr, { className: "text-start w-full", block: !0, onClick: () => { t({ features: [n], coordinates: n.geometry.coordinates }) }, children: n.properties.category === _E.residential ? Qe("div", { className: "space-x-2 flex items-center w-full", children: [I("span", { className: "flex-1 truncate inline-block", children: n.properties.address }), I("span", { children: n.properties.name })] }) : I("div", { className: "flex w-full", children: I("span", { className: "truncate", children: (r = n.properties.name) != null ? r : n.properties.category }) }) }, n.properties.id) }) }) }, Fhe = ({ features: e, lat: t, lng: n, onClose: r }) => I(She, { lat: t, lng: n, onClose: r, children: (() => e.length === 1 ? I(Lhe, { feature: e[0] }) : I(zhe, { features: e }))() }), $he = "https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw", Bhe = () => I(qd, { type: "raster", id: "basemap", tiles: [$he], tileSize: 256, children: I($o, { type: "raster", source: "basemap", id: "basemap-layer", paint: {} }) }); function Vhe() { const e = async () => { await Co.post("accounts/logout/"), RE(!1) }, { data: t } = ao(["profile"], async () => { const { data: n } = await Co.get("/accounts/profile"); return n }); return I("div", { className: "absolute top-[20px] right-[20px]", children: I(Y0, { content: Qe(An, { children: [I(fu, { text: t == null ? void 0 : t.email, classNameText: "lowercase" }), Qe(gr, { type: "primary", block: !0, onClick: e, children: [I("span", { className: "mr-1", children: "\u0412\u044B\u0439\u0442\u0438" }), I(O5, {})] })] }), trigger: "click", placement: "bottomRight", children: I(io, { title: "\u0412\u044B\u0439\u0442\u0438", placement: "left", children: I(gr, { icon: I(zle, {}), type: "primary", size: "large" }) }) }) }) } var Uhe = "Expected a function", VR = 0 / 0, jhe = "[object Symbol]", Khe = /^\s+|\s+$/g, Hhe = /^[-+]0x[0-9a-f]+$/i, Whe = /^0b[01]+$/i, Ghe = /^0o[0-7]+$/i, qhe = parseInt, Zhe = typeof Gs == "object" && Gs && Gs.Object === Object && Gs, Xhe = typeof self == "object" && self && self.Object === Object && self, Yhe = Zhe || Xhe || Function("return this")(), Qhe = Object.prototype, Jhe = Qhe.toString, epe = Math.max, tpe = Math.min, hb = function () { return Yhe.Date.now() }; function npe(e, t, n) { var r, i, s, c, o, f, p = 0, v = !1, y = !1, w = !0; if (typeof e != "function") throw new TypeError(Uhe); t = UR(t) || 0, WC(n) && (v = !!n.leading, y = "maxWait" in n, s = y ? epe(UR(n.maxWait) || 0, t) : s, w = "trailing" in n ? !!n.trailing : w); function P(V) { var G = r, j = i; return r = i = void 0, p = V, c = e.apply(j, G), c } function k(V) { return p = V, o = setTimeout(R, t), v ? P(V) : c } function A(V) { var G = V - f, j = V - p, X = t - G; return y ? tpe(X, s - j) : X } function N(V) { var G = V - f, j = V - p; return f === void 0 || G >= t || G < 0 || y && j >= s } function R() { var V = hb(); if (N(V)) return M(V); o = setTimeout(R, A(V)) } function M(V) { return o = void 0, w && r ? P(V) : (r = i = void 0, c) } function O() { o !== void 0 && clearTimeout(o), p = 0, r = f = i = o = void 0 } function z() { return o === void 0 ? c : M(hb()) } function B() { var V = hb(), G = N(V); if (r = arguments, i = this, f = V, G) { if (o === void 0) return k(f); if (y) return o = setTimeout(R, t), P(f) } return o === void 0 && (o = setTimeout(R, t)), c } return B.cancel = O, B.flush = z, B } function WC(e) { var t = typeof e; return !!e && (t == "object" || t == "function") } function rpe(e) { return !!e && typeof e == "object" } function ipe(e) { return typeof e == "symbol" || rpe(e) && Jhe.call(e) == jhe } function UR(e) { if (typeof e == "number") return e; if (ipe(e)) return VR; if (WC(e)) { var t = typeof e.valueOf == "function" ? e.valueOf() : e; e = WC(t) ? t + "" : t } if (typeof e != "string") return e === 0 ? e : +e; e = e.replace(Khe, ""); var n = Whe.test(e); return n || Ghe.test(e) ? qhe(e.slice(2), n ? 2 : 8) : Hhe.test(e) ? VR : +e } var ope = npe; const Q6 = ({ width: e = 40, height: t = 40, fill: n }) => I("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: e, height: t, children: Qe("g", { children: [I("polygon", { style: { fill: n != null ? n : "#3B555E" }, points: "19.6,24 21.4,24 22.5,23.9 23,23.8 23.5,23.4 23.8,22.9 24,22.3 24,20.4 24,1.9 23.9,1.4 23.6,0.8 23.3,0.4 22.9,0.1 22.3,0 14.2,0 8.9,0 11.2,4.6 19.5,4.5 19.6,4.5 " }), I("polygon", { style: { fill: n != null ? n : "#E63941" }, points: "13.6,6.4 17.7,6.4 16.2,9.4 14.1,14.2 12.3,18.4 11.7,18.4 9.8,14.5 6.8,8.8 4.5,4.5 4.7,23.9 1.7,24 1,23.8 0.5,23.2 0.2,22.7 0,22.1 0,1.8 0.1,1.3 0.4,0.8 0.8,0.4 1.1,0.2 1.4,0.1 2,0.1 7,0.1 11.9,10.6 " })] }) }), zl = ({ color: e, name: t }) => Qe("div", { className: "flex gap-2 items-center", children: [e ? I("span", { className: "rounded-xl w-3 h-3 inline-block", style: { backgroundColor: e } }) : I(Q6, { width: 12, height: 12, fill: "#E63941" }), I("span", { children: t })] }), ape = K6.stops.map(([e, t]) => t), spe = ({ colors: e, name: t }) => Qe("div", { className: "mb-3", children: [I("span", { className: "mb-1 mt-3 text-center", children: t }), I("div", { className: "w-[200px]", children: I("div", { className: "w-full h-[10px] rounded-xl", style: { background: `linear-gradient(to right, ${e.join(",")})` } }) }), I("span", { className: "italic", children: "\u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0442\u0440\u0430\u0444\u0438\u043A\u0430 \u2192" })] }); function lpe() { const { mode: e } = Ss(); return Qe("div", { className: "absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3", children: [I("div", { children: Qe("div", { className: "space-y-1", children: [e === Ur.PENDING && Qe(An, { children: [I(spe, { colors: ape, name: "\u041B\u043E\u043A\u0430\u0446\u0438\u0438 \u043A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E" }), I(zl, { name: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B" }), I(zl, { name: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438", color: KC })] }), e === Ur.ON_APPROVAL && Qe(An, { children: [I(zl, { name: "\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430", color: H6 }), I(zl, { name: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B" }), I(zl, { name: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438", color: KC })] }), e === Ur.WORKING && I(An, { children: I(zl, { name: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B" }) })] }) }), Qe("div", { className: "space-y-1", children: [I(zl, { name: "\u041F\u0412\u0417", color: W6 }), I(zl, { name: "\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439", color: G6 })] })] }) } let jR = e => typeof e == "object" && e != null && e.nodeType === 1, KR = (e, t) => (!t || e !== "hidden") && e !== "visible" && e !== "clip", pb = (e, t) => { if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) { let n = getComputedStyle(e, null); return KR(n.overflowY, t) || KR(n.overflowX, t) || (r => { let i = (s => { if (!s.ownerDocument || !s.ownerDocument.defaultView) return null; try { return s.ownerDocument.defaultView.frameElement } catch { return null } })(r); return !!i && (i.clientHeight < r.scrollHeight || i.clientWidth < r.scrollWidth) })(e) } return !1 }, Pg = (e, t, n, r, i, s, c, o) => s < e && c > t || s > e && c < t ? 0 : s <= e && o <= n || c >= t && o >= n ? s - e - r : c > t && o < n || s < e && o > n ? c - t + i : 0, upe = e => { let t = e.parentElement; return t == null ? e.getRootNode().host || null : t }, HR = (e, t) => { var n, r, i, s; if (typeof document > "u") return []; let { scrollMode: c, block: o, inline: f, boundary: p, skipOverflowHiddenElements: v } = t, y = typeof p == "function" ? p : ee => ee !== p; if (!jR(e)) throw new TypeError("Invalid target"); let w = document.scrollingElement || document.documentElement, P = [], k = e; for (; jR(k) && y(k);) { if (k = upe(k), k === w) { P.push(k); break } k != null && k === document.body && pb(k) && !pb(document.documentElement) || k != null && pb(k, v) && P.push(k) } let A = (r = (n = window.visualViewport) == null ? void 0 : n.width) != null ? r : innerWidth, N = (s = (i = window.visualViewport) == null ? void 0 : i.height) != null ? s : innerHeight, { scrollX: R, scrollY: M } = window, { height: O, width: z, top: B, right: V, bottom: G, left: j } = e.getBoundingClientRect(), X = o === "start" || o === "nearest" ? B : o === "end" ? G : B + O / 2, Y = f === "center" ? j + z / 2 : f === "end" ? V : j, se = []; for (let ee = 0; ee < P.length; ee++) { let Z = P[ee], { height: J, width: ve, top: ie, right: ce, bottom: oe, left: ye } = Z.getBoundingClientRect(); if (c === "if-needed" && B >= 0 && j >= 0 && G <= N && V <= A && B >= ie && G <= oe && j >= ye && V <= ce) return se; let Ie = getComputedStyle(Z), Te = parseInt(Ie.borderLeftWidth, 10), Pe = parseInt(Ie.borderTopWidth, 10), De = parseInt(Ie.borderRightWidth, 10), Re = parseInt(Ie.borderBottomWidth, 10), ke = 0, Oe = 0, $e = "offsetWidth" in Z ? Z.offsetWidth - Z.clientWidth - Te - De : 0, He = "offsetHeight" in Z ? Z.offsetHeight - Z.clientHeight - Pe - Re : 0, Ue = "offsetWidth" in Z ? Z.offsetWidth === 0 ? 0 : ve / Z.offsetWidth : 0, st = "offsetHeight" in Z ? Z.offsetHeight === 0 ? 0 : J / Z.offsetHeight : 0; if (w === Z) ke = o === "start" ? X : o === "end" ? X - N : o === "nearest" ? Pg(M, M + N, N, Pe, Re, M + X, M + X + O, O) : X - N / 2, Oe = f === "start" ? Y : f === "center" ? Y - A / 2 : f === "end" ? Y - A : Pg(R, R + A, A, Te, De, R + Y, R + Y + z, z), ke = Math.max(0, ke + M), Oe = Math.max(0, Oe + R); else { ke = o === "start" ? X - ie - Pe : o === "end" ? X - oe + Re + He : o === "nearest" ? Pg(ie, oe, J, Pe, Re + He, X, X + O, O) : X - (ie + J / 2) + He / 2, Oe = f === "start" ? Y - ye - Te : f === "center" ? Y - (ye + ve / 2) + $e / 2 : f === "end" ? Y - ce + De + $e : Pg(ye, ce, ve, Te, De + $e, Y, Y + z, z); let { scrollLeft: ft, scrollTop: It } = Z; ke = Math.max(0, Math.min(It + ke / st, Z.scrollHeight - J / st + He)), Oe = Math.max(0, Math.min(ft + Oe / Ue, Z.scrollWidth - ve / Ue + $e)), X += It - ke, Y += ft - Oe } se.push({ el: Z, top: ke, left: Oe }) } return se }, cpe = e => typeof e == "object" && typeof e.behavior == "function", dpe = e => e === !1 ? { block: "end", inline: "nearest" } : (t => t === Object(t) && Object.keys(t).length !== 0)(e) ? e : { block: "start", inline: "nearest" }; function fpe(e, t) { if (!e.isConnected || !e.ownerDocument.documentElement.contains(e)) return; if (cpe(t)) return t.behavior(HR(e, t)); let n = typeof t == "boolean" || t == null ? void 0 : t.behavior; for (let { el: r, top: i, left: s } of HR(e, dpe(t))) r.scroll({ top: i, left: s, behavior: n }) } const zE = e => { Rhe("postamates.xlsx", e) }, hpe = ({ provider: e }) => { const [t, n] = C.exports.useState(!1); return e(t, () => n(!1)), I(io, { title: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435", children: I(gr, { onClick: i => { i.stopPropagation(), n(!0) }, loading: t, disabled: t, children: I(Ele, {}) }) }) }, ppe = { isOpened: !1, fullScreen: !1 }, mpe = e => ({ tableState: ppe, toggleOpened: t => { e(n => { n.tableState.isOpened = t[0] === "opened" }) }, toggleFullScreen: () => { e(t => { t.tableState.fullScreen = !t.tableState.fullScreen }) }, openTable: () => { e(t => { t.tableState.isOpened = !0 }) } }), Dm = bs(ws(mpe)), vpe = () => { const { tableState: { fullScreen: e }, toggleFullScreen: t } = Dm(), [n, r] = C.exports.useState(!1); return C.exports.useEffect(() => { const o = setTimeout(() => r(!1), 1500); return () => clearTimeout(o) }, [n]), I(io, { title: e ? "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C" : "\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D", placement: "topRight", open: n, children: I(gr, { onClick: o => { o.stopPropagation(), t() }, onMouseEnter: () => { r(!0) }, onMouseLeave: () => { r(!1) }, children: e ? I(kle, {}) : I(Mle, {}) }) }) }, Ix = ({ leftColumn: e, rightColumn: t, exportProvider: n, classes: r }) => Qe("div", { className: "flex items-center w-full justify-between", children: [Qe("div", { className: r == null ? void 0 : r.leftColumn, children: [I("span", { className: "py-[5px]", children: "\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432" }), e] }), Qe("div", { className: r == null ? void 0 : r.rightColumn, children: [t, Qe("div", { className: "flex items-center gap-x-1", children: [n && I(hpe, { provider: n }), I(vpe, {})] })] })] }), FE = tr.memo(({ rowSelection: e, data: t, pageSize: n, isClickedPointLoading: r, page: i, onPageChange: s, columns: c, header: o, fullWidth: f, loading: p }) => { const { clickedPointConfig: v, setClickedPointConfig: y } = vl(), { map: w } = AE(), { tableState: P, toggleOpened: k } = Dm(), { setPopup: A } = $c(), N = { y: P.fullScreen ? "calc(100vh - 136px)" : "200px", x: "max-content" }; return C.exports.useEffect(() => { if (v === null || r) return; const R = document.querySelector(".scroll-row"); R && fpe(R, { behavior: "smooth" }) }, [v, t]), I(dI, { bordered: !1, onChange: k, activeKey: P.isOpened ? "opened" : null, children: I(dI.Panel, { header: o || I(Ix, {}), collapsible: P.fullScreen ? "disabled" : void 0, children: I(p5, { size: "small", className: "table__wrapper", locale: { emptyText: I(cs, { description: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" }) }, pagination: { pageSize: n, current: i, onChange: s, total: t == null ? void 0 : t.count, showSizeChanger: !1, position: "bottomCenter" }, dataSource: t == null ? void 0 : t.results, columns: c, rowKey: "id", scroll: N, sticky: !0, onRow: R => ({ onClick: () => { const M = zf.exports(R.geometry); w.flyTo({ center: [M.coordinates[0], M.coordinates[1]], zoom: 13, essential: !0 }), A({ features: [{ properties: R }], coordinates: M.coordinates }), y(R.id, e == null ? void 0 : e.selectedRowKeys.includes(R.id)) } }), rowSelection: e, rowClassName: R => Pc("cursor-pointer", R.id === (v == null ? void 0 : v.id) && "scroll-row"), "data-fullwidth": f, loading: p }) }, "opened") }) }), mf = 30, gpe = (e, t) => { const { clickedPointConfig: n } = vl(), { data: r, isInitialLoading: i, isFetching: s } = ao(["clicked-point", n == null ? void 0 : n.id], async () => { const c = new URLSearchParams({ "location_ids[]": [n.id] }), { data: o } = await Co.get(`https://postamates.spatialsystems.ru/api/placement_points?${c.toString()}`); return o }, { enabled: e, onSuccess: t }); return { data: r, isLoading: i || s } }, $E = (e, t) => { const [n, r] = C.exports.useState(), [i, s] = C.exports.useState(!1), c = C.exports.useRef(), { data: o, isLoading: f } = gpe(i, () => s(!1)), { clickedPointConfig: p } = vl(), v = Oc(); return C.exports.useEffect(() => { !e || r(e) }, [e]), C.exports.useEffect(() => { !e || p === null || e.results.find(w => w.id === p.id) || s(!0) }, [e, p]), C.exports.useEffect(() => { var y; !((y = o == null ? void 0 : o.results) != null && y[0]) || (c.current = o.results[0].id, t(mf + 1), r({ count: e.count + 1, results: [o.results[0], ...e.results] })) }, [o, e]), C.exports.useEffect(() => { if (p === null) { const y = ["clicked-point", c.current]; v.removeQueries({ queryKey: y }), t(mf), r(e) } }, [p, e]), { data: n, isClickedPointLoading: f } }, ype = (e, t, n, r) => { const { filters: i } = Cs(), { prediction: s, categories: c, region: o } = i, { data: f, isInitialLoading: p } = ao(["table", e, i], async () => { const w = new URLSearchParams({ page: e, page_size: n, "prediction_current[]": s, "status[]": [Gn.pending], "categories[]": c }); return await Lf(w, o) }, { keepPreviousData: !0, onError: w => { w.response.data.detail === "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430" && t() } }), { data: v, isClickedPointLoading: y } = $E(f, r); return { data: v, pageSize: n, isClickedPointLoading: y, isDataLoading: p } }, xpe = (e, t) => { const { filters: n } = Cs(), { prediction: r, categories: i, region: s } = n, { selection: c } = ml(), o = [...c.included], f = [...c.excluded]; return ao(["export-initial", n, c], async () => { const p = new URLSearchParams({ "prediction_current[]": r, "status[]": [Gn.pending] }); return i.length && p.append("categories[]", i), o.length && p.append("included[]", o), f.length && p.append("excluded[]", f), await kE(p, s) }, { enabled: e, onSuccess: zE, onSettled: t, retry: !1 }) }; function _pe(e, t) { const [n, r] = C.exports.useState(e); return C.exports.useEffect(() => { const i = setTimeout(() => r(e), t || 500); return () => { clearTimeout(i) } }, [e, t]), n } const bpe = e => I("div", { children: e }), BE = ({ autoFocus: e = !1 }) => { const { map: t } = AE(), [n, r] = C.exports.useState(""), i = _pe(n), { setPopup: s } = $c(), { setClickedPointConfig: c } = vl(), o = C.exports.useRef(), { data: f } = ao(["address", i], async () => (await Co.get(`https://postamates.spatialsystems.ru/api/placement_points/search_address?page_size=100&address=${i}`)).data, { enabled: !!i }), p = C.exports.useMemo(() => f ? f.results.map(w => ({ label: bpe(w.address), value: `${w.address}$${w.id}`, item: w })) : [], [f]), v = w => { r(w && w.split("$")[0]) }, y = (w, P) => { const k = zf.exports(P.item.geometry); t.flyTo({ center: [k.coordinates[0], k.coordinates[1]], zoom: 13, essential: !0 }); const A = { properties: P.item }; s({ features: [A], coordinates: k.coordinates }), c(A.properties.id) }; return C.exports.useEffect(() => { e && (o == null ? void 0 : o.current) && o.current.focus() }, [e]), I("div", { children: I(FW, { options: p, style: { width: 300 }, value: n, onChange: v, onSelect: y, allowClear: !0, onClear: () => r(""), autoFocus: e, popupClassName: "overflow-visible", children: I(Xy, { prefix: I(uE, {}), placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438", className: "text-ellipsis", ref: o }) }) }) }, J6 = (e = []) => { const { data: t } = Tx(), { tableState: { fullScreen: n } } = Dm(); return C.exports.useMemo(() => [{ title: n ? Qe("div", { className: "flex items-center justify-between", children: [I("span", { children: "\u0410\u0434\u0440\u0435\u0441" }), I(Y0, { content: I(BE, { autoFocus: !0 }), trigger: "click", placement: "right", children: I(gr, { children: I(uE, {}) }) })] }) : "\u0410\u0434\u0440\u0435\u0441", dataIndex: "address", key: "address", width: 200 }, { title: "\u0420\u0430\u0439\u043E\u043D", dataIndex: "area", key: "area", width: "120px", ellipsis: !0, render: (r, i) => pf(i.area, t == null ? void 0 : t.normalized) }, { title: "\u041E\u043A\u0440\u0443\u0433", dataIndex: "district", key: "district", width: "120px", ellipsis: !0, render: (r, i) => pf(i.district, t == null ? void 0 : t.normalized) }, { title: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", dataIndex: "name", key: "name", width: "120px", ellipsis: !0 }, { title: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F", dataIndex: "category", key: "category", width: "120px", ellipsis: !0 }, { title: "\u0421\u0442\u0430\u0442\u0443\u0441", dataIndex: "status", key: "status", width: "120px", ellipsis: !0, render: (r, i) => uc[i.status] }, { title: "\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A", dataIndex: "prediction_current", key: "prediction_current", width: "120px", ellipsis: !0 }, ...e], [t == null ? void 0 : t.normalized, e, n]) }, wpe = ({ fullWidth: e }) => { const { selection: t, include: n, exclude: r } = ml(), { clickedPointConfig: i, setClickedPointConfig: s } = vl(), [c, o] = C.exports.useState(1), [f, p] = C.exports.useState(mf), v = J6(), { setPopup: y } = $c(), { data: w, isClickedPointLoading: P, isDataLoading: k } = ype(c, () => o(1), f, p), A = () => p(mf), R = { selectedRowKeys: C.exports.useCallback(() => { var X; const z = (X = w == null ? void 0 : w.results.map(Y => Y.id)) != null ? X : [], B = w == null ? void 0 : w.results.find(Y => Y.id === (i == null ? void 0 : i.id)), V = Y => t.excluded.has(Y), G = Y => Y === (B == null ? void 0 : B.id) && (i == null ? void 0 : i.shouldSelect) === !1; return [...z.filter(Y => !V(Y) && !G(Y)), ...t.included] }, [w, i, t])(), onSelect: (z, B) => { const { id: V } = z; B ? n(V) : r(V) }, hideSelectAll: !0 }, M = C.exports.useCallback(z => { A(), s(null), y(null), o(z) }, []), O = Am(); return I(FE, { rowSelection: O ? R : void 0, data: w, onPageChange: M, page: c, pageSize: f, isClickedPointLoading: P, columns: v, fullWidth: e, header: I(Ix, { exportProvider: xpe }), loading: k }) }, Cpe = (e, t) => { const { filters: { region: n } } = Fc(); return ao(["export-on-approval", n], async () => { const r = new URLSearchParams({ "status[]": [Gn.onApproval, Gn.working] }); return await kE(r, n) }, { enabled: e, onSuccess: zE, onSettled: t }) }, Spe = ({ selectedIds: e, selectedStatus: t, onOpenMakeWorkingModal: n, onSuccess: r }) => { const i = Oc(), { setPopup: s } = $c(), { mutate: c } = Px({ onSuccess: () => { i.invalidateQueries(["on-approval-points"]), s(null), r() } }); return I(An, { children: I(gr, { type: "primary", onClick: f => { f.stopPropagation(); const p = new URLSearchParams({ status: t, "location_ids[]": e }); t === Gn.working ? n() : c(p) }, children: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441" }) }) }, Epe = ({ selectedIds: e, onClearSelected: t, onOpenMakeWorkingModal: n }) => { const [r, i] = C.exports.useState(Gn.pending), s = c => { c.stopPropagation(), t() }; return I(Ix, { leftColumn: e.length > 0 && Qe(An, { children: [I(Y6, { value: r, onChange: i }), I(Spe, { selectedIds: e, selectedStatus: r, onOpenMakeWorkingModal: n, onSuccess: t })] }), rightColumn: e.length > 0 && I(gr, { onClick: s, children: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435" }), classes: { leftColumn: "flex items-center gap-x-4", rightColumn: "flex item-center gap-x-4" }, exportProvider: Cpe }) }, Ppe = [{ title: "Id", dataIndex: "id", key: "id", width: 50 }, { title: "\u0410\u0434\u0440\u0435\u0441", dataIndex: "address", key: "address", width: 200 }, { title: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F", dataIndex: "category", key: "category", width: "120px", ellipsis: !0 }, { title: "\u0421\u0442\u0430\u0442\u0443\u0441", dataIndex: "status", key: "status", width: "120px", ellipsis: !0, render: (e, t) => uc[t.status] }, { title: "Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430", dataIndex: "postamat_id", key: "postamat_id", width: "120px", editable: !0 }]; const eF = tr.createContext(null), Tpe = ({ index: e, ...t }) => { const [n] = sc.useForm(); return I(sc, { form: n, component: !1, children: I(eF.Provider, { value: n, children: I("tr", { ...t }) }) }) }, kpe = ({ title: e, editable: t, children: n, dataIndex: r, record: i, handleSave: s, setHasError: c, ...o }) => { const [f, p] = C.exports.useState(!1), v = C.exports.useRef(null), y = C.exports.useContext(eF); C.exports.useEffect(() => { f && v.current.focus() }, [f]); const w = () => { p(!f), y.setFieldsValue({ [r]: i[r] }) }, P = async () => { try { const A = await y.validateFields(); c(!1), w(), s({ ...i, ...A }) } catch (A) { console.log("Save failed:", A), c(!0) } }; let k = n; return t && (k = f ? I(sc.Item, { style: { margin: 0 }, name: r, rules: [{ required: !0, message: `\u0423\u043A\u0430\u0436\u0438\u0442\u0435 ${e}` }], children: I(JL, { ref: v, onPressEnter: P, onBlur: P, className: "w-full", min: 0, precision: 0 }) }) : I("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: w, children: n })), I("td", { ...o, children: k }) }, Ipe = ({ data: e, onChange: t, setHasError: n }) => { const r = o => { const f = [...e], p = f.findIndex(y => o.id === y.id), v = f[p]; f.splice(p, 1, { ...v, ...o }), t(f) }, i = { body: { row: Tpe, cell: kpe } }, s = Ppe.map(o => o.editable ? { ...o, onCell: f => ({ record: f, editable: o.editable, dataIndex: o.dataIndex, title: o.title, handleSave: r, setHasError: n }) } : o); return I(p5, { components: i, size: "small", pagination: !1, dataSource: e, columns: s, rowKey: "id", sticky: !0, rowClassName: () => "editable-row", className: "!max-w-full", scroll: { y: "max-content", x: "max-content" } }) }, Rpe = ({ selectedIds: e, onClose: t, onSuccess: n }) => { const { data: r } = ao(["make-working-table", e], async () => { const A = new URLSearchParams({ page: 1, page_size: 100, "location_ids[]": e }); return await Lf(A) }), [i, s] = C.exports.useState(!1), [c, o] = C.exports.useState([]), [f, p] = C.exports.useState(null); C.exports.useEffect(() => { o(r == null ? void 0 : r.results) }, [r]); const v = Oc(), { setPopup: y } = $c(), { mutateAsync: w } = T6(), { mutateAsync: P } = Px({}); return I(vz, { open: !0, title: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432", onCancel: t, width: 800, footer: [f && I("span", { className: "mr-2 text-primary", children: f }, "error"), I(gr, { type: "primary", onClick: () => { const A = c.map(M => { const O = new URLSearchParams({ id: M.id, postamat_id: M.postamat_id }); return w(O) }), N = new URLSearchParams({ status: Gn.working, "location_ids[]": e }), R = P(N); Promise.all([...A, R]).then(() => { v.invalidateQueries(["on-approval-points"]), p(null), y(null), n(), t() }).catch(() => p("\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435")) }, disabled: i, children: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441" }, "ok-button")], children: c && I(Ipe, { data: c, onChange: o, setHasError: s }) }) }, Mpe = [{ title: "Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430", dataIndex: "postamat_id", key: "postamat_id", width: "70px", ellipsis: !0 }], Ape = ({ fullWidth: e }) => { const [t, n] = C.exports.useState(mf), [r, i] = C.exports.useState(1), [s, c] = C.exports.useState([]), { filters: { region: o } } = Fc(), [f, p] = C.exports.useState(!1), v = J6(Mpe), { isVisible: y } = Za(), w = () => c([]), { data: P, isInitialLoading: k } = ao(["on-approval-points", r, o, y], async () => { const z = []; y[gn.approve] && z.push(Gn.onApproval), y[gn.working] && z.push(Gn.working), y[gn.cancelled] && z.push(Gn.cancelled); const B = new URLSearchParams({ page: r, page_size: t, "status[]": z.length > 0 ? z : [Gn.onApproval, Gn.working, Gn.cancelled] }); return z.length === 0 ? { count: 0, results: [] } : await Lf(B, o) }, { keepPreviousData: !0 }), { data: A, isClickedPointLoading: N } = $E(P, n), R = C.exports.useCallback(z => i(z), []), M = { selectedRowKeys: s, onChange: z => c(z), hideSelectAll: !0 }, O = Am(); return Qe(An, { children: [I(FE, { header: I(Epe, { selectedIds: s, onClearSelected: w, onOpenMakeWorkingModal: () => p(!0) }), rowSelection: O ? M : void 0, data: A, onPageChange: R, page: r, pageSize: t, isClickedPointLoading: N, columns: v, fullWidth: e, loading: k }), f && I(Rpe, { selectedIds: s, onClose: () => p(!1), onSuccess: w })] }) }, Npe = (e, t) => { const { filters: { region: n, deltaTraffic: r, factTraffic: i, age: s } } = _u(); return ao(["export-working", n, r, i, s], async () => { const c = new URLSearchParams({ "status[]": [Gn.working], "delta_current[]": r, "fact[]": i, "age_day[]": s }); return await kE(c, n) }, { enabled: e, onSuccess: zE, onSettled: t }) }, Ope = () => { const { data: e } = Tx(), { tableState: { fullScreen: t } } = Dm(); return C.exports.useMemo(() => [{ title: t ? Qe("div", { className: "flex items-center justify-between", children: [I("span", { children: "\u0410\u0434\u0440\u0435\u0441" }), I(Y0, { content: I(BE, { autoFocus: !0 }), trigger: "click", placement: "right", children: I(gr, { children: I(uE, {}) }) })] }) : "\u0410\u0434\u0440\u0435\u0441", dataIndex: "address", key: "address", width: 200 }, { title: "\u0420\u0430\u0439\u043E\u043D", dataIndex: "area", key: "area", width: "120px", ellipsis: !0, render: (n, r) => pf(r.area, e == null ? void 0 : e.normalized) }, { title: "\u041E\u043A\u0440\u0443\u0433", dataIndex: "district", key: "district", width: "120px", ellipsis: !0, render: (n, r) => pf(r.district, e == null ? void 0 : e.normalized) }, { title: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", dataIndex: "name", key: "name", width: "120px", ellipsis: !0 }, { title: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F", dataIndex: "category", key: "category", width: "120px", ellipsis: !0 }, { title: "\u041F\u043B\u0430\u043D", dataIndex: "plan_current", key: "plan_current", width: "120px", ellipsis: !0 }, { title: "\u0424\u0430\u043A\u0442", dataIndex: "fact", key: "fact", width: "120px", ellipsis: !0 }, { title: "\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C", dataIndex: "delta_current", key: "delta_current", width: "120px", ellipsis: !0 }, { title: "\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C", dataIndex: "age_day", key: "age_day", width: "120px", ellipsis: !0 }, { title: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B", dataIndex: "start_date", key: "start_date", width: "120px", render: n => n ? new Date(n).toLocaleDateString("ru") : "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" }, { title: "Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430", dataIndex: "postamat_id", key: "postamat_id", width: "70px", ellipsis: !0 }], [e == null ? void 0 : e.normalized, t]) }, Dpe = ({ fullWidth: e }) => { const [t, n] = C.exports.useState(mf), [r, i] = C.exports.useState(1), { filters: { region: s, deltaTraffic: c, factTraffic: o, age: f } } = _u(), p = Ope(), { data: v, isInitialLoading: y } = ao(["working-points", r, s, c, o, f], async () => { const A = new URLSearchParams({ page: r, page_size: t, "status[]": [Gn.working], "delta_current[]": c, "fact[]": o, "age_day[]": f }); return await Lf(A, s) }, { keepPreviousData: !0 }), { data: w, isClickedPointLoading: P } = $E(v, n), k = C.exports.useCallback(A => i(A), []); return I(FE, { data: w, onPageChange: k, page: r, pageSize: t, isClickedPointLoading: P, columns: p, fullWidth: e, header: I(Ix, { exportProvider: Npe }), loading: y }) }, Lpe = ({ fullWidth: e }) => { const { mode: t } = Ss(); return t === Ur.ON_APPROVAL ? I(Ape, { fullWidth: e }) : t === Ur.WORKING ? I(Dpe, { fullWidth: e }) : I(wpe, { fullWidth: e }) }, zpe = ({ width: e = 24, height: t = 24 }) => Qe("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: e, height: t, children: [I("polygon", { points: "23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 " }), Qe("g", { children: [I("circle", { cx: "6.3", cy: "5.2", r: "3.1" }), I("circle", { fill: "#fff", cx: "6.3", cy: "5.2", r: "1.4" })] }), I("polygon", { points: "23.6,11.1 23.7,13.1 0,13.1 0,11 " }), Qe("g", { children: [I("circle", { cx: "18.6", cy: "12.1", r: "3.1" }), I("circle", { fill: "#fff", cx: "18.6", cy: "12.1", r: "1.4" })] }), I("polygon", { points: "23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 " }), Qe("g", { children: [I("circle", { cx: "10.2", cy: "19.1", r: "3.1" }), I("circle", { fill: "#fff", cx: "10.2", cy: "19.1", r: "1.4" })] })] }), Fpe = ({ toggleCollapse: e }) => I(gr, { icon: I(zpe, { width: 16, height: 16 }), onClick: e, className: "border-l-0 rounded-bl-none rounded-tl-none absolute top-[100px] flex items-center justify-center" }); var tF = { color: void 0, size: void 0, className: void 0, style: void 0, attr: void 0 }, WR = tr.createContext && tr.createContext(tF), au = globalThis && globalThis.__assign || function () { return au = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) { t = arguments[n]; for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]) } return e }, au.apply(this, arguments) }, $pe = globalThis && globalThis.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]); return n }; function nF(e) { return e && e.map(function (t, n) { return tr.createElement(t.tag, au({ key: n }, t.attr), nF(t.child)) }) } function Bpe(e) { return function (t) { return I(Vpe, { ...au({ attr: au({}, e.attr) }, t), children: nF(e.child) }) } } function Vpe(e) { var t = function (n) { var r = e.attr, i = e.size, s = e.title, c = $pe(e, ["attr", "size", "title"]), o = i || n.size || "1em", f; return n.className && (f = n.className), e.className && (f = (f ? f + " " : "") + e.className), Qe("svg", { ...au({ stroke: "currentColor", fill: "currentColor", strokeWidth: "0" }, n.attr, r, c, { className: f, style: au(au({ color: e.color || n.color }, n.style), e.style), height: o, width: o, xmlns: "http://www.w3.org/2000/svg" }), children: [s && I("title", { children: s }), e.children] }) }; return WR !== void 0 ? I(WR.Consumer, { children: function (n) { return t(n) } }) : t(tF) } function Upe(e) { return Bpe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M22 7.999a1 1 0 0 0-.516-.874l-9.022-5a1.003 1.003 0 0 0-.968 0l-8.978 4.96a1 1 0 0 0-.003 1.748l9.022 5.04a.995.995 0 0 0 .973.001l8.978-5A1 1 0 0 0 22 7.999zm-9.977 3.855L5.06 7.965l6.917-3.822 6.964 3.859-6.918 3.852z" } }, { tag: "path", attr: { d: "M20.515 11.126 12 15.856l-8.515-4.73-.971 1.748 9 5a1 1 0 0 0 .971 0l9-5-.97-1.748z" } }, { tag: "path", attr: { d: "M20.515 15.126 12 19.856l-8.515-4.73-.971 1.748 9 5a1 1 0 0 0 .971 0l9-5-.97-1.748z" } }] })(e) } const jpe = () => { const { toggleVisibility: e, isVisible: t } = Za(), { mode: n } = Ss(); return Qe("div", { className: "space-y-1 flex flex-col", children: [n === Ur.PENDING && Qe(An, { children: [I(Ld, { className: "!ml-0", onChange: () => e(gn.working), checked: t[gn.working], children: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B" }), I(Ld, { className: "!ml-0", onChange: () => e(gn.cancelled), checked: t[gn.cancelled], children: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438" })] }), I(Ld, { className: "!ml-0", onChange: () => e(gn.pvz), checked: t[gn.pvz], children: "\u041F\u0412\u0417" }), I(Ld, { className: "!ml-0", onChange: () => e(gn.other), checked: t[gn.other], children: "\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439" })] }) }, Kpe = () => I(Y0, { content: I(jpe, {}), trigger: "click", placement: "leftBottom", children: I(io, { title: "\u0421\u043B\u043E\u0438", children: I(gr, { className: "absolute bottom-[20px] right-[20px] flex items-center justify-center p-3", children: I(Upe, { className: "w-4 h-4" }) }) }) }), Hpe = ({ width: e = 24, height: t = 24 }) => Qe("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: e, height: t, children: [I("polygon", { className: "ai-st0", points: "10.5,3.6 10.5,5.2 10.5,19.9 10.3,20.8 10,21.5 9.5,22.1 9.1,22.5 8.4,22.7 7.8,22.7 7.3,22.7 6.7,22.7 6.1,22.1 5.7,21.6 5.3,20.9 4.5,20.9 4,20.6 3.5,20.2 3.2,19.6 3,19.1 3,17.9 2.3,17.2 2,16.7 1,15 0.7,14.1 0.4,13.2 0.3,11.1 0.4,10.1 0.9,9.3 1.5,8.7 2,8.2 1.8,7.3 1.7,6.4 2,5.8 2.3,5.3 3.2,4.9 4.1,4.7 4.7,4.6 4.7,3.8 4.8,3 5.4,2.2 6.1,1.5 6.7,1.3 7.4,1.1 8,1.1 8.5,1.3 9.3,1.7 9.9,2.4 " }), I("polyline", { className: "ai-st0", points: "18.6,4.1 17.3,5.8 12.6,5.7 " }), I("polyline", { className: "ai-st0", points: "12.3,9.9 17.2,9.8 21,13.6 " }), I("line", { className: "ai-st0", x1: "12.3", y1: "14.5", x2: "14.5", y2: "14.5" }), I("polyline", { className: "ai-st0", points: "12.4,19 15.9,19 17.5,20.7 " }), Qe("g", { children: [I("ellipse", { className: "ai-st1", cx: "19.4", cy: "3", rx: "1.9", ry: "1.9" }), I("ellipse", { className: "ai-st2", cx: "19.4", cy: "2.9", rx: "1.1", ry: "1.1" })] }), Qe("g", { children: [I("ellipse", { className: "ai-st1", cx: "22", cy: "14.6", rx: "1.9", ry: "1.9" }), I("ellipse", { className: "ai-st2", cx: "22.1", cy: "14.6", rx: "1.1", ry: "1.1" })] }), Qe("g", { children: [I("ellipse", { className: "ai-st1", cx: "16.2", cy: "14.5", rx: "1.9", ry: "1.9" }), I("ellipse", { className: "ai-st2", cx: "16.2", cy: "14.4", rx: "1.1", ry: "1.1" })] }), Qe("g", { children: [I("ellipse", { className: "ai-st1", cx: "18.7", cy: "21.7", rx: "1.9", ry: "1.9" }), I("ellipse", { className: "ai-st2", cx: "18.7", cy: "21.7", rx: "1.1", ry: "1.1" })] }), I("polyline", { className: "ai-st0", points: "5,9.5 3.6,10.9 3.4,12.7 3.8,13.9 5.6,16.4 " })] }); const Wpe = ({ width: e = 24, height: t = 24 }) => Qe("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-293 385 24 24", width: e, height: t, children: [I("polyline", { className: "approve-st0", points: "-273.8,391.3 -273.8,389.8 -274.1,389 -274.8,388.5 -275.9,388.5 -290.5,388.5 -291.2,388.7 -291.9,389.1 -292.3,389.8 -292.4,405.1 -292.3,405.9 -292,406.4 -291.4,406.7 -290.9,406.8 -276,406.8 -275.2,406.7 -274.4,406.4 -273.9,405.8 -273.8,404.3 " }), I("polygon", { className: "approve-st1", points: "-287.3,392.4 -286.4,393.5 -286.2,393.7 -285.8,393.7 -285,393.5 -284.1,392.4 -283.1,391.6 -282.6,391.6 -282,391.6 -281.6,392 -281.4,392.8 -281.6,393.2 -282.4,394.3 -285.6,397 -286,397 -286.4,397 -287.1,396.4 -289.2,394.3 -289.6,393.9 -289.6,393 -289.2,392.4 -288.7,392.2 -288.1,392 -287.7,392 " }), I("polygon", { className: "approve-st1", points: "-276.8,392.9 -275.9,392.4 -275.5,392.4 -275,393.5 -274.5,393.5 -273.9,393.5 -273.2,393.6 -272.9,392.7 -272.3,392.7 -271.8,392.9 -271.3,393.3 -271.1,393.5 -271.6,394.3 -271.3,394.7 -271.1,395 -270.8,395.6 -269.9,395.2 -269.6,395.6 -269.4,396.1 -269.3,396.4 -269.4,396.8 -269.4,397 -270.3,397.2 -270.2,397.9 -270.2,398.4 -270.3,398.7 -269.2,399.2 -269.4,399.6 -269.6,400.1 -270,400.6 -270.1,400.8 -270.9,400.3 -271,400.2 -271.4,400.5 -271.7,400.7 -272.1,401 -272.3,401.2 -272,402 -272.2,402.3 -273.3,402.7 -273.7,402.6 -273.9,401.8 -274,401.5 -274.8,401.6 -275.5,401.5 -275.6,402.5 -275.9,402.7 -276.4,402.6 -277.3,402.3 -277.3,401.9 -276.8,401 -277.5,400.7 -277.7,400.4 -278.1,400 -279,400.3 -279.3,399.8 -279.6,399 -279.5,398.5 -278.6,398.2 -278.5,397.3 -278.6,396.8 -279,396.5 -279.4,396.3 -279.6,396.2 -279.6,395.8 -279.3,395.1 -279.1,394.9 -278.7,394.9 -277.6,395.1 -277.4,394.6 -276.9,394.4 -276.8,394.2 -277.1,393.1 " }), I("circle", { className: "approve-st2", cx: "-274.4", cy: "397.5", r: "2.2" }), I("path", { className: "approve-st1", d: "M-282,400.2h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.5,400-281.7,400.2-282,400.2z" }), I("path", { className: "approve-st1", d: "M-282.1,402.6h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.6,402.4-281.8,402.6-282.1,402.6z" })] }), Gpe = ({ width: e = 24, height: t = 24 }) => Qe("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-293 385 24 24", width: e, height: t, children: [I("path", { className: "working-st0", d: "M-279.1,402.7" }), I("polyline", { className: "working-st1", points: "-275,391.8 -275,390.5 -275.3,389.9 -276,389.6 -277,389.5 -290.8,389.6 -291.4,389.7 -292.1,390 -292.5,390.4 -292.5,401.4 -292.5,401.9 -292.1,402.3 -291.6,402.5 -291.1,402.6 -280,402.5 " }), I("polyline", { className: "working-st2", points: "-290.8,396 -289.3,396 -288.7,398.4 -287.6,394.3 -286.1,399.7 -285.1,392 -284.2,397 -283.2,395.9 -281.8,396 " }), I("circle", { className: "working-st3", cx: "-277", cy: "397.6", r: "4.6" }), I("circle", { className: "working-st4", cx: "-277.1", cy: "397.5", r: "2.9" }), I("polygon", { className: "working-st3", points: "-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 " })] }), qpe = () => { const { mode: e, setMode: t } = Ss(), n = i => { t(i) }, r = i => i === e ? "primary" : "default"; return Qe(An, { children: [I(io, { title: "\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B", children: I(gr, { icon: I(Hpe, {}), type: r(Ur.PENDING), onClick: () => n(Ur.PENDING), className: "flex items-center justify-center", size: "large" }) }), I(io, { title: "\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u043C\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439", children: I(gr, { icon: I(Wpe, {}), type: r(Ur.ON_APPROVAL), onClick: () => n(Ur.ON_APPROVAL), className: "flex items-center justify-center", size: "large" }) }), I(io, { title: "\u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0438\u043D\u0433 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432", className: "text-center", children: I(gr, { icon: I(Gpe, {}), type: r(Ur.WORKING), onClick: () => n(Ur.WORKING), className: "flex items-center justify-center", size: "large" }) })] }) }, Zpe = () => Qe("div", { className: "absolute top-[20px] left-[19px] flex items-center z-10", children: [Qe("div", { className: Pc("flex items-center gap-x-20"), children: [I(Q6, {}), I("div", { className: "flex items-center gap-x-3", children: I(qpe, {}) })] }), I("div", { className: "ml-[71px]", children: I(BE, {}) })] }), Xpe = "/assets/logo.7b298635.svg", Ype = [{ name: "logo", url: Xpe }], Qpe = () => { const e = C.exports.useRef(null), t = C.exports.useRef(null), n = C.exports.useRef(null), { popup: r, setPopup: i } = $c(), { setClickedPointConfig: s } = vl(), { setLayersVisibility: c } = Za(), { mode: o } = Ss(), { tableState: f, openTable: p } = Dm(); C.exports.useEffect(() => { c(Nce[o]), i(null), s(null) }, [o]); const v = N => { if (!N.features) { i(null), s(null); return } const R = N.features[0]; if (!R) { i(null), s(null); return } const { lng: M } = N.lngLat; if (R.geometry.type === "Point") { const O = R.geometry.coordinates.slice(); for (; Math.abs(M - O[0]) > 180;)O[0] += M > O[0] ? 360 : -360; i({ features: N.features, coordinates: O }) } }, y = N => { !N.features[0] || (e.current.getCanvas().style.cursor = "pointer") }, w = N => { !N.features[0] || (e.current.getCanvas().style.cursor = "") }; C.exports.useEffect(() => { const N = new ResizeObserver(ope(() => { var R; (R = e == null ? void 0 : e.current) == null || R.resize() }, 16)); return t.current && N.observe(t.current), () => { N.disconnect() } }, [t.current]), C.exports.useEffect(() => { f.fullScreen && !f.isOpened && p() }, [f.fullScreen]); const [P, k] = C.exports.useState(!1), A = () => k(N => !N); return I(Rde, { children: Qe("div", { className: "w-screen h-screen relative flex overflow-hidden", children: [I(Zpe, {}), I(ehe, { isCollapsed: P, ref: n }), Qe("div", { className: "flex-1 h-screen flex flex-col ", children: [I("div", { ref: t, className: Pc(f.fullScreen ? "" : "flex-1"), children: Qe(NE, { mapLib: Pde, initialViewState: { latitude: 55.7558, longitude: 37.6173, zoom: 12 }, dragRotate: !1, ref: e, interactiveLayerIds: [gn["initial-match"], gn["initial-unmatch"], gn.approve, gn.working, gn.filteredWorking, gn.cancelled, gn.pvz, gn.other], onClick: v, onMouseEnter: y, onMouseLeave: w, onLoad: () => { Ype.map(N => { var M, O; const R = new Image(((M = N.size) == null ? void 0 : M.width) || 24, ((O = N.size) == null ? void 0 : O.height) || 24); R.onload = () => e.current.addImage(N.name, R, { sdf: !0 }), R.src = N.url }) }, id: "map", children: [r && I(Fhe, { lat: r.coordinates[1], lng: r.coordinates[0], features: r.features, onClose: () => { i(null), s(null) } }), I(Fpe, { toggleCollapse: A }), I(Bhe, {}), I(Che, {}), I(lpe, {}), I(Vhe, {}), I(Kpe, {})] }) }), I("div", { className: "w-full border-solid border-border border-0 border-t-[1px] z-20", children: I(Lpe, { fullWidth: P }) })] })] }) }) }; function Jpe() { return I(Ede, { children: I(Qpe, {}) }) } const eme = new pce; Qce(); function tme() { return I(yce, { client: eme, children: I(hV, { basename: "/", children: Qe(dV, { children: [I($g, { path: "/", element: I(Jpe, {}) }), I($g, { path: "/signin", element: I(wde, {}) }), I($g, { path: "/verify-user", element: I(Sde, {}) })] }) }) }) } mb.createRoot(document.getElementById("root")).render(I(tr.StrictMode, { children: I(tme, {}) }));
|