!(function () { function e(e) { if (null != e) { var t = e[('function' == typeof Symbol && Symbol.iterator) || '@@iterator'], n = 0 if (t) return t.call(e) if ('function' == typeof e.next) return e if (!isNaN(e.length)) return { next: function () { return (e && n >= e.length && (e = void 0), { value: e && e[n++], done: !e }) }, } } throw new TypeError(P(e) + ' is not iterable') } function t(e) { var t = Object(e), n = [] for (var r in t) n.unshift(r) return function e() { for (; n.length; ) if ((r = n.pop()) in t) return ((e.value = r), (e.done = !1), e) return ((e.done = !0), e) } } function n(e, t, n, i) { var a = r(b(1 & i ? e.prototype : e), t, n) return 2 & i && 'function' == typeof a ? function (e) { return a.apply(n, e) } : a } function r() { return ( (r = 'undefined' != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, n) { var r = (function (e, t) { for (; !{}.hasOwnProperty.call(e, t) && null !== (e = b(e)); ); return e })(e, t) if (r) { var i = Object.getOwnPropertyDescriptor(r, t) return i.get ? i.get.call(arguments.length < 3 ? e : n) : i.value } }), r.apply(null, arguments) ) } function i(e, t, n) { return n(h(e, t)) } function a(e, t, n) { return (e.set(h(e, t), n), n) } function o(e, t) { var n = Object.keys(e) if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e) ;(t && (r = r.filter(function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable })), n.push.apply(n, r)) } return n } function s(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {} t % 2 ? o(Object(n), !0).forEach(function (t) { M(e, t, n[t]) }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : o(Object(n)).forEach(function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)) }) } return e } function u(e, t, n) { ;(l(e, t), t.set(e, n)) } function l(e, t) { if (t.has(e)) throw new TypeError('Cannot initialize the same private elements twice on an object') } function c(e, t) { return e.get(h(e, t)) } function h(e, t, n) { if ('function' == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n throw new TypeError('Private element is not present on this object') } function d() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, n = 'function' == typeof Symbol ? Symbol : {}, r = n.iterator || '@@iterator', i = n.toStringTag || '@@toStringTag' function a(n, r, i, a) { var u = r && r.prototype instanceof s ? r : s, l = Object.create(u.prototype) return ( f( l, '_invoke', (function (n, r, i) { var a, s, u, l = 0, c = i || [], h = !1, d = { p: 0, n: 0, v: e, a: f, f: f.bind(e, 4), d: function (t, n) { return ((a = t), (s = 0), (u = e), (d.n = n), o) }, } function f(n, r) { for (s = n, u = r, t = 0; !h && l && !i && t < c.length; t++) { var i, a = c[t], f = d.p, p = a[2] n > 3 ? (i = p === r) && ((u = a[(s = a[4]) ? 5 : ((s = 3), 3)]), (a[4] = a[5] = e)) : a[0] <= f && ((i = n < 2 && f < a[1]) ? ((s = 0), (d.v = r), (d.n = a[1])) : f < p && (i = n < 3 || a[0] > r || r > p) && ((a[4] = n), (a[5] = r), (d.n = p), (s = 0))) } if (i || n > 1) return o throw ((h = !0), r) } return function (i, c, p) { if (l > 1) throw TypeError('Generator is already running') for (h && 1 === c && f(c, p), s = c, u = p; (t = s < 2 ? e : u) || !h; ) { a || (s ? (s < 3 ? (s > 1 && (d.n = -1), f(s, u)) : (d.n = u)) : (d.v = u)) try { if (((l = 2), a)) { if ((s || (i = 'next'), (t = a[i]))) { if (!(t = t.call(a, u))) throw TypeError('iterator result is not an object') if (!t.done) return t ;((u = t.value), s < 2 && (s = 0)) } else (1 === s && (t = a.return) && t.call(a), s < 2 && ((u = TypeError("The iterator does not provide a '" + i + "' method")), (s = 1))) a = e } else if ((t = (h = d.n < 0) ? u : n.call(r, d)) !== o) break } catch (t) { ;((a = e), (s = 1), (u = t)) } finally { l = 1 } } return { value: t, done: h } } })(n, i, a), !0 ), l ) } var o = {} function s() {} function u() {} function l() {} t = Object.getPrototypeOf var c = [][r] ? t(t([][r]())) : (f((t = {}), r, function () { return this }), t), h = (l.prototype = s.prototype = Object.create(c)) function p(e) { return ( Object.setPrototypeOf ? Object.setPrototypeOf(e, l) : ((e.__proto__ = l), f(e, i, 'GeneratorFunction')), (e.prototype = Object.create(h)), e ) } return ( (u.prototype = l), f(h, 'constructor', l), f(l, 'constructor', u), (u.displayName = 'GeneratorFunction'), f(l, i, 'GeneratorFunction'), f(h), f(h, i, 'Generator'), f(h, r, function () { return this }), f(h, 'toString', function () { return '[object Generator]' }), (d = function () { return { w: a, m: p } })() ) } function f(e, t, n, r) { var i = Object.defineProperty try { i({}, '', {}) } catch (e) { i = 0 } ;((f = function (e, t, n, r) { if (t) i ? i(e, t, { value: n, enumerable: !r, configurable: !r, writable: !r }) : (e[t] = n) else { function a(t, n) { f(e, t, function (e) { return this._invoke(t, n, e) }) } ;(a('next', 0), a('throw', 1), a('return', 2)) } }), f(e, t, n, r)) } function p(e, t, n, r, i, a, o) { try { var s = e[a](o), u = s.value } catch (e) { return void n(e) } s.done ? t(u) : Promise.resolve(u).then(r, i) } function v(e) { return function () { var t = this, n = arguments return new Promise(function (r, i) { var a = e.apply(t, n) function o(e) { p(a, r, i, o, s, 'next', e) } function s(e) { p(a, r, i, o, s, 'throw', e) } o(void 0) }) } } function m(e) { var t = 'function' == typeof Map ? new Map() : void 0 return ( (m = function (e) { if ( null === e || !(function (e) { try { return -1 !== Function.toString.call(e).indexOf('[native code]') } catch (t) { return 'function' == typeof e } })(e) ) return e if ('function' != typeof e) throw new TypeError('Super expression must either be null or a function') if (void 0 !== t) { if (t.has(e)) return t.get(e) t.set(e, n) } function n() { return g(e, arguments, b(this).constructor) } return ( (n.prototype = Object.create(e.prototype, { constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 }, })), S(n, e) ) }), m(e) ) } function g(e, t, n) { if (_()) return Reflect.construct.apply(null, arguments) var r = [null] r.push.apply(r, t) var i = new (e.bind.apply(e, r))() return (n && S(i, n.prototype), i) } function y(e, t, n) { return ( (t = b(t)), (function (e, t) { if (t && ('object' == P(t) || 'function' == typeof t)) return t if (void 0 !== t) throw new TypeError('Derived constructors may only return object or undefined') return (function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e })(e) })(e, _() ? Reflect.construct(t, n || [], b(e).constructor) : t.apply(e, n)) ) } function _() { try { var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})) } catch (e) {} return (_ = function () { return !!e })() } function b(e) { return ( (b = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { return e.__proto__ || Object.getPrototypeOf(e) }), b(e) ) } function x(e, t) { if ('function' != typeof t && null !== t) 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 && S(e, t)) } function S(e, t) { return ( (S = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { return ((e.__proto__ = t), e) }), S(e, t) ) } function A(e, t) { if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function') } function w(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, E(r.key), r)) } } function T(e, t, n) { return ( t && w(e.prototype, t), n && w(e, n), Object.defineProperty(e, 'prototype', { writable: !1 }), e ) } function M(e, t, n) { return ( (t = E(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : (e[t] = n), e ) } function E(e) { var t = (function (e, t) { if ('object' != P(e) || !e) return e var n = e[Symbol.toPrimitive] if (void 0 !== n) { var r = n.call(e, t || 'default') if ('object' != P(r)) return r throw new TypeError('@@toPrimitive must return a primitive value.') } return ('string' === t ? String : Number)(e) })(e, 'string') return 'symbol' == P(t) ? t : t + '' } function C(e, t) { return ( R(e) || (function (e, t) { var n = null == e ? null : ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator'] if (null != n) { var r, i, a, o, s = [], u = !0, l = !1 try { if (((a = (n = n.call(e)).next), 0 === t)) { if (Object(n) !== n) return u = !1 } else for (; !(u = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); u = !0); } catch (e) { ;((l = !0), (i = e)) } finally { try { if (!u && null != n.return && ((o = n.return()), Object(o) !== o)) return } finally { if (l) throw i } } return s } })(e, t) || D(e, t) || k() ) } function k() { throw new TypeError( 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ) } function R(e) { if (Array.isArray(e)) return e } function I(e) { return ( (function (e) { if (Array.isArray(e)) return O(e) })(e) || N(e) || D(e) || (function () { throw new TypeError( 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ) })() ) } function N(e) { if (('undefined' != typeof Symbol && null != e[Symbol.iterator]) || null != e['@@iterator']) return Array.from(e) } function P(e) { return ( (P = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e }), P(e) ) } function L(e, t) { var n = ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator'] if (!n) { if (Array.isArray(e) || (n = D(e)) || (t && e && 'number' == typeof e.length)) { n && (e = n) var r = 0, i = function () {} return { s: i, n: function () { return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] } }, e: function (e) { throw e }, f: i, } } throw new TypeError( 'Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ) } var a, o = !0, s = !1 return { s: function () { n = n.call(e) }, n: function () { var e = n.next() return ((o = e.done), e) }, e: function (e) { ;((s = !0), (a = e)) }, f: function () { try { o || null == n.return || n.return() } finally { if (s) throw a } }, } } function D(e, t) { if (e) { if ('string' == typeof e) return O(e, t) var n = {}.toString.call(e).slice(8, -1) return ( 'Object' === n && e.constructor && (n = e.constructor.name), 'Map' === n || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? O(e, t) : void 0 ) } } function O(e, t) { ;(null == t || t > e.length) && (t = e.length) for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n] return r } function F(e) { return function () { return new B(e.apply(this, arguments)) } } function B(e) { var t, n function r(t, n) { try { var a = e[t](n), o = a.value, s = o instanceof V Promise.resolve(s ? o.v : o).then( function (n) { if (s) { var u = 'return' === t ? 'return' : 'next' if (!o.k || n.done) return r(u, n) n = e[u](n).value } i(a.done ? 'return' : 'normal', n) }, function (e) { r('throw', e) } ) } catch (e) { i('throw', e) } } function i(e, i) { switch (e) { case 'return': t.resolve({ value: i, done: !0 }) break case 'throw': t.reject(i) break default: t.resolve({ value: i, done: !1 }) } ;(t = t.next) ? r(t.key, t.arg) : (n = null) } ;((this._invoke = function (e, i) { return new Promise(function (a, o) { var s = { key: e, arg: i, resolve: a, reject: o, next: null } n ? (n = n.next = s) : ((t = n = s), r(e, i)) }) }), 'function' != typeof e.return && (this.return = void 0)) } function U(e) { return new V(e, 0) } function z(e) { var t = {}, n = !1 function r(t, r) { return ( (n = !0), (r = new Promise(function (n) { n(e[t](r)) })), { done: !1, value: new V(r, 1) } ) } return ( (t[('undefined' != typeof Symbol && Symbol.iterator) || '@@iterator'] = function () { return this }), (t.next = function (e) { return n ? ((n = !1), e) : r('next', e) }), 'function' == typeof e.throw && (t.throw = function (e) { if (n) throw ((n = !1), e) return r('throw', e) }), 'function' == typeof e.return && (t.return = function (e) { return n ? ((n = !1), e) : r('return', e) }), t ) } function V(e, t) { ;((this.v = e), (this.k = t)) } function H(e) { var t, n, r, i = 2 for ( 'undefined' != typeof Symbol && ((n = Symbol.asyncIterator), (r = Symbol.iterator)); i--; ) { if (n && null != (t = e[n])) return t.call(e) if (r && null != (t = e[r])) return new W(t.call(e)) ;((n = '@@asyncIterator'), (r = '@@iterator')) } throw new TypeError('Object is not async iterable') } function W(e) { function t(e) { if (Object(e) !== e) return Promise.reject(new TypeError(e + ' is not an object.')) var t = e.done return Promise.resolve(e.value).then(function (e) { return { value: e, done: t } }) } return ( (W = function (e) { ;((this.s = e), (this.n = e.next)) }), (W.prototype = { s: null, n: null, next: function () { return t(this.n.apply(this.s, arguments)) }, return: function (e) { var n = this.s.return return void 0 === n ? Promise.resolve({ value: e, done: !0 }) : t(n.apply(this.s, arguments)) }, throw: function (e) { var n = this.s.return return void 0 === n ? Promise.reject(e) : t(n.apply(this.s, arguments)) }, }), new W(e) ) } ;((B.prototype[('function' == typeof Symbol && Symbol.asyncIterator) || '@@asyncIterator'] = function () { return this }), (B.prototype.next = function (e) { return this._invoke('next', e) }), (B.prototype.throw = function (e) { return this._invoke('throw', e) }), (B.prototype.return = function (e) { return this._invoke('return', e) }), System.register([], function (r, o) { 'use strict' return { execute: function () { var r, f, p, _, b = document.createElement('style') /** * @vue/shared v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ /*! #__NO_SIDE_EFFECTS__ */ function S(e) { var t, n = Object.create(null), r = L(e.split(',')) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value n[i] = 1 } } catch (a) { r.e(a) } finally { r.f() } return function (e) { return e in n } } ;((b.textContent = 'body{margin:0;overflow-y:auto}*{box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent!important}img{pointer-events:none}#app{width:100vw;height:100vh}.access-wrap[data-v-3e18f301]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.icon-wrap[data-v-3e18f301]{width:30px;font-size:40px}.icon[data-v-91f3cb32]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden;color:inherit;font-size:inherit}.action-group[data-v-628a9c05]{border-radius:12px;background:rgba(88,87,87,.5);padding:2px;backdrop-filter:blur(8px)}.action-group .action[data-v-628a9c05]{cursor:pointer;width:42px;height:42px;border-radius:8px;font-size:20px;display:flex;align-items:center;justify-content:center;position:relative;color:#fff}.action-group .action .corner[data-v-628a9c05]{position:absolute;right:0;bottom:0;padding:3px}.action-group .action .corner .corner-inner[data-v-628a9c05]{width:6px;height:6px;border-top:3px transparent solid;border-left:3px transparent solid;border-bottom:3px #fff solid;border-right:3px #fff solid}.action-group .action .selectors[data-v-628a9c05]{position:absolute;top:0;left:100%;margin-left:3px;max-height:150px;border-radius:12px;width:max-content;overflow:hidden;overflow:auto;background:rgba(90,90,90,.5);backdrop-filter:blur(8px)}.action-group .action .selectors.left[data-v-628a9c05]{left:0;margin-left:-3px;transform:translate(-100%)}.action-group .action .selectors .selector[data-v-628a9c05]{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;cursor:pointer;height:42px;line-height:42px;color:#fff;font-size:14px;padding-left:15px;padding-right:50px}.action-group .action .selectors .selector[data-v-628a9c05]:hover{background:#67666a}.action-group .action .selectors .selector .active-icon[data-v-628a9c05]{position:absolute;right:10px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;top:0}.action-group .action[data-v-628a9c05]:hover{background:#67666a}.action-group+.action-group[data-v-628a9c05]{margin-top:10px}.gradio-webrtc-waveContainer[data-v-ba6f2cef]{position:relative;display:flex;min-height:100px;max-height:128px;justify-content:center;align-items:center}.gradio-webrtc-boxContainer[data-v-ba6f2cef]{display:flex;justify-content:space-between;height:64px;--boxSize: 4px;--gutter: 4px}.split-container[data-v-ba6f2cef]{width:80px}.gradio-webrtc-box[data-v-ba6f2cef]{height:100%;width:var(--boxSize);background:var(--color-accent);border-radius:8px;transition:transform .05s ease}.gradio-webrtc-icon-container[data-v-ba6f2cef]{position:relative;width:128px;height:128px;display:flex;justify-content:center;align-items:center}.gradio-webrtc-icon[data-v-ba6f2cef]{position:relative;width:48px;height:48px;border-radius:50%;transition:transform .1s ease;display:flex;justify-content:center;align-items:center;z-index:2}.icon-image[data-v-ba6f2cef]{width:32px;height:32px;object-fit:contain;filter:brightness(0) invert(1)}.pulse-ring[data-v-ba6f2cef]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:50%;animation:pulse-ba6f2cef 2s cubic-bezier(.4,0,.6,1) infinite;opacity:.5}@keyframes pulse-ba6f2cef{0%{transform:translate(-50%,-50%) scale(1);opacity:.5}to{transform:translate(-50%,-50%) scale(var(--max-scale, 3));opacity:0}}.dots[data-v-ba6f2cef]{display:flex;gap:8px;align-items:center;height:64px}.dot[data-v-ba6f2cef]{width:12px;height:12px;border-radius:50%;opacity:.5;animation:pulse-ba6f2cef 1.5s infinite}.dot[data-v-ba6f2cef]:nth-child(2){animation-delay:.2s}.dot[data-v-ba6f2cef]:nth-child(3){animation-delay:.4s}@keyframes pulse-ba6f2cef{0%,to{opacity:.4;transform:scale(1)}50%{opacity:1;transform:scale(1.1)}}.player-controls[data-v-58c5790e]{height:15%;position:relative;display:flex;justify-content:center;align-items:center;min-height:84px}.player-controls .chat-btn[data-v-58c5790e]{height:64px;width:296px;display:flex;justify-content:center;align-items:center;border-radius:999px;opacity:1;background:linear-gradient(180deg,#7873f6,#524de1);transition:all .3s;z-index:2;cursor:pointer}.player-controls .start-chat[data-v-58c5790e]{font-size:16px;font-weight:500;text-align:center;color:#fff}.player-controls .waiting-icon-text[data-v-58c5790e]{width:80px;align-items:center;font-size:16px;font-weight:500;color:#fff;margin:0 var(--spacing-sm);display:flex;justify-content:space-evenly;gap:var(--size-1)}.player-controls .waiting-icon-text .icon[data-v-58c5790e]{width:25px;height:25px;fill:#fff;stroke:#fff;color:#fff}.player-controls .waiting-icon-text .spin-icon[data-v-58c5790e]{color:#fff}.ant-spin-dot-item{background-color:#fff!important}.player-controls .stop-chat[data-v-58c5790e]{width:64px}.player-controls .stop-chat .stop-chat-inner[data-v-58c5790e]{width:25px;height:25px;border-radius:6.25px;background:#fafafa}.player-controls .input-audio-wave[data-v-58c5790e]{position:absolute}.chat-input-container[data-v-32a58abc]{height:15%;position:relative;display:flex;justify-content:center;align-items:center;min-height:84px;width:calc(100% - 140px);margin:auto}.chat-input-container .chat-input-inner[data-v-32a58abc]{padding:0 12px;background-color:#fff;height:64px;flex:1;display:flex;align-items:center;border:1px solid #e8eaf2;border-radius:20px;box-shadow:0 12px 24px -16px rgba(54,54,73,.04),0 12px 40px rgba(51,51,71,.08),0 0 1px rgba(44,44,54,.02)}.chat-input-container .chat-input-inner .chat-input-wrapper[data-v-32a58abc]{flex:1;position:relative;display:flex;align-items:center}.chat-input-container .chat-input-inner .chat-input-wrapper .chat-input[data-v-32a58abc]{width:100%;border:none;outline:none;color:#26244c;font-size:16px;font-weight:400;resize:none;padding:0;margin:8px 0;line-height:24px;max-height:48px;min-height:24px}.chat-input-container .chat-input-inner .chat-input-wrapper .rowsDiv[data-v-32a58abc]{position:absolute;left:0;right:0;z-index:-1;visibility:hidden;font-size:16px;font-weight:400;line-height:24px;white-space:pre-wrap;word-wrap:break-word}.chat-input-container .chat-input-inner .send-btn[data-v-32a58abc],.chat-input-container .chat-input-inner .interrupt-btn[data-v-32a58abc]{border:none;flex:0 0 auto;background:#615ced;border-radius:20px;height:28px;width:28px;display:flex;align-items:center;justify-content:center;margin-left:16px;cursor:pointer}.chat-input-container .chat-input-inner .interrupt-btn[data-v-32a58abc]:after{content:" ";width:12px;height:12px;border-radius:2px;background:#fafafa}.chat-input-container .stop-chat-btn[data-v-32a58abc]{cursor:pointer;margin-right:12px;height:28px;width:28px;display:flex;justify-content:center;align-items:center;border-radius:999px;opacity:1;background:linear-gradient(180deg,#7873f6,#524de1)}.chat-input-container .stop-chat-btn[data-v-32a58abc]:after{content:" ";width:12px;height:12px;border-radius:2px;background:#fafafa}.answer-message-container[data-v-dde1c5d3]{padding:6px 12px;background:rgba(255,255,255,.8);border-radius:12px;color:#26244c}.answer-message-container.human[data-v-dde1c5d3]{background:rgba(221,221,221,.6);margin-right:0}.answer-message-container.avatar[data-v-dde1c5d3]{background:#9189fa;color:#fff}.chat-records{width:100%;height:100%;overflow-y:auto}.chat-records::-webkit-scrollbar{display:none}.chat-records-inner{display:flex;flex-direction:column;align-items:flex-end;justify-content:end;width:100%;height:auto;min-height:100%}.chat-records-inner .chat-message{margin-bottom:12px;max-width:80%}.chat-records-inner .chat-message.human{align-self:flex-end}.chat-records-inner .chat-message.avatar{align-self:flex-start}.chat-records-inner .chat-message:last-child{margin-bottom:0}.chat-input-wrapper[data-v-269b506f]{margin:0 70px;transition:width .1s ease}.page-container[data-v-269b506f]{height:100%;width:100%;padding:32px;overflow:hidden;display:flex;align-items:flex-start;justify-content:center}.content-container[data-v-269b506f]{height:100%;max-width:100%}.video-container[data-v-269b506f]{position:relative;aspect-ratio:9 / 16;max-width:calc(100% - 134px);height:85%;margin:0 70px}.video-container .local-video-container[data-v-269b506f]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:32px;overflow:hidden;display:flex;align-items:center;justify-content:center;z-index:1;background:#fff;transition:all .3s ease}.video-container .local-video-container.scaled[data-v-269b506f]{top:auto;left:12px;bottom:12px;width:calc(50% - 12px);height:auto}.video-container .remote-video-container[data-v-269b506f]{width:100%;height:100%;overflow:hidden;border-radius:32px;transition:all .3s linear;background:#fff}.video-container .local-video[data-v-269b506f]{width:100%;height:auto;object-fit:contain;object-position:center center}.video-container .remote-video[data-v-269b506f]{width:101%;height:100%;object-fit:cover}.video-container .remote-canvas[data-v-269b506f]{width:100%;height:100%}.actions[data-v-269b506f]{position:absolute;z-index:2;left:calc(100% + 12px);bottom:0}.chat-records-container[data-v-269b506f]{height:85%;overflow:auto;aspect-ratio:9 / 16;z-index:1}.chat-records-container.inline[data-v-269b506f]{position:absolute;bottom:0;right:0;width:50%;padding:10px}.wrap[data-v-45f9c857]{background-image:url(' + new URL('background.png', o.meta.url).href + ');height:max(80vh,100%);background-size:100% 100%;background-repeat:no-repeat;position:relative}.wrap[data-v-45f9c857] *::-webkit-scrollbar{display:none}\n/*$vite$:1*/'), document.head.appendChild(b)) var w, E = {}, O = [], B = function () {}, V = function () { return !1 }, W = function (e) { return ( 111 === e.charCodeAt(0) && 110 === e.charCodeAt(1) && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97) ) }, G = function (e) { return e.startsWith('onUpdate:') }, j = Object.assign, Q = function (e, t) { var n = e.indexOf(t) n > -1 && e.splice(n, 1) }, q = Object.prototype.hasOwnProperty, X = function (e, t) { return q.call(e, t) }, Y = Array.isArray, K = function (e) { return '[object Map]' === ie(e) }, Z = function (e) { return '[object Set]' === ie(e) }, J = function (e) { return 'function' == typeof e }, $ = function (e) { return 'string' == typeof e }, ee = function (e) { return 'symbol' === P(e) }, te = function (e) { return null !== e && 'object' === P(e) }, ne = function (e) { return (te(e) || J(e)) && J(e.then) && J(e.catch) }, re = Object.prototype.toString, ie = function (e) { return re.call(e) }, ae = function (e) { return '[object Object]' === ie(e) }, oe = function (e) { return $(e) && 'NaN' !== e && '-' !== e[0] && '' + parseInt(e, 10) === e }, se = S( ',key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted' ), ue = function (e) { var t = Object.create(null) return function (n) { return t[n] || (t[n] = e(n)) } }, le = /-(\w)/g, ce = ue(function (e) { return e.replace(le, function (e, t) { return t ? t.toUpperCase() : '' }) }), he = /\B([A-Z])/g, de = ue(function (e) { return e.replace(he, '-$1').toLowerCase() }), fe = ue(function (e) { return e.charAt(0).toUpperCase() + e.slice(1) }), pe = ue(function (e) { return e ? 'on'.concat(fe(e)) : '' }), ve = function (e, t) { return !Object.is(e, t) }, me = function (e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r] for (var i = 0; i < e.length; i++) e[i].apply(e, n) }, ge = function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] Object.defineProperty(e, t, { configurable: !0, enumerable: !1, writable: r, value: n, }) }, ye = function (e) { var t = parseFloat(e) return isNaN(t) ? e : t }, _e = function () { return ( w || (w = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : {}) ) } function be(e) { if (Y(e)) { for (var t = {}, n = 0; n < e.length; n++) { var r = e[n], i = $(r) ? we(r) : be(r) if (i) for (var a in i) t[a] = i[a] } return t } if ($(e) || te(e)) return e } var xe = /;(?![^(]*\))/g, Se = /:([^]+)/, Ae = /\/\*[^]*?\*\//g function we(e) { var t = {} return ( e .replace(Ae, '') .split(xe) .forEach(function (e) { if (e) { var n = e.split(Se) n.length > 1 && (t[n[0].trim()] = n[1].trim()) } }), t ) } function Te(e) { var t = '' if ($(e)) t = e else if (Y(e)) for (var n = 0; n < e.length; n++) { var r = Te(e[n]) r && (t += r + ' ') } else if (te(e)) for (var i in e) e[i] && (t += i + ' ') return t.trim() } var Me = S('itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly') function Ee(e) { return !!e || '' === e } var Ce, ke, Re = function (e) { return !(!e || !0 !== e.__v_isRef) }, Ie = function (e) { return $(e) ? e : null == e ? '' : Y(e) || (te(e) && (e.toString === re || !J(e.toString))) ? Re(e) ? Ie(e.value) : JSON.stringify(e, Ne, 2) : String(e) }, Ne = function (e, t) { return Re(t) ? Ne(e, t.value) : K(t) ? M( {}, 'Map('.concat(t.size, ')'), I(t.entries()).reduce(function (e, t, n) { var r = C(t, 2), i = r[0], a = r[1] return ((e[Pe(i, n) + ' =>'] = a), e) }, {}) ) : Z(t) ? M( {}, 'Set('.concat(t.size, ')'), I(t.values()).map(function (e) { return Pe(e) }) ) : ee(t) ? Pe(t) : !te(t) || Y(t) || ae(t) ? t : String(t) }, Pe = function (e) { var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '' return ee(e) ? 'Symbol('.concat(null != (t = e.description) ? t : n, ')') : e }, Le = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] ;(A(this, e), (this.detached = t), (this._active = !0), (this._on = 0), (this.effects = []), (this.cleanups = []), (this._isPaused = !1), (this.parent = Ce), !t && Ce && (this.index = (Ce.scopes || (Ce.scopes = [])).push(this) - 1)) }, [ { key: 'active', get: function () { return this._active }, }, { key: 'pause', value: function () { if (this._active) { var e, t if (((this._isPaused = !0), this.scopes)) for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].pause() for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].pause() } }, }, { key: 'resume', value: function () { if (this._active && this._isPaused) { var e, t if (((this._isPaused = !1), this.scopes)) for (e = 0, t = this.scopes.length; e < t; e++) this.scopes[e].resume() for (e = 0, t = this.effects.length; e < t; e++) this.effects[e].resume() } }, }, { key: 'run', value: function (e) { if (this._active) { var t = Ce try { return ((Ce = this), e()) } finally { Ce = t } } }, }, { key: 'on', value: function () { 1 === ++this._on && ((this.prevScope = Ce), (Ce = this)) }, }, { key: 'off', value: function () { this._on > 0 && 0 === --this._on && ((Ce = this.prevScope), (this.prevScope = void 0)) }, }, { key: 'stop', value: function (e) { if (this._active) { var t, n for (this._active = !1, t = 0, n = this.effects.length; t < n; t++) this.effects[t].stop() for (this.effects.length = 0, t = 0, n = this.cleanups.length; t < n; t++) this.cleanups[t]() if (((this.cleanups.length = 0), this.scopes)) { for (t = 0, n = this.scopes.length; t < n; t++) this.scopes[t].stop(!0) this.scopes.length = 0 } if (!this.detached && this.parent && !e) { var r = this.parent.scopes.pop() r && r !== this && ((this.parent.scopes[this.index] = r), (r.index = this.index)) } this.parent = void 0 } }, }, ] ) })() function De(e) { return new Le(e) } function Oe() { return Ce } var Fe, Be, Ue = new WeakSet(), ze = (function () { return T( function e(t) { ;(A(this, e), (this.fn = t), (this.deps = void 0), (this.depsTail = void 0), (this.flags = 5), (this.next = void 0), (this.cleanup = void 0), (this.scheduler = void 0), Ce && Ce.active && Ce.effects.push(this)) }, [ { key: 'pause', value: function () { this.flags |= 64 }, }, { key: 'resume', value: function () { 64 & this.flags && ((this.flags &= -65), Ue.has(this) && (Ue.delete(this), this.trigger())) }, }, { key: 'notify', value: function () { ;(2 & this.flags && !(32 & this.flags)) || 8 & this.flags || He(this) }, }, { key: 'run', value: function () { if (!(1 & this.flags)) return this.fn() ;((this.flags |= 2), tt(this), je(this)) var e = ke, t = Ze ;((ke = this), (Ze = !0)) try { return this.fn() } finally { ;(Qe(this), (ke = e), (Ze = t), (this.flags &= -3)) } }, }, { key: 'stop', value: function () { if (1 & this.flags) { for (var e = this.deps; e; e = e.nextDep) Ye(e) ;((this.deps = this.depsTail = void 0), tt(this), this.onStop && this.onStop(), (this.flags &= -2)) } }, }, { key: 'trigger', value: function () { 64 & this.flags ? Ue.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty() }, }, { key: 'runIfDirty', value: function () { qe(this) && this.run() }, }, { key: 'dirty', get: function () { return qe(this) }, }, ] ) })(), Ve = 0 function He(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] if (((e.flags |= 8), t)) return ((e.next = Be), void (Be = e)) ;((e.next = Fe), (Fe = e)) } function We() { Ve++ } function Ge() { if (!(--Ve > 0)) { if (Be) { var e = Be for (Be = void 0; e; ) { var t = e.next ;((e.next = void 0), (e.flags &= -9), (e = t)) } } for (var n; Fe; ) { var r = Fe for (Fe = void 0; r; ) { var i = r.next if (((r.next = void 0), (r.flags &= -9), 1 & r.flags)) try { r.trigger() } catch (a) { n || (n = a) } r = i } } if (n) throw n } } function je(e) { for (var t = e.deps; t; t = t.nextDep) ((t.version = -1), (t.prevActiveLink = t.dep.activeLink), (t.dep.activeLink = t)) } function Qe(e) { for (var t, n = e.depsTail, r = n; r; ) { var i = r.prevDep ;(-1 === r.version ? (r === n && (n = i), Ye(r), Ke(r)) : (t = r), (r.dep.activeLink = r.prevActiveLink), (r.prevActiveLink = void 0), (r = i)) } ;((e.deps = t), (e.depsTail = n)) } function qe(e) { for (var t = e.deps; t; t = t.nextDep) if ( t.dep.version !== t.version || (t.dep.computed && (Xe(t.dep.computed) || t.dep.version !== t.version)) ) return !0 return !!e._dirty } function Xe(e) { if ( (!(4 & e.flags) || 16 & e.flags) && ((e.flags &= -17), e.globalVersion !== nt && ((e.globalVersion = nt), e.isSSR || !(128 & e.flags) || ((e.deps || e._dirty) && qe(e)))) ) { e.flags |= 2 var t = e.dep, n = ke, r = Ze ;((ke = e), (Ze = !0)) try { je(e) var i = e.fn(e._value) ;(0 === t.version || ve(i, e._value)) && ((e.flags |= 128), (e._value = i), t.version++) } catch (a) { throw (t.version++, a) } finally { ;((ke = n), (Ze = r), Qe(e), (e.flags &= -3)) } } } function Ye(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = e.dep, r = e.prevSub, i = e.nextSub if ( (r && ((r.nextSub = i), (e.prevSub = void 0)), i && ((i.prevSub = r), (e.nextSub = void 0)), n.subs === e && ((n.subs = r), !r && n.computed)) ) { n.computed.flags &= -5 for (var a = n.computed.deps; a; a = a.nextDep) Ye(a, !0) } t || --n.sc || !n.map || n.map.delete(n.key) } function Ke(e) { var t = e.prevDep, n = e.nextDep ;(t && ((t.nextDep = n), (e.prevDep = void 0)), n && ((n.prevDep = t), (e.nextDep = void 0))) } var Ze = !0, Je = [] function $e() { ;(Je.push(Ze), (Ze = !1)) } function et() { var e = Je.pop() Ze = void 0 === e || e } function tt(e) { var t = e.cleanup if (((e.cleanup = void 0), t)) { var n = ke ke = void 0 try { t() } finally { ke = n } } } var nt = 0, rt = T(function e(t, n) { ;(A(this, e), (this.sub = t), (this.dep = n), (this.version = n.version), (this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0)) }), it = (function () { return T( function e(t) { ;(A(this, e), (this.computed = t), (this.version = 0), (this.activeLink = void 0), (this.subs = void 0), (this.map = void 0), (this.key = void 0), (this.sc = 0), (this.__v_skip = !0)) }, [ { key: 'track', value: function (e) { if (ke && Ze && ke !== this.computed) { var t = this.activeLink if (void 0 === t || t.sub !== ke) ((t = this.activeLink = new rt(ke, this)), ke.deps ? ((t.prevDep = ke.depsTail), (ke.depsTail.nextDep = t), (ke.depsTail = t)) : (ke.deps = ke.depsTail = t), at(t)) else if (-1 === t.version && ((t.version = this.version), t.nextDep)) { var n = t.nextDep ;((n.prevDep = t.prevDep), t.prevDep && (t.prevDep.nextDep = n), (t.prevDep = ke.depsTail), (t.nextDep = void 0), (ke.depsTail.nextDep = t), (ke.depsTail = t), ke.deps === t && (ke.deps = n)) } return t } }, }, { key: 'trigger', value: function (e) { ;(this.version++, nt++, this.notify(e)) }, }, { key: 'notify', value: function (e) { We() try { 0 for (var t = this.subs; t; t = t.prevSub) t.sub.notify() && t.sub.dep.notify() } finally { Ge() } }, }, ] ) })() function at(e) { if ((e.dep.sc++, 4 & e.sub.flags)) { var t = e.dep.computed if (t && !e.dep.subs) { t.flags |= 20 for (var n = t.deps; n; n = n.nextDep) at(n) } var r = e.dep.subs ;(r !== e && ((e.prevSub = r), r && (r.nextSub = e)), (e.dep.subs = e)) } } var ot = new WeakMap(), st = Symbol(''), ut = Symbol(''), lt = Symbol('') function ct(e, t, n) { if (Ze && ke) { var r = ot.get(e) r || ot.set(e, (r = new Map())) var i = r.get(n) ;(i || (r.set(n, (i = new it())), (i.map = r), (i.key = n)), i.track()) } } function ht(e, t, n, r, i, a) { var o = ot.get(e) if (o) { var s = function (e) { e && e.trigger() } if ((We(), 'clear' === t)) o.forEach(s) else { var u = Y(e), l = u && oe(n) if (u && 'length' === n) { var c = Number(r) o.forEach(function (e, t) { ;('length' === t || t === lt || (!ee(t) && t >= c)) && s(e) }) } else switch (((void 0 !== n || o.has(void 0)) && s(o.get(n)), l && s(o.get(lt)), t)) { case 'add': u ? l && s(o.get('length')) : (s(o.get(st)), K(e) && s(o.get(ut))) break case 'delete': u || (s(o.get(st)), K(e) && s(o.get(ut))) break case 'set': K(e) && s(o.get(st)) } } Ge() } else nt++ } function dt(e) { var t = Kt(e) return t === e ? t : (ct(t, 0, lt), Xt(e) ? t : t.map(Jt)) } function ft(e) { return (ct((e = Kt(e)), 0, lt), e) } var pt = (M( M( M( M( M( M( M( M( M( M((r = { __proto__: null }), Symbol.iterator, function () { return vt(this, Symbol.iterator, Jt) }), 'concat', function () { for ( var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++ ) n[r] = arguments[r] return (e = dt(this)).concat.apply( e, I( n.map(function (e) { return Y(e) ? dt(e) : e }) ) ) } ), 'entries', function () { return vt(this, 'entries', function (e) { return ((e[1] = Jt(e[1])), e) }) } ), 'every', function (e, t) { return gt(this, 'every', e, t, void 0, arguments) } ), 'filter', function (e, t) { return gt( this, 'filter', e, t, function (e) { return e.map(Jt) }, arguments ) } ), 'find', function (e, t) { return gt(this, 'find', e, t, Jt, arguments) } ), 'findIndex', function (e, t) { return gt(this, 'findIndex', e, t, void 0, arguments) } ), 'findLast', function (e, t) { return gt(this, 'findLast', e, t, Jt, arguments) } ), 'findLastIndex', function (e, t) { return gt(this, 'findLastIndex', e, t, void 0, arguments) } ), 'forEach', function (e, t) { return gt(this, 'forEach', e, t, void 0, arguments) } ), M( M( M( M( M( M( M( M( M( M(r, 'includes', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return _t(this, 'includes', t) }), 'indexOf', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return _t(this, 'indexOf', t) } ), 'join', function (e) { return dt(this).join(e) } ), 'lastIndexOf', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return _t(this, 'lastIndexOf', t) } ), 'map', function (e, t) { return gt(this, 'map', e, t, void 0, arguments) } ), 'pop', function () { return bt(this, 'pop') } ), 'push', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return bt(this, 'push', t) } ), 'reduce', function (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 yt(this, 'reduce', e, n) } ), 'reduceRight', function (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 yt(this, 'reduceRight', e, n) } ), 'shift', function () { return bt(this, 'shift') } ), M( M( M( M( M( M( M(r, 'some', function (e, t) { return gt(this, 'some', e, t, void 0, arguments) }), 'splice', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return bt(this, 'splice', t) } ), 'toReversed', function () { return dt(this).toReversed() } ), 'toSorted', function (e) { return dt(this).toSorted(e) } ), 'toSpliced', function () { var e return (e = dt(this)).toSpliced.apply(e, arguments) } ), 'unshift', function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return bt(this, 'unshift', t) } ), 'values', function () { return vt(this, 'values', Jt) } )) function vt(e, t, n) { var r = ft(e), i = r[t]() return ( r === e || Xt(e) || ((i._next = i.next), (i.next = function () { var e = i._next() return (e.value && (e.value = n(e.value)), e) })), i ) } var mt = Array.prototype function gt(e, t, n, r, i, a) { var o = ft(e), s = o !== e && !Xt(e), u = o[t] if (u !== mt[t]) { var l = u.apply(e, a) return s ? Jt(l) : l } var c = n o !== e && (s ? (c = function (t, r) { return n.call(this, Jt(t), r, e) }) : n.length > 2 && (c = function (t, r) { return n.call(this, t, r, e) })) var h = u.call(o, c, r) return s && i ? i(h) : h } function yt(e, t, n, r) { var i = ft(e), a = n return ( i !== e && (Xt(e) ? n.length > 3 && (a = function (t, r, i) { return n.call(this, t, r, i, e) }) : (a = function (t, r, i) { return n.call(this, t, Jt(r), i, e) })), i[t].apply(i, [a].concat(I(r))) ) } function _t(e, t, n) { var r = Kt(e) ct(r, 0, lt) var i = r[t].apply(r, I(n)) return (-1 !== i && !1 !== i) || !Yt(n[0]) ? i : ((n[0] = Kt(n[0])), r[t].apply(r, I(n))) } function bt(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [] ;($e(), We()) var r = Kt(e)[t].apply(e, n) return (Ge(), et(), r) } var xt = S('__proto__,__v_isRef,__isVue'), St = new Set( Object.getOwnPropertyNames(Symbol) .filter(function (e) { return 'arguments' !== e && 'caller' !== e }) .map(function (e) { return Symbol[e] }) .filter(ee) ) function At(e) { ee(e) || (e = String(e)) var t = Kt(this) return (ct(t, 0, e), t.hasOwnProperty(e)) } var wt = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ;(A(this, e), (this._isReadonly = t), (this._isShallow = n)) }, [ { key: 'get', value: function (e, t, n) { if ('__v_skip' === t) return e.__v_skip var r = this._isReadonly, i = this._isShallow if ('__v_isReactive' === t) return !r if ('__v_isReadonly' === t) return r if ('__v_isShallow' === t) return i if ('__v_raw' === t) return n === (r ? (i ? Vt : zt) : i ? Ut : Bt).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0 var a = Y(e) if (!r) { var o if (a && (o = pt[t])) return o if ('hasOwnProperty' === t) return At } var s = Reflect.get(e, t, en(e) ? e : n) return (ee(t) ? St.has(t) : xt(t)) ? s : (r || ct(e, 0, t), i ? s : en(s) ? a && oe(t) ? s : s.value : te(s) ? r ? Gt(s) : Wt(s) : s) }, }, ] ) })(), Tt = (function (e) { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] return (A(this, t), y(this, t, [!1, e])) } return ( x(t, e), T(t, [ { key: 'set', value: function (e, t, n, r) { var i = e[t] if (!this._isShallow) { var a = qt(i) if ( (Xt(n) || qt(n) || ((i = Kt(i)), (n = Kt(n))), !Y(e) && en(i) && !en(n)) ) return !a && ((i.value = n), !0) } var o = Y(e) && oe(t) ? Number(t) < e.length : X(e, t), s = Reflect.set(e, t, n, en(e) ? e : r) return ( e === Kt(r) && (o ? ve(n, i) && ht(e, 'set', t, n) : ht(e, 'add', t, n)), s ) }, }, { key: 'deleteProperty', value: function (e, t) { var n = X(e, t) e[t] var r = Reflect.deleteProperty(e, t) return (r && n && ht(e, 'delete', t, void 0), r) }, }, { key: 'has', value: function (e, t) { var n = Reflect.has(e, t) return ((ee(t) && St.has(t)) || ct(e, 0, t), n) }, }, { key: 'ownKeys', value: function (e) { return (ct(e, 0, Y(e) ? 'length' : st), Reflect.ownKeys(e)) }, }, ]) ) })(wt), Mt = (function (e) { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] return (A(this, t), y(this, t, [!0, e])) } return ( x(t, e), T(t, [ { key: 'set', value: function (e, t) { return !0 }, }, { key: 'deleteProperty', value: function (e, t) { return !0 }, }, ]) ) })(wt), Et = new Tt(), Ct = new Mt(), kt = new Tt(!0), Rt = function (e) { return e }, It = function (e) { return Reflect.getPrototypeOf(e) } function Nt(e) { return function () { return 'delete' !== e && ('clear' === e ? void 0 : this) } } function Pt(e, t) { var n = { get: function (n) { var r = this.__v_raw, i = Kt(r), a = Kt(n) e || (ve(n, a) && ct(i, 0, n), ct(i, 0, a)) var o = It(i).has, s = t ? Rt : e ? $t : Jt return o.call(i, n) ? s(r.get(n)) : o.call(i, a) ? s(r.get(a)) : void (r !== i && r.get(n)) }, get size() { var t = this.__v_raw return (!e && ct(Kt(t), 0, st), Reflect.get(t, 'size', t)) }, has: function (t) { var n = this.__v_raw, r = Kt(n), i = Kt(t) return ( e || (ve(t, i) && ct(r, 0, t), ct(r, 0, i)), t === i ? n.has(t) : n.has(t) || n.has(i) ) }, forEach: function (n, r) { var i = this, a = i.__v_raw, o = Kt(a), s = t ? Rt : e ? $t : Jt return ( !e && ct(o, 0, st), a.forEach(function (e, t) { return n.call(r, s(e), s(t), i) }) ) }, } return ( j( n, e ? { add: Nt('add'), set: Nt('set'), delete: Nt('delete'), clear: Nt('clear') } : { add: function (e) { t || Xt(e) || qt(e) || (e = Kt(e)) var n = Kt(this) return (It(n).has.call(n, e) || (n.add(e), ht(n, 'add', e, e)), this) }, set: function (e, n) { t || Xt(n) || qt(n) || (n = Kt(n)) var r = Kt(this), i = It(r), a = i.has, o = i.get, s = a.call(r, e) s || ((e = Kt(e)), (s = a.call(r, e))) var u = o.call(r, e) return ( r.set(e, n), s ? ve(n, u) && ht(r, 'set', e, n) : ht(r, 'add', e, n), this ) }, delete: function (e) { var t = Kt(this), n = It(t), r = n.has, i = n.get, a = r.call(t, e) ;(a || ((e = Kt(e)), (a = r.call(t, e))), i && i.call(t, e)) var o = t.delete(e) return (a && ht(t, 'delete', e, void 0), o) }, clear: function () { var e = Kt(this), t = 0 !== e.size, n = e.clear() return (t && ht(e, 'clear', void 0, void 0), n) }, } ), ['keys', 'values', 'entries', Symbol.iterator].forEach(function (r) { n[r] = (function (e, t, n) { return function () { var r = this.__v_raw, i = Kt(r), a = K(i), o = 'entries' === e || (e === Symbol.iterator && a), s = 'keys' === e && a, u = r[e].apply(r, arguments), l = n ? Rt : t ? $t : Jt return ( !t && ct(i, 0, s ? ut : st), M( { next: function () { var e = u.next(), t = e.value, n = e.done return n ? { value: t, done: n } : { value: o ? [l(t[0]), l(t[1])] : l(t), done: n } }, }, Symbol.iterator, function () { return this } ) ) } })(r, e, t) }), n ) } function Lt(e, t) { var n = Pt(e, t) return function (t, r, i) { return '__v_isReactive' === r ? !e : '__v_isReadonly' === r ? e : '__v_raw' === r ? t : Reflect.get(X(n, r) && r in t ? n : t, r, i) } } var Dt = { get: Lt(!1, !1) }, Ot = { get: Lt(!1, !0) }, Ft = { get: Lt(!0, !1) }, Bt = new WeakMap(), Ut = new WeakMap(), zt = new WeakMap(), Vt = new WeakMap() function Ht(e) { return e.__v_skip || !Object.isExtensible(e) ? 0 : (function (e) { switch (e) { case 'Object': case 'Array': return 1 case 'Map': case 'Set': case 'WeakMap': case 'WeakSet': return 2 default: return 0 } })( (function (e) { return ie(e).slice(8, -1) })(e) ) } function Wt(e) { return qt(e) ? e : jt(e, !1, Et, Dt, Bt) } function Gt(e) { return jt(e, !0, Ct, Ft, zt) } function jt(e, t, n, r, i) { if (!te(e)) return e if (e.__v_raw && (!t || !e.__v_isReactive)) return e var a = Ht(e) if (0 === a) return e var o = i.get(e) if (o) return o var s = new Proxy(e, 2 === a ? r : n) return (i.set(e, s), s) } function Qt(e) { return qt(e) ? Qt(e.__v_raw) : !(!e || !e.__v_isReactive) } function qt(e) { return !(!e || !e.__v_isReadonly) } function Xt(e) { return !(!e || !e.__v_isShallow) } function Yt(e) { return !!e && !!e.__v_raw } function Kt(e) { var t = e && e.__v_raw return t ? Kt(t) : e } function Zt(e) { return (!X(e, '__v_skip') && Object.isExtensible(e) && ge(e, '__v_skip', !0), e) } var Jt = function (e) { return te(e) ? Wt(e) : e }, $t = function (e) { return te(e) ? Gt(e) : e } function en(e) { return !!e && !0 === e.__v_isRef } function tn(e) { return rn(e, !1) } function nn(e) { return rn(e, !0) } function rn(e, t) { return en(e) ? e : new an(e, t) } var an = (function () { return T( function e(t, n) { ;(A(this, e), (this.dep = new it()), (this.__v_isRef = !0), (this.__v_isShallow = !1), (this._rawValue = n ? t : Kt(t)), (this._value = n ? t : Jt(t)), (this.__v_isShallow = n)) }, [ { key: 'value', get: function () { return (this.dep.track(), this._value) }, set: function (e) { var t = this._rawValue, n = this.__v_isShallow || Xt(e) || qt(e) ;((e = n ? e : Kt(e)), ve(e, t) && ((this._rawValue = e), (this._value = n ? e : Jt(e)), this.dep.trigger())) }, }, ] ) })() function on(e) { return en(e) ? e.value : e } var sn = { get: function (e, t, n) { return '__v_raw' === t ? e : on(Reflect.get(e, t, n)) }, set: function (e, t, n, r) { var i = e[t] return en(i) && !en(n) ? ((i.value = n), !0) : Reflect.set(e, t, n, r) }, } function un(e) { return Qt(e) ? e : new Proxy(e, sn) } var ln = (function () { return T( function e(t, n, r) { ;(A(this, e), (this._object = t), (this._key = n), (this._defaultValue = r), (this.__v_isRef = !0), (this._value = void 0)) }, [ { key: 'value', get: function () { var e = this._object[this._key] return (this._value = void 0 === e ? this._defaultValue : e) }, set: function (e) { this._object[this._key] = e }, }, { key: 'dep', get: function () { return (function (e, t) { var n = ot.get(e) return n && n.get(t) })(Kt(this._object), this._key) }, }, ] ) })(), cn = (function () { return T( function e(t) { ;(A(this, e), (this._getter = t), (this.__v_isRef = !0), (this.__v_isReadonly = !0), (this._value = void 0)) }, [ { key: 'value', get: function () { return (this._value = this._getter()) }, }, ] ) })() function hn(e, t, n) { var r = e[t] return en(r) ? r : new ln(e, t, n) } var dn = (function () { return T( function e(t, n, r) { ;(A(this, e), (this.fn = t), (this.setter = n), (this._value = void 0), (this.dep = new it(this)), (this.__v_isRef = !0), (this.deps = void 0), (this.depsTail = void 0), (this.flags = 16), (this.globalVersion = nt - 1), (this.next = void 0), (this.effect = this), (this.__v_isReadonly = !n), (this.isSSR = r)) }, [ { key: 'notify', value: function () { if (((this.flags |= 16), !(8 & this.flags) && ke !== this)) return (He(this, !0), !0) }, }, { key: 'value', get: function () { var e = this.dep.track() return (Xe(this), e && (e.version = this.dep.version), this._value) }, set: function (e) { this.setter && this.setter(e) }, }, ] ) })() var fn = {}, pn = new WeakMap(), vn = void 0 function mn(e, t) { var n, r, i, a, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : E, s = o.immediate, u = o.deep, l = o.once, c = o.scheduler, h = o.augmentJob, d = o.call, f = function (e) { return u ? e : Xt(e) || !1 === u || 0 === u ? gn(e, 1) : gn(e) }, p = !1, v = !1 if ( (en(e) ? ((r = function () { return e.value }), (p = Xt(e))) : Qt(e) ? ((r = function () { return f(e) }), (p = !0)) : Y(e) ? ((v = !0), (p = e.some(function (e) { return Qt(e) || Xt(e) })), (r = function () { return e.map(function (e) { return en(e) ? e.value : Qt(e) ? f(e) : J(e) ? d ? d(e, 2) : e() : void 0 }) })) : (r = J(e) ? t ? d ? function () { return d(e, 2) } : e : function () { if (i) { $e() try { i() } finally { et() } } var t = vn vn = n try { return d ? d(e, 3, [a]) : e(a) } finally { vn = t } } : B), t && u) ) { var m = r, g = !0 === u ? 1 / 0 : u r = function () { return gn(m(), g) } } var y = Oe(), _ = function () { ;(n.stop(), y && y.active && Q(y.effects, n)) } if (l && t) { var b = t t = function () { ;(b.apply(void 0, arguments), _()) } } var x = v ? new Array(e.length).fill(fn) : fn, S = function (e) { if (1 & n.flags && (n.dirty || e)) if (t) { var r = n.run() if ( u || p || (v ? r.some(function (e, t) { return ve(e, x[t]) }) : ve(r, x)) ) { i && i() var o = vn vn = n try { var s = [r, x === fn ? void 0 : v && x[0] === fn ? [] : x, a] ;((x = r), d ? d(t, 3, s) : t.apply(void 0, s)) } finally { vn = o } } } else n.run() } return ( h && h(S), ((n = new ze(r)).scheduler = c ? function () { return c(S, !1) } : S), (a = function (e) { return (function (e) { var t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : vn if (t) { var n = pn.get(t) ;(n || pn.set(t, (n = [])), n.push(e)) } })(e, !1, n) }), (i = n.onStop = function () { var e = pn.get(n) if (e) { if (d) d(e, 4) else { var t, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { ;(0, t.value)() } } catch (i) { r.e(i) } finally { r.f() } } pn.delete(n) } }), t ? (s ? S(!0) : (x = n.run())) : c ? c(S.bind(null, !0), !0) : n.run(), (_.pause = n.pause.bind(n)), (_.resume = n.resume.bind(n)), (_.stop = _), _ ) } function gn(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0, n = arguments.length > 2 ? arguments[2] : void 0 if (t <= 0 || !te(e) || e.__v_skip) return e if ((n = n || new Set()).has(e)) return e if ((n.add(e), t--, en(e))) gn(e.value, t, n) else if (Y(e)) for (var r = 0; r < e.length; r++) gn(e[r], t, n) else if (Z(e) || K(e)) e.forEach(function (e) { gn(e, t, n) }) else if (ae(e)) { for (var i in e) gn(e[i], t, n) var a, o = L(Object.getOwnPropertySymbols(e)) try { for (o.s(); !(a = o.n()).done; ) { var s = a.value Object.prototype.propertyIsEnumerable.call(e, s) && gn(e[s], t, n) } } catch (u) { o.e(u) } finally { o.f() } } return e } /** * @vue/runtime-core v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ function yn(e, t, n, r) { try { return r ? e.apply(void 0, I(r)) : e() } catch (i) { bn(i, t, n) } } function _n(e, t, n, r) { if (J(e)) { var i = yn(e, t, n, r) return ( i && ne(i) && i.catch(function (e) { bn(e, t, n) }), i ) } if (Y(e)) { for (var a = [], o = 0; o < e.length; o++) a.push(_n(e[o], t, n, r)) return a } } function bn(e, t, n) { var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i = t ? t.vnode : null, a = (t && t.appContext.config) || E, o = a.errorHandler, s = a.throwUnhandledErrorInProduction if (t) { for ( var u = t.parent, l = t.proxy, c = 'https://vuejs.org/error-reference/#runtime-'.concat(n); u; ) { var h = u.ec if (h) for (var d = 0; d < h.length; d++) if (!1 === h[d](e, l, c)) return u = u.parent } if (o) return ($e(), yn(o, null, 10, [e, l, c]), void et()) } !(function (e, t, n) { var r = arguments.length > 4 && void 0 !== arguments[4] && arguments[4] if (r) throw e console.error(e) })(e, n, i, r, s) } var xn = [], Sn = -1, An = [], wn = null, Tn = 0, Mn = Promise.resolve(), En = null function Cn(e) { var t = En || Mn return e ? t.then(this ? e.bind(this) : e) : t } function kn(e) { if (!(1 & e.flags)) { var t = Pn(e), n = xn[xn.length - 1] ;(!n || (!(2 & e.flags) && t >= Pn(n)) ? xn.push(e) : xn.splice( (function (e) { for (var t = Sn + 1, n = xn.length; t < n; ) { var r = (t + n) >>> 1, i = xn[r], a = Pn(i) a < e || (a === e && 2 & i.flags) ? (t = r + 1) : (n = r) } return t })(t), 0, e ), (e.flags |= 1), Rn()) } } function Rn() { En || (En = Mn.then(Ln)) } function In(e, t) { for ( var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Sn + 1; n < xn.length; n++ ) { var r = xn[n] if (r && 2 & r.flags) { if (e && r.id !== e.uid) continue ;(xn.splice(n, 1), n--, 4 & r.flags && (r.flags &= -2), r(), 4 & r.flags || (r.flags &= -2)) } } } function Nn(e) { if (An.length) { var t, n = I(new Set(An)).sort(function (e, t) { return Pn(e) - Pn(t) }) if (((An.length = 0), wn)) return void (t = wn).push.apply(t, I(n)) for (wn = n, Tn = 0; Tn < wn.length; Tn++) { var r = wn[Tn] ;(4 & r.flags && (r.flags &= -2), 8 & r.flags || r(), (r.flags &= -2)) } ;((wn = null), (Tn = 0)) } } var Pn = function (e) { return null == e.id ? (2 & e.flags ? -1 : 1 / 0) : e.id } function Ln(e) { try { for (Sn = 0; Sn < xn.length; Sn++) { var t = xn[Sn] !t || 8 & t.flags || (4 & t.flags && (t.flags &= -2), yn(t, t.i, t.i ? 15 : 14), 4 & t.flags || (t.flags &= -2)) } } finally { for (; Sn < xn.length; Sn++) { var n = xn[Sn] n && (n.flags &= -2) } ;((Sn = -1), (xn.length = 0), Nn(), (En = null), (xn.length || An.length) && Ln()) } } var Dn = null, On = null function Fn(e) { var t = Dn return ((Dn = e), (On = (e && e.type.__scopeId) || null), t) } function Bn(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Dn if (!t) return e if (e._n) return e var n = function () { n._d && Qi(-1) var r, i = Fn(t) try { r = e.apply(void 0, arguments) } finally { ;(Fn(i), n._d && Qi(1)) } return r } return ((n._n = !0), (n._c = !0), (n._d = !0), n) } function Un(e, t) { if (null === Dn) return e for (var n = Ta(Dn), r = e.dirs || (e.dirs = []), i = 0; i < t.length; i++) { var a = C(t[i], 4), o = a[0], s = a[1], u = a[2], l = a[3], c = void 0 === l ? E : l o && (J(o) && (o = { mounted: o, updated: o }), o.deep && gn(s), r.push({ dir: o, instance: n, value: s, oldValue: void 0, arg: u, modifiers: c })) } return e } function zn(e, t, n, r) { for (var i = e.dirs, a = t && t.dirs, o = 0; o < i.length; o++) { var s = i[o] a && (s.oldValue = a[o].value) var u = s.dir[r] u && ($e(), _n(u, n, 8, [e.el, s, e, t]), et()) } } var Vn = Symbol('_vte'), Hn = function (e) { return e && (e.disabled || '' === e.disabled) }, Wn = function (e) { return e && (e.defer || '' === e.defer) }, Gn = function (e) { return 'undefined' != typeof SVGElement && e instanceof SVGElement }, jn = function (e) { return 'function' == typeof MathMLElement && e instanceof MathMLElement }, Qn = function (e, t) { var n = e && e.to return $(n) ? (t ? t(n) : null) : n }, qn = { name: 'Teleport', __isTeleport: !0, process: function (e, t, n, r, i, a, o, s, u, l) { var c = l.mc, h = l.pc, d = l.pbc, f = l.o, p = f.insert, v = f.querySelector, m = f.createText, g = (f.createComment, Hn(t.props)), y = t.shapeFlag, _ = t.children, b = t.dynamicChildren if (null == e) { var x = (t.el = m('')), S = (t.anchor = m('')) ;(p(x, n, r), p(S, n, r)) var A = function (e, t) { 16 & y && (i && i.isCE && (i.ce._teleportTarget = e), c(_, e, t, i, a, o, s, u)) }, w = function () { var e = (t.target = Qn(t.props, v)), n = Zn(e, t, m, p) e && ('svg' !== o && Gn(e) ? (o = 'svg') : 'mathml' !== o && jn(e) && (o = 'mathml'), g || (A(e, n), Kn(t, !1))) } ;(g && (A(n, S), Kn(t, !0)), Wn(t.props) ? ((t.el.__isMounted = !1), vi(function () { ;(w(), delete t.el.__isMounted) }, a)) : w()) } else { if (Wn(t.props) && !1 === e.el.__isMounted) return void vi(function () { qn.process(e, t, n, r, i, a, o, s, u, l) }, a) ;((t.el = e.el), (t.targetStart = e.targetStart)) var T = (t.anchor = e.anchor), M = (t.target = e.target), E = (t.targetAnchor = e.targetAnchor), C = Hn(e.props), k = C ? n : M, R = C ? T : E if ( ('svg' === o || Gn(M) ? (o = 'svg') : ('mathml' === o || jn(M)) && (o = 'mathml'), b ? (d(e.dynamicChildren, b, k, i, a, o, s), _i(e, t, !0)) : u || h(e, t, k, R, i, a, o, s, !1), g) ) C ? t.props && e.props && t.props.to !== e.props.to && (t.props.to = e.props.to) : Xn(t, n, T, l, 1) else if ((t.props && t.props.to) !== (e.props && e.props.to)) { var I = (t.target = Qn(t.props, v)) I && Xn(t, I, null, l, 0) } else C && Xn(t, M, E, l, 1) Kn(t, g) } }, remove: function (e, t, n, r, i) { var a = r.um, o = r.o.remove, s = e.shapeFlag, u = e.children, l = e.anchor, c = e.targetStart, h = e.targetAnchor, d = e.target, f = e.props if ((d && (o(c), o(h)), i && o(l), 16 & s)) for (var p = i || !Hn(f), v = 0; v < u.length; v++) { var m = u[v] a(m, t, n, p, !!m.dynamicChildren) } }, move: Xn, hydrate: function (e, t, n, r, i, a, o, s) { var u = o.o, l = u.nextSibling, c = u.parentNode, h = u.querySelector, d = u.insert, f = u.createText, p = (t.target = Qn(t.props, h)) if (p) { var v = Hn(t.props), m = p._lpa || p.firstChild if (16 & t.shapeFlag) if (v) ((t.anchor = s(l(e), t, c(e), n, r, i, a)), (t.targetStart = m), (t.targetAnchor = m && l(m))) else { t.anchor = l(e) for (var g = m; g; ) { if (g && 8 === g.nodeType) if ('teleport start anchor' === g.data) t.targetStart = g else if ('teleport anchor' === g.data) { ;((t.targetAnchor = g), (p._lpa = t.targetAnchor && l(t.targetAnchor))) break } g = l(g) } ;(t.targetAnchor || Zn(p, t, f, d), s(m && l(m), t, p, n, r, i, a)) } Kn(t, v) } return t.anchor && l(t.anchor) }, } function Xn(e, t, n, r) { var i = r.o.insert, a = r.m, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 2 0 === o && i(e.targetAnchor, t, n) var s = e.el, u = e.anchor, l = e.shapeFlag, c = e.children, h = e.props, d = 2 === o if ((d && i(s, t, n), (!d || Hn(h)) && 16 & l)) for (var f = 0; f < c.length; f++) a(c[f], t, n, 2) d && i(u, t, n) } var Yn = qn function Kn(e, t) { var n = e.ctx if (n && n.ut) { var r, i for ( t ? ((r = e.el), (i = e.anchor)) : ((r = e.targetStart), (i = e.targetAnchor)); r && r !== i; ) (1 === r.nodeType && r.setAttribute('data-v-owner', n.uid), (r = r.nextSibling)) n.ut() } } function Zn(e, t, n, r) { var i = (t.targetStart = n('')), a = (t.targetAnchor = n('')) return ((i[Vn] = a), e && (r(i, e), r(a, e)), a) } var Jn = Symbol('_leaveCb'), $n = Symbol('_enterCb') var er = [Function, Array], tr = { mode: String, appear: Boolean, persisted: Boolean, onBeforeEnter: er, onEnter: er, onAfterEnter: er, onEnterCancelled: er, onBeforeLeave: er, onLeave: er, onAfterLeave: er, onLeaveCancelled: er, onBeforeAppear: er, onAppear: er, onAfterAppear: er, onAppearCancelled: er, } function nr(e, t, n, r, i) { var a = t.appear, o = t.mode, s = t.persisted, u = void 0 !== s && s, l = t.onBeforeEnter, c = t.onEnter, h = t.onAfterEnter, d = t.onEnterCancelled, f = t.onBeforeLeave, p = t.onLeave, v = t.onAfterLeave, m = t.onLeaveCancelled, g = t.onBeforeAppear, y = t.onAppear, _ = t.onAfterAppear, b = t.onAppearCancelled, x = String(e.key), S = (function (e, t) { var n = e.leavingVNodes, r = n.get(t.type) return (r || ((r = Object.create(null)), n.set(t.type, r)), r) })(n, e), A = function (e, t) { e && _n(e, r, 9, t) }, w = function (e, t) { var n = t[1] ;(A(e, t), Y(e) ? e.every(function (e) { return e.length <= 1 }) && n() : e.length <= 1 && n()) }, T = { mode: o, persisted: u, beforeEnter: function (t) { var r = l if (!n.isMounted) { if (!a) return r = g || l } t[Jn] && t[Jn](!0) var i = S[x] ;(i && Zi(e, i) && i.el[Jn] && i.el[Jn](), A(r, [t])) }, enter: function (e) { var t = c, r = h, i = d if (!n.isMounted) { if (!a) return ;((t = y || c), (r = _ || h), (i = b || d)) } var o = !1, s = (e[$n] = function (t) { o || ((o = !0), A(t ? i : r, [e]), T.delayedLeave && T.delayedLeave(), (e[$n] = void 0)) }) t ? w(t, [e, s]) : s() }, leave: function (t, r) { var i = String(e.key) if ((t[$n] && t[$n](!0), n.isUnmounting)) return r() A(f, [t]) var a = !1, o = (t[Jn] = function (n) { a || ((a = !0), r(), A(n ? m : v, [t]), (t[Jn] = void 0), S[i] === e && delete S[i]) }) ;((S[i] = e), p ? w(p, [t, o]) : o()) }, clone: function (e) { return nr(e, t, n, r) }, } return T } function rr(e, t) { 6 & e.shapeFlag && e.component ? ((e.transition = t), rr(e.component.subTree, t)) : 128 & e.shapeFlag ? ((e.ssContent.transition = t.clone(e.ssContent)), (e.ssFallback.transition = t.clone(e.ssFallback))) : (e.transition = t) } function ir(e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = arguments.length > 2 ? arguments[2] : void 0, r = [], i = 0, a = 0; a < e.length; a++ ) { var o = e[a], s = null == n ? o.key : String(n) + String(null != o.key ? o.key : a) o.type === Bi ? (128 & o.patchFlag && i++, (r = r.concat(ir(o.children, t, s)))) : (t || o.type !== zi) && r.push(null != s ? na(o, { key: s }) : o) } if (i > 1) for (var u = 0; u < r.length; u++) r[u].patchFlag = -2 return r } /*! #__NO_SIDE_EFFECTS__ */ function ar(e, t) { return J(e) ? (function () { return j({ name: e.name }, t, { setup: e }) })() : e } function or(e) { e.ids = [e.ids[0] + e.ids[2]++ + '-', 0, 0] } function sr(e) { var t = va(), n = nn(null) if (t) { var r = t.refs === E ? (t.refs = {}) : t.refs Object.defineProperty(r, e, { enumerable: !0, get: function () { return n.value }, set: function (e) { return (n.value = e) }, }) } return n } function ur(e, t, n, r) { var i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4] if (Y(e)) e.forEach(function (e, a) { return ur(e, t && (Y(t) ? t[a] : t), n, r, i) }) else if (!lr(r) || i) { var a = 4 & r.shapeFlag ? Ta(r.component) : r.el, o = i ? null : a, s = e.i, u = e.r, l = t && t.r, c = s.refs === E ? (s.refs = {}) : s.refs, h = s.setupState, d = Kt(h), f = h === E ? function () { return !1 } : function (e) { return X(d, e) } if ( (null != l && l !== u && ($(l) ? ((c[l] = null), f(l) && (h[l] = null)) : en(l) && (l.value = null)), J(u)) ) yn(u, s, 12, [o, c]) else { var p = $(u), v = en(u) if (p || v) { var m = function () { if (e.f) { var t = p ? (f(u) ? h[u] : c[u]) : u.value i ? Y(t) && Q(t, a) : Y(t) ? t.includes(a) || t.push(a) : p ? ((c[u] = [a]), f(u) && (h[u] = c[u])) : ((u.value = [a]), e.k && (c[e.k] = u.value)) } else p ? ((c[u] = o), f(u) && (h[u] = o)) : v && ((u.value = o), e.k && (c[e.k] = o)) } o ? ((m.id = -1), vi(m, n)) : m() } } } else 512 & r.shapeFlag && r.type.__asyncResolved && r.component.subTree.component && ur(e, t, n, r.component.subTree) } ;(_e().requestIdleCallback, _e().cancelIdleCallback) var lr = function (e) { return !!e.type.__asyncLoader }, cr = function (e) { return e.type.__isKeepAlive } function hr(e, t) { fr(e, 'a', t) } function dr(e, t) { fr(e, 'da', t) } function fr(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : pa, r = e.__wdc || (e.__wdc = function () { for (var t = n; t; ) { if (t.isDeactivated) return t = t.parent } return e() }) if ((vr(t, r, n), n)) for (var i = n.parent; i && i.parent; ) (cr(i.parent.vnode) && pr(r, t, n, i), (i = i.parent)) } function pr(e, t, n, r) { var i = vr(t, e, r, !0) Sr(function () { Q(r[t], i) }, n) } function vr(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : pa, r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] if (n) { var i = n[e] || (n[e] = []), a = t.__weh || (t.__weh = function () { $e() for (var r = ya(n), i = arguments.length, a = new Array(i), o = 0; o < i; o++) a[o] = arguments[o] var s = _n(t, n, e, a) return (r(), et(), s) }) return (r ? i.unshift(a) : i.push(a), a) } } var mr = function (e) { return function (t) { ;(xa && 'sp' !== e) || vr( e, function () { return t.apply(void 0, arguments) }, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : pa ) } }, gr = mr('bm'), yr = mr('m'), _r = mr('bu'), br = mr('u'), xr = mr('bum'), Sr = mr('um'), Ar = mr('sp'), wr = mr('rtg'), Tr = mr('rtc') function Mr(e) { vr('ec', e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : pa) } var Er = 'components', Cr = Symbol.for('v-ndc') function kr(e, t) { var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], r = Dn || pa if (r) { var i = r.type if (e === Er) { var a = Ma(i, !1) if (a && (a === t || a === ce(t) || a === fe(ce(t)))) return i } var o = Rr(r[e] || i[e], t) || Rr(r.appContext[e], t) return !o && n ? i : o } } function Rr(e, t) { return e && (e[t] || e[ce(t)] || e[fe(ce(t))]) } function Ir(e, t, n, r) { var i, a = n, o = Y(e) if (o || $(e)) { var s = !1, u = !1 ;(o && Qt(e) && ((s = !Xt(e)), (u = qt(e)), (e = ft(e))), (i = new Array(e.length))) for (var l = 0, c = e.length; l < c; l++) i[l] = t(s ? (u ? $t(Jt(e[l])) : Jt(e[l])) : e[l], l, void 0, a) } else if ('number' == typeof e) { i = new Array(e) for (var h = 0; h < e; h++) i[h] = t(h + 1, h, void 0, a) } else if (te(e)) if (e[Symbol.iterator]) i = Array.from(e, function (e, n) { return t(e, n, void 0, a) }) else { var d = Object.keys(e) i = new Array(d.length) for (var f = 0, p = d.length; f < p; f++) { var v = d[f] i[f] = t(e[v], v, f, a) } } else i = [] return i } var Nr = function (e) { return e ? (ba(e) ? Ta(e) : Nr(e.parent)) : null }, Pr = j(Object.create(null), { $: function (e) { return e }, $el: function (e) { return e.vnode.el }, $data: function (e) { return e.data }, $props: function (e) { return e.props }, $attrs: function (e) { return e.attrs }, $slots: function (e) { return e.slots }, $refs: function (e) { return e.refs }, $parent: function (e) { return Nr(e.parent) }, $root: function (e) { return Nr(e.root) }, $host: function (e) { return e.ce }, $emit: function (e) { return e.emit }, $options: function (e) { return Vr(e) }, $forceUpdate: function (e) { return ( e.f || (e.f = function () { kn(e.update) }) ) }, $nextTick: function (e) { return e.n || (e.n = Cn.bind(e.proxy)) }, $watch: function (e) { return Ei.bind(e) }, }), Lr = function (e, t) { return e !== E && !e.__isScriptSetup && X(e, t) }, Dr = { get: function (e, t) { var n = e._ if ('__v_skip' === t) return !0 var r, i = n.ctx, a = n.setupState, o = n.data, s = n.props, u = n.accessCache, l = n.type, c = n.appContext if ('$' !== t[0]) { var h = u[t] if (void 0 !== h) switch (h) { case 1: return a[t] case 2: return o[t] case 4: return i[t] case 3: return s[t] } else { if (Lr(a, t)) return ((u[t] = 1), a[t]) if (o !== E && X(o, t)) return ((u[t] = 2), o[t]) if ((r = n.propsOptions[0]) && X(r, t)) return ((u[t] = 3), s[t]) if (i !== E && X(i, t)) return ((u[t] = 4), i[t]) Fr && (u[t] = 0) } } var d, f, p = Pr[t] return p ? ('$attrs' === t && ct(n.attrs, 0, ''), p(n)) : (d = l.__cssModules) && (d = d[t]) ? d : i !== E && X(i, t) ? ((u[t] = 4), i[t]) : ((f = c.config.globalProperties), X(f, t) ? f[t] : void 0) }, set: function (e, t, n) { var r = e._, i = r.data, a = r.setupState, o = r.ctx return Lr(a, t) ? ((a[t] = n), !0) : i !== E && X(i, t) ? ((i[t] = n), !0) : !X(r.props, t) && ('$' !== t[0] || !(t.slice(1) in r)) && ((o[t] = n), !0) }, has: function (e, t) { var n, r = e._, i = r.data, a = r.setupState, o = r.accessCache, s = r.ctx, u = r.appContext, l = r.propsOptions return ( !!o[t] || (i !== E && X(i, t)) || Lr(a, t) || ((n = l[0]) && X(n, t)) || X(s, t) || X(Pr, t) || X(u.config.globalProperties, t) ) }, defineProperty: function (e, t, n) { return ( null != n.get ? (e._.accessCache[t] = 0) : X(n, 'value') && this.set(e, t, n.value, null), Reflect.defineProperty(e, t, n) ) }, } function Or(e) { return Y(e) ? e.reduce(function (e, t) { return ((e[t] = null), e) }, {}) : e } var Fr = !0 function Br(e) { var t = Vr(e), n = e.proxy, r = e.ctx ;((Fr = !1), t.beforeCreate && Ur(t.beforeCreate, e, 'bc')) var i = t.data, a = t.computed, o = t.methods, s = t.watch, u = t.provide, l = t.inject, c = t.created, h = t.beforeMount, d = t.mounted, f = t.beforeUpdate, p = t.updated, v = t.activated, m = t.deactivated, g = (t.beforeDestroy, t.beforeUnmount), y = (t.destroyed, t.unmounted), _ = t.render, b = t.renderTracked, x = t.renderTriggered, S = t.errorCaptured, A = t.serverPrefetch, w = t.expose, T = t.inheritAttrs, M = t.components, E = t.directives t.filters if ( (l && (function (e, t) { Y(e) && (e = jr(e)) var n = function () { var n, i = e[r] en( (n = te(i) ? 'default' in i ? ei(i.from || r, i.default, !0) : ei(i.from || r) : ei(i)) ) ? Object.defineProperty(t, r, { enumerable: !0, configurable: !0, get: function () { return n.value }, set: function (e) { return (n.value = e) }, }) : (t[r] = n) } for (var r in e) n() })(l, r, null), o) ) for (var C in o) { var k = o[C] J(k) && (r[C] = k.bind(n)) } if (i) { var R = i.call(n, n) te(R) && (e.data = Wt(R)) } if (((Fr = !0), a)) { var I = function () { var e = a[N], t = J(e) ? e.bind(n, n) : J(e.get) ? e.get.bind(n, n) : B, i = !J(e) && J(e.set) ? e.set.bind(n) : B, o = Ea({ get: t, set: i }) Object.defineProperty(r, N, { enumerable: !0, configurable: !0, get: function () { return o.value }, set: function (e) { return (o.value = e) }, }) } for (var N in a) I() } if (s) for (var P in s) zr(s[P], r, n, P) if (u) { var L = J(u) ? u.call(n) : u Reflect.ownKeys(L).forEach(function (e) { $r(e, L[e]) }) } function D(e, t) { Y(t) ? t.forEach(function (t) { return e(t.bind(n)) }) : t && e(t.bind(n)) } if ( (c && Ur(c, e, 'c'), D(gr, h), D(yr, d), D(_r, f), D(br, p), D(hr, v), D(dr, m), D(Mr, S), D(Tr, b), D(wr, x), D(xr, g), D(Sr, y), D(Ar, A), Y(w)) ) if (w.length) { var O = e.exposed || (e.exposed = {}) w.forEach(function (e) { Object.defineProperty(O, e, { get: function () { return n[e] }, set: function (t) { return (n[e] = t) }, }) }) } else e.exposed || (e.exposed = {}) ;(_ && e.render === B && (e.render = _), null != T && (e.inheritAttrs = T), M && (e.components = M), E && (e.directives = E), A && or(e)) } function Ur(e, t, n) { _n( Y(e) ? e.map(function (e) { return e.bind(t.proxy) }) : e.bind(t.proxy), t, n ) } function zr(e, t, n, r) { var i = r.includes('.') ? Ci(n, r) : function () { return n[r] } if ($(e)) { var a = t[e] J(a) && Ti(i, a) } else if (J(e)) Ti(i, e.bind(n)) else if (te(e)) if (Y(e)) e.forEach(function (e) { return zr(e, t, n, r) }) else { var o = J(e.handler) ? e.handler.bind(n) : t[e.handler] J(o) && Ti(i, o, e) } } function Vr(e) { var t, n = e.type, r = n.mixins, i = n.extends, a = e.appContext, o = a.mixins, s = a.optionsCache, u = a.config.optionMergeStrategies, l = s.get(n) return ( l ? (t = l) : o.length || r || i ? ((t = {}), o.length && o.forEach(function (e) { return Hr(t, e, u, !0) }), Hr(t, n, u)) : (t = n), te(n) && s.set(n, t), t ) } function Hr(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = t.mixins, a = t.extends for (var o in (a && Hr(e, a, n, !0), i && i.forEach(function (t) { return Hr(e, t, n, !0) }), t)) if (r && 'expose' === o); else { var s = Wr[o] || (n && n[o]) e[o] = s ? s(e[o], t[o]) : t[o] } return e } var Wr = { data: Gr, props: Xr, emits: Xr, methods: qr, computed: qr, beforeCreate: Qr, created: Qr, beforeMount: Qr, mounted: Qr, beforeUpdate: Qr, updated: Qr, beforeDestroy: Qr, beforeUnmount: Qr, destroyed: Qr, unmounted: Qr, activated: Qr, deactivated: Qr, errorCaptured: Qr, serverPrefetch: Qr, components: qr, directives: qr, watch: function (e, t) { if (!e) return t if (!t) return e var n = j(Object.create(null), e) for (var r in t) n[r] = Qr(e[r], t[r]) return n }, provide: Gr, inject: function (e, t) { return qr(jr(e), jr(t)) }, } function Gr(e, t) { return t ? e ? function () { return j(J(e) ? e.call(this, this) : e, J(t) ? t.call(this, this) : t) } : t : e } function jr(e) { if (Y(e)) { for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = e[n] return t } return e } function Qr(e, t) { return e ? I(new Set([].concat(e, t))) : t } function qr(e, t) { return e ? j(Object.create(null), e, t) : t } function Xr(e, t) { return e ? Y(e) && Y(t) ? I(new Set([].concat(I(e), I(t)))) : j(Object.create(null), Or(e), Or(null != t ? t : {})) : t } function Yr() { return { app: null, config: { isNativeTag: V, performance: !1, globalProperties: {}, optionMergeStrategies: {}, errorHandler: void 0, warnHandler: void 0, compilerOptions: {}, }, mixins: [], components: {}, directives: {}, provides: Object.create(null), optionsCache: new WeakMap(), propsCache: new WeakMap(), emitsCache: new WeakMap(), } } var Kr = 0 function Zr(e, t) { return function (t) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null ;(J(t) || (t = j({}, t)), null == n || te(n) || (n = null)) var r = Yr(), i = new WeakSet(), a = [], o = !1, s = (r.app = { _uid: Kr++, _component: t, _props: n, _container: null, _context: r, _instance: null, version: ka, get config() { return r.config }, set config(e) {}, use: function (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 ( i.has(e) || (e && J(e.install) ? (i.add(e), e.install.apply(e, [s].concat(n))) : J(e) && (i.add(e), e.apply(void 0, [s].concat(n)))), s ) }, mixin: function (e) { return (r.mixins.includes(e) || r.mixins.push(e), s) }, component: function (e, t) { return t ? ((r.components[e] = t), s) : r.components[e] }, directive: function (e, t) { return t ? ((r.directives[e] = t), s) : r.directives[e] }, mount: function (i, a, u) { if (!o) { var l = s._ceVNode || ta(t, n) return ( (l.appContext = r), !0 === u ? (u = 'svg') : !1 === u && (u = void 0), e(l, i, u), (o = !0), (s._container = i), (i.__vue_app__ = s), Ta(l.component) ) } }, onUnmount: function (e) { a.push(e) }, unmount: function () { o && (_n(a, s._instance, 16), e(null, s._container), delete s._container.__vue_app__) }, provide: function (e, t) { return ((r.provides[e] = t), s) }, runWithContext: function (e) { var t = Jr Jr = s try { return e() } finally { Jr = t } }, }) return s } } var Jr = null function $r(e, t) { if (pa) { var n = pa.provides, r = pa.parent && pa.parent.provides ;(r === n && (n = pa.provides = Object.create(r)), (n[e] = t)) } else; } function ei(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = pa || Dn if (r || Jr) { var i = Jr ? Jr._context.provides : r ? null == r.parent || r.ce ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : void 0 if (i && e in i) return i[e] if (arguments.length > 1) return n && J(t) ? t.call(r && r.proxy) : t } } var ti = {}, ni = function () { return Object.create(ti) }, ri = function (e) { return Object.getPrototypeOf(e) === ti } function ii(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = {}, a = ni() for (var o in ((e.propsDefaults = Object.create(null)), ai(e, t, i, a), e.propsOptions[0])) o in i || (i[o] = void 0) ;(n ? (e.props = r ? i : (function (e) { return jt(e, !1, kt, Ot, Ut) })(i)) : e.type.props ? (e.props = i) : (e.props = a), (e.attrs = a)) } function ai(e, t, n, r) { var i, a = C(e.propsOptions, 2), o = a[0], s = a[1], u = !1 if (t) for (var l in t) if (!se(l)) { var c = t[l], h = void 0 o && X(o, (h = ce(l))) ? s && s.includes(h) ? ((i || (i = {}))[h] = c) : (n[h] = c) : Ni(e.emitsOptions, l) || (l in r && c === r[l]) || ((r[l] = c), (u = !0)) } if (s) for (var d = Kt(n), f = i || E, p = 0; p < s.length; p++) { var v = s[p] n[v] = oi(o, d, v, f[v], e, !X(f, v)) } return u } function oi(e, t, n, r, i, a) { var o = e[n] if (null != o) { var s = X(o, 'default') if (s && void 0 === r) { var u = o.default if (o.type !== Function && !o.skipFactory && J(u)) { var l = i.propsDefaults if (n in l) r = l[n] else { var c = ya(i) ;((r = l[n] = u.call(null, t)), c()) } } else r = u i.ce && i.ce._setProp(n, r) } o[0] && (a && !s ? (r = !1) : !o[1] || ('' !== r && r !== de(n)) || (r = !0)) } return r } var si = new WeakMap() function ui(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = n ? si : t.propsCache, i = r.get(e) if (i) return i var a = e.props, o = {}, s = [], u = !1 if (!J(e)) { var l = function (e) { u = !0 var n = C(ui(e, t, !0), 2), r = n[0], i = n[1] ;(j(o, r), i && s.push.apply(s, I(i))) } ;(!n && t.mixins.length && t.mixins.forEach(l), e.extends && l(e.extends), e.mixins && e.mixins.forEach(l)) } if (!a && !u) return (te(e) && r.set(e, O), O) if (Y(a)) for (var c = 0; c < a.length; c++) { var h = ce(a[c]) li(h) && (o[h] = E) } else if (a) for (var d in a) { var f = ce(d) if (li(f)) { var p = a[d], v = (o[f] = Y(p) || J(p) ? { type: p } : j({}, p)), m = v.type, g = !1, y = !0 if (Y(m)) for (var _ = 0; _ < m.length; ++_) { var b = m[_], x = J(b) && b.name if ('Boolean' === x) { g = !0 break } 'String' === x && (y = !1) } else g = J(m) && 'Boolean' === m.name ;((v[0] = g), (v[1] = y), (g || X(v, 'default')) && s.push(f)) } } var S = [o, s] return (te(e) && r.set(e, S), S) } function li(e) { return '$' !== e[0] && !se(e) } var ci = function (e) { return '_' === e[0] || '$stable' === e }, hi = function (e) { return Y(e) ? e.map(oa) : [oa(e)] }, di = function (e, t, n) { var r = e._ctx, i = function () { if (ci(a)) return 1 var n = e[a] if (J(n)) t[a] = (function (e, t, n) { if (t._n) return t var r = Bn(function () { return hi(t.apply(void 0, arguments)) }, n) return ((r._c = !1), r) })(0, n, r) else if (null != n) { var i = hi(n) t[a] = function () { return i } } } for (var a in e) i() }, fi = function (e, t) { var n = hi(t) e.slots.default = function () { return n } }, pi = function (e, t, n) { for (var r in t) (!n && ci(r)) || (e[r] = t[r]) }, vi = function (e, t) { if (t && t.pendingBranch) { var n if (Y(e)) (n = t.effects).push.apply(n, I(e)) else t.effects.push(e) } else (Y((r = e)) ? An.push.apply(An, I(r)) : wn && -1 === r.id ? wn.splice(Tn + 1, 0, r) : 1 & r.flags || (An.push(r), (r.flags |= 1)), Rn()) var r } function mi(e) { return (function (e) { var t = _e() t.__VUE__ = !0 var n, r = e.insert, i = e.remove, a = e.patchProp, o = e.createElement, s = e.createText, u = e.createComment, l = e.setText, c = e.setElementText, h = e.parentNode, d = e.nextSibling, f = e.setScopeId, p = void 0 === f ? B : f, v = e.insertStaticContent, m = function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null, a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : null, o = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : void 0, s = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : null, u = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : !!t.dynamicChildren if (e !== t) { ;(e && !Zi(e, t) && ((r = K(e)), W(e, i, a, !0), (e = null)), -2 === t.patchFlag && ((u = !1), (t.dynamicChildren = null))) var l = t.type, c = t.ref, h = t.shapeFlag switch (l) { case Ui: g(e, t, n, r) break case zi: y(e, t, n, r) break case Vi: null == e && _(t, n, r, o) break case Bi: I(e, t, n, r, i, a, o, s, u) break default: 1 & h ? S(e, t, n, r, i, a, o, s, u) : 6 & h ? N(e, t, n, r, i, a, o, s, u) : (64 & h || 128 & h) && l.process(e, t, n, r, i, a, o, s, u, $) } null != c && i ? ur(c, e && e.ref, a, t || e, !t) : null == c && e && null != e.ref && ur(e.ref, null, a, e, !0) } }, g = function (e, t, n, i) { if (null == e) r((t.el = s(t.children)), n, i) else { var a = (t.el = e.el) t.children !== e.children && l(a, t.children) } }, y = function (e, t, n, i) { null == e ? r((t.el = u(t.children || '')), n, i) : (t.el = e.el) }, _ = function (e, t, n, r) { var i = C(v(e.children, t, n, r, e.el, e.anchor), 2) ;((e.el = i[0]), (e.anchor = i[1])) }, b = function (e, t, n) { for (var i, a = e.el, o = e.anchor; a && a !== o; ) ((i = d(a)), r(a, t, n), (a = i)) r(o, t, n) }, x = function (e) { for (var t, n = e.el, r = e.anchor; n && n !== r; ) ((t = d(n)), i(n), (n = t)) i(r) }, S = function (e, t, n, r, i, a, o, s, u) { ;('svg' === t.type ? (o = 'svg') : 'math' === t.type && (o = 'mathml'), null == e ? A(t, n, r, i, a, o, s, u) : M(e, t, i, a, o, s, u)) }, A = function (e, t, n, i, s, u, l, h) { var d, f, p = e.props, v = e.shapeFlag, m = e.transition, g = e.dirs if ( ((d = e.el = o(e.type, u, p && p.is, p)), 8 & v ? c(d, e.children) : 16 & v && T(e.children, d, null, i, s, gi(e, u), l, h), g && zn(e, null, i, 'created'), w(d, e, e.scopeId, l, i), p) ) { for (var y in p) 'value' === y || se(y) || a(d, y, null, p[y], u, i) ;('value' in p && a(d, 'value', null, p.value, u), (f = p.onVnodeBeforeMount) && la(f, i, e)) } g && zn(e, null, i, 'beforeMount') var _ = (function (e, t) { return (!e || (e && !e.pendingBranch)) && t && !t.persisted })(s, m) ;(_ && m.beforeEnter(d), r(d, t, n), ((f = p && p.onVnodeMounted) || _ || g) && vi(function () { ;(f && la(f, i, e), _ && m.enter(d), g && zn(e, null, i, 'mounted')) }, s)) }, w = function (e, t, n, r, i) { if ((n && p(e, n), r)) for (var a = 0; a < r.length; a++) p(e, r[a]) if (i) { var o = i.subTree if (t === o || (Fi(o.type) && (o.ssContent === t || o.ssFallback === t))) { var s = i.vnode w(e, s, s.scopeId, s.slotScopeIds, i.parent) } } }, T = function (e, t, n, r, i, a, o, s) { for ( var u = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 0; u < e.length; u++ ) { var l = (e[u] = s ? sa(e[u]) : oa(e[u])) m(null, l, t, n, r, i, a, o, s) } }, M = function (e, t, n, r, i, o, s) { var u = (t.el = e.el), l = t.patchFlag, h = t.dynamicChildren, d = t.dirs l |= 16 & e.patchFlag var f, p = e.props || E, v = t.props || E if ( (n && yi(n, !1), (f = v.onVnodeBeforeUpdate) && la(f, n, t, e), d && zn(t, e, n, 'beforeUpdate'), n && yi(n, !0), ((p.innerHTML && null == v.innerHTML) || (p.textContent && null == v.textContent)) && c(u, ''), h ? k(e.dynamicChildren, h, u, n, r, gi(t, i), o) : s || U(e, t, u, null, n, r, gi(t, i), o, !1), l > 0) ) { if (16 & l) R(u, p, v, n, i) else if ( (2 & l && p.class !== v.class && a(u, 'class', null, v.class, i), 4 & l && a(u, 'style', p.style, v.style, i), 8 & l) ) for (var m = t.dynamicProps, g = 0; g < m.length; g++) { var y = m[g], _ = p[y], b = v[y] ;(b === _ && 'value' !== y) || a(u, y, _, b, i, n) } 1 & l && e.children !== t.children && c(u, t.children) } else s || null != h || R(u, p, v, n, i) ;((f = v.onVnodeUpdated) || d) && vi(function () { ;(f && la(f, n, t, e), d && zn(t, e, n, 'updated')) }, r) }, k = function (e, t, n, r, i, a, o) { for (var s = 0; s < t.length; s++) { var u = e[s], l = t[s], c = u.el && (u.type === Bi || !Zi(u, l) || 198 & u.shapeFlag) ? h(u.el) : n m(u, l, c, null, r, i, a, o, !0) } }, R = function (e, t, n, r, i) { if (t !== n) { if (t !== E) for (var o in t) se(o) || o in n || a(e, o, t[o], null, i, r) for (var s in n) if (!se(s)) { var u = n[s], l = t[s] u !== l && 'value' !== s && a(e, s, l, u, i, r) } 'value' in n && a(e, 'value', t.value, n.value, i) } }, I = function (e, t, n, i, a, o, u, l, c) { var h = (t.el = e ? e.el : s('')), d = (t.anchor = e ? e.anchor : s('')), f = t.patchFlag, p = t.dynamicChildren, v = t.slotScopeIds ;(v && (l = l ? l.concat(v) : v), null == e ? (r(h, n, i), r(d, n, i), T(t.children || [], n, d, a, o, u, l, c)) : f > 0 && 64 & f && p && e.dynamicChildren ? (k(e.dynamicChildren, p, n, a, o, u, l), (null != t.key || (a && t === a.subTree)) && _i(e, t, !0)) : U(e, t, n, d, a, o, u, l, c)) }, N = function (e, t, n, r, i, a, o, s, u) { ;((t.slotScopeIds = s), null == e ? 512 & t.shapeFlag ? i.ctx.activate(t, n, r, o, u) : P(t, n, r, i, a, o, u) : L(e, t, u)) }, P = function (e, t, n, r, i, a, o) { var s = (e.component = (function (e, t, n) { var r = e.type, i = (t ? t.appContext : e.appContext) || ca, a = { uid: ha++, vnode: e, type: r, parent: t, appContext: i, root: null, next: null, subTree: null, effect: null, update: null, job: null, scope: new Le(!0), render: null, proxy: null, exposed: null, exposeProxy: null, withProxy: null, provides: t ? t.provides : Object.create(i.provides), ids: t ? t.ids : ['', 0, 0], accessCache: null, renderCache: [], components: null, directives: null, propsOptions: ui(r, i), emitsOptions: Ii(r, i), emit: null, emitted: null, propsDefaults: E, inheritAttrs: r.inheritAttrs, ctx: E, data: E, props: E, attrs: E, slots: E, refs: E, setupState: E, setupContext: null, suspense: n, suspenseId: n ? n.pendingId : 0, asyncDep: null, asyncResolved: !1, isMounted: !1, isUnmounted: !1, isDeactivated: !1, bc: null, c: null, bm: null, m: null, bu: null, u: null, um: null, bum: null, da: null, a: null, rtg: null, rtc: null, ec: null, sp: null, } ;((a.ctx = { _: a }), (a.root = t ? t.root : a), (a.emit = Ri.bind(null, a)), e.ce && e.ce(a)) return a })(e, r, i)) if ( (cr(e) && (s.ctx.renderer = $), (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] t && fa(t) var r = e.vnode, i = r.props, a = r.children, o = ba(e) ;(ii(e, i, o, t), (function (e, t, n) { var r = (e.slots = ni()) if (32 & e.vnode.shapeFlag) { var i = t.__ i && ge(r, '__', i, !0) var a = t._ a ? (pi(r, t, n), n && ge(r, '_', a, !0)) : di(t, r) } else t && fi(e, t) })(e, a, n || t)) var s = o ? (function (e, t) { var n = e.type ;((e.accessCache = Object.create(null)), (e.proxy = new Proxy(e.ctx, Dr))) var r = n.setup if (r) { $e() var i = (e.setupContext = r.length > 1 ? (function (e) { var t = function (t) { e.exposed = t || {} } return { attrs: new Proxy(e.attrs, wa), slots: e.slots, emit: e.emit, expose: t, } })(e) : null), a = ya(e), o = yn(r, e, 0, [e.props, i]), s = ne(o) if ((et(), a(), (!s && !e.sp) || lr(e) || or(e), s)) { if ((o.then(_a, _a), t)) return o .then(function (t) { Sa(e, t) }) .catch(function (t) { bn(t, e, 0) }) e.asyncDep = o } else Sa(e, o) } else Aa(e) })(e, t) : void 0 t && fa(!1) })(s, !1, o), s.asyncDep) ) { if ((i && i.registerDep(s, D, o), !e.el)) { var u = (s.subTree = ta(zi)) y(null, u, t, n) } } else D(s, e, t, n, i, a, o) }, L = function (e, t, n) { var r = (t.component = e.component) if ( (function (e, t, n) { var r = e.props, i = e.children, a = e.component, o = t.props, s = t.children, u = t.patchFlag, l = a.emitsOptions if (t.dirs || t.transition) return !0 if (!(n && u >= 0)) return ( !((!i && !s) || (s && s.$stable)) || (r !== o && (r ? !o || Oi(r, o, l) : !!o)) ) if (1024 & u) return !0 if (16 & u) return r ? Oi(r, o, l) : !!o if (8 & u) for (var c = t.dynamicProps, h = 0; h < c.length; h++) { var d = c[h] if (o[d] !== r[d] && !Ni(l, d)) return !0 } return !1 })(e, t, n) ) { if (r.asyncDep && !r.asyncResolved) return void F(r, t, n) ;((r.next = t), r.update()) } else ((t.el = e.el), (r.vnode = t)) }, D = function (e, t, n, r, i, a, o) { var s = function () { if (e.isMounted) { var u = e.next, l = e.bu, c = e.u, d = e.parent, f = e.vnode, p = bi(e) if (p) return ( u && ((u.el = f.el), F(e, u, o)), void p.asyncDep.then(function () { e.isUnmounted || s() }) ) var v, g = u ;(yi(e, !1), u ? ((u.el = f.el), F(e, u, o)) : (u = f), l && me(l), (v = u.props && u.props.onVnodeBeforeUpdate) && la(v, d, u, f), yi(e, !0)) var y = Pi(e), _ = e.subTree ;((e.subTree = y), m(_, y, h(_.el), K(_), e, i, a), (u.el = y.el), null === g && (function (e, t) { var n = e.vnode, r = e.parent for (; r; ) { var i = r.subTree if ( (i.suspense && i.suspense.activeBranch === n && (i.el = n.el), i !== n) ) break ;(((n = r.vnode).el = t), (r = r.parent)) } })(e, y.el), c && vi(c, i), (v = u.props && u.props.onVnodeUpdated) && vi(function () { return la(v, d, u, f) }, i)) } else { var b, x = t, S = (x.el, x.props), A = e.bm, w = e.m, T = e.parent, M = e.root, E = e.type, C = lr(t) ;(yi(e, !1), A && me(A), !C && (b = S && S.onVnodeBeforeMount) && la(b, T, t), yi(e, !0), M.ce && !1 !== M.ce._def.shadowRoot && M.ce._injectChildStyle(E)) var k = (e.subTree = Pi(e)) if ( (m(null, k, n, r, e, i, a), (t.el = k.el), w && vi(w, i), !C && (b = S && S.onVnodeMounted)) ) { var R = t vi(function () { return la(b, T, R) }, i) } ;((256 & t.shapeFlag || (T && lr(T.vnode) && 256 & T.vnode.shapeFlag)) && e.a && vi(e.a, i), (e.isMounted = !0), (t = n = r = null)) } } e.scope.on() var u = (e.effect = new ze(s)) e.scope.off() var l = (e.update = u.run.bind(u)), c = (e.job = u.runIfDirty.bind(u)) ;((c.i = e), (c.id = e.uid), (u.scheduler = function () { return kn(c) }), yi(e, !0), l()) }, F = function (e, t, n) { t.component = e var r = e.vnode.props ;((e.vnode = t), (e.next = null), (function (e, t, n, r) { var i = e.props, a = e.attrs, o = e.vnode.patchFlag, s = Kt(i), u = C(e.propsOptions, 1)[0], l = !1 if (!(r || o > 0) || 16 & o) { var c for (var h in (ai(e, t, i, a) && (l = !0), s)) (t && (X(t, h) || ((c = de(h)) !== h && X(t, c)))) || (u ? !n || (void 0 === n[h] && void 0 === n[c]) || (i[h] = oi(u, s, h, void 0, e, !0)) : delete i[h]) if (a !== s) for (var d in a) (t && X(t, d)) || (delete a[d], (l = !0)) } else if (8 & o) for (var f = e.vnode.dynamicProps, p = 0; p < f.length; p++) { var v = f[p] if (!Ni(e.emitsOptions, v)) { var m = t[v] if (u) if (X(a, v)) m !== a[v] && ((a[v] = m), (l = !0)) else { var g = ce(v) i[g] = oi(u, s, g, m, e, !1) } else m !== a[v] && ((a[v] = m), (l = !0)) } } l && ht(e.attrs, 'set', '') })(e, t.props, r, n), (function (e, t, n) { var r = e.vnode, i = e.slots, a = !0, o = E if (32 & r.shapeFlag) { var s = t._ ;(s ? n && 1 === s ? (a = !1) : pi(i, t, n) : ((a = !t.$stable), di(t, i)), (o = t)) } else t && (fi(e, t), (o = { default: 1 })) if (a) for (var u in i) ci(u) || null != o[u] || delete i[u] })(e, t.children, n), $e(), In(e), et()) }, U = function (e, t, n, r, i, a, o, s) { var u = arguments.length > 8 && void 0 !== arguments[8] && arguments[8], l = e && e.children, h = e ? e.shapeFlag : 0, d = t.children, f = t.patchFlag, p = t.shapeFlag if (f > 0) { if (128 & f) return void V(l, d, n, r, i, a, o, s, u) if (256 & f) return void z(l, d, n, r, i, a, o, s, u) } 8 & p ? (16 & h && q(l, i, a), d !== l && c(n, d)) : 16 & h ? 16 & p ? V(l, d, n, r, i, a, o, s, u) : q(l, i, a, !0) : (8 & h && c(n, ''), 16 & p && T(d, n, r, i, a, o, s, u)) }, z = function (e, t, n, r, i, a, o, s, u) { t = t || O var l, c = (e = e || O).length, h = t.length, d = Math.min(c, h) for (l = 0; l < d; l++) { var f = (t[l] = u ? sa(t[l]) : oa(t[l])) m(e[l], f, n, null, i, a, o, s, u) } c > h ? q(e, i, a, !0, !1, d) : T(t, n, r, i, a, o, s, u, d) }, V = function (e, t, n, r, i, a, o, s, u) { for (var l = 0, c = t.length, h = e.length - 1, d = c - 1; l <= h && l <= d; ) { var f = e[l], p = (t[l] = u ? sa(t[l]) : oa(t[l])) if (!Zi(f, p)) break ;(m(f, p, n, null, i, a, o, s, u), l++) } for (; l <= h && l <= d; ) { var v = e[h], g = (t[d] = u ? sa(t[d]) : oa(t[d])) if (!Zi(v, g)) break ;(m(v, g, n, null, i, a, o, s, u), h--, d--) } if (l > h) { if (l <= d) for (var y = d + 1, _ = y < c ? t[y].el : r; l <= d; ) (m(null, (t[l] = u ? sa(t[l]) : oa(t[l])), n, _, i, a, o, s, u), l++) } else if (l > d) for (; l <= h; ) (W(e[l], i, a, !0), l++) else { var b, x = l, S = l, A = new Map() for (l = S; l <= d; l++) { var w = (t[l] = u ? sa(t[l]) : oa(t[l])) null != w.key && A.set(w.key, l) } var T = 0, M = d - S + 1, E = !1, C = 0, k = new Array(M) for (l = 0; l < M; l++) k[l] = 0 for (l = x; l <= h; l++) { var R = e[l] if (T >= M) W(R, i, a, !0) else { var I = void 0 if (null != R.key) I = A.get(R.key) else for (b = S; b <= d; b++) if (0 === k[b - S] && Zi(R, t[b])) { I = b break } void 0 === I ? W(R, i, a, !0) : ((k[I - S] = l + 1), I >= C ? (C = I) : (E = !0), m(R, t[I], n, null, i, a, o, s, u), T++) } } var N = E ? (function (e) { var t, n, r, i, a, o = e.slice(), s = [0], u = e.length for (t = 0; t < u; t++) { var l = e[t] if (0 !== l) { if (e[(n = s[s.length - 1])] < l) { ;((o[t] = n), s.push(t)) continue } for (r = 0, i = s.length - 1; r < i; ) e[s[(a = (r + i) >> 1)]] < l ? (r = a + 1) : (i = a) l < e[s[r]] && (r > 0 && (o[t] = s[r - 1]), (s[r] = t)) } } ;((r = s.length), (i = s[r - 1])) for (; r-- > 0; ) ((s[r] = i), (i = o[i])) return s })(k) : O for (b = N.length - 1, l = M - 1; l >= 0; l--) { var P = S + l, L = t[P], D = P + 1 < c ? t[P + 1].el : r 0 === k[l] ? m(null, L, n, D, i, a, o, s, u) : E && (b < 0 || l !== N[b] ? H(L, n, D, 2) : b--) } } }, H = function (e, t, n, a) { var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null, s = e.el, u = e.type, l = e.transition, c = e.children, h = e.shapeFlag if (6 & h) H(e.component.subTree, t, n, a) else if (128 & h) e.suspense.move(t, n, a) else if (64 & h) u.move(e, t, n, $) else if (u !== Bi) { if (u !== Vi) if (2 !== a && 1 & h && l) if (0 === a) (l.beforeEnter(s), r(s, t, n), vi(function () { return l.enter(s) }, o)) else { var d = l.leave, f = l.delayLeave, p = l.afterLeave, v = function () { e.ctx.isUnmounted ? i(s) : r(s, t, n) }, m = function () { d(s, function () { ;(v(), p && p()) }) } f ? f(s, v, m) : m() } else r(s, t, n) else b(e, t, n) } else { r(s, t, n) for (var g = 0; g < c.length; g++) H(c[g], t, n, a) r(e.anchor, t, n) } }, W = function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a = e.type, o = e.props, s = e.ref, u = e.children, l = e.dynamicChildren, c = e.shapeFlag, h = e.patchFlag, d = e.dirs, f = e.cacheIndex if ( (-2 === h && (i = !1), null != s && ($e(), ur(s, null, n, e, !0), et()), null != f && (t.renderCache[f] = void 0), 256 & c) ) t.ctx.deactivate(e) else { var p, v = 1 & c && d, m = !lr(e) if ((m && (p = o && o.onVnodeBeforeUnmount) && la(p, t, e), 6 & c)) Q(e.component, n, r) else { if (128 & c) return void e.suspense.unmount(n, r) ;(v && zn(e, null, t, 'beforeUnmount'), 64 & c ? e.type.remove(e, t, n, $, r) : l && !l.hasOnce && (a !== Bi || (h > 0 && 64 & h)) ? q(l, t, n, !1, !0) : ((a === Bi && 384 & h) || (!i && 16 & c)) && q(u, t, n), r && G(e)) } ;((m && (p = o && o.onVnodeUnmounted)) || v) && vi(function () { ;(p && la(p, t, e), v && zn(e, null, t, 'unmounted')) }, n) } }, G = function (e) { var t = e.type, n = e.el, r = e.anchor, a = e.transition if (t !== Bi) if (t !== Vi) { var o = function () { ;(i(n), a && !a.persisted && a.afterLeave && a.afterLeave()) } if (1 & e.shapeFlag && a && !a.persisted) { var s = a.leave, u = a.delayLeave, l = function () { return s(n, o) } u ? u(e.el, o, l) : l() } else o() } else x(e) else j(n, r) }, j = function (e, t) { for (var n; e !== t; ) ((n = d(e)), i(e), (e = n)) i(t) }, Q = function (e, t, n) { var r = e.bum, i = e.scope, a = e.job, o = e.subTree, s = e.um, u = e.m, l = e.a, c = e.parent, h = e.slots.__ ;(xi(u), xi(l), r && me(r), c && Y(h) && h.forEach(function (e) { c.renderCache[e] = void 0 }), i.stop(), a && ((a.flags |= 8), W(o, e, t, n)), s && vi(s, t), vi(function () { e.isUnmounted = !0 }, t), t && t.pendingBranch && !t.isUnmounted && e.asyncDep && !e.asyncResolved && e.suspenseId === t.pendingId && (t.deps--, 0 === t.deps && t.resolve())) }, q = function (e, t, n) { for ( var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0; a < e.length; a++ ) W(e[a], t, n, r, i) }, K = function (e) { if (6 & e.shapeFlag) return K(e.component.subTree) if (128 & e.shapeFlag) return e.suspense.next() var t = d(e.anchor || e.el), n = t && t[Vn] return n ? d(n) : t }, Z = !1, J = function (e, t, n) { ;(null == e ? t._vnode && W(t._vnode, null, null, !0) : m(t._vnode || null, e, t, null, null, null, n), (t._vnode = e), Z || ((Z = !0), In(), Nn(), (Z = !1))) }, $ = { p: m, um: W, m: H, r: G, mt: P, mc: T, pc: U, pbc: k, n: K, o: e } return { render: J, hydrate: n, createApp: Zr(J) } })(e) } function gi(e, t) { var n = e.type, r = e.props return ('svg' === t && 'foreignObject' === n) || ('mathml' === t && 'annotation-xml' === n && r && r.encoding && r.encoding.includes('html')) ? void 0 : t } function yi(e, t) { var n = e.effect, r = e.job t ? ((n.flags |= 32), (r.flags |= 4)) : ((n.flags &= -33), (r.flags &= -5)) } function _i(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = e.children, i = t.children if (Y(r) && Y(i)) for (var a = 0; a < r.length; a++) { var o = r[a], s = i[a] ;(1 & s.shapeFlag && !s.dynamicChildren && ((s.patchFlag <= 0 || 32 === s.patchFlag) && ((s = i[a] = sa(i[a])).el = o.el), n || -2 === s.patchFlag || _i(o, s)), s.type === Ui && (s.el = o.el), s.type !== zi || s.el || (s.el = o.el)) } } function bi(e) { var t = e.subTree.component if (t) return t.asyncDep && !t.asyncResolved ? t : bi(t) } function xi(e) { if (e) for (var t = 0; t < e.length; t++) e[t].flags |= 8 } var Si = Symbol.for('v-scx'), Ai = function () { return ei(Si) } function wi(e, t) { return Mi(e, null, t) } function Ti(e, t, n) { return Mi(e, t, n) } function Mi(e, t) { var n, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : E, i = r.immediate, a = (r.deep, r.flush), o = (r.once, j({}, r)), s = (t && i) || (!t && 'post' !== a) if (xa) if ('sync' === a) { var u = Ai() n = u.__watcherHandles || (u.__watcherHandles = []) } else if (!s) { var l = function () {} return ((l.stop = B), (l.resume = B), (l.pause = B), l) } var c = pa o.call = function (e, t, n) { return _n(e, c, t, n) } var h = !1 ;('post' === a ? (o.scheduler = function (e) { vi(e, c && c.suspense) }) : 'sync' !== a && ((h = !0), (o.scheduler = function (e, t) { t ? e() : kn(e) })), (o.augmentJob = function (e) { ;(t && (e.flags |= 4), h && ((e.flags |= 2), c && ((e.id = c.uid), (e.i = c)))) })) var d = mn(e, t, o) return (xa && (n ? n.push(d) : s && d()), d) } function Ei(e, t, n) { var r, i = this.proxy, a = $(e) ? e.includes('.') ? Ci(i, e) : function () { return i[e] } : e.bind(i, i) J(t) ? (r = t) : ((r = t.handler), (n = t)) var o = ya(this), s = Mi(a, r.bind(i), n) return (o(), s) } function Ci(e, t) { var n = t.split('.') return function () { for (var t = e, r = 0; r < n.length && t; r++) t = t[n[r]] return t } } var ki = function (e, t) { return 'modelValue' === t || 'model-value' === t ? e.modelModifiers : e[''.concat(t, 'Modifiers')] || e[''.concat(ce(t), 'Modifiers')] || e[''.concat(de(t), 'Modifiers')] } function Ri(e, t) { if (!e.isUnmounted) { for ( var n = e.vnode.props || E, r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), a = 2; a < r; a++ ) i[a - 2] = arguments[a] var o, s = i, u = t.startsWith('update:'), l = u && ki(n, t.slice(7)) l && (l.trim && (s = i.map(function (e) { return $(e) ? e.trim() : e })), l.number && (s = i.map(ye))) var c = n[(o = pe(t))] || n[(o = pe(ce(t)))] ;(!c && u && (c = n[(o = pe(de(t)))]), c && _n(c, e, 6, s)) var h = n[o + 'Once'] if (h) { if (e.emitted) { if (e.emitted[o]) return } else e.emitted = {} ;((e.emitted[o] = !0), _n(h, e, 6, s)) } } } function Ii(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = t.emitsCache, i = r.get(e) if (void 0 !== i) return i var a = e.emits, o = {}, s = !1 if (!J(e)) { var u = function (e) { var n = Ii(e, t, !0) n && ((s = !0), j(o, n)) } ;(!n && t.mixins.length && t.mixins.forEach(u), e.extends && u(e.extends), e.mixins && e.mixins.forEach(u)) } return a || s ? (Y(a) ? a.forEach(function (e) { return (o[e] = null) }) : j(o, a), te(e) && r.set(e, o), o) : (te(e) && r.set(e, null), null) } function Ni(e, t) { return ( !(!e || !W(t)) && ((t = t.slice(2).replace(/Once$/, '')), X(e, t[0].toLowerCase() + t.slice(1)) || X(e, de(t)) || X(e, t)) ) } function Pi(e) { var t, n, r = e.type, i = e.vnode, a = e.proxy, o = e.withProxy, s = C(e.propsOptions, 1)[0], u = e.slots, l = e.attrs, c = e.emit, h = e.render, d = e.renderCache, f = e.props, p = e.data, v = e.setupState, m = e.ctx, g = e.inheritAttrs, y = Fn(e) try { if (4 & i.shapeFlag) { var _ = o || a, b = _ ;((t = oa(h.call(b, _, d, f, v, p, m))), (n = l)) } else { var x = r ;(0, (t = oa(x.length > 1 ? x(f, { attrs: l, slots: u, emit: c }) : x(f, null))), (n = r.props ? l : Li(l))) } } catch (T) { ;((Hi.length = 0), bn(T, e, 1), (t = ta(zi))) } var S = t if (n && !1 !== g) { var A = Object.keys(n), w = S.shapeFlag A.length && 7 & w && (s && A.some(G) && (n = Di(n, s)), (S = na(S, n, !1, !0))) } return ( i.dirs && ((S = na(S, null, !1, !0)).dirs = S.dirs ? S.dirs.concat(i.dirs) : i.dirs), i.transition && rr(S, i.transition), (t = S), Fn(y), t ) } var Li = function (e) { var t for (var n in e) ('class' === n || 'style' === n || W(n)) && ((t || (t = {}))[n] = e[n]) return t }, Di = function (e, t) { var n = {} for (var r in e) (G(r) && r.slice(9) in t) || (n[r] = e[r]) return n } function Oi(e, t, n) { var r = Object.keys(t) if (r.length !== Object.keys(e).length) return !0 for (var i = 0; i < r.length; i++) { var a = r[i] if (t[a] !== e[a] && !Ni(n, a)) return !0 } return !1 } var Fi = function (e) { return e.__isSuspense } var Bi = Symbol.for('v-fgt'), Ui = Symbol.for('v-txt'), zi = Symbol.for('v-cmt'), Vi = Symbol.for('v-stc'), Hi = [], Wi = null function Gi() { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] Hi.push((Wi = e ? null : [])) } var ji = 1 function Qi(e) { ;((ji += e), e < 0 && Wi && arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && (Wi.hasOnce = !0)) } function qi(e) { return ( (e.dynamicChildren = ji > 0 ? Wi || O : null), Hi.pop(), (Wi = Hi[Hi.length - 1] || null), ji > 0 && Wi && Wi.push(e), e ) } function Xi(e, t, n, r, i, a) { return qi(ea(e, t, n, r, i, a, !0)) } function Yi(e, t, n, r, i) { return qi(ta(e, t, n, r, i, !0)) } function Ki(e) { return !!e && !0 === e.__v_isVNode } function Zi(e, t) { return e.type === t.type && e.key === t.key } var Ji = function (e) { var t = e.key return null != t ? t : null }, $i = function (e) { var t = e.ref, n = e.ref_key, r = e.ref_for return ( 'number' == typeof t && (t = '' + t), null != t ? ($(t) || en(t) || J(t) ? { i: Dn, r: t, k: n, f: !!r } : t) : null ) } function ea(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null, a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : e === Bi ? 0 : 1, o = arguments.length > 6 && void 0 !== arguments[6] && arguments[6], s = arguments.length > 7 && void 0 !== arguments[7] && arguments[7], u = { __v_isVNode: !0, __v_skip: !0, type: e, props: t, key: t && Ji(t), ref: t && $i(t), scopeId: On, slotScopeIds: null, children: n, component: null, suspense: null, ssContent: null, ssFallback: null, dirs: null, transition: null, el: null, anchor: null, target: null, targetStart: null, targetAnchor: null, staticCount: 0, shapeFlag: a, patchFlag: r, dynamicProps: i, dynamicChildren: null, appContext: null, ctx: Dn, } return ( s ? (ua(u, n), 128 & a && e.normalize(u)) : n && (u.shapeFlag |= $(n) ? 8 : 16), ji > 0 && !o && Wi && (u.patchFlag > 0 || 6 & a) && 32 !== u.patchFlag && Wi.push(u), u ) } var ta = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null, a = arguments.length > 5 && void 0 !== arguments[5] && arguments[5] ;(e && e !== Cr) || (e = zi) if (Ki(e)) { var o = na(e, t, !0) return ( n && ua(o, n), ji > 0 && !a && Wi && (6 & o.shapeFlag ? (Wi[Wi.indexOf(e)] = o) : Wi.push(o)), (o.patchFlag = -2), o ) } ;((s = e), J(s) && '__vccOpts' in s && (e = e.__vccOpts)) var s if (t) { var u = (t = (function (e) { return e ? (Yt(e) || ri(e) ? j({}, e) : e) : null })(t)), l = u.class, c = u.style ;(l && !$(l) && (t.class = Te(l)), te(c) && (Yt(c) && !Y(c) && (c = j({}, c)), (t.style = be(c)))) } var h = $(e) ? 1 : Fi(e) ? 128 : (function (e) { return e.__isTeleport })(e) ? 64 : te(e) ? 4 : J(e) ? 2 : 0 return ea(e, t, n, r, i, h, a, !0) } function na(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = e.props, a = e.ref, o = e.patchFlag, s = e.children, u = e.transition, l = t ? (function () { for (var e = {}, t = 0; t < arguments.length; t++) { var n = t < 0 || arguments.length <= t ? void 0 : arguments[t] for (var r in n) if ('class' === r) e.class !== n.class && (e.class = Te([e.class, n.class])) else if ('style' === r) e.style = be([e.style, n.style]) else if (W(r)) { var i = e[r], a = n[r] !a || i === a || (Y(i) && i.includes(a)) || (e[r] = i ? [].concat(i, a) : a) } else '' !== r && (e[r] = n[r]) } return e })(i || {}, t) : i, c = { __v_isVNode: !0, __v_skip: !0, type: e.type, props: l, key: l && Ji(l), ref: t && t.ref ? (n && a ? (Y(a) ? a.concat($i(t)) : [a, $i(t)]) : $i(t)) : a, scopeId: e.scopeId, slotScopeIds: e.slotScopeIds, children: s, target: e.target, targetStart: e.targetStart, targetAnchor: e.targetAnchor, staticCount: e.staticCount, shapeFlag: e.shapeFlag, patchFlag: t && e.type !== Bi ? (-1 === o ? 16 : 16 | o) : o, dynamicProps: e.dynamicProps, dynamicChildren: e.dynamicChildren, appContext: e.appContext, dirs: e.dirs, transition: u, component: e.component, suspense: e.suspense, ssContent: e.ssContent && na(e.ssContent), ssFallback: e.ssFallback && na(e.ssFallback), el: e.el, anchor: e.anchor, ctx: e.ctx, ce: e.ce, } return (u && r && rr(c, u.clone(c)), c) } function ra() { return ta( Ui, null, arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ' ', arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 ) } function ia(e, t) { var n = ta(Vi, null, e) return ((n.staticCount = t), n) } function aa() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '' return arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ? (Gi(), Yi(zi, null, e)) : ta(zi, null, e) } function oa(e) { return null == e || 'boolean' == typeof e ? ta(zi) : Y(e) ? ta(Bi, null, e.slice()) : Ki(e) ? sa(e) : ta(Ui, null, String(e)) } function sa(e) { return (null === e.el && -1 !== e.patchFlag) || e.memo ? e : na(e) } function ua(e, t) { var n = 0, r = e.shapeFlag if (null == t) t = null else if (Y(t)) n = 16 else if ('object' === P(t)) { if (65 & r) { var i = t.default return void (i && (i._c && (i._d = !1), ua(e, i()), i._c && (i._d = !0))) } n = 32 var a = t._ a || ri(t) ? 3 === a && Dn && (1 === Dn.slots._ ? (t._ = 1) : ((t._ = 2), (e.patchFlag |= 1024))) : (t._ctx = Dn) } else J(t) ? ((t = { default: t, _ctx: Dn }), (n = 32)) : ((t = String(t)), 64 & r ? ((n = 16), (t = [ra(t)])) : (n = 8)) ;((e.children = t), (e.shapeFlag |= n)) } function la(e, t, n) { _n(e, t, 7, [n, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null]) } var ca = Yr(), ha = 0 var da, fa, pa = null, va = function () { return pa || Dn }, ma = _e(), ga = function (e, t) { var n return ( (n = ma[e]) || (n = ma[e] = []), n.push(t), function (e) { n.length > 1 ? n.forEach(function (t) { return t(e) }) : n[0](e) } ) } ;((da = ga('__VUE_INSTANCE_SETTERS__', function (e) { return (pa = e) })), (fa = ga('__VUE_SSR_SETTERS__', function (e) { return (xa = e) }))) var ya = function (e) { var t = pa return ( da(e), e.scope.on(), function () { ;(e.scope.off(), da(t)) } ) }, _a = function () { ;(pa && pa.scope.off(), da(null)) } function ba(e) { return 4 & e.vnode.shapeFlag } var xa = !1 function Sa(e, t, n) { ;(J(t) ? e.type.__ssrInlineRender ? (e.ssrRender = t) : (e.render = t) : te(t) && (e.setupState = un(t)), Aa(e)) } function Aa(e, t, n) { var r = e.type e.render || (e.render = r.render || B) var i = ya(e) $e() try { Br(e) } finally { ;(et(), i()) } } var wa = { get: function (e, t) { return (ct(e, 0, ''), e[t]) }, } function Ta(e) { return e.exposed ? e.exposeProxy || (e.exposeProxy = new Proxy(un(Zt(e.exposed)), { get: function (t, n) { return n in t ? t[n] : n in Pr ? Pr[n](e) : void 0 }, has: function (e, t) { return t in e || t in Pr }, })) : e.proxy } function Ma(e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] return J(e) ? e.displayName || e.name : e.name || (t && e.__name) } var Ea = function (e, t) { var n = (function (e, t) { var n, r, i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] return (J(e) ? (n = e) : ((n = e.get), (r = e.set)), new dn(n, r, i)) })(e, t, xa) return n } function Ca(e, t, n) { var r = arguments.length return 2 === r ? te(t) && !Y(t) ? Ki(t) ? ta(e, null, [t]) : ta(e, t) : ta(e, null, t) : (r > 3 ? (n = Array.prototype.slice.call(arguments, 2)) : 3 === r && Ki(n) && (n = [n]), ta(e, t, n)) } var ka = '3.5.17', Ra = void 0, Ia = 'undefined' != typeof window && window.trustedTypes /** * @vue/runtime-dom v3.5.17 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ if (Ia) try { Ra = Ia.createPolicy('vue', { createHTML: function (e) { return e }, }) } catch (ZJ) {} var Na = Ra ? function (e) { return Ra.createHTML(e) } : function (e) { return e }, Pa = 'undefined' != typeof document ? document : null, La = Pa && Pa.createElement('template'), Da = { insert: function (e, t, n) { t.insertBefore(e, n || null) }, remove: function (e) { var t = e.parentNode t && t.removeChild(e) }, createElement: function (e, t, n, r) { var i = 'svg' === t ? Pa.createElementNS('http://www.w3.org/2000/svg', e) : 'mathml' === t ? Pa.createElementNS('http://www.w3.org/1998/Math/MathML', e) : n ? Pa.createElement(e, { is: n }) : Pa.createElement(e) return ( 'select' === e && r && null != r.multiple && i.setAttribute('multiple', r.multiple), i ) }, createText: function (e) { return Pa.createTextNode(e) }, createComment: function (e) { return Pa.createComment(e) }, setText: function (e, t) { e.nodeValue = t }, setElementText: function (e, t) { e.textContent = t }, parentNode: function (e) { return e.parentNode }, nextSibling: function (e) { return e.nextSibling }, querySelector: function (e) { return Pa.querySelector(e) }, setScopeId: function (e, t) { e.setAttribute(t, '') }, insertStaticContent: function (e, t, n, r, i, a) { var o = n ? n.previousSibling : t.lastChild if (i && (i === a || i.nextSibling)) for (; t.insertBefore(i.cloneNode(!0), n), i !== a && (i = i.nextSibling); ); else { La.innerHTML = Na( 'svg' === r ? ''.concat(e, '') : 'mathml' === r ? ''.concat(e, '') : e ) var s = La.content if ('svg' === r || 'mathml' === r) { for (var u = s.firstChild; u.firstChild; ) s.appendChild(u.firstChild) s.removeChild(u) } t.insertBefore(s, n) } return [o ? o.nextSibling : t.firstChild, n ? n.previousSibling : t.lastChild] }, }, Oa = 'transition', Fa = 'animation', Ba = Symbol('_vtc'), Ua = { name: String, type: String, css: { type: Boolean, default: !0 }, duration: [String, Number, Object], enterFromClass: String, enterActiveClass: String, enterToClass: String, appearFromClass: String, appearActiveClass: String, appearToClass: String, leaveFromClass: String, leaveActiveClass: String, leaveToClass: String, }, za = j({}, tr, Ua), Va = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [] Y(e) ? e.forEach(function (e) { return e.apply(void 0, I(t)) }) : e && e.apply(void 0, I(t)) }, Ha = function (e) { return ( !!e && (Y(e) ? e.some(function (e) { return e.length > 1 }) : e.length > 1) ) } function Wa(e) { var t = {} for (var n in e) n in Ua || (t[n] = e[n]) if (!1 === e.css) return t var r = e.name, i = void 0 === r ? 'v' : r, a = e.type, o = e.duration, s = e.enterFromClass, u = void 0 === s ? ''.concat(i, '-enter-from') : s, l = e.enterActiveClass, c = void 0 === l ? ''.concat(i, '-enter-active') : l, h = e.enterToClass, d = void 0 === h ? ''.concat(i, '-enter-to') : h, f = e.appearFromClass, p = void 0 === f ? u : f, v = e.appearActiveClass, m = void 0 === v ? c : v, g = e.appearToClass, y = void 0 === g ? d : g, _ = e.leaveFromClass, b = void 0 === _ ? ''.concat(i, '-leave-from') : _, x = e.leaveActiveClass, S = void 0 === x ? ''.concat(i, '-leave-active') : x, A = e.leaveToClass, w = void 0 === A ? ''.concat(i, '-leave-to') : A, T = (function (e) { if (null == e) return null if (te(e)) return [Ga(e.enter), Ga(e.leave)] var t = Ga(e) return [t, t] })(o), M = T && T[0], E = T && T[1], C = t.onBeforeEnter, k = t.onEnter, R = t.onEnterCancelled, I = t.onLeave, N = t.onLeaveCancelled, P = t.onBeforeAppear, L = void 0 === P ? C : P, D = t.onAppear, O = void 0 === D ? k : D, F = t.onAppearCancelled, B = void 0 === F ? R : F, U = function (e, t, n, r) { ;((e._enterCancelled = r), Qa(e, t ? y : d), Qa(e, t ? m : c), n && n()) }, z = function (e, t) { ;((e._isLeaving = !1), Qa(e, b), Qa(e, w), Qa(e, S), t && t()) }, V = function (e) { return function (t, n) { var r = e ? O : k, i = function () { return U(t, e, n) } ;(Va(r, [t, i]), qa(function () { ;(Qa(t, e ? p : u), ja(t, e ? y : d), Ha(r) || Ya(t, a, M, i)) })) } } return j(t, { onBeforeEnter: function (e) { ;(Va(C, [e]), ja(e, u), ja(e, c)) }, onBeforeAppear: function (e) { ;(Va(L, [e]), ja(e, p), ja(e, m)) }, onEnter: V(!1), onAppear: V(!0), onLeave: function (e, t) { e._isLeaving = !0 var n = function () { return z(e, t) } ;(ja(e, b), e._enterCancelled ? (ja(e, S), $a()) : ($a(), ja(e, S)), qa(function () { e._isLeaving && (Qa(e, b), ja(e, w), Ha(I) || Ya(e, a, E, n)) }), Va(I, [e, n])) }, onEnterCancelled: function (e) { ;(U(e, !1, void 0, !0), Va(R, [e])) }, onAppearCancelled: function (e) { ;(U(e, !0, void 0, !0), Va(B, [e])) }, onLeaveCancelled: function (e) { ;(z(e), Va(N, [e])) }, }) } function Ga(e) { var t = (function (e) { var t = $(e) ? Number(e) : NaN return isNaN(t) ? e : t })(e) return t } function ja(e, t) { ;(t.split(/\s+/).forEach(function (t) { return t && e.classList.add(t) }), (e[Ba] || (e[Ba] = new Set())).add(t)) } function Qa(e, t) { t.split(/\s+/).forEach(function (t) { return t && e.classList.remove(t) }) var n = e[Ba] n && (n.delete(t), n.size || (e[Ba] = void 0)) } function qa(e) { requestAnimationFrame(function () { requestAnimationFrame(e) }) } var Xa = 0 function Ya(e, t, n, r) { var i = (e._endId = ++Xa), a = function () { i === e._endId && r() } if (null != n) return setTimeout(a, n) var o = Ka(e, t), s = o.type, u = o.timeout, l = o.propCount if (!s) return r() var c = s + 'end', h = 0, d = function () { ;(e.removeEventListener(c, f), a()) }, f = function (t) { t.target === e && ++h >= l && d() } ;(setTimeout(function () { h < l && d() }, u + 1), e.addEventListener(c, f)) } function Ka(e, t) { var n = window.getComputedStyle(e), r = function (e) { return (n[e] || '').split(', ') }, i = r(''.concat(Oa, 'Delay')), a = r(''.concat(Oa, 'Duration')), o = Za(i, a), s = r(''.concat(Fa, 'Delay')), u = r(''.concat(Fa, 'Duration')), l = Za(s, u), c = null, h = 0, d = 0 return ( t === Oa ? o > 0 && ((c = Oa), (h = o), (d = a.length)) : t === Fa ? l > 0 && ((c = Fa), (h = l), (d = u.length)) : (d = (c = (h = Math.max(o, l)) > 0 ? (o > l ? Oa : Fa) : null) ? c === Oa ? a.length : u.length : 0), { type: c, timeout: h, propCount: d, hasTransform: c === Oa && /\b(transform|all)(,|$)/.test(r(''.concat(Oa, 'Property')).toString()), } ) } function Za(e, t) { for (; e.length < t.length; ) e = e.concat(e) return Math.max.apply( Math, I( t.map(function (t, n) { return Ja(t) + Ja(e[n]) }) ) ) } function Ja(e) { return 'auto' === e ? 0 : 1e3 * Number(e.slice(0, -1).replace(',', '.')) } function $a() { return document.body.offsetHeight } var eo = Symbol('_vod'), to = Symbol('_vsh'), no = { beforeMount: function (e, t, n) { var r = t.value, i = n.transition ;((e[eo] = 'none' === e.style.display ? '' : e.style.display), i && r ? i.beforeEnter(e) : ro(e, r)) }, mounted: function (e, t, n) { var r = t.value, i = n.transition i && r && i.enter(e) }, updated: function (e, t, n) { var r = t.value, i = t.oldValue, a = n.transition !r != !i && (a ? r ? (a.beforeEnter(e), ro(e, !0), a.enter(e)) : a.leave(e, function () { ro(e, !1) }) : ro(e, r)) }, beforeUnmount: function (e, t) { ro(e, t.value) }, } function ro(e, t) { ;((e.style.display = t ? e[eo] : 'none'), (e[to] = !t)) } var io = Symbol(''), ao = /(^|;)\s*display\s*:/ var oo = /\s*!important$/ function so(e, t, n) { if (Y(n)) n.forEach(function (n) { return so(e, t, n) }) else if ((null == n && (n = ''), t.startsWith('--'))) e.setProperty(t, n) else { var r = (function (e, t) { var n = lo[t] if (n) return n var r = ce(t) if ('filter' !== r && r in e) return (lo[t] = r) r = fe(r) for (var i = 0; i < uo.length; i++) { var a = uo[i] + r if (a in e) return (lo[t] = a) } return t })(e, t) oo.test(n) ? e.setProperty(de(r), n.replace(oo, ''), 'important') : (e[r] = n) } } var uo = ['Webkit', 'Moz', 'ms'], lo = {} var co = 'http://www.w3.org/1999/xlink' function ho(e, t, n, r, i) { var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Me(t) r && t.startsWith('xlink:') ? null == n ? e.removeAttributeNS(co, t.slice(6, t.length)) : e.setAttributeNS(co, t, n) : null == n || (a && !Ee(n)) ? e.removeAttribute(t) : e.setAttribute(t, a ? '' : ee(n) ? String(n) : n) } function fo(e, t, n, r, i) { if ('innerHTML' !== t && 'textContent' !== t) { var a = e.tagName if ('value' === t && 'PROGRESS' !== a && !a.includes('-')) { var o = 'OPTION' === a ? e.getAttribute('value') || '' : e.value, s = null == n ? ('checkbox' === e.type ? 'on' : '') : String(n) return ( (o === s && '_value' in e) || (e.value = s), null == n && e.removeAttribute(t), void (e._value = n) ) } var u = !1 if ('' === n || null == n) { var l = P(e[t]) 'boolean' === l ? (n = Ee(n)) : null == n && 'string' === l ? ((n = ''), (u = !0)) : 'number' === l && ((n = 0), (u = !0)) } try { e[t] = n } catch (ZJ) {} u && e.removeAttribute(i || t) } else null != n && (e[t] = 'innerHTML' === t ? Na(n) : n) } var po = Symbol('_vei') function vo(e, t, n, r) { var i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : null, a = e[po] || (e[po] = {}), o = a[t] if (r && o) o.value = r else { var s = (function (e) { var t if (mo.test(e)) { var n for (t = {}; (n = e.match(mo)); ) ((e = e.slice(0, e.length - n[0].length)), (t[n[0].toLowerCase()] = !0)) } var r = ':' === e[2] ? e.slice(3) : de(e.slice(2)) return [r, t] })(t), u = C(s, 2), l = u[0], c = u[1] if (r) { var h = (a[t] = (function (e, t) { var n = function (e) { if (e._vts) { if (e._vts <= n.attached) return } else e._vts = Date.now() _n( (function (e, t) { if (Y(t)) { var n = e.stopImmediatePropagation return ( (e.stopImmediatePropagation = function () { ;(n.call(e), (e._stopped = !0)) }), t.map(function (e) { return function (t) { return !t._stopped && e && e(t) } }) ) } return t })(e, n.value), t, 5, [e] ) } return ((n.value = e), (n.attached = _o()), n) })(r, i)) !(function (e, t, n, r) { e.addEventListener(t, n, r) })(e, l, h, c) } else o && (!(function (e, t, n, r) { e.removeEventListener(t, n, r) })(e, l, o, c), (a[t] = void 0)) } } var mo = /(?:Once|Passive|Capture)$/ var go = 0, yo = Promise.resolve(), _o = function () { return ( go || (yo.then(function () { return (go = 0) }), (go = Date.now())) ) } var bo = function (e) { return ( 111 === e.charCodeAt(0) && 110 === e.charCodeAt(1) && e.charCodeAt(2) > 96 && e.charCodeAt(2) < 123 ) } var xo = new WeakMap(), So = new WeakMap(), Ao = Symbol('_moveCb'), wo = Symbol('_enterCb'), To = function (e) { return (delete e.props.mode, e) }, Mo = To({ name: 'TransitionGroup', props: j({}, za, { tag: String, moveClass: String }), setup: function (e, t) { var n, r, i = t.slots, a = va(), o = (function () { var e = { isMounted: !1, isLeaving: !1, isUnmounting: !1, leavingVNodes: new Map(), } return ( yr(function () { e.isMounted = !0 }), xr(function () { e.isUnmounting = !0 }), e ) })() return ( br(function () { if (n.length) { var t = e.moveClass || ''.concat(e.name || 'v', '-move') if ( (function (e, t, n) { var r = e.cloneNode(), i = e[Ba] i && i.forEach(function (e) { e.split(/\s+/).forEach(function (e) { return e && r.classList.remove(e) }) }) ;(n.split(/\s+/).forEach(function (e) { return e && r.classList.add(e) }), (r.style.display = 'none')) var a = 1 === t.nodeType ? t : t.parentNode a.appendChild(r) var o = Ka(r).hasTransform return (a.removeChild(r), o) })(n[0].el, a.vnode.el, t) ) { ;(n.forEach(Co), n.forEach(ko)) var r = n.filter(Ro) ;($a(), r.forEach(function (e) { var n = e.el, r = n.style ;(ja(n, t), (r.transform = r.webkitTransform = r.transitionDuration = '')) var i = (n[Ao] = function (e) { ;(e && e.target !== n) || (e && !/transform$/.test(e.propertyName)) || (n.removeEventListener('transitionend', i), (n[Ao] = null), Qa(n, t)) }) n.addEventListener('transitionend', i) }), (n = [])) } else n = [] } }), function () { var t = Kt(e), s = Wa(t), u = t.tag || Bi if (((n = []), r)) for (var l = 0; l < r.length; l++) { var c = r[l] c.el && c.el instanceof Element && (n.push(c), rr(c, nr(c, s, o, a)), xo.set(c, c.el.getBoundingClientRect())) } r = i.default ? ir(i.default()) : [] for (var h = 0; h < r.length; h++) { var d = r[h] null != d.key && rr(d, nr(d, s, o, a)) } return ta(u, null, r) } ) }, }), Eo = Mo function Co(e) { var t = e.el ;(t[Ao] && t[Ao](), t[wo] && t[wo]()) } function ko(e) { So.set(e, e.el.getBoundingClientRect()) } function Ro(e) { var t = xo.get(e), n = So.get(e), r = t.left - n.left, i = t.top - n.top if (r || i) { var a = e.el.style return ( (a.transform = a.webkitTransform = 'translate('.concat(r, 'px,').concat(i, 'px)')), (a.transitionDuration = '0s'), e ) } } var Io, No = ['ctrl', 'shift', 'alt', 'meta'], Po = { stop: function (e) { return e.stopPropagation() }, prevent: function (e) { return e.preventDefault() }, self: function (e) { return e.target !== e.currentTarget }, ctrl: function (e) { return !e.ctrlKey }, shift: function (e) { return !e.shiftKey }, alt: function (e) { return !e.altKey }, meta: function (e) { return !e.metaKey }, left: function (e) { return 'button' in e && 0 !== e.button }, middle: function (e) { return 'button' in e && 1 !== e.button }, right: function (e) { return 'button' in e && 2 !== e.button }, exact: function (e, t) { return No.some(function (n) { return e[''.concat(n, 'Key')] && !t.includes(n) }) }, }, Lo = function (e, t) { var n = e._withMods || (e._withMods = {}), r = t.join('.') return ( n[r] || (n[r] = function (n) { for (var r = 0; r < t.length; r++) { var i = Po[t[r]] if (i && i(n, t)) return } for ( var a = arguments.length, o = new Array(a > 1 ? a - 1 : 0), s = 1; s < a; s++ ) o[s - 1] = arguments[s] return e.apply(void 0, [n].concat(o)) }) ) }, Do = j( { patchProp: function (e, t, n, r, i, a) { var o = 'svg' === i 'class' === t ? (function (e, t, n) { var r = e[Ba] ;(r && (t = (t ? [t].concat(I(r)) : I(r)).join(' ')), null == t ? e.removeAttribute('class') : n ? e.setAttribute('class', t) : (e.className = t)) })(e, r, o) : 'style' === t ? (function (e, t, n) { var r = e.style, i = $(n), a = !1 if (n && !i) { if (t) if ($(t)) { var o, s = L(t.split(';')) try { for (s.s(); !(o = s.n()).done; ) { var u = o.value, l = u.slice(0, u.indexOf(':')).trim() null == n[l] && so(r, l, '') } } catch (f) { s.e(f) } finally { s.f() } } else for (var c in t) null == n[c] && so(r, c, '') for (var h in n) ('display' === h && (a = !0), so(r, h, n[h])) } else if (i) { if (t !== n) { var d = r[io] ;(d && (n += ';' + d), (r.cssText = n), (a = ao.test(n))) } } else t && e.removeAttribute('style') eo in e && ((e[eo] = a ? r.display : ''), e[to] && (r.display = 'none')) })(e, n, r) : W(t) ? G(t) || vo(e, t, n, r, a) : ( '.' === t[0] ? ((t = t.slice(1)), 1) : '^' === t[0] ? ((t = t.slice(1)), 0) : (function (e, t, n, r) { if (r) return ( 'innerHTML' === t || 'textContent' === t || !!(t in e && bo(t) && J(n)) ) if ( 'spellcheck' === t || 'draggable' === t || 'translate' === t || 'autocorrect' === t ) return !1 if ('form' === t) return !1 if ('list' === t && 'INPUT' === e.tagName) return !1 if ('type' === t && 'TEXTAREA' === e.tagName) return !1 if ('width' === t || 'height' === t) { var i = e.tagName if ( 'IMG' === i || 'VIDEO' === i || 'CANVAS' === i || 'SOURCE' === i ) return !1 } if (bo(t) && $(n)) return !1 return t in e })(e, t, r, o) ) ? (fo(e, t, r), e.tagName.includes('-') || ('value' !== t && 'checked' !== t && 'selected' !== t) || ho(e, t, r, o, a, 'value' !== t)) : !e._isVueCE || (!/[A-Z]/.test(t) && $(r)) ? ('true-value' === t ? (e._trueValue = r) : 'false-value' === t && (e._falseValue = r), ho(e, t, r, o)) : fo(e, ce(t), r, 0, t) }, }, Da ) function Oo() { return Io || (Io = mi(Do)) } var Fo, Bo = function () { var e ;(e = Oo()).render.apply(e, arguments) } var Uo, zo, Vo = function (e) { return (Fo = e) }, Ho = Symbol() function Wo(e) { return ( e && 'object' === P(e) && '[object Object]' === Object.prototype.toString.call(e) && 'function' != typeof e.toJSON ) } ;(((zo = Uo || (Uo = {})).direct = 'direct'), (zo.patchObject = 'patch object'), (zo.patchFunction = 'patch function')) var Go = function () {} function jo(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Go e.push(t) var i, a = function () { var n = e.indexOf(t) n > -1 && (e.splice(n, 1), r()) } return (!n && Oe() && ((i = a), Ce && Ce.cleanups.push(i)), a) } function Qo(e) { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r] e.slice().forEach(function (e) { e.apply(void 0, n) }) } var qo = function (e) { return e() }, Xo = Symbol(), Yo = Symbol() function Ko(e, t) { for (var n in (e instanceof Map && t instanceof Map ? t.forEach(function (t, n) { return e.set(n, t) }) : e instanceof Set && t instanceof Set && t.forEach(e.add, e), t)) if (t.hasOwnProperty(n)) { var r = t[n], i = e[n] Wo(i) && Wo(r) && e.hasOwnProperty(n) && !en(r) && !Qt(r) ? (e[n] = Ko(i, r)) : (e[n] = r) } return e } var Zo = Symbol() function Jo(e) { return !Wo(e) || !Object.prototype.hasOwnProperty.call(e, Zo) } var $o = Object.assign function es(e) { return !(!en(e) || !e.effect) } function ts(e, t, n, r) { var i, a = t.state, o = t.actions, s = t.getters, u = n.state.value[e] return ( (i = ns( e, function () { u || (n.state.value[e] = a ? a() : {}) var t = (function (e) { var t = Y(e) ? new Array(e.length) : {} for (var n in e) t[n] = hn(e, n) return t })(n.state.value[e]) return $o( t, o, Object.keys(s || {}).reduce(function (t, r) { return ( (t[r] = Zt( Ea(function () { Vo(n) var t = n._s.get(e) return s[r].call(t, t) }) )), t ) }, {}) ) }, t, n, r, !0 )), i ) } function ns(e, t) { var n, r, i, a, o, s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, u = arguments.length > 3 ? arguments[3] : void 0, l = arguments.length > 5 ? arguments[5] : void 0, c = $o({ actions: {} }, s), h = { deep: !0 }, d = [], f = [], p = u.state.value[e] function v(t) { var n ;((r = i = !1), 'function' == typeof t ? (t(u.state.value[e]), (n = { type: Uo.patchFunction, storeId: e, events: a })) : (Ko(u.state.value[e], t), (n = { type: Uo.patchObject, payload: t, storeId: e, events: a }))) var s = (o = Symbol()) ;(Cn().then(function () { o === s && (r = !0) }), (i = !0), Qo(d, n, u.state.value[e])) } ;(l || p || (u.state.value[e] = {}), tn({})) var m = l ? function () { var e = s.state, t = e ? e() : {} this.$patch(function (e) { $o(e, t) }) } : Go var g = function (t) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '' if (Xo in t) return ((t[Yo] = n), t) var r = function () { Vo(u) var n, i = Array.from(arguments), a = [], o = [] Qo(f, { args: i, name: r[Yo], store: _, after: function (e) { a.push(e) }, onError: function (e) { o.push(e) }, }) try { n = t.apply(this && this.$id === e ? this : _, i) } catch (s) { throw (Qo(o, s), s) } return n instanceof Promise ? n .then(function (e) { return (Qo(a, e), e) }) .catch(function (e) { return (Qo(o, e), Promise.reject(e)) }) : (Qo(a, n), n) } return ((r[Xo] = !0), (r[Yo] = n), r) }, y = { _p: u, $id: e, $onAction: jo.bind(null, f), $patch: v, $reset: m, $subscribe: function (t) { var o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, s = jo(d, t, o.detached, function () { return l() }), l = n.run(function () { return Ti( function () { return u.state.value[e] }, function (n) { ;('sync' === o.flush ? i : r) && t({ storeId: e, type: Uo.direct, events: a }, n) }, $o({}, h, o) ) }) return s }, $dispose: function () { ;(n.stop(), (d = []), (f = []), u._s.delete(e)) }, }, _ = Wt(y) u._s.set(e, _) var b = ((u._a && u._a.runWithContext) || qo)(function () { return u._e.run(function () { return (n = De()).run(function () { return t({ action: g }) }) }) }) for (var x in b) { var S = b[x] if ((en(S) && !es(S)) || Qt(S)) l || (p && Jo(S) && (en(S) ? (S.value = p[x]) : Ko(S, p[x])), (u.state.value[e][x] = S)) else if ('function' == typeof S) { var A = g(S, x) ;((b[x] = A), (c.actions[x] = S)) } } return ( $o(_, b), $o(Kt(_), b), Object.defineProperty(_, '$state', { get: function () { return u.state.value[e] }, set: function (e) { v(function (t) { $o(t, e) }) }, }), u._p.forEach(function (e) { $o( _, n.run(function () { return e({ store: _, app: u._a, pinia: u, options: c }) }) ) }), p && l && s.hydrate && s.hydrate(_.$state, p), (r = !0), (i = !0), _ ) } /*! #__NO_SIDE_EFFECTS__ */ function rs(e, t, n) { var r, i = 'function' == typeof t function a(n, a) { return ( (n = n || (!!(pa || Dn || Jr) ? ei(Ho, null) : null)) && Vo(n), (n = Fo)._s.has(e) || (i ? ns(e, t, r, n) : ts(e, r, n)), n._s.get(e) ) } return ((r = i ? n : t), (a.$id = e), a) } function is(e) { var t = Kt(e), n = {}, r = function (r) { var i = t[r] i.effect ? (n[r] = Ea({ get: function () { return e[r] }, set: function (t) { e[r] = t }, })) : (en(i) || Qt(i)) && (n[r] = (function (e, t, n) { return en(e) ? e : J(e) ? new cn(e) : te(e) && arguments.length > 1 ? hn(e, t, n) : tn(e) })(e, r)) } for (var i in t) r(i) return n } function as(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e } var os, ss = { exports: {} } var us = (os || ((os = 1), (function (e) { var t = Object.prototype.hasOwnProperty, n = '~' function r() {} function i(e, t, n) { ;((this.fn = e), (this.context = t), (this.once = n || !1)) } function a(e, t, r, a, o) { if ('function' != typeof r) throw new TypeError('The listener must be a function') var s = new i(r, a || e, o), u = n ? n + t : t return ( e._events[u] ? e._events[u].fn ? (e._events[u] = [e._events[u], s]) : e._events[u].push(s) : ((e._events[u] = s), e._eventsCount++), e ) } function o(e, t) { 0 === --e._eventsCount ? (e._events = new r()) : delete e._events[t] } function s() { ;((this._events = new r()), (this._eventsCount = 0)) } ;(Object.create && ((r.prototype = Object.create(null)), new r().__proto__ || (n = !1)), (s.prototype.eventNames = function () { var e, r, i = [] if (0 === this._eventsCount) return i for (r in (e = this._events)) t.call(e, r) && i.push(n ? r.slice(1) : r) return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(e)) : i }), (s.prototype.listeners = function (e) { var t = n ? n + e : e, r = this._events[t] if (!r) return [] if (r.fn) return [r.fn] for (var i = 0, a = r.length, o = new Array(a); i < a; i++) o[i] = r[i].fn return o }), (s.prototype.listenerCount = function (e) { var t = n ? n + e : e, r = this._events[t] return r ? (r.fn ? 1 : r.length) : 0 }), (s.prototype.emit = function (e, t, r, i, a, o) { var s = n ? n + e : e if (!this._events[s]) return !1 var u, l, c = this._events[s], h = arguments.length if (c.fn) { switch ((c.once && this.removeListener(e, c.fn, void 0, !0), h)) { case 1: return (c.fn.call(c.context), !0) case 2: return (c.fn.call(c.context, t), !0) case 3: return (c.fn.call(c.context, t, r), !0) case 4: return (c.fn.call(c.context, t, r, i), !0) case 5: return (c.fn.call(c.context, t, r, i, a), !0) case 6: return (c.fn.call(c.context, t, r, i, a, o), !0) } for (l = 1, u = new Array(h - 1); l < h; l++) u[l - 1] = arguments[l] c.fn.apply(c.context, u) } else { var d, f = c.length for (l = 0; l < f; l++) switch ((c[l].once && this.removeListener(e, c[l].fn, void 0, !0), h)) { case 1: c[l].fn.call(c[l].context) break case 2: c[l].fn.call(c[l].context, t) break case 3: c[l].fn.call(c[l].context, t, r) break case 4: c[l].fn.call(c[l].context, t, r, i) break default: if (!u) for (d = 1, u = new Array(h - 1); d < h; d++) u[d - 1] = arguments[d] c[l].fn.apply(c[l].context, u) } } return !0 }), (s.prototype.on = function (e, t, n) { return a(this, e, t, n, !1) }), (s.prototype.once = function (e, t, n) { return a(this, e, t, n, !0) }), (s.prototype.removeListener = function (e, t, r, i) { var a = n ? n + e : e if (!this._events[a]) return this if (!t) return (o(this, a), this) var s = this._events[a] if (s.fn) s.fn !== t || (i && !s.once) || (r && s.context !== r) || o(this, a) else { for (var u = 0, l = [], c = s.length; u < c; u++) (s[u].fn !== t || (i && !s[u].once) || (r && s[u].context !== r)) && l.push(s[u]) l.length ? (this._events[a] = 1 === l.length ? l[0] : l) : o(this, a) } return this }), (s.prototype.removeAllListeners = function (e) { var t return ( e ? ((t = n ? n + e : e), this._events[t] && o(this, t)) : ((this._events = new r()), (this._eventsCount = 0)), this ) }), (s.prototype.off = s.prototype.removeListener), (s.prototype.addListener = s.prototype.on), (s.prefixed = n), (s.EventEmitter = s), (e.exports = s)) })(ss)), ss.exports), ls = as(us), cs = (function (e) { return ( (e.ErrorReceived = 'ErrorReceived'), (e.MessageReceived = 'MessageReceived'), (e.StartSpeech = 'StartSpeech'), (e.EndSpeech = 'EndSpeech'), (e.StateChanged = 'StateChanged'), e ) })(cs || {}), hs = (function (e) { return ( (e.WS_CLOSE = 'WS_CLOSE'), (e.WS_ERROR = 'WS_ERROR'), (e.WS_MESSAGE = 'WS_MESSAGE'), (e.WS_OPEN = 'WS_OPEN'), e ) })(hs || {}), ds = (function (e) { return ( (e.Player_EndSpeaking = 'Player_EndSpeaking'), (e.Player_NoLegacy = 'Player_NoLegacy'), (e.Player_StartSpeaking = 'Player_StartSpeaking'), (e.Player_WaitNextAudioClip = 'Player_WaitNextAudioClip'), e ) })(ds || {}), fs = (function (e) { return ( (e.Change_Status = 'Change_Status'), (e.Chat_BinsizeError = 'Chat_BinsizeError'), e ) })(fs || {}), ps = (function (e) { function t(e) { var n return ( A(this, t), M((n = y(this, t)), 'engine', void 0), M(n, '_inited', !1), n._init(e), n ) } return ( x(t, e), T(t, [ { key: '_init', value: function (e) { var t = this this._inited || ((this._inited = !0), (this.engine = new WebSocket(e)), this.engine.addEventListener('error', function (e) { t.emit(hs.WS_ERROR, e) }), this.engine.addEventListener('open', function () { t.emit(hs.WS_OPEN) }), this.engine.addEventListener('message', function (e) { t.emit(hs.WS_MESSAGE, e.data) }), this.engine.addEventListener('close', function () { t.emit(hs.WS_CLOSE) })) }, }, { key: 'send', value: function (e) { var t null === (t = this.engine) || void 0 === t || t.send(e) }, }, { key: 'stop', value: function () { var e ;(this.emit(hs.WS_CLOSE), (this._inited = !1), null === (e = this.engine) || void 0 === e || e.close()) }, }, ]) ) })(ls), vs = (function (e) { return ( (e.Idle = 'Idle'), (e.Listening = 'Listening'), (e.Responding = 'Responding'), (e.Thinking = 'Thinking'), e ) })(vs || {}), ms = (function (e) { return ((e.closed = 'closed'), (e.open = 'open'), (e.waiting = 'waiting'), e) })(ms || {}), gs = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t, [e])).name = 'TimeoutError'), n) } return (x(t, e), T(t)) })(m(Error)), ys = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).name = 'AbortError'), (n.message = e), n) } return (x(t, e), T(t)) })(m(Error)), _s = function (e) { return void 0 === globalThis.DOMException ? new ys(e) : new DOMException(e) }, bs = function (e) { var t = void 0 === e.reason ? _s('This operation was aborted.') : e.reason return t instanceof Error ? t : _s(t) } function xs(e, t) { var n, r, i = t.milliseconds, a = t.fallback, o = t.message, s = t.customTimers, u = void 0 === s ? { setTimeout: setTimeout, clearTimeout: clearTimeout } : s, l = new Promise(function (s, l) { if ('number' != typeof i || 1 !== Math.sign(i)) throw new TypeError( 'Expected `milliseconds` to be a positive number, got `'.concat(i, '`') ) if (t.signal) { var c = t.signal ;(c.aborted && l(bs(c)), (r = function () { l(bs(c)) }), c.addEventListener('abort', r, { once: !0 })) } if (i !== Number.POSITIVE_INFINITY) { var h = new gs() ;((n = u.setTimeout.call( void 0, function () { if (a) try { s(a()) } catch (t) { l(t) } else ('function' == typeof e.cancel && e.cancel(), !1 === o ? s() : o instanceof Error ? l(o) : ((h.message = null != o ? o : 'Promise timed out after '.concat(i, ' milliseconds')), l(h))) }, i )), v( d().m(function t() { var n, r, i return d().w( function (t) { for (;;) switch (t.n) { case 0: return ((t.p = 0), (n = s), (t.n = 1), e) case 1: ;((r = t.v), n(r), (t.n = 3)) break case 2: ;((t.p = 2), (i = t.v), l(i)) case 3: return t.a(2) } }, t, null, [[0, 2]] ) }) )()) } else e.then(s, l) }), c = l.finally(function () { ;(c.clear(), r && t.signal && t.signal.removeEventListener('abort', r)) }) return ( (c.clear = function () { ;(u.clearTimeout.call(void 0, n), (n = void 0)) }), c ) } var Ss = new WeakMap(), As = (function () { return T( function e() { ;(A(this, e), u(this, Ss, [])) }, [ { key: 'enqueue', value: function (e, t) { var n = { priority: (t = s({ priority: 0 }, t)).priority, id: t.id, run: e } if (0 === this.size || c(Ss, this)[this.size - 1].priority >= t.priority) c(Ss, this).push(n) else { var r = (function (e, t, n) { for (var r = 0, i = e.length; i > 0; ) { var a = Math.trunc(i / 2), o = r + a n(e[o], t) <= 0 ? ((r = ++o), (i -= a + 1)) : (i = a) } return r })(c(Ss, this), n, function (e, t) { return t.priority - e.priority }) c(Ss, this).splice(r, 0, n) } }, }, { key: 'setPriority', value: function (e, t) { var n = c(Ss, this).findIndex(function (t) { return t.id === e }) if (-1 === n) throw new ReferenceError( 'No promise function with the id "'.concat(e, '" exists in the queue.') ) var r = C(c(Ss, this).splice(n, 1), 1)[0] this.enqueue(r.run, { priority: t, id: e }) }, }, { key: 'dequeue', value: function () { var e = c(Ss, this).shift() return null == e ? void 0 : e.run }, }, { key: 'filter', value: function (e) { return c(Ss, this) .filter(function (t) { return t.priority === e.priority }) .map(function (e) { return e.run }) }, }, { key: 'size', get: function () { return c(Ss, this).length }, }, ] ) })(), ws = new WeakMap(), Ts = new WeakMap(), Ms = new WeakMap(), Es = new WeakMap(), Cs = new WeakMap(), ks = new WeakMap(), Rs = new WeakMap(), Is = new WeakMap(), Ns = new WeakMap(), Ps = new WeakMap(), Ls = new WeakMap(), Ds = new WeakMap(), Os = new WeakMap(), Fs = new WeakMap(), Bs = new WeakMap(), Us = new WeakSet(), zs = (function (e) { function t(e) { var n, r, i, o, c if ( (A(this, t), (function (e, t) { ;(l(e, t), t.add(e)) })((n = y(this, t)), Us), u(n, ws, void 0), u(n, Ts, void 0), u(n, Ms, 0), u(n, Es, void 0), u(n, Cs, void 0), u(n, ks, 0), u(n, Rs, void 0), u(n, Is, void 0), u(n, Ns, void 0), u(n, Ps, void 0), u(n, Ls, 0), u(n, Ds, void 0), u(n, Os, void 0), u(n, Fs, void 0), u(n, Bs, 1n), M(n, 'timeout', void 0), !( 'number' == typeof (e = s( { carryoverConcurrencyCount: !1, intervalCap: Number.POSITIVE_INFINITY, interval: 0, concurrency: Number.POSITIVE_INFINITY, autoStart: !0, queueClass: As, }, e )).intervalCap && e.intervalCap >= 1 )) ) throw new TypeError( 'Expected `intervalCap` to be a number from 1 and up, got `' .concat( null !== (r = null === (i = e.intervalCap) || void 0 === i ? void 0 : i.toString()) && void 0 !== r ? r : '', '` (' ) .concat(P(e.intervalCap), ')') ) if (void 0 === e.interval || !(Number.isFinite(e.interval) && e.interval >= 0)) throw new TypeError( 'Expected `interval` to be a finite number >= 0, got `' .concat( null !== (o = null === (c = e.interval) || void 0 === c ? void 0 : c.toString()) && void 0 !== o ? o : '', '` (' ) .concat(P(e.interval), ')') ) return ( a(ws, n, e.carryoverConcurrencyCount), a(Ts, n, e.intervalCap === Number.POSITIVE_INFINITY || 0 === e.interval), a(Es, n, e.intervalCap), a(Cs, n, e.interval), a(Ns, n, new e.queueClass()), a(Ps, n, e.queueClass), (n.concurrency = e.concurrency), (n.timeout = e.timeout), a(Fs, n, !0 === e.throwOnTimeout), a(Os, n, !1 === e.autoStart), n ) } return ( x(t, e), T(t, [ { key: 'concurrency', get: function () { return c(Ds, this) }, set: function (e) { if (!('number' == typeof e && e >= 1)) throw new TypeError( 'Expected `concurrency` to be a number from 1 and up, got `' .concat(e, '` (') .concat(P(e), ')') ) ;(a(Ds, this, e), h(Us, this, Ys).call(this)) }, }, { key: 'setPriority', value: function (e, t) { c(Ns, this).setPriority(e, t) }, }, { key: 'add', value: ((f = v( d().m(function e(t) { var n, r, i, o, u, l = this, f = arguments return d().w( function (e) { for (;;) if (0 === e.n) return ( (null !== (o = (i = u = f.length > 1 && void 0 !== f[1] ? f[1] : {}) .id) && void 0 !== o) || (i.id = (a(Bs, this, ((n = c(Bs, this)), (r = n++), n)), r).toString()), (u = s( { timeout: this.timeout, throwOnTimeout: c(Fs, this) }, u )), e.a( 2, new Promise(function (e, n) { ;(c(Ns, l).enqueue( v( d().m(function r() { var i, o, s, f, p, v return d().w( function (r) { for (;;) switch (r.n) { case 0: return ( a(Ls, l, ((i = c(Ls, l)), ++i)), a(Ms, l, ((o = c(Ms, l)), ++o)), (r.p = 1), null === (s = u.signal) || void 0 === s || s.throwIfAborted(), (f = t({ signal: u.signal })), u.timeout && (f = xs(Promise.resolve(f), { milliseconds: u.timeout, })), u.signal && (f = Promise.race([ f, h(Us, l, Ks).call(l, u.signal), ])), (r.n = 2), f ) case 2: ;((p = r.v), e(p), l.emit('completed', p), (r.n = 5)) break case 3: if ( ((r.p = 3), !((v = r.v) instanceof gs) || u.throwOnTimeout) ) { r.n = 4 break } return (e(), r.a(2)) case 4: ;(n(v), l.emit('error', v)) case 5: return ( (r.p = 5), h(Us, l, Ws).call(l), r.f(5) ) case 6: return r.a(2) } }, r, null, [[1, 3, 5, 6]] ) }) ), u ), l.emit('add'), h(Us, l, Qs).call(l)) }) ) ) }, e, this ) }) )), function (e) { return f.apply(this, arguments) }), }, { key: 'addAll', value: ((o = v( d().m(function e(t, n) { var r = this return d().w(function (e) { for (;;) if (0 === e.n) return e.a( 2, Promise.all( t.map( (function () { var e = v( d().m(function e(t) { return d().w(function (e) { for (;;) if (0 === e.n) return e.a(2, r.add(t, n)) }, e) }) ) return function (t) { return e.apply(this, arguments) } })() ) ) ) }, e) }) )), function (e, t) { return o.apply(this, arguments) }), }, { key: 'start', value: function () { return c(Os, this) ? (a(Os, this, !1), h(Us, this, Ys).call(this), this) : this }, }, { key: 'pause', value: function () { a(Os, this, !0) }, }, { key: 'clear', value: function () { a(Ns, this, new (c(Ps, this))()) }, }, { key: 'onEmpty', value: ((i = v( d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: if (0 !== c(Ns, this).size) { e.n = 1 break } return e.a(2) case 1: return ((e.n = 2), h(Us, this, Js).call(this, 'empty')) case 2: return e.a(2) } }, e, this ) }) )), function () { return i.apply(this, arguments) }), }, { key: 'onSizeLessThan', value: ((r = v( d().m(function e(t) { var n = this return d().w( function (e) { for (;;) switch (e.n) { case 0: if (!(c(Ns, this).size < t)) { e.n = 1 break } return e.a(2) case 1: return ( (e.n = 2), h(Us, this, Js).call(this, 'next', function () { return c(Ns, n).size < t }) ) case 2: return e.a(2) } }, e, this ) }) )), function (e) { return r.apply(this, arguments) }), }, { key: 'onIdle', value: ((n = v( d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: if (0 !== c(Ls, this) || 0 !== c(Ns, this).size) { e.n = 1 break } return e.a(2) case 1: return ((e.n = 2), h(Us, this, Js).call(this, 'idle')) case 2: return e.a(2) } }, e, this ) }) )), function () { return n.apply(this, arguments) }), }, { key: 'size', get: function () { return c(Ns, this).size }, }, { key: 'sizeBy', value: function (e) { return c(Ns, this).filter(e).length }, }, { key: 'pending', get: function () { return c(Ls, this) }, }, { key: 'isPaused', get: function () { return c(Os, this) }, }, ]) ) var n, r, i, o, f })(ls) function Vs(e) { return c(Ts, e) || c(Ms, e) < c(Es, e) } function Hs(e) { return c(Ls, e) < c(Ds, e) } function Ws() { var e ;(a(Ls, this, ((e = c(Ls, this)), e--, e)), h(Us, this, Qs).call(this), this.emit('next')) } function Gs() { ;(h(Us, this, Xs).call(this), h(Us, this, qs).call(this), a(Is, this, void 0)) } function js(e) { var t = Date.now() if (void 0 === c(Rs, e)) { var n = c(ks, e) - t if (!(n < 0)) return ( void 0 === c(Is, e) && a( Is, e, setTimeout(function () { h(Us, e, Gs).call(e) }, n) ), !0 ) a(Ms, e, c(ws, e) ? c(Ls, e) : 0) } return !1 } function Qs() { if (0 === c(Ns, this).size) return ( c(Rs, this) && clearInterval(c(Rs, this)), a(Rs, this, void 0), this.emit('empty'), 0 === c(Ls, this) && this.emit('idle'), !1 ) if (!c(Os, this)) { var e = !i(Us, this, js) if (i(Us, this, Vs) && i(Us, this, Hs)) { var t = c(Ns, this).dequeue() return !!t && (this.emit('active'), t(), e && h(Us, this, qs).call(this), !0) } } return !1 } function qs() { var e = this c(Ts, this) || void 0 !== c(Rs, this) || (a( Rs, this, setInterval( function () { h(Us, e, Xs).call(e) }, c(Cs, this) ) ), a(ks, this, Date.now() + c(Cs, this))) } function Xs() { ;(0 === c(Ms, this) && 0 === c(Ls, this) && c(Rs, this) && (clearInterval(c(Rs, this)), a(Rs, this, void 0)), a(Ms, this, c(ws, this) ? c(Ls, this) : 0), h(Us, this, Ys).call(this)) } function Ys() { for (; h(Us, this, Qs).call(this); ); } function Ks(e) { return Zs.apply(this, arguments) } function Zs() { return (Zs = v( d().m(function e(t) { return d().w(function (e) { for (;;) if (0 === e.n) return e.a( 2, new Promise(function (e, n) { t.addEventListener( 'abort', function () { n(t.reason) }, { once: !0 } ) }) ) }, e) }) )).apply(this, arguments) } function Js(e, t) { return $s.apply(this, arguments) } function $s() { return ( ($s = v( d().m(function e(t, n) { var r = this return d().w(function (e) { for (;;) if (0 === e.n) return e.a( 2, new Promise(function (e) { var i = function () { ;(n && !n()) || (r.off(t, i), e()) } r.on(t, i) }) ) }, e) }) )), $s.apply(this, arguments) ) } var eu, tu = {} function nu() { if (eu) return tu ;((eu = 1), (tu.byteLength = function (e) { var t = a(e), n = t[0], r = t[1] return (3 * (n + r)) / 4 - r }), (tu.toByteArray = function (e) { var r, i, o = a(e), s = o[0], u = o[1], l = new n( (function (e, t, n) { return (3 * (t + n)) / 4 - n })(0, s, u) ), c = 0, h = u > 0 ? s - 4 : s for (i = 0; i < h; i += 4) ((r = (t[e.charCodeAt(i)] << 18) | (t[e.charCodeAt(i + 1)] << 12) | (t[e.charCodeAt(i + 2)] << 6) | t[e.charCodeAt(i + 3)]), (l[c++] = (r >> 16) & 255), (l[c++] = (r >> 8) & 255), (l[c++] = 255 & r)) 2 === u && ((r = (t[e.charCodeAt(i)] << 2) | (t[e.charCodeAt(i + 1)] >> 4)), (l[c++] = 255 & r)) 1 === u && ((r = (t[e.charCodeAt(i)] << 10) | (t[e.charCodeAt(i + 1)] << 4) | (t[e.charCodeAt(i + 2)] >> 2)), (l[c++] = (r >> 8) & 255), (l[c++] = 255 & r)) return l }), (tu.fromByteArray = function (t) { for ( var n, r = t.length, i = r % 3, a = [], o = 16383, u = 0, l = r - i; u < l; u += o ) a.push(s(t, u, u + o > l ? l : u + o)) 1 === i ? ((n = t[r - 1]), a.push(e[n >> 2] + e[(n << 4) & 63] + '==')) : 2 === i && ((n = (t[r - 2] << 8) + t[r - 1]), a.push(e[n >> 10] + e[(n >> 4) & 63] + e[(n << 2) & 63] + '=')) return a.join('') })) for ( var e = [], t = [], n = 'undefined' != typeof Uint8Array ? Uint8Array : Array, r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', i = 0; i < 64; ++i ) ((e[i] = r[i]), (t[r.charCodeAt(i)] = i)) function a(e) { var t = e.length if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4') var n = e.indexOf('=') return (-1 === n && (n = t), [n, n === t ? 0 : 4 - (n % 4)]) } function o(t) { return e[(t >> 18) & 63] + e[(t >> 12) & 63] + e[(t >> 6) & 63] + e[63 & t] } function s(e, t, n) { for (var r, i = [], a = t; a < n; a += 3) ((r = ((e[a] << 16) & 16711680) + ((e[a + 1] << 8) & 65280) + (255 & e[a + 2])), i.push(o(r))) return i.join('') } return ((t['-'.charCodeAt(0)] = 62), (t['_'.charCodeAt(0)] = 63), tu) } nu() var ru, iu, au = {}, ou = {} function su() { return ( ru || ((ru = 1), (ou.read = function (e, t, n, r, i) { var a, o, s = 8 * i - r - 1, u = (1 << s) - 1, l = u >> 1, c = -7, h = n ? i - 1 : 0, d = n ? -1 : 1, f = e[t + h] for ( h += d, a = f & ((1 << -c) - 1), f >>= -c, c += s; c > 0; a = 256 * a + e[t + h], h += d, c -= 8 ); for ( o = a & ((1 << -c) - 1), a >>= -c, c += r; c > 0; o = 256 * o + e[t + h], h += d, c -= 8 ); if (0 === a) a = 1 - l else { if (a === u) return o ? NaN : (1 / 0) * (f ? -1 : 1) ;((o += Math.pow(2, r)), (a -= l)) } return (f ? -1 : 1) * o * Math.pow(2, a - r) }), (ou.write = function (e, t, n, r, i, a) { var o, s, u, l = 8 * a - i - 1, c = (1 << l) - 1, h = c >> 1, d = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = r ? 0 : a - 1, p = r ? 1 : -1, v = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0 for ( t = Math.abs(t), isNaN(t) || t === 1 / 0 ? ((s = isNaN(t) ? 1 : 0), (o = c)) : ((o = Math.floor(Math.log(t) / Math.LN2)), t * (u = Math.pow(2, -o)) < 1 && (o--, (u *= 2)), (t += o + h >= 1 ? d / u : d * Math.pow(2, 1 - h)) * u >= 2 && (o++, (u /= 2)), o + h >= c ? ((s = 0), (o = c)) : o + h >= 1 ? ((s = (t * u - 1) * Math.pow(2, i)), (o += h)) : ((s = t * Math.pow(2, h - 1) * Math.pow(2, i)), (o = 0))); i >= 8; e[n + f] = 255 & s, f += p, s /= 256, i -= 8 ); for ( o = (o << i) | s, l += i; l > 0; e[n + f] = 255 & o, f += p, o /= 256, l -= 8 ); e[n + f - p] |= 128 * v })), ou ) } /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ function uu() { return ( iu || ((iu = 1), (function (e) { var t = nu(), n = su(), r = 'function' == typeof Symbol && 'function' == typeof Symbol.for ? Symbol.for('nodejs.util.inspect.custom') : null ;((e.Buffer = o), (e.SlowBuffer = function (e) { ;+e != e && (e = 0) return o.alloc(+e) }), (e.INSPECT_MAX_BYTES = 50)) var i = 2147483647 function a(e) { if (e > i) throw new RangeError('The value "' + e + '" is invalid for option "size"') var t = new Uint8Array(e) return (Object.setPrototypeOf(t, o.prototype), t) } function o(e, t, n) { if ('number' == typeof e) { if ('string' == typeof t) throw new TypeError( 'The "string" argument must be of type string. Received type number' ) return l(e) } return s(e, t, n) } function s(e, t, n) { if ('string' == typeof e) return (function (e, t) { ;('string' == typeof t && '' !== t) || (t = 'utf8') if (!o.isEncoding(t)) throw new TypeError('Unknown encoding: ' + t) var n = 0 | f(e, t), r = a(n), i = r.write(e, t) i !== n && (r = r.slice(0, i)) return r })(e, t) if (ArrayBuffer.isView(e)) return (function (e) { if (J(e, Uint8Array)) { var t = new Uint8Array(e) return h(t.buffer, t.byteOffset, t.byteLength) } return c(e) })(e) if (null == e) throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + P(e) ) if (J(e, ArrayBuffer) || (e && J(e.buffer, ArrayBuffer))) return h(e, t, n) if ( 'undefined' != typeof SharedArrayBuffer && (J(e, SharedArrayBuffer) || (e && J(e.buffer, SharedArrayBuffer))) ) return h(e, t, n) if ('number' == typeof e) throw new TypeError( 'The "value" argument must not be of type number. Received type number' ) var r = e.valueOf && e.valueOf() if (null != r && r !== e) return o.from(r, t, n) var i = (function (e) { if (o.isBuffer(e)) { var t = 0 | d(e.length), n = a(t) return (0 === n.length || e.copy(n, 0, 0, t), n) } if (void 0 !== e.length) return 'number' != typeof e.length || $(e.length) ? a(0) : c(e) if ('Buffer' === e.type && Array.isArray(e.data)) return c(e.data) })(e) if (i) return i if ( 'undefined' != typeof Symbol && null != Symbol.toPrimitive && 'function' == typeof e[Symbol.toPrimitive] ) return o.from(e[Symbol.toPrimitive]('string'), t, n) throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + P(e) ) } function u(e) { if ('number' != typeof e) throw new TypeError('"size" argument must be of type number') if (e < 0) throw new RangeError('The value "' + e + '" is invalid for option "size"') } function l(e) { return (u(e), a(e < 0 ? 0 : 0 | d(e))) } function c(e) { for (var t = e.length < 0 ? 0 : 0 | d(e.length), n = a(t), r = 0; r < t; r += 1) n[r] = 255 & e[r] return n } function h(e, t, n) { if (t < 0 || e.byteLength < t) throw new RangeError('"offset" is outside of buffer bounds') if (e.byteLength < t + (n || 0)) throw new RangeError('"length" is outside of buffer bounds') var r return ( (r = void 0 === t && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, t) : new Uint8Array(e, t, n)), Object.setPrototypeOf(r, o.prototype), r ) } function d(e) { if (e >= i) throw new RangeError( 'Attempt to allocate Buffer larger than maximum size: 0x' + i.toString(16) + ' bytes' ) return 0 | e } function f(e, t) { if (o.isBuffer(e)) return e.length if (ArrayBuffer.isView(e) || J(e, ArrayBuffer)) return e.byteLength if ('string' != typeof e) throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + P(e) ) var n = e.length, r = arguments.length > 2 && !0 === arguments[2] if (!r && 0 === n) return 0 for (var i = !1; ; ) switch (t) { case 'ascii': case 'latin1': case 'binary': return n case 'utf8': case 'utf-8': return Y(e).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 2 * n case 'hex': return n >>> 1 case 'base64': return K(e).length default: if (i) return r ? -1 : Y(e).length ;((t = ('' + t).toLowerCase()), (i = !0)) } } function p(e, t, n) { var r = !1 if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return '' if (((void 0 === n || n > this.length) && (n = this.length), n <= 0)) return '' if ((n >>>= 0) <= (t >>>= 0)) return '' for (e || (e = 'utf8'); ; ) switch (e) { case 'hex': return N(this, t, n) case 'utf8': case 'utf-8': return C(this, t, n) case 'ascii': return R(this, t, n) case 'latin1': case 'binary': return I(this, t, n) case 'base64': return E(this, t, n) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return L(this, t, n) default: if (r) throw new TypeError('Unknown encoding: ' + e) ;((e = (e + '').toLowerCase()), (r = !0)) } } function v(e, t, n) { var r = e[t] ;((e[t] = e[n]), (e[n] = r)) } function m(e, t, n, r, i) { if (0 === e.length) return -1 if ( ('string' == typeof n ? ((r = n), (n = 0)) : n > 2147483647 ? (n = 2147483647) : n < -2147483648 && (n = -2147483648), $((n = +n)) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) ) { if (i) return -1 n = e.length - 1 } else if (n < 0) { if (!i) return -1 n = 0 } if (('string' == typeof t && (t = o.from(t, r)), o.isBuffer(t))) return 0 === t.length ? -1 : g(e, t, n, r, i) if ('number' == typeof t) return ( (t &= 255), 'function' == typeof Uint8Array.prototype.indexOf ? i ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : g(e, [t], n, r, i) ) throw new TypeError('val must be string, number or Buffer') } function g(e, t, n, r, i) { var a, o = 1, s = e.length, u = t.length if ( void 0 !== r && ('ucs2' === (r = String(r).toLowerCase()) || 'ucs-2' === r || 'utf16le' === r || 'utf-16le' === r) ) { if (e.length < 2 || t.length < 2) return -1 ;((o = 2), (s /= 2), (u /= 2), (n /= 2)) } function l(e, t) { return 1 === o ? e[t] : e.readUInt16BE(t * o) } if (i) { var c = -1 for (a = n; a < s; a++) if (l(e, a) === l(t, -1 === c ? 0 : a - c)) { if ((-1 === c && (c = a), a - c + 1 === u)) return c * o } else (-1 !== c && (a -= a - c), (c = -1)) } else for (n + u > s && (n = s - u), a = n; a >= 0; a--) { for (var h = !0, d = 0; d < u; d++) if (l(e, a + d) !== l(t, d)) { h = !1 break } if (h) return a } return -1 } function _(e, t, n, r) { n = Number(n) || 0 var i = e.length - n r ? (r = Number(r)) > i && (r = i) : (r = i) var a, o = t.length for (r > o / 2 && (r = o / 2), a = 0; a < r; ++a) { var s = parseInt(t.substr(2 * a, 2), 16) if ($(s)) return a e[n + a] = s } return a } function b(e, t, n, r) { return Z(Y(t, e.length - n), e, n, r) } function S(e, t, n, r) { return Z( (function (e) { for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n)) return t })(t), e, n, r ) } function w(e, t, n, r) { return Z(K(t), e, n, r) } function M(e, t, n, r) { return Z( (function (e, t) { for (var n, r, i, a = [], o = 0; o < e.length && !((t -= 2) < 0); ++o) ((r = (n = e.charCodeAt(o)) >> 8), (i = n % 256), a.push(i), a.push(r)) return a })(t, e.length - n), e, n, r ) } function E(e, n, r) { return 0 === n && r === e.length ? t.fromByteArray(e) : t.fromByteArray(e.slice(n, r)) } function C(e, t, n) { n = Math.min(e.length, n) for (var r = [], i = t; i < n; ) { var a = e[i], o = null, s = a > 239 ? 4 : a > 223 ? 3 : a > 191 ? 2 : 1 if (i + s <= n) { var u = void 0, l = void 0, c = void 0, h = void 0 switch (s) { case 1: a < 128 && (o = a) break case 2: 128 == (192 & (u = e[i + 1])) && (h = ((31 & a) << 6) | (63 & u)) > 127 && (o = h) break case 3: ;((u = e[i + 1]), (l = e[i + 2]), 128 == (192 & u) && 128 == (192 & l) && (h = ((15 & a) << 12) | ((63 & u) << 6) | (63 & l)) > 2047 && (h < 55296 || h > 57343) && (o = h)) break case 4: ;((u = e[i + 1]), (l = e[i + 2]), (c = e[i + 3]), 128 == (192 & u) && 128 == (192 & l) && 128 == (192 & c) && (h = ((15 & a) << 18) | ((63 & u) << 12) | ((63 & l) << 6) | (63 & c)) > 65535 && h < 1114112 && (o = h)) } } ;(null === o ? ((o = 65533), (s = 1)) : o > 65535 && ((o -= 65536), r.push(((o >>> 10) & 1023) | 55296), (o = 56320 | (1023 & o))), r.push(o), (i += s)) } return (function (e) { var t = e.length if (t <= k) return String.fromCharCode.apply(String, e) var n = '', r = 0 for (; r < t; ) n += String.fromCharCode.apply(String, e.slice(r, (r += k))) return n })(r) } ;((e.kMaxLength = i), (o.TYPED_ARRAY_SUPPORT = (function () { try { var e = new Uint8Array(1), t = { foo: function () { return 42 }, } return ( Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(e, t), 42 === e.foo() ) } catch (ZJ) { return !1 } })()), o.TYPED_ARRAY_SUPPORT || 'undefined' == typeof console || 'function' != typeof console.error || console.error( 'This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.' ), Object.defineProperty(o.prototype, 'parent', { enumerable: !0, get: function () { if (o.isBuffer(this)) return this.buffer }, }), Object.defineProperty(o.prototype, 'offset', { enumerable: !0, get: function () { if (o.isBuffer(this)) return this.byteOffset }, }), (o.poolSize = 8192), (o.from = function (e, t, n) { return s(e, t, n) }), Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array), (o.alloc = function (e, t, n) { return (function (e, t, n) { return ( u(e), e <= 0 ? a(e) : void 0 !== t ? 'string' == typeof n ? a(e).fill(t, n) : a(e).fill(t) : a(e) ) })(e, t, n) }), (o.allocUnsafe = function (e) { return l(e) }), (o.allocUnsafeSlow = function (e) { return l(e) }), (o.isBuffer = function (e) { return null != e && !0 === e._isBuffer && e !== o.prototype }), (o.compare = function (e, t) { if ( (J(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)), J(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(e) || !o.isBuffer(t)) ) throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ) if (e === t) return 0 for (var n = e.length, r = t.length, i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) { ;((n = e[i]), (r = t[i])) break } return n < r ? -1 : r < n ? 1 : 0 }), (o.isEncoding = function (e) { switch (String(e).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return !0 default: return !1 } }), (o.concat = function (e, t) { if (!Array.isArray(e)) throw new TypeError('"list" argument must be an Array of Buffers') if (0 === e.length) return o.alloc(0) var n if (void 0 === t) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length var r = o.allocUnsafe(t), i = 0 for (n = 0; n < e.length; ++n) { var a = e[n] if (J(a, Uint8Array)) i + a.length > r.length ? (o.isBuffer(a) || (a = o.from(a)), a.copy(r, i)) : Uint8Array.prototype.set.call(r, a, i) else { if (!o.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers') a.copy(r, i) } i += a.length } return r }), (o.byteLength = f), (o.prototype._isBuffer = !0), (o.prototype.swap16 = function () { var e = this.length if (e % 2 != 0) throw new RangeError('Buffer size must be a multiple of 16-bits') for (var t = 0; t < e; t += 2) v(this, t, t + 1) return this }), (o.prototype.swap32 = function () { var e = this.length if (e % 4 != 0) throw new RangeError('Buffer size must be a multiple of 32-bits') for (var t = 0; t < e; t += 4) (v(this, t, t + 3), v(this, t + 1, t + 2)) return this }), (o.prototype.swap64 = function () { var e = this.length if (e % 8 != 0) throw new RangeError('Buffer size must be a multiple of 64-bits') for (var t = 0; t < e; t += 8) (v(this, t, t + 7), v(this, t + 1, t + 6), v(this, t + 2, t + 5), v(this, t + 3, t + 4)) return this }), (o.prototype.toString = function () { var e = this.length return 0 === e ? '' : 0 === arguments.length ? C(this, 0, e) : p.apply(this, arguments) }), (o.prototype.toLocaleString = o.prototype.toString), (o.prototype.equals = function (e) { if (!o.isBuffer(e)) throw new TypeError('Argument must be a Buffer') return this === e || 0 === o.compare(this, e) }), (o.prototype.inspect = function () { var t = '', n = e.INSPECT_MAX_BYTES return ( (t = this.toString('hex', 0, n) .replace(/(.{2})/g, '$1 ') .trim()), this.length > n && (t += ' ... '), '' ) }), r && (o.prototype[r] = o.prototype.inspect), (o.prototype.compare = function (e, t, n, r, i) { if ( (J(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)), !o.isBuffer(e)) ) throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + P(e) ) if ( (void 0 === t && (t = 0), void 0 === n && (n = e ? e.length : 0), void 0 === r && (r = 0), void 0 === i && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) ) throw new RangeError('out of range index') if (r >= i && t >= n) return 0 if (r >= i) return -1 if (t >= n) return 1 if (this === e) return 0 for ( var a = (i >>>= 0) - (r >>>= 0), s = (n >>>= 0) - (t >>>= 0), u = Math.min(a, s), l = this.slice(r, i), c = e.slice(t, n), h = 0; h < u; ++h ) if (l[h] !== c[h]) { ;((a = l[h]), (s = c[h])) break } return a < s ? -1 : s < a ? 1 : 0 }), (o.prototype.includes = function (e, t, n) { return -1 !== this.indexOf(e, t, n) }), (o.prototype.indexOf = function (e, t, n) { return m(this, e, t, n, !0) }), (o.prototype.lastIndexOf = function (e, t, n) { return m(this, e, t, n, !1) }), (o.prototype.write = function (e, t, n, r) { if (void 0 === t) ((r = 'utf8'), (n = this.length), (t = 0)) else if (void 0 === n && 'string' == typeof t) ((r = t), (n = this.length), (t = 0)) else { if (!isFinite(t)) throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) ;((t >>>= 0), isFinite(n) ? ((n >>>= 0), void 0 === r && (r = 'utf8')) : ((r = n), (n = void 0))) } var i = this.length - t if ( ((void 0 === n || n > i) && (n = i), (e.length > 0 && (n < 0 || t < 0)) || t > this.length) ) throw new RangeError('Attempt to write outside buffer bounds') r || (r = 'utf8') for (var a = !1; ; ) switch (r) { case 'hex': return _(this, e, t, n) case 'utf8': case 'utf-8': return b(this, e, t, n) case 'ascii': case 'latin1': case 'binary': return S(this, e, t, n) case 'base64': return w(this, e, t, n) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return M(this, e, t, n) default: if (a) throw new TypeError('Unknown encoding: ' + r) ;((r = ('' + r).toLowerCase()), (a = !0)) } }), (o.prototype.toJSON = function () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0), } })) var k = 4096 function R(e, t, n) { var r = '' n = Math.min(e.length, n) for (var i = t; i < n; ++i) r += String.fromCharCode(127 & e[i]) return r } function I(e, t, n) { var r = '' n = Math.min(e.length, n) for (var i = t; i < n; ++i) r += String.fromCharCode(e[i]) return r } function N(e, t, n) { var r = e.length ;((!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r)) for (var i = '', a = t; a < n; ++a) i += ee[e[a]] return i } function L(e, t, n) { for (var r = e.slice(t, n), i = '', a = 0; a < r.length - 1; a += 2) i += String.fromCharCode(r[a] + 256 * r[a + 1]) return i } function D(e, t, n) { if (e % 1 != 0 || e < 0) throw new RangeError('offset is not uint') if (e + t > n) throw new RangeError('Trying to access beyond buffer length') } function O(e, t, n, r, i, a) { if (!o.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance') if (t > i || t < a) throw new RangeError('"value" argument is out of bounds') if (n + r > e.length) throw new RangeError('Index out of range') } function F(e, t, n, r, i) { j(t, r, i, e, n, 7) var a = Number(t & BigInt(4294967295)) ;((e[n++] = a), (a >>= 8), (e[n++] = a), (a >>= 8), (e[n++] = a), (a >>= 8), (e[n++] = a)) var o = Number((t >> BigInt(32)) & BigInt(4294967295)) return ( (e[n++] = o), (o >>= 8), (e[n++] = o), (o >>= 8), (e[n++] = o), (o >>= 8), (e[n++] = o), n ) } function B(e, t, n, r, i) { j(t, r, i, e, n, 7) var a = Number(t & BigInt(4294967295)) ;((e[n + 7] = a), (a >>= 8), (e[n + 6] = a), (a >>= 8), (e[n + 5] = a), (a >>= 8), (e[n + 4] = a)) var o = Number((t >> BigInt(32)) & BigInt(4294967295)) return ( (e[n + 3] = o), (o >>= 8), (e[n + 2] = o), (o >>= 8), (e[n + 1] = o), (o >>= 8), (e[n] = o), n + 8 ) } function U(e, t, n, r, i, a) { if (n + r > e.length) throw new RangeError('Index out of range') if (n < 0) throw new RangeError('Index out of range') } function z(e, t, r, i, a) { return ( (t = +t), (r >>>= 0), a || U(e, 0, r, 4), n.write(e, t, r, i, 23, 4), r + 4 ) } function V(e, t, r, i, a) { return ( (t = +t), (r >>>= 0), a || U(e, 0, r, 8), n.write(e, t, r, i, 52, 8), r + 8 ) } ;((o.prototype.slice = function (e, t) { var n = this.length ;((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), t < e && (t = e)) var r = this.subarray(e, t) return (Object.setPrototypeOf(r, o.prototype), r) }), (o.prototype.readUintLE = o.prototype.readUIntLE = function (e, t, n) { ;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length)) for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256); ) r += this[e + a] * i return r }), (o.prototype.readUintBE = o.prototype.readUIntBE = function (e, t, n) { ;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length)) for (var r = this[e + --t], i = 1; t > 0 && (i *= 256); ) r += this[e + --t] * i return r }), (o.prototype.readUint8 = o.prototype.readUInt8 = function (e, t) { return ((e >>>= 0), t || D(e, 1, this.length), this[e]) }), (o.prototype.readUint16LE = o.prototype.readUInt16LE = function (e, t) { return ((e >>>= 0), t || D(e, 2, this.length), this[e] | (this[e + 1] << 8)) }), (o.prototype.readUint16BE = o.prototype.readUInt16BE = function (e, t) { return ((e >>>= 0), t || D(e, 2, this.length), (this[e] << 8) | this[e + 1]) }), (o.prototype.readUint32LE = o.prototype.readUInt32LE = function (e, t) { return ( (e >>>= 0), t || D(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3] ) }), (o.prototype.readUint32BE = o.prototype.readUInt32BE = function (e, t) { return ( (e >>>= 0), t || D(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]) ) }), (o.prototype.readBigUInt64LE = te(function (e) { Q((e >>>= 0), 'offset') var t = this[e], n = this[e + 7] ;(void 0 !== t && void 0 !== n) || q(e, this.length - 8) var r = t + this[++e] * Math.pow(2, 8) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 24), i = this[++e] + this[++e] * Math.pow(2, 8) + this[++e] * Math.pow(2, 16) + n * Math.pow(2, 24) return BigInt(r) + (BigInt(i) << BigInt(32)) })), (o.prototype.readBigUInt64BE = te(function (e) { Q((e >>>= 0), 'offset') var t = this[e], n = this[e + 7] ;(void 0 !== t && void 0 !== n) || q(e, this.length - 8) var r = t * Math.pow(2, 24) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 8) + this[++e], i = this[++e] * Math.pow(2, 24) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 8) + n return (BigInt(r) << BigInt(32)) + BigInt(i) })), (o.prototype.readIntLE = function (e, t, n) { ;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length)) for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256); ) r += this[e + a] * i return (r >= (i *= 128) && (r -= Math.pow(2, 8 * t)), r) }), (o.prototype.readIntBE = function (e, t, n) { ;((e >>>= 0), (t >>>= 0), n || D(e, t, this.length)) for (var r = t, i = 1, a = this[e + --r]; r > 0 && (i *= 256); ) a += this[e + --r] * i return (a >= (i *= 128) && (a -= Math.pow(2, 8 * t)), a) }), (o.prototype.readInt8 = function (e, t) { return ( (e >>>= 0), t || D(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e] ) }), (o.prototype.readInt16LE = function (e, t) { ;((e >>>= 0), t || D(e, 2, this.length)) var n = this[e] | (this[e + 1] << 8) return 32768 & n ? 4294901760 | n : n }), (o.prototype.readInt16BE = function (e, t) { ;((e >>>= 0), t || D(e, 2, this.length)) var n = this[e + 1] | (this[e] << 8) return 32768 & n ? 4294901760 | n : n }), (o.prototype.readInt32LE = function (e, t) { return ( (e >>>= 0), t || D(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24) ) }), (o.prototype.readInt32BE = function (e, t) { return ( (e >>>= 0), t || D(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3] ) }), (o.prototype.readBigInt64LE = te(function (e) { Q((e >>>= 0), 'offset') var t = this[e], n = this[e + 7] ;(void 0 !== t && void 0 !== n) || q(e, this.length - 8) var r = this[e + 4] + this[e + 5] * Math.pow(2, 8) + this[e + 6] * Math.pow(2, 16) + (n << 24) return ( (BigInt(r) << BigInt(32)) + BigInt( t + this[++e] * Math.pow(2, 8) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 24) ) ) })), (o.prototype.readBigInt64BE = te(function (e) { Q((e >>>= 0), 'offset') var t = this[e], n = this[e + 7] ;(void 0 !== t && void 0 !== n) || q(e, this.length - 8) var r = (t << 24) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 8) + this[++e] return ( (BigInt(r) << BigInt(32)) + BigInt( this[++e] * Math.pow(2, 24) + this[++e] * Math.pow(2, 16) + this[++e] * Math.pow(2, 8) + n ) ) })), (o.prototype.readFloatLE = function (e, t) { return ((e >>>= 0), t || D(e, 4, this.length), n.read(this, e, !0, 23, 4)) }), (o.prototype.readFloatBE = function (e, t) { return ((e >>>= 0), t || D(e, 4, this.length), n.read(this, e, !1, 23, 4)) }), (o.prototype.readDoubleLE = function (e, t) { return ((e >>>= 0), t || D(e, 8, this.length), n.read(this, e, !0, 52, 8)) }), (o.prototype.readDoubleBE = function (e, t) { return ((e >>>= 0), t || D(e, 8, this.length), n.read(this, e, !1, 52, 8)) }), (o.prototype.writeUintLE = o.prototype.writeUIntLE = function (e, t, n, r) { ;((e = +e), (t >>>= 0), (n >>>= 0), r) || O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0) var i = 1, a = 0 for (this[t] = 255 & e; ++a < n && (i *= 256); ) this[t + a] = (e / i) & 255 return t + n }), (o.prototype.writeUintBE = o.prototype.writeUIntBE = function (e, t, n, r) { ;((e = +e), (t >>>= 0), (n >>>= 0), r) || O(this, e, t, n, Math.pow(2, 8 * n) - 1, 0) var i = n - 1, a = 1 for (this[t + i] = 255 & e; --i >= 0 && (a *= 256); ) this[t + i] = (e / a) & 255 return t + n }), (o.prototype.writeUint8 = o.prototype.writeUInt8 = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 1, 255, 0), (this[t] = 255 & e), t + 1 ) }), (o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 2, 65535, 0), (this[t] = 255 & e), (this[t + 1] = e >>> 8), t + 2 ) }), (o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 2, 65535, 0), (this[t] = e >>> 8), (this[t + 1] = 255 & e), t + 2 ) }), (o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 4, 4294967295, 0), (this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e), t + 4 ) }), (o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 4, 4294967295, 0), (this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e), t + 4 ) }), (o.prototype.writeBigUInt64LE = te(function (e) { return F( this, e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, BigInt(0), BigInt('0xffffffffffffffff') ) })), (o.prototype.writeBigUInt64BE = te(function (e) { return B( this, e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, BigInt(0), BigInt('0xffffffffffffffff') ) })), (o.prototype.writeIntLE = function (e, t, n, r) { if (((e = +e), (t >>>= 0), !r)) { var i = Math.pow(2, 8 * n - 1) O(this, e, t, n, i - 1, -i) } var a = 0, o = 1, s = 0 for (this[t] = 255 & e; ++a < n && (o *= 256); ) (e < 0 && 0 === s && 0 !== this[t + a - 1] && (s = 1), (this[t + a] = (((e / o) | 0) - s) & 255)) return t + n }), (o.prototype.writeIntBE = function (e, t, n, r) { if (((e = +e), (t >>>= 0), !r)) { var i = Math.pow(2, 8 * n - 1) O(this, e, t, n, i - 1, -i) } var a = n - 1, o = 1, s = 0 for (this[t + a] = 255 & e; --a >= 0 && (o *= 256); ) (e < 0 && 0 === s && 0 !== this[t + a + 1] && (s = 1), (this[t + a] = (((e / o) | 0) - s) & 255)) return t + n }), (o.prototype.writeInt8 = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), (this[t] = 255 & e), t + 1 ) }), (o.prototype.writeInt16LE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 2, 32767, -32768), (this[t] = 255 & e), (this[t + 1] = e >>> 8), t + 2 ) }), (o.prototype.writeInt16BE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 2, 32767, -32768), (this[t] = e >>> 8), (this[t + 1] = 255 & e), t + 2 ) }), (o.prototype.writeInt32LE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 4, 2147483647, -2147483648), (this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24), t + 4 ) }), (o.prototype.writeInt32BE = function (e, t, n) { return ( (e = +e), (t >>>= 0), n || O(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), (this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e), t + 4 ) }), (o.prototype.writeBigInt64LE = te(function (e) { return F( this, e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff') ) })), (o.prototype.writeBigInt64BE = te(function (e) { return B( this, e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff') ) })), (o.prototype.writeFloatLE = function (e, t, n) { return z(this, e, t, !0, n) }), (o.prototype.writeFloatBE = function (e, t, n) { return z(this, e, t, !1, n) }), (o.prototype.writeDoubleLE = function (e, t, n) { return V(this, e, t, !0, n) }), (o.prototype.writeDoubleBE = function (e, t, n) { return V(this, e, t, !1, n) }), (o.prototype.copy = function (e, t, n, r) { if (!o.isBuffer(e)) throw new TypeError('argument should be a Buffer') if ( (n || (n = 0), r || 0 === r || (r = this.length), t >= e.length && (t = e.length), t || (t = 0), r > 0 && r < n && (r = n), r === n) ) return 0 if (0 === e.length || 0 === this.length) return 0 if (t < 0) throw new RangeError('targetStart out of bounds') if (n < 0 || n >= this.length) throw new RangeError('Index out of range') if (r < 0) throw new RangeError('sourceEnd out of bounds') ;(r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n)) var i = r - n return ( this === e && 'function' == typeof Uint8Array.prototype.copyWithin ? this.copyWithin(t, n, r) : Uint8Array.prototype.set.call(e, this.subarray(n, r), t), i ) }), (o.prototype.fill = function (e, t, n, r) { if ('string' == typeof e) { if ( ('string' == typeof t ? ((r = t), (t = 0), (n = this.length)) : 'string' == typeof n && ((r = n), (n = this.length)), void 0 !== r && 'string' != typeof r) ) throw new TypeError('encoding must be a string') if ('string' == typeof r && !o.isEncoding(r)) throw new TypeError('Unknown encoding: ' + r) if (1 === e.length) { var i = e.charCodeAt(0) ;(('utf8' === r && i < 128) || 'latin1' === r) && (e = i) } } else 'number' == typeof e ? (e &= 255) : 'boolean' == typeof e && (e = Number(e)) if (t < 0 || this.length < t || this.length < n) throw new RangeError('Out of range index') if (n <= t) return this var a if ( ((t >>>= 0), (n = void 0 === n ? this.length : n >>> 0), e || (e = 0), 'number' == typeof e) ) for (a = t; a < n; ++a) this[a] = e else { var s = o.isBuffer(e) ? e : o.from(e, r), u = s.length if (0 === u) throw new TypeError( 'The value "' + e + '" is invalid for argument "value"' ) for (a = 0; a < n - t; ++a) this[a + t] = s[a % u] } return this })) var H = {} function W(e, t, n) { H[e] = (function (n) { function r() { var n return ( A(this, r), (n = y(this, r)), Object.defineProperty(n, 'message', { value: t.apply(n, arguments), writable: !0, configurable: !0, }), (n.name = ''.concat(n.name, ' [').concat(e, ']')), n.stack, delete n.name, n ) } return ( x(r, n), T(r, [ { key: 'code', get: function () { return e }, set: function (e) { Object.defineProperty(this, 'code', { configurable: !0, enumerable: !0, value: e, writable: !0, }) }, }, { key: 'toString', value: function () { return '' .concat(this.name, ' [') .concat(e, ']: ') .concat(this.message) }, }, ]) ) })(n) } function G(e) { for (var t = '', n = e.length, r = '-' === e[0] ? 1 : 0; n >= r + 4; n -= 3) t = '_'.concat(e.slice(n - 3, n)).concat(t) return ''.concat(e.slice(0, n)).concat(t) } function j(e, t, n, r, i, a) { if (e > n || e < t) { var o, s = 'bigint' == typeof t ? 'n' : '' throw ( (o = 0 === t || t === BigInt(0) ? '>= 0' .concat(s, ' and < 2') .concat(s, ' ** ') .concat(8 * (a + 1)) .concat(s) : '>= -(2' .concat(s, ' ** ') .concat(8 * (a + 1) - 1) .concat(s, ') and < 2 ** ') + ''.concat(8 * (a + 1) - 1).concat(s)), new H.ERR_OUT_OF_RANGE('value', o, e) ) } !(function (e, t, n) { ;(Q(t, 'offset'), (void 0 !== e[t] && void 0 !== e[t + n]) || q(t, e.length - (n + 1))) })(r, i, a) } function Q(e, t) { if ('number' != typeof e) throw new H.ERR_INVALID_ARG_TYPE(t, 'number', e) } function q(e, t, n) { if (Math.floor(e) !== e) throw (Q(e, n), new H.ERR_OUT_OF_RANGE('offset', 'an integer', e)) if (t < 0) throw new H.ERR_BUFFER_OUT_OF_BOUNDS() throw new H.ERR_OUT_OF_RANGE('offset', '>= '.concat(0, ' and <= ', t), e) } ;(W( 'ERR_BUFFER_OUT_OF_BOUNDS', function (e) { return e ? ''.concat(e, ' is outside of buffer bounds') : 'Attempt to access memory outside buffer bounds' }, RangeError ), W( 'ERR_INVALID_ARG_TYPE', function (e, t) { return 'The "' .concat(e, '" argument must be of type number. Received type ') .concat(P(t)) }, TypeError ), W( 'ERR_OUT_OF_RANGE', function (e, t, n) { var r = 'The value of "'.concat(e, '" is out of range.'), i = n return ( Number.isInteger(n) && Math.abs(n) > Math.pow(2, 32) ? (i = G(String(n))) : 'bigint' == typeof n && ((i = String(n)), (n > Math.pow(BigInt(2), BigInt(32)) || n < -Math.pow(BigInt(2), BigInt(32))) && (i = G(i)), (i += 'n')), (r += ' It must be '.concat(t, '. Received ').concat(i)) ) }, RangeError )) var X = /[^+/0-9A-Za-z-_]/g function Y(e, t) { var n t = t || 1 / 0 for (var r = e.length, i = null, a = [], o = 0; o < r; ++o) { if ((n = e.charCodeAt(o)) > 55295 && n < 57344) { if (!i) { if (n > 56319) { ;(t -= 3) > -1 && a.push(239, 191, 189) continue } if (o + 1 === r) { ;(t -= 3) > -1 && a.push(239, 191, 189) continue } i = n continue } if (n < 56320) { ;((t -= 3) > -1 && a.push(239, 191, 189), (i = n)) continue } n = 65536 + (((i - 55296) << 10) | (n - 56320)) } else i && (t -= 3) > -1 && a.push(239, 191, 189) if (((i = null), n < 128)) { if ((t -= 1) < 0) break a.push(n) } else if (n < 2048) { if ((t -= 2) < 0) break a.push((n >> 6) | 192, (63 & n) | 128) } else if (n < 65536) { if ((t -= 3) < 0) break a.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128) } else { if (!(n < 1114112)) throw new Error('Invalid code point') if ((t -= 4) < 0) break a.push( (n >> 18) | 240, ((n >> 12) & 63) | 128, ((n >> 6) & 63) | 128, (63 & n) | 128 ) } } return a } function K(e) { return t.toByteArray( (function (e) { if ((e = (e = e.split('=')[0]).trim().replace(X, '')).length < 2) return '' for (; e.length % 4 != 0; ) e += '=' return e })(e) ) } function Z(e, t, n, r) { var i for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i] return i } function J(e, t) { return ( e instanceof t || (null != e && null != e.constructor && null != e.constructor.name && e.constructor.name === t.name) ) } function $(e) { return e != e } var ee = (function () { for (var e = '0123456789abcdef', t = new Array(256), n = 0; n < 16; ++n) for (var r = 16 * n, i = 0; i < 16; ++i) t[r + i] = e[n] + e[i] return t })() function te(e) { return 'undefined' == typeof BigInt ? ne : e } function ne() { throw new Error('BigInt not supported') } })(au)), au ) } var lu, cu, hu, du, fu, pu, vu, mu, gu = uu() function yu() { if (pu) return fu pu = 1 var e = (function () { if (du) return hu ;((du = 1), (hu = t)) var e = null try { e = new WebAssembly.Instance( new WebAssembly.Module( new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, ]) ), {} ).exports } catch (ZJ) {} function t(e, t, n) { ;((this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!n)) } function n(e) { return !0 === (e && e.__isLong__) } ;(t.prototype.__isLong__, Object.defineProperty(t.prototype, '__isLong__', { value: !0 }), (t.isLong = n)) var r = {}, i = {} function a(e, t) { var n, a, o return t ? (o = 0 <= (e >>>= 0) && e < 256) && (a = i[e]) ? a : ((n = s(e, (0 | e) < 0 ? -1 : 0, !0)), o && (i[e] = n), n) : (o = -128 <= (e |= 0) && e < 128) && (a = r[e]) ? a : ((n = s(e, e < 0 ? -1 : 0, !1)), o && (r[e] = n), n) } function o(e, t) { if (isNaN(e)) return t ? m : v if (t) { if (e < 0) return m if (e >= d) return x } else { if (e <= -f) return S if (e + 1 >= f) return b } return e < 0 ? o(-e, t).neg() : s(e % h | 0, (e / h) | 0, t) } function s(e, n, r) { return new t(e, n, r) } ;((t.fromInt = a), (t.fromNumber = o), (t.fromBits = s)) var u = Math.pow function l(e, t, n) { if (0 === e.length) throw Error('empty string') if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return v if ( ('number' == typeof t ? ((n = t), (t = !1)) : (t = !!t), (n = n || 10) < 2 || 36 < n) ) throw RangeError('radix') var r if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen') if (0 === r) return l(e.substring(1), t, n).neg() for (var i = o(u(n, 8)), a = v, s = 0; s < e.length; s += 8) { var c = Math.min(8, e.length - s), h = parseInt(e.substring(s, s + c), n) if (c < 8) { var d = o(u(n, c)) a = a.mul(d).add(o(h)) } else a = (a = a.mul(i)).add(o(h)) } return ((a.unsigned = t), a) } function c(e, t) { return 'number' == typeof e ? o(e, t) : 'string' == typeof e ? l(e, t) : s(e.low, e.high, 'boolean' == typeof t ? t : e.unsigned) } ;((t.fromString = l), (t.fromValue = c)) var h = 4294967296, d = h * h, f = d / 2, p = a(1 << 24), v = a(0) t.ZERO = v var m = a(0, !0) t.UZERO = m var g = a(1) t.ONE = g var y = a(1, !0) t.UONE = y var _ = a(-1) t.NEG_ONE = _ var b = s(-1, 2147483647, !1) t.MAX_VALUE = b var x = s(-1, -1, !0) t.MAX_UNSIGNED_VALUE = x var S = s(0, -2147483648, !1) t.MIN_VALUE = S var A = t.prototype return ( (A.toInt = function () { return this.unsigned ? this.low >>> 0 : this.low }), (A.toNumber = function () { return this.unsigned ? (this.high >>> 0) * h + (this.low >>> 0) : this.high * h + (this.low >>> 0) }), (A.toString = function (e) { if ((e = e || 10) < 2 || 36 < e) throw RangeError('radix') if (this.isZero()) return '0' if (this.isNegative()) { if (this.eq(S)) { var t = o(e), n = this.div(t), r = n.mul(t).sub(this) return n.toString(e) + r.toInt().toString(e) } return '-' + this.neg().toString(e) } for (var i = o(u(e, 6), this.unsigned), a = this, s = ''; ; ) { var l = a.div(i), c = (a.sub(l.mul(i)).toInt() >>> 0).toString(e) if ((a = l).isZero()) return c + s for (; c.length < 6; ) c = '0' + c s = '' + c + s } }), (A.getHighBits = function () { return this.high }), (A.getHighBitsUnsigned = function () { return this.high >>> 0 }), (A.getLowBits = function () { return this.low }), (A.getLowBitsUnsigned = function () { return this.low >>> 0 }), (A.getNumBitsAbs = function () { if (this.isNegative()) return this.eq(S) ? 64 : this.neg().getNumBitsAbs() for ( var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && !(e & (1 << t)); t-- ); return 0 != this.high ? t + 33 : t + 1 }), (A.isZero = function () { return 0 === this.high && 0 === this.low }), (A.eqz = A.isZero), (A.isNegative = function () { return !this.unsigned && this.high < 0 }), (A.isPositive = function () { return this.unsigned || this.high >= 0 }), (A.isOdd = function () { return !(1 & ~this.low) }), (A.isEven = function () { return !(1 & this.low) }), (A.equals = function (e) { return ( n(e) || (e = c(e)), (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low ) }), (A.eq = A.equals), (A.notEquals = function (e) { return !this.eq(e) }), (A.neq = A.notEquals), (A.ne = A.notEquals), (A.lessThan = function (e) { return this.comp(e) < 0 }), (A.lt = A.lessThan), (A.lessThanOrEqual = function (e) { return this.comp(e) <= 0 }), (A.lte = A.lessThanOrEqual), (A.le = A.lessThanOrEqual), (A.greaterThan = function (e) { return this.comp(e) > 0 }), (A.gt = A.greaterThan), (A.greaterThanOrEqual = function (e) { return this.comp(e) >= 0 }), (A.gte = A.greaterThanOrEqual), (A.ge = A.greaterThanOrEqual), (A.compare = function (e) { if ((n(e) || (e = c(e)), this.eq(e))) return 0 var t = this.isNegative(), r = e.isNegative() return t && !r ? -1 : !t && r ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || (e.high === this.high && e.low >>> 0 > this.low >>> 0) ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1 }), (A.comp = A.compare), (A.negate = function () { return !this.unsigned && this.eq(S) ? S : this.not().add(g) }), (A.neg = A.negate), (A.add = function (e) { n(e) || (e = c(e)) var t = this.high >>> 16, r = 65535 & this.high, i = this.low >>> 16, a = 65535 & this.low, o = e.high >>> 16, u = 65535 & e.high, l = e.low >>> 16, h = 0, d = 0, f = 0, p = 0 return ( (f += (p += a + (65535 & e.low)) >>> 16), (d += (f += i + l) >>> 16), (h += (d += r + u) >>> 16), (h += t + o), s( ((f &= 65535) << 16) | (p &= 65535), ((h &= 65535) << 16) | (d &= 65535), this.unsigned ) ) }), (A.subtract = function (e) { return (n(e) || (e = c(e)), this.add(e.neg())) }), (A.sub = A.subtract), (A.multiply = function (t) { if (this.isZero()) return v if ((n(t) || (t = c(t)), e)) return s( e.mul(this.low, this.high, t.low, t.high), e.get_high(), this.unsigned ) if (t.isZero()) return v if (this.eq(S)) return t.isOdd() ? S : v if (t.eq(S)) return this.isOdd() ? S : v if (this.isNegative()) return t.isNegative() ? this.neg().mul(t.neg()) : this.neg().mul(t).neg() if (t.isNegative()) return this.mul(t.neg()).neg() if (this.lt(p) && t.lt(p)) return o(this.toNumber() * t.toNumber(), this.unsigned) var r = this.high >>> 16, i = 65535 & this.high, a = this.low >>> 16, u = 65535 & this.low, l = t.high >>> 16, h = 65535 & t.high, d = t.low >>> 16, f = 65535 & t.low, m = 0, g = 0, y = 0, _ = 0 return ( (y += (_ += u * f) >>> 16), (g += (y += a * f) >>> 16), (y &= 65535), (g += (y += u * d) >>> 16), (m += (g += i * f) >>> 16), (g &= 65535), (m += (g += a * d) >>> 16), (g &= 65535), (m += (g += u * h) >>> 16), (m += r * f + i * d + a * h + u * l), s( ((y &= 65535) << 16) | (_ &= 65535), ((m &= 65535) << 16) | (g &= 65535), this.unsigned ) ) }), (A.mul = A.multiply), (A.divide = function (t) { if ((n(t) || (t = c(t)), t.isZero())) throw Error('division by zero') var r, i, a if (e) return this.unsigned || -2147483648 !== this.high || -1 !== t.low || -1 !== t.high ? s( (this.unsigned ? e.div_u : e.div_s)(this.low, this.high, t.low, t.high), e.get_high(), this.unsigned ) : this if (this.isZero()) return this.unsigned ? m : v if (this.unsigned) { if ((t.unsigned || (t = t.toUnsigned()), t.gt(this))) return m if (t.gt(this.shru(1))) return y a = m } else { if (this.eq(S)) return t.eq(g) || t.eq(_) ? S : t.eq(S) ? g : (r = this.shr(1).div(t).shl(1)).eq(v) ? t.isNegative() ? g : _ : ((i = this.sub(t.mul(r))), (a = r.add(i.div(t)))) if (t.eq(S)) return this.unsigned ? m : v if (this.isNegative()) return t.isNegative() ? this.neg().div(t.neg()) : this.neg().div(t).neg() if (t.isNegative()) return this.div(t.neg()).neg() a = v } for (i = this; i.gte(t); ) { r = Math.max(1, Math.floor(i.toNumber() / t.toNumber())) for ( var l = Math.ceil(Math.log(r) / Math.LN2), h = l <= 48 ? 1 : u(2, l - 48), d = o(r), f = d.mul(t); f.isNegative() || f.gt(i); ) f = (d = o((r -= h), this.unsigned)).mul(t) ;(d.isZero() && (d = g), (a = a.add(d)), (i = i.sub(f))) } return a }), (A.div = A.divide), (A.modulo = function (t) { return ( n(t) || (t = c(t)), e ? s( (this.unsigned ? e.rem_u : e.rem_s)(this.low, this.high, t.low, t.high), e.get_high(), this.unsigned ) : this.sub(this.div(t).mul(t)) ) }), (A.mod = A.modulo), (A.rem = A.modulo), (A.not = function () { return s(~this.low, ~this.high, this.unsigned) }), (A.and = function (e) { return ( n(e) || (e = c(e)), s(this.low & e.low, this.high & e.high, this.unsigned) ) }), (A.or = function (e) { return ( n(e) || (e = c(e)), s(this.low | e.low, this.high | e.high, this.unsigned) ) }), (A.xor = function (e) { return ( n(e) || (e = c(e)), s(this.low ^ e.low, this.high ^ e.high, this.unsigned) ) }), (A.shiftLeft = function (e) { return ( n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? s( this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned ) : s(0, this.low << (e - 32), this.unsigned) ) }), (A.shl = A.shiftLeft), (A.shiftRight = function (e) { return ( n(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? s( (this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned ) : s(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned) ) }), (A.shr = A.shiftRight), (A.shiftRightUnsigned = function (e) { if ((n(e) && (e = e.toInt()), 0 == (e &= 63))) return this var t = this.high return e < 32 ? s((this.low >>> e) | (t << (32 - e)), t >>> e, this.unsigned) : s(32 === e ? t : t >>> (e - 32), 0, this.unsigned) }), (A.shru = A.shiftRightUnsigned), (A.shr_u = A.shiftRightUnsigned), (A.toSigned = function () { return this.unsigned ? s(this.low, this.high, !1) : this }), (A.toUnsigned = function () { return this.unsigned ? this : s(this.low, this.high, !0) }), (A.toBytes = function (e) { return e ? this.toBytesLE() : this.toBytesBE() }), (A.toBytesLE = function () { var e = this.high, t = this.low return [ 255 & t, (t >>> 8) & 255, (t >>> 16) & 255, t >>> 24, 255 & e, (e >>> 8) & 255, (e >>> 16) & 255, e >>> 24, ] }), (A.toBytesBE = function () { var e = this.high, t = this.low return [ e >>> 24, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e, t >>> 24, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t, ] }), (t.fromBytes = function (e, n, r) { return r ? t.fromBytesLE(e, n) : t.fromBytesBE(e, n) }), (t.fromBytesLE = function (e, n) { return new t( e[0] | (e[1] << 8) | (e[2] << 16) | (e[3] << 24), e[4] | (e[5] << 8) | (e[6] << 16) | (e[7] << 24), n ) }), (t.fromBytesBE = function (e, n) { return new t( (e[4] << 24) | (e[5] << 16) | (e[6] << 8) | e[7], (e[0] << 24) | (e[1] << 16) | (e[2] << 8) | e[3], n ) }), hu ) })(), t = function (t, n, r) { ;(t instanceof e || (t = 'number' == typeof t ? e.fromNumber(t) : e.fromString(t || '')), n.writeInt32LE(t.getLowBits(), r, !0), n.writeInt32LE(t.getHighBits(), r + 4, !0)) }, n = function (t, n, r) { ;(t instanceof e || (t = 'number' == typeof t ? e.fromNumber(t) : e.fromString(t || '')), n.writeInt32BE(t.getHighBits(), r, !0), n.writeInt32BE(t.getLowBits(), r + 4, !0)) } return (fu = { unpackUInt64LE: function (t, n) { return e.fromBits(t.readInt32LE(n), t.readInt32LE(n + 4), !0) }, unpackUInt64BE: function (t, n) { return e.fromBits(t.readInt32BE(n + 4), t.readInt32BE(n), !0) }, unpackInt64LE: function (t, n) { return e.fromBits(t.readInt32LE(n), t.readInt32LE(n + 4), !1) }, unpackInt64BE: function (t, n) { return e.fromBits(t.readInt32BE(n + 4), t.readInt32BE(n), !1) }, packUInt64LE: t, packUInt64BE: n, packInt64LE: t, packInt64BE: n, }) } var _u = (mu || ((mu = 1), (vu = (function () { if (cu) return lu cu = 1 var e = function (e, t, n) { var r = e.indexOf(0, t), i = Math.min(t + n, -1 === r ? e.length : r) return e.slice(t, i).toString('utf8') }, t = function (e, t, n, r) { var i = t.write(e, n, r, 'utf8') i < r && t.fill(0, n + i, n + r) }, n = function (e, t, n) { var r = e[0] return (r >= n && (r = n - 1), t++, e.slice(t, t + r).toString('utf8')) }, r = function (e, t, n, r) { var i = Buffer.alloc(e, 'utf8'), a = i.length ;(a >= r && (a = r - 1), a > 255 && (a = 255), (i[n] = a), i.copy(t, n + 1, 0, a), t.fill(0, n + 1 + a, n + r)) }, i = function (e, t) { return e.readUInt32LE(t, !0) }, a = function (e, t) { return e.readUInt32BE(t, !0) }, o = function (e, t) { return e.readInt32LE(t, !0) }, s = function (e, t) { return e.readInt32BE(t, !0) }, u = function (e, t, n) { t.writeUInt32LE(e, n, !0) }, l = function (e, t, n) { t.writeUInt32BE(e, n, !0) }, c = function (e, t, n) { t.writeInt32LE(e, n, !0) }, h = function (e, t, n) { t.writeInt32BE(e, n, !0) } return ( (lu = function (d) { var f = d.Buffer, p = void 0 === d.isLittleEndian || !!d.isLittleEndian, v = void 0 === d.is64bit || !!d.is64bit, m = d.unpackUInt64LE, g = d.unpackUInt64BE, y = d.unpackInt64LE, _ = d.unpackInt64BE, b = d.packUInt64LE, x = d.packUInt64BE, S = d.packInt64LE, w = d.packInt64BE, M = { x: [1, 1, null, null], c: [ 1, 1, function (e, t) { return String.fromCharCode(e[t]) }, function (e, t, n) { t[n] = e.charCodeAt(0) }, ], b: [ 1, 1, function (e, t) { return e.readInt8(t) }, function (e, t, n) { t.writeInt8(e, n, !0) }, ], B: [ 1, 1, function (e, t) { return e[t] }, function (e, t, n) { t[n] = e }, ], h: [ 2, 2, p ? function (e, t) { return e.readInt16LE(t) } : function (e, t) { return e.readInt16BE(t) }, p ? function (e, t, n) { return t.writeInt16LE(e, n, !0) } : function (e, t, n) { return t.writeInt16BE(e, n, !0) }, ], H: [ 2, 2, p ? function (e, t) { return e.readUInt16LE(t) } : function (e, t) { return e.readUInt16BE(t) }, p ? function (e, t, n) { return t.writeUInt16LE(e, n, !0) } : function (e, t, n) { return t.writeUInt16BE(e, n, !0) }, ], i: [4, 4, p ? o : s, p ? c : h], I: [4, 4, p ? i : a, p ? u : l], l: [4, 4, p ? o : s, p ? c : h], L: [4, 4, p ? i : a, p ? u : l], f: [ 4, 4, p ? function (e, t) { return e.readFloatLE(t) } : function (e, t) { return e.readFloatBE(t) }, p ? function (e, t, n) { return t.writeFloatLE(e, n, !0) } : function (e, t, n) { return t.writeFloatBE(e, n, !0) }, ], d: [ 8, 8, p ? function (e, t) { return e.readDoubleLE(t) } : function (e, t) { return e.readDoubleBE(t) }, p ? function (e, t, n) { return t.writeDoubleLE(e, n, !0) } : function (e, t, n) { return t.writeDoubleBE(e, n, !0) }, ], s: [1, 1, e, t], p: [1, 1, n, r], P: [ v ? 8 : 4, v ? 8 : 4, p ? (v ? m : i) : v ? g : a, p ? (v ? b : u) : v ? x : l, ], q: [8, 8, p ? y : _, p ? S : w], Q: [8, 8, p ? m : g, p ? b : x], '?': [ 1, 1, function (e, t) { return 0 !== e[t] }, function (e, t, n) { t[n] = e ? 1 : 0 }, ], }, E = { x: [1, 1, null, null], c: [ 1, 1, function (e, t) { return String.fromCharCode(e[t]) }, function (e, t, n) { t[n] = e.charCodeAt(0) }, ], b: [ 1, 1, function (e, t) { return e.readInt8(t) }, function (e, t, n) { t.writeInt8(e, n, !0) }, ], B: [ 1, 1, function (e, t) { return e[t] }, function (e, t, n) { t[n] = e }, ], h: [ 2, 1, function (e, t) { return e.readInt16LE(t) }, function (e, t, n) { return t.writeInt16LE(e, n, !0) }, ], H: [ 2, 1, function (e, t) { return e.readUInt16LE(t) }, function (e, t, n) { return t.writeUInt16LE(e, n, !0) }, ], i: [4, 1, o, c], I: [4, 1, i, u], l: [4, 1, o, c], L: [4, 1, i, u], f: [ 4, 1, function (e, t) { return e.readFloatLE(t) }, function (e, t, n) { return t.writeFloatLE(e, n, !0) }, ], d: [ 8, 1, function (e, t) { return e.readDoubleLE(t) }, function (e, t, n) { return t.writeDoubleLE(e, n, !0) }, ], s: [1, 1, e, t], p: [1, 1, n, r], P: [v ? 8 : 4, 1, v ? m : i, v ? b : u], q: [8, 1, y, S], Q: [8, 1, m, b], '?': [ 1, 1, function (e, t) { return 0 !== e[t] }, function (e, t, n) { t[n] = e ? 1 : 0 }, ], }, C = { x: [1, 1, null, null], c: [ 1, 1, function (e, t) { return String.fromCharCode(e[t]) }, function (e, t, n) { t[n] = e.charCodeAt(0) }, ], b: [ 1, 1, function (e, t) { return e.readInt8(t) }, function (e, t, n) { t.writeInt8(e, n, !0) }, ], B: [ 1, 1, function (e, t) { return e[t] }, function (e, t, n) { t[n] = e }, ], h: [ 2, 1, function (e, t) { return e.readInt16BE(t) }, function (e, t, n) { return t.writeInt16BE(e, n, !0) }, ], H: [ 2, 1, function (e, t) { return e.readUInt16BE(t) }, function (e, t, n) { return t.writeUInt16BE(e, n, !0) }, ], i: [4, 1, s, h], I: [4, 1, a, l], l: [4, 1, s, h], L: [4, 1, a, l], f: [ 4, 1, function (e, t) { return e.readFloatBE(t) }, function (e, t, n) { return t.writeFloatBE(e, n, !0) }, ], d: [ 8, 1, function (e, t) { return e.readDoubleBE(t) }, function (e, t, n) { return t.writeDoubleBE(e, n, !0) }, ], s: [1, 1, e, t], p: [1, 1, n, r], P: [v ? 8 : 4, 1, v ? g : a, v ? x : l], q: [8, 1, _, w], Q: [8, 1, g, x], '?': [ 1, 1, function (e, t) { return 0 !== e[t] }, function (e, t, n) { t[n] = e ? 1 : 0 }, ], }, k = function (e) { var t = e[0], n = !0, r = M switch (t) { case '<': r = E break case '>': case '!': r = C break case '=': r = p ? E : C break default: n = !1 case '@': r = M } return { map: r, skipFirst: n } }, R = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'sizeOf', value: function (e) { var t, n, r, i, a = 0, o = null, s = 0, u = k(e), l = u.map for (u.skipFirst && s++, n = e.length; s < n; s++) (t = e[s]) >= '0' && t <= '9' ? (o = null === o ? t : o + t) : (r = l[t]) && ((i = r[1]) > 1 && (a = Math.ceil(a / i) * i), (o = o ? parseInt(o, 10) : 0), (a += 's' === t ? o || 0 : 'p' === t ? o || 1 : r[0] * (o || 1)), (o = null)) return a }, }, { key: 'unpack', value: function (t, n, r) { return e.unpackFrom(t, n, r, 0) }, }, { key: 'unpackFrom', value: function (e, t, n, r) { var i = [], a = null, o = 0, s = k(e), u = s.map s.skipFirst && o++ for (var l = e.length; o < l; o++) { var c = e[o] if (c >= '0' && c <= '9') a = null === a ? c : a + c else { var h = u[c] if (h) { var d = h[0], f = h[1] ;(f > 1 && (r = Math.ceil(r / f) * f), (a = a ? parseInt(a, 10) : 0)) var p = void 0 's' === c ? ((p = 1), (d = a)) : 'p' === c ? ((p = 1), (d = a || 1)) : (p = a || 1) for (var v = h[2]; p > 0; ) { if (v) { if (n && r + d >= t.length) throw new Error( "Reached end of buffer, can't unpack anymore data." ) i.push(v(t, r, a)) } ;((r += d), p--) } a = null } } } return i }, }, { key: 'pack', value: function (t, n, r) { Array.isArray(n) || ((n = Array.prototype.slice.call(arguments, 1)), (r = !0)) var i = f.alloc(e.sizeOf(t)), a = 0, o = null, s = 0, u = 0, l = k(t), c = l.map l.skipFirst && s++ for (var h = t.length; s < h; s++) { var d = t[s] if (d >= '0' && d <= '9') o = null === o ? d : o + d else { var p = c[d] if (p) { var v = p[0], m = p[1] ;(m > 1 && (a = Math.ceil(a / m) * m), (o = o ? parseInt(o, 10) : 0)) var g = void 0 's' === d ? ((g = 1), (v = o)) : 'p' === d ? ((g = 1), (v = o || 1)) : (g = o || 1) for (var y = p[3]; g > 0; ) { if (y) { if (r && u >= n.length) throw new Error( 'Reached end of data, no more elements to pack.' ) ;(y(n[u], i, a, o), u++) } ;((a += v), g--) } o = null } } } return i }, }, ]) })() return R }), lu ) })()( Object.assign( { Buffer: uu().Buffer, isLittleEndian: void 0 === ('undefined' == typeof Uint8Array ? 'undefined' : P(Uint8Array)) || 120 === new Uint8Array(new Uint32Array([305419896]).buffer)[0], is64bit: void 0 === ('undefined' == typeof navigator ? 'undefined' : P(navigator)) || /WOW64|Win64|arm64|ia64|x64;|Mac OS X/i.test(navigator.userAgent), }, yu() ) ))), vu), bu = as(_u), xu = (function () { var e = v( d().m(function e(t) { var n, r, i, a, o, s, u, l, c = arguments return d().w(function (e) { for (;;) switch (e.n) { case 0: return ( (n = c.length > 1 && void 0 !== c[1] ? c[1] : ' 0 && void 0 !== arguments[0] ? arguments[0] : 21, t = '', n = crypto.getRandomValues(new Uint8Array((e |= 0))); e--; ) t += 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'[ 63 & n[e] ] return t })() ), M(this, 'analyserNode', void 0), M(this, 'audioCtx', void 0), M(this, 'autoPlay', !0), M(this, 'bufferSource', void 0), M(this, 'convertValue', 32768), M(this, 'ee', void 0), M(this, 'gainNode', void 0), M(this, 'option', { inputCodec: 'Int16', channels: 1, sampleRate: 8e3, fftSize: 2048, onended: function () {}, isMute: !1, }), M(this, 'samplesList', []), M(this, 'startTime', void 0), M(this, 'typedArray', void 0), M(this, '_firstStartRelativeTime', void 0), M(this, '_firstStartAbsoluteTime', void 0), (this.ee = n), this.init(t)) } return T( e, [ { key: 'continue', value: ((r = v( d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.audioCtx.resume()) case 1: return e.a(2) } }, e, this ) }) )), function () { return r.apply(this, arguments) }), }, { key: 'destroy', value: function () { var e ;((this.samplesList = []), null === (e = this.audioCtx) || void 0 === e || e.close(), (this.audioCtx = void 0)) }, }, { key: 'feed', value: function (e) { var t = e.audio, n = e.end_of_batch if (t) { ;(this._isSupported(t), (t = this._getFormattedValue(t))) var r = new Float32Array(t.length) r.set(t, 0) var i = { data: r, end_of_batch: n } ;(this.samplesList.push(i), this.flush(i, this.samplesList.length - 1)) } }, }, { key: 'flush', value: function (e, t) { var n = this if (e && this.autoPlay && this.audioCtx) { var r = e.data, i = e.end_of_batch ;(this.bufferSource && (this.bufferSource.onended = function () {}), (this.bufferSource = this.audioCtx.createBufferSource()), 'function' == typeof this.option.onended && (this.bufferSource.onended = function () { ;(i || t !== n.samplesList.length - 1 || n.ee.emit(ds.Player_WaitNextAudioClip), n.option.onended()) })) for ( var a = r.length / this.option.channels, o = this.audioCtx.createBuffer( this.option.channels, a, this.option.sampleRate ), s = 0; s < this.option.channels; s++ ) for (var u = o.getChannelData(s), l = s, c = 50, h = 0; h < a; h++) ((u[h] = r[l]), h < 50 && (u[h] = (u[h] * h) / 50), h >= a - 51 && (u[h] = (u[h] * c--) / 50), (l += this.option.channels)) ;(this.startTime < this.audioCtx.currentTime && (this.startTime = this.audioCtx.currentTime), (this.bufferSource.buffer = o), this.bufferSource.connect(this.gainNode), this.bufferSource.connect(this.analyserNode), this.bufferSource.start(this.startTime), (e.startTime = this.startTime), void 0 === this._firstStartAbsoluteTime && (this._firstStartAbsoluteTime = Date.now()), void 0 === this._firstStartRelativeTime && ((this._firstStartRelativeTime = this.startTime), this.ee.emit(ds.Player_StartSpeaking, this)), (this.startTime += o.duration)) } }, }, { key: 'init', value: function (e) { ;((this.option = Object.assign(this.option, e)), (this.convertValue = this._getConvertValue()), (this.typedArray = this._getTypedArray()), this.initAudioContext()) }, }, { key: 'initAudioContext', value: function () { ;((this.audioCtx = new (window.AudioContext || window.webkitAudioContext)()), (this.gainNode = this.audioCtx.createGain()), (this.gainNode.gain.value = this.option.isMute ? 0 : 1), this.gainNode.connect(this.audioCtx.destination), (this.startTime = this.audioCtx.currentTime), (this.analyserNode = this.audioCtx.createAnalyser()), (this.analyserNode.fftSize = this.option.fftSize)) }, }, { key: 'setMute', value: function (e) { this.gainNode.gain.value = e ? 0 : 1 }, }, { key: 'pause', value: ((n = v( d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.audioCtx.suspend()) case 1: return e.a(2) } }, e, this ) }) )), function () { return n.apply(this, arguments) }), }, { key: 'updateAutoPlay', value: ((t = v( d().m(function e(t) { var n = this return d().w( function (e) { for (;;) switch (e.n) { case 0: this.autoPlay !== t && t ? ((this.autoPlay = t), this.samplesList.forEach(function (e, t) { n.flush(e, t) })) : (this.autoPlay = t) case 1: return e.a(2) } }, e, this ) }) )), function (e) { return t.apply(this, arguments) }), }, { key: 'volume', value: function (e) { this.gainNode.gain.value = e }, }, { key: '_getFormattedValue', value: function (e) { var t = this.typedArray e = e.constructor === ArrayBuffer ? new t(e) : new t(e.buffer) for (var n = new Float32Array(e.length), r = 0; r < e.length; r++) n[r] = e[r] / this.convertValue return n }, }, { key: '_isSupported', value: function (t) { if (!e.isTypedArray(t)) throw new Error('请传入ArrayBuffer或者任意TypedArray') return !0 }, }, { key: '_getConvertValue', value: function () { var e = { Int8: 128, Int16: 32768, Int32: 2147483648, Float32: 1 } if (!e[this.option.inputCodec]) throw new Error( 'wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32' ) return e[this.option.inputCodec] }, }, { key: '_getTypedArray', value: function () { var e = { Int8: Int8Array, Int16: Int16Array, Int32: Int32Array, Float32: Float32Array, } if (!e[this.option.inputCodec]) throw new Error( 'wrong codec.please input one of these codecs:Int8,Int16,Int32,Float32' ) return e[this.option.inputCodec] }, }, ], [ { key: 'isTypedArray', value: function (e) { return ( (e.byteLength && e.buffer && e.buffer.constructor === ArrayBuffer) || e.constructor === ArrayBuffer ) }, }, ] ) var t, n, r })(), Au = { int16: 'Int16', int32: 'Int32', float32: 'Float32' }, wu = { int16: Int16Array, int32: Int32Array, float32: Float32Array }, Tu = (function () { return T( function e(t) { ;(A(this, e), M(this, 'ee', void 0), M(this, '_motionDataGroupHandlerQueue', new zs({ concurrency: 1 })), M(this, '_motionDataGroups', []), M(this, '_arkit_face_sample_rate', void 0), M(this, '_arkit_face_channel_names', void 0), M(this, '_tts2face_sample_rate', void 0), M(this, '_tts2face_channel_names', void 0), M(this, '_maxBatchId', void 0), M(this, '_arkitFaceShape', void 0), M(this, '_tts2FaceShape', void 0), (this.ee = t)) }, [ { key: 'add', value: function (e) { var t = this, n = e.avatar_motion_data this._motionDataGroupHandlerQueue.add( v( d().m(function e() { return d().w(function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), t._motionDataGroupHandler(n)) case 1: return e.a(2, e.v) } }, e) }) ) ) }, }, { key: 'clear', value: function () { ;(this._motionDataGroups.forEach(function (e) { var t null === (t = e.player) || void 0 === t || t.destroy() }), (this._motionDataGroups = [])) }, }, { key: 'setMute', value: function (e) { this._motionDataGroups.forEach(function (t) { var n null === (n = t.player) || void 0 === n || n.setMute(e) }) }, }, { key: 'getArkitFaceFrame', value: function () { return { arkitFace: this._getArkitFaceFrame() } }, }, { key: 'getLastBatchId', value: function () { var e return ( this._motionDataGroups.forEach(function (t) { t.batch_id && (e = t.batch_id) }), e ) }, }, { key: 'getTtt2FaceFrame', value: function () { return { tts2Face: this._getTts2FaceFrame() } }, }, { key: 'interrupt', value: function () { var e = this ;(this._motionDataGroups.forEach(function (t) { var n ;(t.batch_id && (e._maxBatchId = t.batch_id), null === (n = t.player) || void 0 === n || n.destroy()) }), (this._motionDataGroups = [])) }, }, { key: '_getArkitFaceFrame', value: function () { if (!this._motionDataGroups.length) return null var e = this._motionDataGroups.find(function (e) { return e.player }) if (!e) return null var t = e.arkitFaceArrayBufferArray, n = e.player if ( n && n._firstStartAbsoluteTime && t && t.length > 0 && this._arkitFaceShape && this._arkit_face_sample_rate ) { var r, i = Date.now() - n._firstStartAbsoluteTime, a = 0 n.samplesList.forEach(function (e, t) { ;(void 0 === r && void 0 !== e.startTime && (r = e.startTime), void 0 !== e.startTime && e.startTime - r <= i / 1e3 && (a = t)) }) var o = n.samplesList[a], s = i - 1e3 * o.startTime, u = Math.floor((s / 1e3) * this._arkit_face_sample_rate), l = new Float32Array(t[a]), c = null == l ? void 0 : l.slice( u * this._arkitFaceShape, u * this._arkitFaceShape + this._arkitFaceShape ) if (null != c && c.length) { var h = {} return ( (this._arkit_face_channel_names || []).forEach(function (e, t) { Object.assign(h, M({}, e, c[t])) }), h ) } return null } return null }, }, { key: '_getTts2FaceFrame', value: function () { if (!this._motionDataGroups.length) return null var e = this._motionDataGroups.find(function (e) { return e.player }) if (!e) return null var t = e.tts2faceArrayBufferArray, n = e.player if ( n && n._firstStartAbsoluteTime && t && t.length > 0 && this._tts2FaceShape && this._tts2face_sample_rate ) { var r, i = Date.now() - n._firstStartAbsoluteTime, a = 0 n.samplesList.forEach(function (e, t) { ;(void 0 === r && void 0 !== e.startTime && (r = e.startTime), void 0 !== e.startTime && e.startTime - r <= i / 1e3 && (a = t)) }) var o = n.samplesList[a], s = i - 1e3 * o.startTime, u = Math.floor((s / 1e3) * this._tts2face_sample_rate), l = new Float32Array(t[a]), c = null == l ? void 0 : l.slice( u * this._tts2FaceShape, u * this._tts2FaceShape + this._tts2FaceShape ) return null != c && c.length ? c : null } return null }, }, { key: '_motionDataGroupHandler', value: ((r = v( d().m(function e(t) { var n, r, i, a, o, s, u, l, c, h, f, p, v, m, g, y return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((e.p = 0), (n = t.first_package), (r = t.motion_data_slice), (i = t.segment_num), (a = t.binary_size), (o = t.use_binary_frame), (s = t.is_audio_mute), !n) ) { e.n = 1 break } ;((u = this._motionDataGroups[this._motionDataGroups.length - 1]) && u.segment_num !== u.motion_data_slices.length && this.ee.emit(cs.ErrorReceived, 'lost data packets'), this._motionDataGroups.push({ first_package: n, binary_size: a, segment_num: i, use_binary_frame: o, motion_data_slices: [], merged_motion_data: new Uint8Array(a), }), (e.n = 8)) break case 1: if (0 !== this._motionDataGroups.length) { e.n = 2 break } return e.a(2) case 2: if (r) { e.n = 3 break } return e.a(2) case 3: if ( ((l = this._motionDataGroups[this._motionDataGroups.length - 1]), (c = this._motionDataGroups[this._motionDataGroups.length - 2]), l.motion_data_slices.push(r), l.motion_data_slices.length !== l.segment_num) ) { e.n = 8 break } return ((h = l.motion_data_slices[0]), (e.n = 4), xu(h)) case 4: if ( ((f = e.v), (p = f.parsedData), (v = f.jsonSize), (m = f.binSize), (l.jsonSize = v), (l.binSize = m), (g = h.slice(12 + l.jsonSize)).size !== l.binSize && this.ee.emit(fs.Chat_BinsizeError), this._connectBatch(p, l, c)) ) { e.n = 5 break } return e.a(2) case 5: return ((e.n = 6), this._handleArkitFaceConfig(p, l, c, g)) case 6: return ((e.n = 7), this._handleAudioConfig(p, l, c, g, s || !1)) case 7: this._handleEvents(p) case 8: e.n = 10 break case 9: ;((e.p = 9), (y = e.v), console.error('err', y), this.ee.emit(cs.ErrorReceived, y.message)) case 10: return e.a(2) } }, e, this, [[0, 9]] ) }) )), function (e) { return r.apply(this, arguments) }), }, { key: '_handleAudioConfig', value: ((n = v( d().m(function e(t, n, r, i, a) { var o, s, u, l, c, h, f, p, v, m, g, y, _, b, x, S, A, w = this return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((o = t.data_records), (s = void 0 === o ? {} : o), (u = t.end_of_batch), !(l = s.audio)) ) { e.n = 2 break } return ( (c = l.sample_rate), (h = l.shape), (f = l.data_offset), (p = l.data_type), (v = Au[p]), (m = wu[p]), void 0 === n.player && (r && r.player && r.batch_id === n.batch_id ? (n.player = r.player) : c && (n.player = new Su( { inputCodec: v, channels: 1, sampleRate: c, fftSize: 1024, isMute: a, onended: function (e) { if (e) { var t = e.end_of_batch, n = e.lastMotionGroup if (t) { var r = n.batch_id, i = n.player ;(w.ee.emit(ds.Player_EndSpeaking, i), (w._motionDataGroups = w._motionDataGroups.filter(function (e) { return e.batch_id > r })), w._motionDataGroups.length && w._motionDataGroups[0].player ? w._motionDataGroups[0].player.updateAutoPlay( !0 ) : w.ee.emit(ds.Player_NoLegacy)) } } }, }, this.ee )), u && ((g = n.player.option.onended), (n.player.option.onended = function () { g({ end_of_batch: u, lastMotionGroup: n }) }))), (y = h.reduce( function (e, t) { return e * t }, 'Int16' === v ? 2 : 4 )), (_ = f), (b = f + y), (x = i.slice(_, b)), (e.n = 1), x.arrayBuffer() ) case 1: ;((S = e.v), (A = this._motionDataGroups.find(function (e) { return e.player })), this._motionDataGroups.length && n.player && A && A.player !== n.player && (n.player.autoPlay = !1), n.player && n.player.feed({ audio: new m(S), end_of_batch: u }), (e.n = 3)) break case 2: r && r.player && n.batch_id === r.batch_id && (n.player = r.player) case 3: return e.a(2) } }, e, this ) }) )), function (e, t, r, i, a) { return n.apply(this, arguments) }), }, { key: '_handleArkitFaceConfig', value: ((t = v( d().m(function e(t, n, r, i) { var a, o, s, u, l, c, h, f, p return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((a = t.data_records), !(o = (void 0 === a ? {} : a).arkit_face)) ) { e.n = 3 break } if ( ((s = o.channel_names), (u = o.shape), (l = o.data_offset), (c = o.sample_rate), s && !this._arkit_face_channel_names && ((this._arkit_face_channel_names = s), (this._arkit_face_sample_rate = c)), void 0 !== n.arkitFaceArrayBufferArray) ) { e.n = 2 break } return ( r && r.arkitFaceArrayBufferArray && r.batch_id === n.batch_id ? (n.arkitFaceArrayBufferArray = r.arkitFaceArrayBufferArray) : (n.arkitFaceArrayBufferArray = []), (h = u.reduce(function (e, t) { return e * t }, 4)), (this._arkitFaceShape = u[1]), (f = i.slice(l, l + h)), (e.n = 1), f.arrayBuffer() ) case 1: ;((p = e.v), n.arkitFaceArrayBufferArray.push(p)) case 2: e.n = 4 break case 3: r && r.arkitFaceArrayBufferArray && n.batch_id === r.batch_id && (n.arkitFaceArrayBufferArray = r.arkitFaceArrayBufferArray) case 4: return e.a(2) } }, e, this ) }) )), function (e, n, r, i) { return t.apply(this, arguments) }), }, { key: '_handletts2faceConfig', value: ((e = v( d().m(function e(t, n, r, i) { var a, o, s, u, l, c, h, f, p return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((a = t.data_records), !(o = (void 0 === a ? {} : a).tts2face)) ) { e.n = 3 break } if ( ((s = o.channel_names), (u = o.shape), (l = o.data_offset), (c = o.sample_rate), s && !this._tts2face_channel_names && ((this._tts2face_channel_names = s), (this._tts2face_sample_rate = c)), void 0 !== n.tts2faceArrayBufferArray) ) { e.n = 2 break } return ( r && r.tts2faceArrayBufferArray && r.batch_id === n.batch_id ? (n.tts2faceArrayBufferArray = r.tts2faceArrayBufferArray) : (n.tts2faceArrayBufferArray = []), (h = u.reduce(function (e, t) { return e * t }, 4)), (this._tts2FaceShape = u[1]), (f = i.slice(l, l + h)), (e.n = 1), f.arrayBuffer() ) case 1: ;((p = e.v), n.tts2faceArrayBufferArray.push(p)) case 2: e.n = 4 break case 3: r && r.tts2faceArrayBufferArray && n.batch_id === r.batch_id && (n.tts2faceArrayBufferArray = r.tts2faceArrayBufferArray) case 4: return e.a(2) } }, e, this ) }) )), function (t, n, r, i) { return e.apply(this, arguments) }), }, { key: '_handleEvents', value: function (e) { var t = this, n = e.events n && n.length && n.forEach(function (e) { switch (e.event_type) { case 'interrupt_speech': break case 'change_status': t.ee.emit(fs.Change_Status, e) } }) }, }, { key: '_connectBatch', value: function (e, t, n) { var r = !0 return ( e.batch_id && void 0 === t.batch_id && (t.batch_id = e.batch_id), !t.batch_id && n && n.batch_id && (t.batch_id = n.batch_id), e.batch_name && void 0 === t.batch_name && (t.batch_name = e.batch_name), this._maxBatchId && t.batch_id && t.batch_id <= this._maxBatchId && (this.clear(), (r = !1)), r ) }, }, ] ) var e, t, n, r })(), Mu = (function () { function e(t, n) { var r, i ;(A(this, e), (this.promise = new Promise(function (e, t) { ;((r = e), (i = t)) }))) var a = r.bind(this), o = i.bind(this) ;(t( function () { a.apply(void 0, arguments) }.bind(this), function (e) { o(e) }.bind(this) ), (this.abortHandler = n), (this.id = e.idGen++)) } return T(e, [ { key: 'then', value: function (t) { var n = this return new e(function (r, i) { n.promise = n.promise .then(function () { var n = t.apply(void 0, arguments) n instanceof Promise || n instanceof e ? n.then(function () { r.apply(void 0, arguments) }) : r(n) }) .catch(function (e) { i(e) }) }, this.abortHandler) }, }, { key: 'catch', value: function (t) { var n = this return new e(function (e) { n.promise = n.promise .then(function () { e.apply(void 0, arguments) }) .catch(t) }, this.abortHandler) }, }, { key: 'abort', value: function (e) { this.abortHandler && this.abortHandler(e) }, }, ]) })() M(Mu, 'idGen', 0) var Eu, Cu = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return (x(t, e), T(t)) })(m(Error)) ;((Eu = new Float32Array(1)), new Int32Array(Eu.buffer)) var ku = (function () { var e = new Float32Array(1), t = new Int32Array(e.buffer) return function (n) { return ((e[0] = n), t[0]) } })(), Ru = function (e, t) { return e[t] + (e[t + 1] << 8) + (e[t + 2] << 16) + (e[t + 3] << 24) }, Iu = function (e, t) { var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r = arguments.length > 3 ? arguments[3] : void 0, i = new AbortController(), a = i.signal, o = !1 return new Mu( function (i, s) { var u = { signal: a } ;(r && (u.headers = r), fetch(e, u) .then( (function () { var e = v( d().m(function e(r) { var a, u, l, c, h, f, p, v, m, g, y, _ return d().w( function (e) { for (;;) switch (e.n) { case 0: if (r.ok) { e.n = 2 break } return ((e.n = 1), r.text()) case 1: return ( (a = e.v), s( new Error( 'Fetch failed: ' .concat(r.status, ' ') .concat(r.statusText, ' ') .concat(a) ) ), e.a(2) ) case 2: ;((u = r.body.getReader()), (l = 0), (c = r.headers.get('Content-Length')), (h = c ? parseInt(c) : void 0), (f = [])) case 3: if (o) { e.n = 9 break } return ((e.p = 4), (e.n = 5), u.read()) case 5: if (((p = e.v), (v = p.value), !p.done)) { e.n = 6 break } return ( t && t(100, '100%', v, h), n ? ((m = new Blob(f).arrayBuffer()), i(m)) : i(), e.a(3, 9) ) case 6: ;((l += v.length), (g = void 0), (y = void 0), void 0 !== h && (y = ''.concat((g = (l / h) * 100).toFixed(2), '%')), n && f.push(v), t && t(g, y, v, h), (e.n = 8)) break case 7: return ((e.p = 7), (_ = e.v), s(_), e.a(2)) case 8: e.n = 3 break case 9: return e.a(2) } }, e, null, [[4, 7]] ) }) ) return function (t) { return e.apply(this, arguments) } })() ) .catch(function (e) { s(new Cu(e)) })) }, function (e) { ;(i.abort(e), (o = !0)) } ) }, Nu = function (e, t, n) { return Math.max(Math.min(e, n), t) }, Pu = function () { return performance.now() / 1e3 }, Lu = function (e) { if ( (e.geometry && (e.geometry.dispose(), (e.geometry = null)), e.material && (e.material.dispose(), (e.material = null)), e.children) ) { var t, n = L(e.children) try { for (n.s(); !(t = n.n()).done; ) { var r = t.value Lu(r) } } catch (i) { n.e(i) } finally { n.f() } } }, Du = function (e, t) { return new Promise(function (n) { window.setTimeout( function () { n(e()) }, t ? 1 : 50 ) }) }, Ou = function () { switch (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0) { case 1: return 9 case 2: return 24 } return 0 }, Fu = function () { var e, t, n = new Promise(function (n, r) { ;((e = n), (t = r)) }) return { promise: n, resolve: e, reject: t } }, Bu = function (e) { var t, n e || (e = function () {}) var r = new Mu(function (e, r) { ;((t = e), (n = r)) }, e) return { promise: r, resolve: t, reject: n } }, Uu = (function () { return T( function e(t, n, r) { ;(A(this, e), (this.major = t), (this.minor = n), (this.patch = r)) }, [ { key: 'toString', value: function () { return ''.concat(this.major, '_').concat(this.minor, '_').concat(this.patch) }, }, ] ) })() function zu() { var e = navigator.userAgent return e.indexOf('iPhone') > 0 || e.indexOf('iPad') > 0 } function Vu() { if (zu()) { var e = navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/) return new Uu( parseInt(e[1] || 0, 10), parseInt(e[2] || 0, 10), parseInt(e[3] || 0, 10) ) } return null } var Hu = (function () { function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0 ;(A(this, e), (this.sphericalHarmonicsDegree = t), (this.sphericalHarmonicsCount = Ou(this.sphericalHarmonicsDegree)), (this.componentCount = this.sphericalHarmonicsCount + 14), (this.defaultSphericalHarmonics = new Array(this.sphericalHarmonicsCount).fill(0)), (this.splats = []), (this.splatCount = 0)) } return T( e, [ { key: 'addSplat', value: function (e) { ;(this.splats.push(e), this.splatCount++) }, }, { key: 'getSplat', value: function (e) { return this.splats[e] }, }, { key: 'addDefaultSplat', value: function () { var t = e.createSplat(this.sphericalHarmonicsDegree) return (this.addSplat(t), t) }, }, { key: 'addSplatFromComonents', value: function (e, t, n, r, i, a, o, s, u, l, c, h, d, f) { for ( var p = [e, t, n, r, i, a, o, s, u, l, c, h, d, f].concat( I(this.defaultSphericalHarmonics) ), v = 0; v < (arguments.length <= 14 ? 0 : arguments.length - 14) && v < this.sphericalHarmonicsCount; v++ ) p[v] = v + 14 < 14 || arguments.length <= v + 14 ? void 0 : arguments[v + 14] return (this.addSplat(p), p) }, }, { key: 'addSplatFromArray', value: function (t, n) { for ( var r = t.splats[n], i = e.createSplat(this.sphericalHarmonicsDegree), a = 0; a < this.componentCount && a < r.length; a++ ) i[a] = r[a] this.addSplat(i) }, }, ], [ { key: 'createSplat', value: function () { for ( var e = [0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], t = Ou(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0), n = 0; n < t; n++ ) e.push(0) return e }, }, ] ) })() /** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ M(Hu, 'OFFSET', { X: 0, Y: 1, Z: 2, SCALE0: 3, SCALE1: 4, SCALE2: 5, ROTATION0: 6, ROTATION1: 7, ROTATION2: 8, ROTATION3: 9, FDC0: 10, FDC1: 11, FDC2: 12, OPACITY: 13, FRC0: 14, FRC1: 15, FRC2: 16, FRC3: 17, FRC4: 18, FRC5: 19, FRC6: 20, FRC7: 21, FRC8: 22, FRC9: 23, FRC10: 24, FRC11: 25, FRC12: 26, FRC13: 27, FRC14: 28, FRC15: 29, FRC16: 30, FRC17: 31, FRC18: 32, FRC19: 33, FRC20: 34, FRC21: 35, FRC22: 36, FRC23: 37, }) var Wu = '173', Gu = 0, ju = 1, Qu = 2, qu = 0, Xu = 1, Yu = 2, Ku = 3, Zu = 100, Ju = 204, $u = 205, el = 'attached', tl = 301, nl = 302, rl = 306, il = 1e3, al = 1001, ol = 1002, sl = 1003, ul = 1005, ll = 1006, cl = 1007, hl = 1008, dl = 1009, fl = 1010, pl = 1011, vl = 1012, ml = 1013, gl = 1014, yl = 1015, _l = 1016, bl = 1017, xl = 1018, Sl = 1020, Al = 35902, wl = 1023, Tl = 1026, Ml = 1027, El = 1028, Cl = 1029, kl = 1030, Rl = 1031, Il = 1033, Nl = 33776, Pl = 33777, Ll = 33778, Dl = 33779, Ol = 35840, Fl = 35841, Bl = 35842, Ul = 35843, zl = 36196, Vl = 37492, Hl = 37496, Wl = 37808, Gl = 37809, jl = 37810, Ql = 37811, ql = 37812, Xl = 37813, Yl = 37814, Kl = 37815, Zl = 37816, Jl = 37817, $l = 37818, ec = 37819, tc = 37820, nc = 37821, rc = 36492, ic = 36494, ac = 36495, oc = 36284, sc = 36285, uc = 36286, lc = 2200, cc = 2201, hc = 2300, dc = 2301, fc = 2302, pc = 2400, vc = 2401, mc = 2402, gc = 2500, yc = '', _c = 'srgb', bc = 'srgb-linear', xc = 'linear', Sc = 'srgb', Ac = 7680, wc = 35044, Tc = 35048, Mc = '300 es', Ec = 2e3, Cc = 2001, kc = (function () { return T( function e() { A(this, e) }, [ { key: 'addEventListener', value: function (e, t) { void 0 === this._listeners && (this._listeners = {}) var n = this._listeners ;(void 0 === n[e] && (n[e] = []), -1 === n[e].indexOf(t) && n[e].push(t)) }, }, { key: 'hasEventListener', value: function (e, t) { var n = this._listeners return void 0 !== n && void 0 !== n[e] && -1 !== n[e].indexOf(t) }, }, { key: 'removeEventListener', value: function (e, t) { var n = this._listeners if (void 0 !== n) { var r = n[e] if (void 0 !== r) { var i = r.indexOf(t) ;-1 !== i && r.splice(i, 1) } } }, }, { key: 'dispatchEvent', value: function (e) { var t = this._listeners if (void 0 !== t) { var n = t[e.type] if (void 0 !== n) { e.target = this for (var r = n.slice(0), i = 0, a = r.length; i < a; i++) r[i].call(this, e) e.target = null } } }, }, ] ) })(), Rc = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff', ], Ic = 1234567, Nc = Math.PI / 180, Pc = 180 / Math.PI function Lc() { var e = (4294967295 * Math.random()) | 0, t = (4294967295 * Math.random()) | 0, n = (4294967295 * Math.random()) | 0, r = (4294967295 * Math.random()) | 0 return ( Rc[255 & e] + Rc[(e >> 8) & 255] + Rc[(e >> 16) & 255] + Rc[(e >> 24) & 255] + '-' + Rc[255 & t] + Rc[(t >> 8) & 255] + '-' + Rc[((t >> 16) & 15) | 64] + Rc[(t >> 24) & 255] + '-' + Rc[(63 & n) | 128] + Rc[(n >> 8) & 255] + '-' + Rc[(n >> 16) & 255] + Rc[(n >> 24) & 255] + Rc[255 & r] + Rc[(r >> 8) & 255] + Rc[(r >> 16) & 255] + Rc[(r >> 24) & 255] ).toLowerCase() } function Dc(e, t, n) { return Math.max(t, Math.min(n, e)) } function Oc(e, t) { return ((e % t) + t) % t } function Fc(e, t, n) { return (1 - n) * e + n * t } function Bc(e, t) { switch (t.constructor) { case Float32Array: return e case Uint32Array: return e / 4294967295 case Uint16Array: return e / 65535 case Uint8Array: return e / 255 case Int32Array: return Math.max(e / 2147483647, -1) case Int16Array: return Math.max(e / 32767, -1) case Int8Array: return Math.max(e / 127, -1) default: throw new Error('Invalid component type.') } } function Uc(e, t) { switch (t.constructor) { case Float32Array: return e case Uint32Array: return Math.round(4294967295 * e) case Uint16Array: return Math.round(65535 * e) case Uint8Array: return Math.round(255 * e) case Int32Array: return Math.round(2147483647 * e) case Int16Array: return Math.round(32767 * e) case Int8Array: return Math.round(127 * e) default: throw new Error('Invalid component type.') } } var zc = { DEG2RAD: Nc, RAD2DEG: Pc, generateUUID: Lc, clamp: Dc, euclideanModulo: Oc, mapLinear: function (e, t, n, r, i) { return r + ((e - t) * (i - r)) / (n - t) }, inverseLerp: function (e, t, n) { return e !== t ? (n - e) / (t - e) : 0 }, lerp: Fc, damp: function (e, t, n, r) { return Fc(e, t, 1 - Math.exp(-n * r)) }, pingpong: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return t - Math.abs(Oc(e, 2 * t) - t) }, smoothstep: function (e, t, n) { return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * (3 - 2 * e) }, smootherstep: function (e, t, n) { return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * e * (e * (6 * e - 15) + 10) }, randInt: function (e, t) { return e + Math.floor(Math.random() * (t - e + 1)) }, randFloat: function (e, t) { return e + Math.random() * (t - e) }, randFloatSpread: function (e) { return e * (0.5 - Math.random()) }, seededRandom: function (e) { void 0 !== e && (Ic = e) var t = (Ic += 1831565813) return ( (t = Math.imul(t ^ (t >>> 15), 1 | t)), (((t ^= t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ (t >>> 14)) >>> 0) / 4294967296 ) }, degToRad: function (e) { return e * Nc }, radToDeg: function (e) { return e * Pc }, isPowerOfTwo: function (e) { return !(e & (e - 1)) && 0 !== e }, ceilPowerOfTwo: function (e) { return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2)) }, floorPowerOfTwo: function (e) { return Math.pow(2, Math.floor(Math.log(e) / Math.LN2)) }, setQuaternionFromProperEuler: function (e, t, n, r, i) { var a = Math.cos, o = Math.sin, s = a(n / 2), u = o(n / 2), l = a((t + r) / 2), c = o((t + r) / 2), h = a((t - r) / 2), d = o((t - r) / 2), f = a((r - t) / 2), p = o((r - t) / 2) switch (i) { case 'XYX': e.set(s * c, u * h, u * d, s * l) break case 'YZY': e.set(u * d, s * c, u * h, s * l) break case 'ZXZ': e.set(u * h, u * d, s * c, s * l) break case 'XZX': e.set(s * c, u * p, u * f, s * l) break case 'YXY': e.set(u * f, s * c, u * p, s * l) break case 'ZYZ': e.set(u * p, u * f, s * c, s * l) break default: console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + i ) } }, normalize: Uc, denormalize: Bc, }, Vc = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 ;(A(this, e), (e.prototype.isVector2 = !0), (this.x = t), (this.y = n)) }, [ { key: 'width', get: function () { return this.x }, set: function (e) { this.x = e }, }, { key: 'height', get: function () { return this.y }, set: function (e) { this.y = e }, }, { key: 'set', value: function (e, t) { return ((this.x = e), (this.y = t), this) }, }, { key: 'setScalar', value: function (e) { return ((this.x = e), (this.y = e), this) }, }, { key: 'setX', value: function (e) { return ((this.x = e), this) }, }, { key: 'setY', value: function (e) { return ((this.y = e), this) }, }, { key: 'setComponent', value: function (e, t) { switch (e) { case 0: this.x = t break case 1: this.y = t break default: throw new Error('index is out of range: ' + e) } return this }, }, { key: 'getComponent', value: function (e) { switch (e) { case 0: return this.x case 1: return this.y default: throw new Error('index is out of range: ' + e) } }, }, { key: 'clone', value: function () { return new this.constructor(this.x, this.y) }, }, { key: 'copy', value: function (e) { return ((this.x = e.x), (this.y = e.y), this) }, }, { key: 'add', value: function (e) { return ((this.x += e.x), (this.y += e.y), this) }, }, { key: 'addScalar', value: function (e) { return ((this.x += e), (this.y += e), this) }, }, { key: 'addVectors', value: function (e, t) { return ((this.x = e.x + t.x), (this.y = e.y + t.y), this) }, }, { key: 'addScaledVector', value: function (e, t) { return ((this.x += e.x * t), (this.y += e.y * t), this) }, }, { key: 'sub', value: function (e) { return ((this.x -= e.x), (this.y -= e.y), this) }, }, { key: 'subScalar', value: function (e) { return ((this.x -= e), (this.y -= e), this) }, }, { key: 'subVectors', value: function (e, t) { return ((this.x = e.x - t.x), (this.y = e.y - t.y), this) }, }, { key: 'multiply', value: function (e) { return ((this.x *= e.x), (this.y *= e.y), this) }, }, { key: 'multiplyScalar', value: function (e) { return ((this.x *= e), (this.y *= e), this) }, }, { key: 'divide', value: function (e) { return ((this.x /= e.x), (this.y /= e.y), this) }, }, { key: 'divideScalar', value: function (e) { return this.multiplyScalar(1 / e) }, }, { key: 'applyMatrix3', value: function (e) { var t = this.x, n = this.y, r = e.elements return ( (this.x = r[0] * t + r[3] * n + r[6]), (this.y = r[1] * t + r[4] * n + r[7]), this ) }, }, { key: 'min', value: function (e) { return ( (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this ) }, }, { key: 'max', value: function (e) { return ( (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this ) }, }, { key: 'clamp', value: function (e, t) { return ( (this.x = Dc(this.x, e.x, t.x)), (this.y = Dc(this.y, e.y, t.y)), this ) }, }, { key: 'clampScalar', value: function (e, t) { return ((this.x = Dc(this.x, e, t)), (this.y = Dc(this.y, e, t)), this) }, }, { key: 'clampLength', value: function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t)) }, }, { key: 'floor', value: function () { return ((this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this) }, }, { key: 'ceil', value: function () { return ((this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this) }, }, { key: 'round', value: function () { return ((this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this) }, }, { key: 'roundToZero', value: function () { return ((this.x = Math.trunc(this.x)), (this.y = Math.trunc(this.y)), this) }, }, { key: 'negate', value: function () { return ((this.x = -this.x), (this.y = -this.y), this) }, }, { key: 'dot', value: function (e) { return this.x * e.x + this.y * e.y }, }, { key: 'cross', value: function (e) { return this.x * e.y - this.y * e.x }, }, { key: 'lengthSq', value: function () { return this.x * this.x + this.y * this.y }, }, { key: 'length', value: function () { return Math.sqrt(this.x * this.x + this.y * this.y) }, }, { key: 'manhattanLength', value: function () { return Math.abs(this.x) + Math.abs(this.y) }, }, { key: 'normalize', value: function () { return this.divideScalar(this.length() || 1) }, }, { key: 'angle', value: function () { var e = Math.atan2(-this.y, -this.x) + Math.PI return e }, }, { key: 'angleTo', value: function (e) { var t = Math.sqrt(this.lengthSq() * e.lengthSq()) if (0 === t) return Math.PI / 2 var n = this.dot(e) / t return Math.acos(Dc(n, -1, 1)) }, }, { key: 'distanceTo', value: function (e) { return Math.sqrt(this.distanceToSquared(e)) }, }, { key: 'distanceToSquared', value: function (e) { var t = this.x - e.x, n = this.y - e.y return t * t + n * n }, }, { key: 'manhattanDistanceTo', value: function (e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) }, }, { key: 'setLength', value: function (e) { return this.normalize().multiplyScalar(e) }, }, { key: 'lerp', value: function (e, t) { return ((this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this) }, }, { key: 'lerpVectors', value: function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), this ) }, }, { key: 'equals', value: function (e) { return e.x === this.x && e.y === this.y }, }, { key: 'fromArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((this.x = e[t]), (this.y = e[t + 1]), this) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((e[t] = this.x), (e[t + 1] = this.y), e) }, }, { key: 'fromBufferAttribute', value: function (e, t) { return ((this.x = e.getX(t)), (this.y = e.getY(t)), this) }, }, { key: 'rotateAround', value: function (e, t) { var n = Math.cos(t), r = Math.sin(t), i = this.x - e.x, a = this.y - e.y return ((this.x = i * n - a * r + e.x), (this.y = i * r + a * n + e.y), this) }, }, { key: 'random', value: function () { return ((this.x = Math.random()), (this.y = Math.random()), this) }, }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.x) case 1: return ((e.n = 2), this.y) case 2: return e.a(2) } }, e, this ) }), }, ] ) })(), Hc = (function () { return T( function e(t, n, r, i, a, o, s, u, l) { ;(A(this, e), (e.prototype.isMatrix3 = !0), (this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1]), void 0 !== t && this.set(t, n, r, i, a, o, s, u, l)) }, [ { key: 'set', value: function (e, t, n, r, i, a, o, s, u) { var l = this.elements return ( (l[0] = e), (l[1] = r), (l[2] = o), (l[3] = t), (l[4] = i), (l[5] = s), (l[6] = n), (l[7] = a), (l[8] = u), this ) }, }, { key: 'identity', value: function () { return (this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this) }, }, { key: 'copy', value: function (e) { var t = this.elements, n = e.elements return ( (t[0] = n[0]), (t[1] = n[1]), (t[2] = n[2]), (t[3] = n[3]), (t[4] = n[4]), (t[5] = n[5]), (t[6] = n[6]), (t[7] = n[7]), (t[8] = n[8]), this ) }, }, { key: 'extractBasis', value: function (e, t, n) { return ( e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), n.setFromMatrix3Column(this, 2), this ) }, }, { key: 'setFromMatrix4', value: function (e) { var t = e.elements return (this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this) }, }, { key: 'multiply', value: function (e) { return this.multiplyMatrices(this, e) }, }, { key: 'premultiply', value: function (e) { return this.multiplyMatrices(e, this) }, }, { key: 'multiplyMatrices', value: function (e, t) { var n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[3], s = n[6], u = n[1], l = n[4], c = n[7], h = n[2], d = n[5], f = n[8], p = r[0], v = r[3], m = r[6], g = r[1], y = r[4], _ = r[7], b = r[2], x = r[5], S = r[8] return ( (i[0] = a * p + o * g + s * b), (i[3] = a * v + o * y + s * x), (i[6] = a * m + o * _ + s * S), (i[1] = u * p + l * g + c * b), (i[4] = u * v + l * y + c * x), (i[7] = u * m + l * _ + c * S), (i[2] = h * p + d * g + f * b), (i[5] = h * v + d * y + f * x), (i[8] = h * m + d * _ + f * S), this ) }, }, { key: 'multiplyScalar', value: function (e) { var t = this.elements return ( (t[0] *= e), (t[3] *= e), (t[6] *= e), (t[1] *= e), (t[4] *= e), (t[7] *= e), (t[2] *= e), (t[5] *= e), (t[8] *= e), this ) }, }, { key: 'determinant', value: function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], u = e[7], l = e[8] return t * a * l - t * o * u - n * i * l + n * o * s + r * i * u - r * a * s }, }, { key: 'invert', value: function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], u = e[7], l = e[8], c = l * a - o * u, h = o * s - l * i, d = u * i - a * s, f = t * c + n * h + r * d if (0 === f) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0) var p = 1 / f return ( (e[0] = c * p), (e[1] = (r * u - l * n) * p), (e[2] = (o * n - r * a) * p), (e[3] = h * p), (e[4] = (l * t - r * s) * p), (e[5] = (r * i - o * t) * p), (e[6] = d * p), (e[7] = (n * s - u * t) * p), (e[8] = (a * t - n * i) * p), this ) }, }, { key: 'transpose', value: function () { var e, t = this.elements return ( (e = t[1]), (t[1] = t[3]), (t[3] = e), (e = t[2]), (t[2] = t[6]), (t[6] = e), (e = t[5]), (t[5] = t[7]), (t[7] = e), this ) }, }, { key: 'getNormalMatrix', value: function (e) { return this.setFromMatrix4(e).invert().transpose() }, }, { key: 'transposeIntoArray', value: function (e) { var t = this.elements return ( (e[0] = t[0]), (e[1] = t[3]), (e[2] = t[6]), (e[3] = t[1]), (e[4] = t[4]), (e[5] = t[7]), (e[6] = t[2]), (e[7] = t[5]), (e[8] = t[8]), this ) }, }, { key: 'setUvTransform', value: function (e, t, n, r, i, a, o) { var s = Math.cos(i), u = Math.sin(i) return ( this.set( n * s, n * u, -n * (s * a + u * o) + a + e, -r * u, r * s, -r * (-u * a + s * o) + o + t, 0, 0, 1 ), this ) }, }, { key: 'scale', value: function (e, t) { return (this.premultiply(Wc.makeScale(e, t)), this) }, }, { key: 'rotate', value: function (e) { return (this.premultiply(Wc.makeRotation(-e)), this) }, }, { key: 'translate', value: function (e, t) { return (this.premultiply(Wc.makeTranslation(e, t)), this) }, }, { key: 'makeTranslation', value: function (e, t) { return ( e.isVector2 ? this.set(1, 0, e.x, 0, 1, e.y, 0, 0, 1) : this.set(1, 0, e, 0, 1, t, 0, 0, 1), this ) }, }, { key: 'makeRotation', value: function (e) { var t = Math.cos(e), n = Math.sin(e) return (this.set(t, -n, 0, n, t, 0, 0, 0, 1), this) }, }, { key: 'makeScale', value: function (e, t) { return (this.set(e, 0, 0, 0, t, 0, 0, 0, 1), this) }, }, { key: 'equals', value: function (e) { for (var t = this.elements, n = e.elements, r = 0; r < 9; r++) if (t[r] !== n[r]) return !1 return !0 }, }, { key: 'fromArray', value: function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = 0; n < 9; n++ ) this.elements[n] = e[n + t] return this }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = this.elements return ( (e[t] = n[0]), (e[t + 1] = n[1]), (e[t + 2] = n[2]), (e[t + 3] = n[3]), (e[t + 4] = n[4]), (e[t + 5] = n[5]), (e[t + 6] = n[6]), (e[t + 7] = n[7]), (e[t + 8] = n[8]), e ) }, }, { key: 'clone', value: function () { return new this.constructor().fromArray(this.elements) }, }, ] ) })(), Wc = new Hc() function Gc(e) { for (var t = e.length - 1; t >= 0; --t) if (e[t] >= 65535) return !0 return !1 } function jc(e) { return document.createElementNS('http://www.w3.org/1999/xhtml', e) } var Qc = {} function qc(e) { e in Qc || ((Qc[e] = !0), console.warn(e)) } function Xc(e, t, n) { return new Promise(function (r, i) { setTimeout(function a() { switch (e.clientWaitSync(t, e.SYNC_FLUSH_COMMANDS_BIT, 0)) { case e.WAIT_FAILED: i() break case e.TIMEOUT_EXPIRED: setTimeout(a, n) break default: r() } }, n) }) } var Yc = new Hc().set( 0.4123908, 0.3575843, 0.1804808, 0.212639, 0.7151687, 0.0721923, 0.0193308, 0.1191948, 0.9505322 ), Kc = new Hc().set( 3.2409699, -1.5373832, -0.4986108, -0.9692436, 1.8759675, 0.0415551, 0.0556301, -0.203977, 1.0569715 ) function Zc() { var e = { enabled: !0, workingColorSpace: bc, spaces: {}, convert: function (e, t, n) { return !1 !== this.enabled && t !== n && t && n ? (this.spaces[t].transfer === Sc && ((e.r = eh(e.r)), (e.g = eh(e.g)), (e.b = eh(e.b))), this.spaces[t].primaries !== this.spaces[n].primaries && (e.applyMatrix3(this.spaces[t].toXYZ), e.applyMatrix3(this.spaces[n].fromXYZ)), this.spaces[n].transfer === Sc && ((e.r = th(e.r)), (e.g = th(e.g)), (e.b = th(e.b))), e) : e }, fromWorkingColorSpace: function (e, t) { return this.convert(e, this.workingColorSpace, t) }, toWorkingColorSpace: function (e, t) { return this.convert(e, t, this.workingColorSpace) }, getPrimaries: function (e) { return this.spaces[e].primaries }, getTransfer: function (e) { return e === yc ? xc : this.spaces[e].transfer }, getLuminanceCoefficients: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.workingColorSpace return e.fromArray(this.spaces[t].luminanceCoefficients) }, define: function (e) { Object.assign(this.spaces, e) }, _getMatrix: function (e, t, n) { return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ) }, _getDrawingBufferColorSpace: function (e) { return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace }, _getUnpackColorSpace: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.workingColorSpace return this.spaces[e].workingColorSpaceConfig.unpackColorSpace }, }, t = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], n = [0.2126, 0.7152, 0.0722], r = [0.3127, 0.329] return ( e.define( M( M({}, bc, { primaries: t, whitePoint: r, transfer: xc, toXYZ: Yc, fromXYZ: Kc, luminanceCoefficients: n, workingColorSpaceConfig: { unpackColorSpace: _c }, outputColorSpaceConfig: { drawingBufferColorSpace: _c }, }), _c, { primaries: t, whitePoint: r, transfer: Sc, toXYZ: Yc, fromXYZ: Kc, luminanceCoefficients: n, outputColorSpaceConfig: { drawingBufferColorSpace: _c }, } ) ), e ) } var Jc, $c = Zc() function eh(e) { return e < 0.04045 ? 0.0773993808 * e : Math.pow(0.9478672986 * e + 0.0521327014, 2.4) } function th(e) { return e < 0.0031308 ? 12.92 * e : 1.055 * Math.pow(e, 0.41666) - 0.055 } var nh = (function () { return T( function e() { A(this, e) }, null, [ { key: 'getDataURL', value: function (e) { if (/^data:/i.test(e.src)) return e.src if ('undefined' == typeof HTMLCanvasElement) return e.src var t if (e instanceof HTMLCanvasElement) t = e else { ;(void 0 === Jc && (Jc = jc('canvas')), (Jc.width = e.width), (Jc.height = e.height)) var n = Jc.getContext('2d') ;(e instanceof ImageData ? n.putImageData(e, 0, 0) : n.drawImage(e, 0, 0, e.width, e.height), (t = Jc)) } return t.toDataURL('image/png') }, }, { key: 'sRGBToLinear', value: function (e) { if ( ('undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement) || ('undefined' != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) || ('undefined' != typeof ImageBitmap && e instanceof ImageBitmap) ) { var t = jc('canvas') ;((t.width = e.width), (t.height = e.height)) var n = t.getContext('2d') n.drawImage(e, 0, 0, e.width, e.height) for ( var r = n.getImageData(0, 0, e.width, e.height), i = r.data, a = 0; a < i.length; a++ ) i[a] = 255 * eh(i[a] / 255) return (n.putImageData(r, 0, 0), t) } if (e.data) { for (var o = e.data.slice(0), s = 0; s < o.length; s++) o instanceof Uint8Array || o instanceof Uint8ClampedArray ? (o[s] = Math.floor(255 * eh(o[s] / 255))) : (o[s] = eh(o[s])) return { data: o, width: e.width, height: e.height } } return ( console.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' ), e ) }, }, ] ) })(), rh = 0, ih = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null ;(A(this, e), (this.isSource = !0), Object.defineProperty(this, 'id', { value: rh++ }), (this.uuid = Lc()), (this.data = t), (this.dataReady = !0), (this.version = 0)) }, [ { key: 'needsUpdate', set: function (e) { !0 === e && this.version++ }, }, { key: 'toJSON', value: function (e) { var t = void 0 === e || 'string' == typeof e if (!t && void 0 !== e.images[this.uuid]) return e.images[this.uuid] var n = { uuid: this.uuid, url: '' }, r = this.data if (null !== r) { var i if (Array.isArray(r)) { i = [] for (var a = 0, o = r.length; a < o; a++) r[a].isDataTexture ? i.push(ah(r[a].image)) : i.push(ah(r[a])) } else i = ah(r) n.url = i } return (t || (e.images[this.uuid] = n), n) }, }, ] ) })() function ah(e) { return ('undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement) || ('undefined' != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) || ('undefined' != typeof ImageBitmap && e instanceof ImageBitmap) ? nh.getDataURL(e) : e.data ? { data: Array.from(e.data), width: e.width, height: e.height, type: e.data.constructor.name, } : (console.warn('THREE.Texture: Unable to serialize Texture.'), {}) } var oh = 0, sh = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t.DEFAULT_IMAGE, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t.DEFAULT_MAPPING, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : al, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : al, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : ll, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : hl, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : wl, l = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : dl, c = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : t.DEFAULT_ANISOTROPY, h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : yc return ( A(this, t), ((e = y(this, t)).isTexture = !0), Object.defineProperty(e, 'id', { value: oh++ }), (e.uuid = Lc()), (e.name = ''), (e.source = new ih(n)), (e.mipmaps = []), (e.mapping = r), (e.channel = 0), (e.wrapS = i), (e.wrapT = a), (e.magFilter = o), (e.minFilter = s), (e.anisotropy = c), (e.format = u), (e.internalFormat = null), (e.type = l), (e.offset = new Vc(0, 0)), (e.repeat = new Vc(1, 1)), (e.center = new Vc(0, 0)), (e.rotation = 0), (e.matrixAutoUpdate = !0), (e.matrix = new Hc()), (e.generateMipmaps = !0), (e.premultiplyAlpha = !1), (e.flipY = !0), (e.unpackAlignment = 4), (e.colorSpace = h), (e.userData = {}), (e.version = 0), (e.onUpdate = null), (e.renderTarget = null), (e.isRenderTargetTexture = !1), (e.pmremVersion = 0), e ) } return ( x(t, e), T(t, [ { key: 'image', get: function () { return this.source.data }, set: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null this.source.data = e }, }, { key: 'updateMatrix', value: function () { this.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y ) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { return ( (this.name = e.name), (this.source = e.source), (this.mipmaps = e.mipmaps.slice(0)), (this.mapping = e.mapping), (this.channel = e.channel), (this.wrapS = e.wrapS), (this.wrapT = e.wrapT), (this.magFilter = e.magFilter), (this.minFilter = e.minFilter), (this.anisotropy = e.anisotropy), (this.format = e.format), (this.internalFormat = e.internalFormat), (this.type = e.type), this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), (this.rotation = e.rotation), (this.matrixAutoUpdate = e.matrixAutoUpdate), this.matrix.copy(e.matrix), (this.generateMipmaps = e.generateMipmaps), (this.premultiplyAlpha = e.premultiplyAlpha), (this.flipY = e.flipY), (this.unpackAlignment = e.unpackAlignment), (this.colorSpace = e.colorSpace), (this.renderTarget = e.renderTarget), (this.isRenderTargetTexture = e.isRenderTargetTexture), (this.userData = JSON.parse(JSON.stringify(e.userData))), (this.needsUpdate = !0), this ) }, }, { key: 'toJSON', value: function (e) { var t = void 0 === e || 'string' == typeof e if (!t && void 0 !== e.textures[this.uuid]) return e.textures[this.uuid] var n = { metadata: { version: 4.6, type: 'Texture', generator: 'Texture.toJSON' }, uuid: this.uuid, name: this.name, image: this.source.toJSON(e).uuid, mapping: this.mapping, channel: this.channel, repeat: [this.repeat.x, this.repeat.y], offset: [this.offset.x, this.offset.y], center: [this.center.x, this.center.y], rotation: this.rotation, wrap: [this.wrapS, this.wrapT], format: this.format, internalFormat: this.internalFormat, type: this.type, colorSpace: this.colorSpace, minFilter: this.minFilter, magFilter: this.magFilter, anisotropy: this.anisotropy, flipY: this.flipY, generateMipmaps: this.generateMipmaps, premultiplyAlpha: this.premultiplyAlpha, unpackAlignment: this.unpackAlignment, } return ( Object.keys(this.userData).length > 0 && (n.userData = this.userData), t || (e.textures[this.uuid] = n), n ) }, }, { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, { key: 'transformUv', value: function (e) { if (300 !== this.mapping) return e if ((e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)) switch (this.wrapS) { case il: e.x = e.x - Math.floor(e.x) break case al: e.x = e.x < 0 ? 0 : 1 break case ol: 1 === Math.abs(Math.floor(e.x) % 2) ? (e.x = Math.ceil(e.x) - e.x) : (e.x = e.x - Math.floor(e.x)) } if (e.y < 0 || e.y > 1) switch (this.wrapT) { case il: e.y = e.y - Math.floor(e.y) break case al: e.y = e.y < 0 ? 0 : 1 break case ol: 1 === Math.abs(Math.floor(e.y) % 2) ? (e.y = Math.ceil(e.y) - e.y) : (e.y = e.y - Math.floor(e.y)) } return (this.flipY && (e.y = 1 - e.y), e) }, }, { key: 'needsUpdate', set: function (e) { !0 === e && (this.version++, (this.source.needsUpdate = !0)) }, }, { key: 'needsPMREMUpdate', set: function (e) { !0 === e && this.pmremVersion++ }, }, ]) ) })(kc) ;((sh.DEFAULT_IMAGE = null), (sh.DEFAULT_MAPPING = 300), (sh.DEFAULT_ANISOTROPY = 1)) var uh = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 ;(A(this, e), (e.prototype.isVector4 = !0), (this.x = t), (this.y = n), (this.z = r), (this.w = i)) }, [ { key: 'width', get: function () { return this.z }, set: function (e) { this.z = e }, }, { key: 'height', get: function () { return this.w }, set: function (e) { this.w = e }, }, { key: 'set', value: function (e, t, n, r) { return ((this.x = e), (this.y = t), (this.z = n), (this.w = r), this) }, }, { key: 'setScalar', value: function (e) { return ((this.x = e), (this.y = e), (this.z = e), (this.w = e), this) }, }, { key: 'setX', value: function (e) { return ((this.x = e), this) }, }, { key: 'setY', value: function (e) { return ((this.y = e), this) }, }, { key: 'setZ', value: function (e) { return ((this.z = e), this) }, }, { key: 'setW', value: function (e) { return ((this.w = e), this) }, }, { key: 'setComponent', value: function (e, t) { switch (e) { case 0: this.x = t break case 1: this.y = t break case 2: this.z = t break case 3: this.w = t break default: throw new Error('index is out of range: ' + e) } return this }, }, { key: 'getComponent', value: function (e) { switch (e) { case 0: return this.x case 1: return this.y case 2: return this.z case 3: return this.w default: throw new Error('index is out of range: ' + e) } }, }, { key: 'clone', value: function () { return new this.constructor(this.x, this.y, this.z, this.w) }, }, { key: 'copy', value: function (e) { return ( (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = void 0 !== e.w ? e.w : 1), this ) }, }, { key: 'add', value: function (e) { return ( (this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this ) }, }, { key: 'addScalar', value: function (e) { return ((this.x += e), (this.y += e), (this.z += e), (this.w += e), this) }, }, { key: 'addVectors', value: function (e, t) { return ( (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), (this.w = e.w + t.w), this ) }, }, { key: 'addScaledVector', value: function (e, t) { return ( (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), (this.w += e.w * t), this ) }, }, { key: 'sub', value: function (e) { return ( (this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this ) }, }, { key: 'subScalar', value: function (e) { return ((this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this) }, }, { key: 'subVectors', value: function (e, t) { return ( (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), (this.w = e.w - t.w), this ) }, }, { key: 'multiply', value: function (e) { return ( (this.x *= e.x), (this.y *= e.y), (this.z *= e.z), (this.w *= e.w), this ) }, }, { key: 'multiplyScalar', value: function (e) { return ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e), this) }, }, { key: 'applyMatrix4', value: function (e) { var t = this.x, n = this.y, r = this.z, i = this.w, a = e.elements return ( (this.x = a[0] * t + a[4] * n + a[8] * r + a[12] * i), (this.y = a[1] * t + a[5] * n + a[9] * r + a[13] * i), (this.z = a[2] * t + a[6] * n + a[10] * r + a[14] * i), (this.w = a[3] * t + a[7] * n + a[11] * r + a[15] * i), this ) }, }, { key: 'divide', value: function (e) { return ( (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), (this.w /= e.w), this ) }, }, { key: 'divideScalar', value: function (e) { return this.multiplyScalar(1 / e) }, }, { key: 'setAxisAngleFromQuaternion', value: function (e) { this.w = 2 * Math.acos(e.w) var t = Math.sqrt(1 - e.w * e.w) return ( t < 1e-4 ? ((this.x = 1), (this.y = 0), (this.z = 0)) : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)), this ) }, }, { key: 'setAxisAngleFromRotationMatrix', value: function (e) { var t, n, r, i, a = 0.01, o = 0.1, s = e.elements, u = s[0], l = s[4], c = s[8], h = s[1], d = s[5], f = s[9], p = s[2], v = s[6], m = s[10] if (Math.abs(l - h) < a && Math.abs(c - p) < a && Math.abs(f - v) < a) { if ( Math.abs(l + h) < o && Math.abs(c + p) < o && Math.abs(f + v) < o && Math.abs(u + d + m - 3) < o ) return (this.set(1, 0, 0, 0), this) t = Math.PI var g = (u + 1) / 2, y = (d + 1) / 2, _ = (m + 1) / 2, b = (l + h) / 4, x = (c + p) / 4, S = (f + v) / 4 return ( g > y && g > _ ? g < a ? ((n = 0), (r = 0.707106781), (i = 0.707106781)) : ((r = b / (n = Math.sqrt(g))), (i = x / n)) : y > _ ? y < a ? ((n = 0.707106781), (r = 0), (i = 0.707106781)) : ((n = b / (r = Math.sqrt(y))), (i = S / r)) : _ < a ? ((n = 0.707106781), (r = 0.707106781), (i = 0)) : ((n = x / (i = Math.sqrt(_))), (r = S / i)), this.set(n, r, i, t), this ) } var A = Math.sqrt((v - f) * (v - f) + (c - p) * (c - p) + (h - l) * (h - l)) return ( Math.abs(A) < 0.001 && (A = 1), (this.x = (v - f) / A), (this.y = (c - p) / A), (this.z = (h - l) / A), (this.w = Math.acos((u + d + m - 1) / 2)), this ) }, }, { key: 'setFromMatrixPosition', value: function (e) { var t = e.elements return ( (this.x = t[12]), (this.y = t[13]), (this.z = t[14]), (this.w = t[15]), this ) }, }, { key: 'min', value: function (e) { return ( (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), (this.w = Math.min(this.w, e.w)), this ) }, }, { key: 'max', value: function (e) { return ( (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), (this.w = Math.max(this.w, e.w)), this ) }, }, { key: 'clamp', value: function (e, t) { return ( (this.x = Dc(this.x, e.x, t.x)), (this.y = Dc(this.y, e.y, t.y)), (this.z = Dc(this.z, e.z, t.z)), (this.w = Dc(this.w, e.w, t.w)), this ) }, }, { key: 'clampScalar', value: function (e, t) { return ( (this.x = Dc(this.x, e, t)), (this.y = Dc(this.y, e, t)), (this.z = Dc(this.z, e, t)), (this.w = Dc(this.w, e, t)), this ) }, }, { key: 'clampLength', value: function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t)) }, }, { key: 'floor', value: function () { return ( (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), (this.w = Math.floor(this.w)), this ) }, }, { key: 'ceil', value: function () { return ( (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), (this.w = Math.ceil(this.w)), this ) }, }, { key: 'round', value: function () { return ( (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), (this.w = Math.round(this.w)), this ) }, }, { key: 'roundToZero', value: function () { return ( (this.x = Math.trunc(this.x)), (this.y = Math.trunc(this.y)), (this.z = Math.trunc(this.z)), (this.w = Math.trunc(this.w)), this ) }, }, { key: 'negate', value: function () { return ( (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this ) }, }, { key: 'dot', value: function (e) { return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w }, }, { key: 'lengthSq', value: function () { return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w }, }, { key: 'length', value: function () { return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ) }, }, { key: 'manhattanLength', value: function () { return ( Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w) ) }, }, { key: 'normalize', value: function () { return this.divideScalar(this.length() || 1) }, }, { key: 'setLength', value: function (e) { return this.normalize().multiplyScalar(e) }, }, { key: 'lerp', value: function (e, t) { return ( (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), (this.w += (e.w - this.w) * t), this ) }, }, { key: 'lerpVectors', value: function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), (this.z = e.z + (t.z - e.z) * n), (this.w = e.w + (t.w - e.w) * n), this ) }, }, { key: 'equals', value: function (e) { return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w }, }, { key: 'fromArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ( (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), (this.w = e[t + 3]), this ) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ( (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), (e[t + 3] = this.w), e ) }, }, { key: 'fromBufferAttribute', value: function (e, t) { return ( (this.x = e.getX(t)), (this.y = e.getY(t)), (this.z = e.getZ(t)), (this.w = e.getW(t)), this ) }, }, { key: 'random', value: function () { return ( (this.x = Math.random()), (this.y = Math.random()), (this.z = Math.random()), (this.w = Math.random()), this ) }, }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.x) case 1: return ((e.n = 2), this.y) case 2: return ((e.n = 3), this.z) case 3: return ((e.n = 4), this.w) case 4: return e.a(2) } }, e, this ) }), }, ] ) })(), lh = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} ;(A(this, t), ((e = y(this, t)).isRenderTarget = !0), (e.width = n), (e.height = r), (e.depth = 1), (e.scissor = new uh(0, 0, n, r)), (e.scissorTest = !1), (e.viewport = new uh(0, 0, n, r))) var a = { width: n, height: r, depth: 1 } i = Object.assign( { generateMipmaps: !1, internalFormat: null, minFilter: ll, depthBuffer: !0, stencilBuffer: !1, resolveDepthBuffer: !0, resolveStencilBuffer: !0, depthTexture: null, samples: 0, count: 1, }, i ) var o = new sh( a, i.mapping, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy, i.colorSpace ) ;((o.flipY = !1), (o.generateMipmaps = i.generateMipmaps), (o.internalFormat = i.internalFormat), (e.textures = [])) for (var s = i.count, u = 0; u < s; u++) ((e.textures[u] = o.clone()), (e.textures[u].isRenderTargetTexture = !0), (e.textures[u].renderTarget = e)) return ( (e.depthBuffer = i.depthBuffer), (e.stencilBuffer = i.stencilBuffer), (e.resolveDepthBuffer = i.resolveDepthBuffer), (e.resolveStencilBuffer = i.resolveStencilBuffer), (e._depthTexture = null), (e.depthTexture = i.depthTexture), (e.samples = i.samples), e ) } return ( x(t, e), T(t, [ { key: 'texture', get: function () { return this.textures[0] }, set: function (e) { this.textures[0] = e }, }, { key: 'depthTexture', get: function () { return this._depthTexture }, set: function (e) { ;(null !== this._depthTexture && (this._depthTexture.renderTarget = null), null !== e && (e.renderTarget = this), (this._depthTexture = e)) }, }, { key: 'setSize', value: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 if (this.width !== e || this.height !== t || this.depth !== n) { ;((this.width = e), (this.height = t), (this.depth = n)) for (var r = 0, i = this.textures.length; r < i; r++) ((this.textures[r].image.width = e), (this.textures[r].image.height = t), (this.textures[r].image.depth = n)) this.dispose() } ;(this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { ;((this.width = e.width), (this.height = e.height), (this.depth = e.depth), this.scissor.copy(e.scissor), (this.scissorTest = e.scissorTest), this.viewport.copy(e.viewport), (this.textures.length = 0)) for (var t = 0, n = e.textures.length; t < n; t++) ((this.textures[t] = e.textures[t].clone()), (this.textures[t].isRenderTargetTexture = !0), (this.textures[t].renderTarget = this)) var r = Object.assign({}, e.texture.image) return ( (this.texture.source = new ih(r)), (this.depthBuffer = e.depthBuffer), (this.stencilBuffer = e.stencilBuffer), (this.resolveDepthBuffer = e.resolveDepthBuffer), (this.resolveStencilBuffer = e.resolveStencilBuffer), null !== e.depthTexture && (this.depthTexture = e.depthTexture.clone()), (this.samples = e.samples), this ) }, }, { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, ]) ) })(kc), ch = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} return (A(this, t), ((e = y(this, t, [n, r, i])).isWebGLRenderTarget = !0), e) } return (x(t, e), T(t)) })(lh), hh = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 return ( A(this, t), ((e = y(this, t, [null])).isDataArrayTexture = !0), (e.image = { data: n, width: r, height: i, depth: a }), (e.magFilter = sl), (e.minFilter = sl), (e.wrapR = al), (e.generateMipmaps = !1), (e.flipY = !1), (e.unpackAlignment = 1), (e.layerUpdates = new Set()), e ) } return ( x(t, e), T(t, [ { key: 'addLayerUpdate', value: function (e) { this.layerUpdates.add(e) }, }, { key: 'clearLayerUpdates', value: function () { this.layerUpdates.clear() }, }, ]) ) })(sh), dh = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 return ( A(this, t), ((e = y(this, t, [null])).isData3DTexture = !0), (e.image = { data: n, width: r, height: i, depth: a }), (e.magFilter = sl), (e.minFilter = sl), (e.wrapR = al), (e.generateMipmaps = !1), (e.flipY = !1), (e.unpackAlignment = 1), e ) } return (x(t, e), T(t)) })(sh), fh = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 ;(A(this, e), (this.isQuaternion = !0), (this._x = t), (this._y = n), (this._z = r), (this._w = i)) }, [ { key: 'x', get: function () { return this._x }, set: function (e) { ;((this._x = e), this._onChangeCallback()) }, }, { key: 'y', get: function () { return this._y }, set: function (e) { ;((this._y = e), this._onChangeCallback()) }, }, { key: 'z', get: function () { return this._z }, set: function (e) { ;((this._z = e), this._onChangeCallback()) }, }, { key: 'w', get: function () { return this._w }, set: function (e) { ;((this._w = e), this._onChangeCallback()) }, }, { key: 'set', value: function (e, t, n, r) { return ( (this._x = e), (this._y = t), (this._z = n), (this._w = r), this._onChangeCallback(), this ) }, }, { key: 'clone', value: function () { return new this.constructor(this._x, this._y, this._z, this._w) }, }, { key: 'copy', value: function (e) { return ( (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this._onChangeCallback(), this ) }, }, { key: 'setFromEuler', value: function (e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n = e._x, r = e._y, i = e._z, a = e._order, o = Math.cos, s = Math.sin, u = o(n / 2), l = o(r / 2), c = o(i / 2), h = s(n / 2), d = s(r / 2), f = s(i / 2) switch (a) { case 'XYZ': ;((this._x = h * l * c + u * d * f), (this._y = u * d * c - h * l * f), (this._z = u * l * f + h * d * c), (this._w = u * l * c - h * d * f)) break case 'YXZ': ;((this._x = h * l * c + u * d * f), (this._y = u * d * c - h * l * f), (this._z = u * l * f - h * d * c), (this._w = u * l * c + h * d * f)) break case 'ZXY': ;((this._x = h * l * c - u * d * f), (this._y = u * d * c + h * l * f), (this._z = u * l * f + h * d * c), (this._w = u * l * c - h * d * f)) break case 'ZYX': ;((this._x = h * l * c - u * d * f), (this._y = u * d * c + h * l * f), (this._z = u * l * f - h * d * c), (this._w = u * l * c + h * d * f)) break case 'YZX': ;((this._x = h * l * c + u * d * f), (this._y = u * d * c + h * l * f), (this._z = u * l * f - h * d * c), (this._w = u * l * c - h * d * f)) break case 'XZY': ;((this._x = h * l * c - u * d * f), (this._y = u * d * c - h * l * f), (this._z = u * l * f + h * d * c), (this._w = u * l * c + h * d * f)) break default: console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + a ) } return (!0 === t && this._onChangeCallback(), this) }, }, { key: 'setFromAxisAngle', value: function (e, t) { var n = t / 2, r = Math.sin(n) return ( (this._x = e.x * r), (this._y = e.y * r), (this._z = e.z * r), (this._w = Math.cos(n)), this._onChangeCallback(), this ) }, }, { key: 'setFromRotationMatrix', value: function (e) { var t = e.elements, n = t[0], r = t[4], i = t[8], a = t[1], o = t[5], s = t[9], u = t[2], l = t[6], c = t[10], h = n + o + c if (h > 0) { var d = 0.5 / Math.sqrt(h + 1) ;((this._w = 0.25 / d), (this._x = (l - s) * d), (this._y = (i - u) * d), (this._z = (a - r) * d)) } else if (n > o && n > c) { var f = 2 * Math.sqrt(1 + n - o - c) ;((this._w = (l - s) / f), (this._x = 0.25 * f), (this._y = (r + a) / f), (this._z = (i + u) / f)) } else if (o > c) { var p = 2 * Math.sqrt(1 + o - n - c) ;((this._w = (i - u) / p), (this._x = (r + a) / p), (this._y = 0.25 * p), (this._z = (s + l) / p)) } else { var v = 2 * Math.sqrt(1 + c - n - o) ;((this._w = (a - r) / v), (this._x = (i + u) / v), (this._y = (s + l) / v), (this._z = 0.25 * v)) } return (this._onChangeCallback(), this) }, }, { key: 'setFromUnitVectors', value: function (e, t) { var n = e.dot(t) + 1 return ( n < Number.EPSILON ? ((n = 0), Math.abs(e.x) > Math.abs(e.z) ? ((this._x = -e.y), (this._y = e.x), (this._z = 0), (this._w = n)) : ((this._x = 0), (this._y = -e.z), (this._z = e.y), (this._w = n))) : ((this._x = e.y * t.z - e.z * t.y), (this._y = e.z * t.x - e.x * t.z), (this._z = e.x * t.y - e.y * t.x), (this._w = n)), this.normalize() ) }, }, { key: 'angleTo', value: function (e) { return 2 * Math.acos(Math.abs(Dc(this.dot(e), -1, 1))) }, }, { key: 'rotateTowards', value: function (e, t) { var n = this.angleTo(e) if (0 === n) return this var r = Math.min(1, t / n) return (this.slerp(e, r), this) }, }, { key: 'identity', value: function () { return this.set(0, 0, 0, 1) }, }, { key: 'invert', value: function () { return this.conjugate() }, }, { key: 'conjugate', value: function () { return ( (this._x *= -1), (this._y *= -1), (this._z *= -1), this._onChangeCallback(), this ) }, }, { key: 'dot', value: function (e) { return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w }, }, { key: 'lengthSq', value: function () { return ( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ) }, }, { key: 'length', value: function () { return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ) }, }, { key: 'normalize', value: function () { var e = this.length() return ( 0 === e ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1)) : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)), this._onChangeCallback(), this ) }, }, { key: 'multiply', value: function (e) { return this.multiplyQuaternions(this, e) }, }, { key: 'premultiply', value: function (e) { return this.multiplyQuaternions(e, this) }, }, { key: 'multiplyQuaternions', value: function (e, t) { var n = e._x, r = e._y, i = e._z, a = e._w, o = t._x, s = t._y, u = t._z, l = t._w return ( (this._x = n * l + a * o + r * u - i * s), (this._y = r * l + a * s + i * o - n * u), (this._z = i * l + a * u + n * s - r * o), (this._w = a * l - n * o - r * s - i * u), this._onChangeCallback(), this ) }, }, { key: 'slerp', value: function (e, t) { if (0 === t) return this if (1 === t) return this.copy(e) var n = this._x, r = this._y, i = this._z, a = this._w, o = a * e._w + n * e._x + r * e._y + i * e._z if ( (o < 0 ? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (o = -o)) : this.copy(e), o >= 1) ) return ((this._w = a), (this._x = n), (this._y = r), (this._z = i), this) var s = 1 - o * o if (s <= Number.EPSILON) { var u = 1 - t return ( (this._w = u * a + t * this._w), (this._x = u * n + t * this._x), (this._y = u * r + t * this._y), (this._z = u * i + t * this._z), this.normalize(), this ) } var l = Math.sqrt(s), c = Math.atan2(l, o), h = Math.sin((1 - t) * c) / l, d = Math.sin(t * c) / l return ( (this._w = a * h + this._w * d), (this._x = n * h + this._x * d), (this._y = r * h + this._y * d), (this._z = i * h + this._z * d), this._onChangeCallback(), this ) }, }, { key: 'slerpQuaternions', value: function (e, t, n) { return this.copy(e).slerp(t, n) }, }, { key: 'random', value: function () { var e = 2 * Math.PI * Math.random(), t = 2 * Math.PI * Math.random(), n = Math.random(), r = Math.sqrt(1 - n), i = Math.sqrt(n) return this.set( r * Math.sin(e), r * Math.cos(e), i * Math.sin(t), i * Math.cos(t) ) }, }, { key: 'equals', value: function (e) { return ( e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w ) }, }, { key: 'fromArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ( (this._x = e[t]), (this._y = e[t + 1]), (this._z = e[t + 2]), (this._w = e[t + 3]), this._onChangeCallback(), this ) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ( (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._w), e ) }, }, { key: 'fromBufferAttribute', value: function (e, t) { return ( (this._x = e.getX(t)), (this._y = e.getY(t)), (this._z = e.getZ(t)), (this._w = e.getW(t)), this._onChangeCallback(), this ) }, }, { key: 'toJSON', value: function () { return this.toArray() }, }, { key: '_onChange', value: function (e) { return ((this._onChangeCallback = e), this) }, }, { key: '_onChangeCallback', value: function () {} }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this._x) case 1: return ((e.n = 2), this._y) case 2: return ((e.n = 3), this._z) case 3: return ((e.n = 4), this._w) case 4: return e.a(2) } }, e, this ) }), }, ], [ { key: 'slerpFlat', value: function (e, t, n, r, i, a, o) { var s = n[r + 0], u = n[r + 1], l = n[r + 2], c = n[r + 3], h = i[a + 0], d = i[a + 1], f = i[a + 2], p = i[a + 3] if (0 === o) return ((e[t + 0] = s), (e[t + 1] = u), (e[t + 2] = l), void (e[t + 3] = c)) if (1 === o) return ((e[t + 0] = h), (e[t + 1] = d), (e[t + 2] = f), void (e[t + 3] = p)) if (c !== p || s !== h || u !== d || l !== f) { var v = 1 - o, m = s * h + u * d + l * f + c * p, g = m >= 0 ? 1 : -1, y = 1 - m * m if (y > Number.EPSILON) { var _ = Math.sqrt(y), b = Math.atan2(_, m * g) ;((v = Math.sin(v * b) / _), (o = Math.sin(o * b) / _)) } var x = o * g if ( ((s = s * v + h * x), (u = u * v + d * x), (l = l * v + f * x), (c = c * v + p * x), v === 1 - o) ) { var S = 1 / Math.sqrt(s * s + u * u + l * l + c * c) ;((s *= S), (u *= S), (l *= S), (c *= S)) } } ;((e[t] = s), (e[t + 1] = u), (e[t + 2] = l), (e[t + 3] = c)) }, }, { key: 'multiplyQuaternionsFlat', value: function (e, t, n, r, i, a) { var o = n[r], s = n[r + 1], u = n[r + 2], l = n[r + 3], c = i[a], h = i[a + 1], d = i[a + 2], f = i[a + 3] return ( (e[t] = o * f + l * c + s * d - u * h), (e[t + 1] = s * f + l * h + u * c - o * d), (e[t + 2] = u * f + l * d + o * h - s * c), (e[t + 3] = l * f - o * c - s * h - u * d), e ) }, }, ] ) })(), ph = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 ;(A(this, e), (e.prototype.isVector3 = !0), (this.x = t), (this.y = n), (this.z = r)) }, [ { key: 'set', value: function (e, t, n) { return ( void 0 === n && (n = this.z), (this.x = e), (this.y = t), (this.z = n), this ) }, }, { key: 'setScalar', value: function (e) { return ((this.x = e), (this.y = e), (this.z = e), this) }, }, { key: 'setX', value: function (e) { return ((this.x = e), this) }, }, { key: 'setY', value: function (e) { return ((this.y = e), this) }, }, { key: 'setZ', value: function (e) { return ((this.z = e), this) }, }, { key: 'setComponent', value: function (e, t) { switch (e) { case 0: this.x = t break case 1: this.y = t break case 2: this.z = t break default: throw new Error('index is out of range: ' + e) } return this }, }, { key: 'getComponent', value: function (e) { switch (e) { case 0: return this.x case 1: return this.y case 2: return this.z default: throw new Error('index is out of range: ' + e) } }, }, { key: 'clone', value: function () { return new this.constructor(this.x, this.y, this.z) }, }, { key: 'copy', value: function (e) { return ((this.x = e.x), (this.y = e.y), (this.z = e.z), this) }, }, { key: 'add', value: function (e) { return ((this.x += e.x), (this.y += e.y), (this.z += e.z), this) }, }, { key: 'addScalar', value: function (e) { return ((this.x += e), (this.y += e), (this.z += e), this) }, }, { key: 'addVectors', value: function (e, t) { return ( (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this ) }, }, { key: 'addScaledVector', value: function (e, t) { return ((this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this) }, }, { key: 'sub', value: function (e) { return ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this) }, }, { key: 'subScalar', value: function (e) { return ((this.x -= e), (this.y -= e), (this.z -= e), this) }, }, { key: 'subVectors', value: function (e, t) { return ( (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this ) }, }, { key: 'multiply', value: function (e) { return ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this) }, }, { key: 'multiplyScalar', value: function (e) { return ((this.x *= e), (this.y *= e), (this.z *= e), this) }, }, { key: 'multiplyVectors', value: function (e, t) { return ( (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this ) }, }, { key: 'applyEuler', value: function (e) { return this.applyQuaternion(mh.setFromEuler(e)) }, }, { key: 'applyAxisAngle', value: function (e, t) { return this.applyQuaternion(mh.setFromAxisAngle(e, t)) }, }, { key: 'applyMatrix3', value: function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements return ( (this.x = i[0] * t + i[3] * n + i[6] * r), (this.y = i[1] * t + i[4] * n + i[7] * r), (this.z = i[2] * t + i[5] * n + i[8] * r), this ) }, }, { key: 'applyNormalMatrix', value: function (e) { return this.applyMatrix3(e).normalize() }, }, { key: 'applyMatrix4', value: function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements, a = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]) return ( (this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * a), (this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * a), (this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * a), this ) }, }, { key: 'applyQuaternion', value: function (e) { var t = this.x, n = this.y, r = this.z, i = e.x, a = e.y, o = e.z, s = e.w, u = 2 * (a * r - o * n), l = 2 * (o * t - i * r), c = 2 * (i * n - a * t) return ( (this.x = t + s * u + a * c - o * l), (this.y = n + s * l + o * u - i * c), (this.z = r + s * c + i * l - a * u), this ) }, }, { key: 'project', value: function (e) { return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4( e.projectionMatrix ) }, }, { key: 'unproject', value: function (e) { return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4( e.matrixWorld ) }, }, { key: 'transformDirection', value: function (e) { var t = this.x, n = this.y, r = this.z, i = e.elements return ( (this.x = i[0] * t + i[4] * n + i[8] * r), (this.y = i[1] * t + i[5] * n + i[9] * r), (this.z = i[2] * t + i[6] * n + i[10] * r), this.normalize() ) }, }, { key: 'divide', value: function (e) { return ((this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this) }, }, { key: 'divideScalar', value: function (e) { return this.multiplyScalar(1 / e) }, }, { key: 'min', value: function (e) { return ( (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), this ) }, }, { key: 'max', value: function (e) { return ( (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), this ) }, }, { key: 'clamp', value: function (e, t) { return ( (this.x = Dc(this.x, e.x, t.x)), (this.y = Dc(this.y, e.y, t.y)), (this.z = Dc(this.z, e.z, t.z)), this ) }, }, { key: 'clampScalar', value: function (e, t) { return ( (this.x = Dc(this.x, e, t)), (this.y = Dc(this.y, e, t)), (this.z = Dc(this.z, e, t)), this ) }, }, { key: 'clampLength', value: function (e, t) { var n = this.length() return this.divideScalar(n || 1).multiplyScalar(Dc(n, e, t)) }, }, { key: 'floor', value: function () { return ( (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this ) }, }, { key: 'ceil', value: function () { return ( (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this ) }, }, { key: 'round', value: function () { return ( (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this ) }, }, { key: 'roundToZero', value: function () { return ( (this.x = Math.trunc(this.x)), (this.y = Math.trunc(this.y)), (this.z = Math.trunc(this.z)), this ) }, }, { key: 'negate', value: function () { return ((this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this) }, }, { key: 'dot', value: function (e) { return this.x * e.x + this.y * e.y + this.z * e.z }, }, { key: 'lengthSq', value: function () { return this.x * this.x + this.y * this.y + this.z * this.z }, }, { key: 'length', value: function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z) }, }, { key: 'manhattanLength', value: function () { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) }, }, { key: 'normalize', value: function () { return this.divideScalar(this.length() || 1) }, }, { key: 'setLength', value: function (e) { return this.normalize().multiplyScalar(e) }, }, { key: 'lerp', value: function (e, t) { return ( (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), this ) }, }, { key: 'lerpVectors', value: function (e, t, n) { return ( (this.x = e.x + (t.x - e.x) * n), (this.y = e.y + (t.y - e.y) * n), (this.z = e.z + (t.z - e.z) * n), this ) }, }, { key: 'cross', value: function (e) { return this.crossVectors(this, e) }, }, { key: 'crossVectors', value: function (e, t) { var n = e.x, r = e.y, i = e.z, a = t.x, o = t.y, s = t.z return ( (this.x = r * s - i * o), (this.y = i * a - n * s), (this.z = n * o - r * a), this ) }, }, { key: 'projectOnVector', value: function (e) { var t = e.lengthSq() if (0 === t) return this.set(0, 0, 0) var n = e.dot(this) / t return this.copy(e).multiplyScalar(n) }, }, { key: 'projectOnPlane', value: function (e) { return (vh.copy(this).projectOnVector(e), this.sub(vh)) }, }, { key: 'reflect', value: function (e) { return this.sub(vh.copy(e).multiplyScalar(2 * this.dot(e))) }, }, { key: 'angleTo', value: function (e) { var t = Math.sqrt(this.lengthSq() * e.lengthSq()) if (0 === t) return Math.PI / 2 var n = this.dot(e) / t return Math.acos(Dc(n, -1, 1)) }, }, { key: 'distanceTo', value: function (e) { return Math.sqrt(this.distanceToSquared(e)) }, }, { key: 'distanceToSquared', value: function (e) { var t = this.x - e.x, n = this.y - e.y, r = this.z - e.z return t * t + n * n + r * r }, }, { key: 'manhattanDistanceTo', value: function (e) { return ( Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z) ) }, }, { key: 'setFromSpherical', value: function (e) { return this.setFromSphericalCoords(e.radius, e.phi, e.theta) }, }, { key: 'setFromSphericalCoords', value: function (e, t, n) { var r = Math.sin(t) * e return ( (this.x = r * Math.sin(n)), (this.y = Math.cos(t) * e), (this.z = r * Math.cos(n)), this ) }, }, { key: 'setFromCylindrical', value: function (e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y) }, }, { key: 'setFromCylindricalCoords', value: function (e, t, n) { return ( (this.x = e * Math.sin(t)), (this.y = n), (this.z = e * Math.cos(t)), this ) }, }, { key: 'setFromMatrixPosition', value: function (e) { var t = e.elements return ((this.x = t[12]), (this.y = t[13]), (this.z = t[14]), this) }, }, { key: 'setFromMatrixScale', value: function (e) { var t = this.setFromMatrixColumn(e, 0).length(), n = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length() return ((this.x = t), (this.y = n), (this.z = r), this) }, }, { key: 'setFromMatrixColumn', value: function (e, t) { return this.fromArray(e.elements, 4 * t) }, }, { key: 'setFromMatrix3Column', value: function (e, t) { return this.fromArray(e.elements, 3 * t) }, }, { key: 'setFromEuler', value: function (e) { return ((this.x = e._x), (this.y = e._y), (this.z = e._z), this) }, }, { key: 'setFromColor', value: function (e) { return ((this.x = e.r), (this.y = e.g), (this.z = e.b), this) }, }, { key: 'equals', value: function (e) { return e.x === this.x && e.y === this.y && e.z === this.z }, }, { key: 'fromArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e) }, }, { key: 'fromBufferAttribute', value: function (e, t) { return ( (this.x = e.getX(t)), (this.y = e.getY(t)), (this.z = e.getZ(t)), this ) }, }, { key: 'random', value: function () { return ( (this.x = Math.random()), (this.y = Math.random()), (this.z = Math.random()), this ) }, }, { key: 'randomDirection', value: function () { var e = Math.random() * Math.PI * 2, t = 2 * Math.random() - 1, n = Math.sqrt(1 - t * t) return ( (this.x = n * Math.cos(e)), (this.y = t), (this.z = n * Math.sin(e)), this ) }, }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.x) case 1: return ((e.n = 2), this.y) case 2: return ((e.n = 3), this.z) case 3: return e.a(2) } }, e, this ) }), }, ] ) })(), vh = new ph(), mh = new fh(), gh = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(1 / 0, 1 / 0, 1 / 0), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(-1 / 0, -1 / 0, -1 / 0) ;(A(this, e), (this.isBox3 = !0), (this.min = t), (this.max = n)) }, [ { key: 'set', value: function (e, t) { return (this.min.copy(e), this.max.copy(t), this) }, }, { key: 'setFromArray', value: function (e) { this.makeEmpty() for (var t = 0, n = e.length; t < n; t += 3) this.expandByPoint(_h.fromArray(e, t)) return this }, }, { key: 'setFromBufferAttribute', value: function (e) { this.makeEmpty() for (var t = 0, n = e.count; t < n; t++) this.expandByPoint(_h.fromBufferAttribute(e, t)) return this }, }, { key: 'setFromPoints', value: function (e) { this.makeEmpty() for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]) return this }, }, { key: 'setFromCenterAndSize', value: function (e, t) { var n = _h.copy(t).multiplyScalar(0.5) return (this.min.copy(e).sub(n), this.max.copy(e).add(n), this) }, }, { key: 'setFromObject', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] return (this.makeEmpty(), this.expandByObject(e, t)) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { return (this.min.copy(e.min), this.max.copy(e.max), this) }, }, { key: 'makeEmpty', value: function () { return ( (this.min.x = this.min.y = this.min.z = 1 / 0), (this.max.x = this.max.y = this.max.z = -1 / 0), this ) }, }, { key: 'isEmpty', value: function () { return ( this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z ) }, }, { key: 'getCenter', value: function (e) { return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5) }, }, { key: 'getSize', value: function (e) { return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min) }, }, { key: 'expandByPoint', value: function (e) { return (this.min.min(e), this.max.max(e), this) }, }, { key: 'expandByVector', value: function (e) { return (this.min.sub(e), this.max.add(e), this) }, }, { key: 'expandByScalar', value: function (e) { return (this.min.addScalar(-e), this.max.addScalar(e), this) }, }, { key: 'expandByObject', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] e.updateWorldMatrix(!1, !1) var n = e.geometry if (void 0 !== n) { var r = n.getAttribute('position') if (!0 === t && void 0 !== r && !0 !== e.isInstancedMesh) for (var i = 0, a = r.count; i < a; i++) (!0 === e.isMesh ? e.getVertexPosition(i, _h) : _h.fromBufferAttribute(r, i), _h.applyMatrix4(e.matrixWorld), this.expandByPoint(_h)) else (void 0 !== e.boundingBox ? (null === e.boundingBox && e.computeBoundingBox(), bh.copy(e.boundingBox)) : (null === n.boundingBox && n.computeBoundingBox(), bh.copy(n.boundingBox)), bh.applyMatrix4(e.matrixWorld), this.union(bh)) } for (var o = e.children, s = 0, u = o.length; s < u; s++) this.expandByObject(o[s], t) return this }, }, { key: 'containsPoint', value: function (e) { return ( e.x >= this.min.x && e.x <= this.max.x && e.y >= this.min.y && e.y <= this.max.y && e.z >= this.min.z && e.z <= this.max.z ) }, }, { key: 'containsBox', value: function (e) { return ( this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z ) }, }, { key: 'getParameter', value: function (e, t) { return t.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z) ) }, }, { key: 'intersectsBox', value: function (e) { return ( e.max.x >= this.min.x && e.min.x <= this.max.x && e.max.y >= this.min.y && e.min.y <= this.max.y && e.max.z >= this.min.z && e.min.z <= this.max.z ) }, }, { key: 'intersectsSphere', value: function (e) { return ( this.clampPoint(e.center, _h), _h.distanceToSquared(e.center) <= e.radius * e.radius ) }, }, { key: 'intersectsPlane', value: function (e) { var t, n return ( e.normal.x > 0 ? ((t = e.normal.x * this.min.x), (n = e.normal.x * this.max.x)) : ((t = e.normal.x * this.max.x), (n = e.normal.x * this.min.x)), e.normal.y > 0 ? ((t += e.normal.y * this.min.y), (n += e.normal.y * this.max.y)) : ((t += e.normal.y * this.max.y), (n += e.normal.y * this.min.y)), e.normal.z > 0 ? ((t += e.normal.z * this.min.z), (n += e.normal.z * this.max.z)) : ((t += e.normal.z * this.max.z), (n += e.normal.z * this.min.z)), t <= -e.constant && n >= -e.constant ) }, }, { key: 'intersectsTriangle', value: function (e) { if (this.isEmpty()) return !1 ;(this.getCenter(Eh), Ch.subVectors(this.max, Eh), xh.subVectors(e.a, Eh), Sh.subVectors(e.b, Eh), Ah.subVectors(e.c, Eh), wh.subVectors(Sh, xh), Th.subVectors(Ah, Sh), Mh.subVectors(xh, Ah)) var t = [ 0, -wh.z, wh.y, 0, -Th.z, Th.y, 0, -Mh.z, Mh.y, wh.z, 0, -wh.x, Th.z, 0, -Th.x, Mh.z, 0, -Mh.x, -wh.y, wh.x, 0, -Th.y, Th.x, 0, -Mh.y, Mh.x, 0, ] return ( !!Ih(t, xh, Sh, Ah, Ch) && !!Ih((t = [1, 0, 0, 0, 1, 0, 0, 0, 1]), xh, Sh, Ah, Ch) && (kh.crossVectors(wh, Th), Ih((t = [kh.x, kh.y, kh.z]), xh, Sh, Ah, Ch)) ) }, }, { key: 'clampPoint', value: function (e, t) { return t.copy(e).clamp(this.min, this.max) }, }, { key: 'distanceToPoint', value: function (e) { return this.clampPoint(e, _h).distanceTo(e) }, }, { key: 'getBoundingSphere', value: function (e) { return ( this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), (e.radius = 0.5 * this.getSize(_h).length())), e ) }, }, { key: 'intersect', value: function (e) { return ( this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this ) }, }, { key: 'union', value: function (e) { return (this.min.min(e.min), this.max.max(e.max), this) }, }, { key: 'applyMatrix4', value: function (e) { return ( this.isEmpty() || (yh[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), yh[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), yh[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), yh[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), yh[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), yh[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), yh[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), yh[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(yh)), this ) }, }, { key: 'translate', value: function (e) { return (this.min.add(e), this.max.add(e), this) }, }, { key: 'equals', value: function (e) { return e.min.equals(this.min) && e.max.equals(this.max) }, }, ] ) })(), yh = [new ph(), new ph(), new ph(), new ph(), new ph(), new ph(), new ph(), new ph()], _h = new ph(), bh = new gh(), xh = new ph(), Sh = new ph(), Ah = new ph(), wh = new ph(), Th = new ph(), Mh = new ph(), Eh = new ph(), Ch = new ph(), kh = new ph(), Rh = new ph() function Ih(e, t, n, r, i) { for (var a = 0, o = e.length - 3; a <= o; a += 3) { Rh.fromArray(e, a) var s = i.x * Math.abs(Rh.x) + i.y * Math.abs(Rh.y) + i.z * Math.abs(Rh.z), u = t.dot(Rh), l = n.dot(Rh), c = r.dot(Rh) if (Math.max(-Math.max(u, l, c), Math.min(u, l, c)) > s) return !1 } return !0 } var Nh = new gh(), Ph = new ph(), Lh = new ph(), Dh = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1 ;(A(this, e), (this.isSphere = !0), (this.center = t), (this.radius = n)) }, [ { key: 'set', value: function (e, t) { return (this.center.copy(e), (this.radius = t), this) }, }, { key: 'setFromPoints', value: function (e, t) { var n = this.center void 0 !== t ? n.copy(t) : Nh.setFromPoints(e).getCenter(n) for (var r = 0, i = 0, a = e.length; i < a; i++) r = Math.max(r, n.distanceToSquared(e[i])) return ((this.radius = Math.sqrt(r)), this) }, }, { key: 'copy', value: function (e) { return (this.center.copy(e.center), (this.radius = e.radius), this) }, }, { key: 'isEmpty', value: function () { return this.radius < 0 }, }, { key: 'makeEmpty', value: function () { return (this.center.set(0, 0, 0), (this.radius = -1), this) }, }, { key: 'containsPoint', value: function (e) { return e.distanceToSquared(this.center) <= this.radius * this.radius }, }, { key: 'distanceToPoint', value: function (e) { return e.distanceTo(this.center) - this.radius }, }, { key: 'intersectsSphere', value: function (e) { var t = this.radius + e.radius return e.center.distanceToSquared(this.center) <= t * t }, }, { key: 'intersectsBox', value: function (e) { return e.intersectsSphere(this) }, }, { key: 'intersectsPlane', value: function (e) { return Math.abs(e.distanceToPoint(this.center)) <= this.radius }, }, { key: 'clampPoint', value: function (e, t) { var n = this.center.distanceToSquared(e) return ( t.copy(e), n > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t ) }, }, { key: 'getBoundingBox', value: function (e) { return this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e) }, }, { key: 'applyMatrix4', value: function (e) { return ( this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this ) }, }, { key: 'translate', value: function (e) { return (this.center.add(e), this) }, }, { key: 'expandByPoint', value: function (e) { if (this.isEmpty()) return (this.center.copy(e), (this.radius = 0), this) Ph.subVectors(e, this.center) var t = Ph.lengthSq() if (t > this.radius * this.radius) { var n = Math.sqrt(t), r = 0.5 * (n - this.radius) ;(this.center.addScaledVector(Ph, r / n), (this.radius += r)) } return this }, }, { key: 'union', value: function (e) { return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (!0 === this.center.equals(e.center) ? (this.radius = Math.max(this.radius, e.radius)) : (Lh.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Ph.copy(e.center).add(Lh)), this.expandByPoint(Ph.copy(e.center).sub(Lh))), this) }, }, { key: 'equals', value: function (e) { return e.center.equals(this.center) && e.radius === this.radius }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ] ) })(), Oh = new ph(), Fh = new ph(), Bh = new ph(), Uh = new ph(), zh = new ph(), Vh = new ph(), Hh = new ph(), Wh = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(0, 0, -1) ;(A(this, e), (this.origin = t), (this.direction = n)) }, [ { key: 'set', value: function (e, t) { return (this.origin.copy(e), this.direction.copy(t), this) }, }, { key: 'copy', value: function (e) { return (this.origin.copy(e.origin), this.direction.copy(e.direction), this) }, }, { key: 'at', value: function (e, t) { return t.copy(this.origin).addScaledVector(this.direction, e) }, }, { key: 'lookAt', value: function (e) { return (this.direction.copy(e).sub(this.origin).normalize(), this) }, }, { key: 'recast', value: function (e) { return (this.origin.copy(this.at(e, Oh)), this) }, }, { key: 'closestPointToPoint', value: function (e, t) { t.subVectors(e, this.origin) var n = t.dot(this.direction) return n < 0 ? t.copy(this.origin) : t.copy(this.origin).addScaledVector(this.direction, n) }, }, { key: 'distanceToPoint', value: function (e) { return Math.sqrt(this.distanceSqToPoint(e)) }, }, { key: 'distanceSqToPoint', value: function (e) { var t = Oh.subVectors(e, this.origin).dot(this.direction) return t < 0 ? this.origin.distanceToSquared(e) : (Oh.copy(this.origin).addScaledVector(this.direction, t), Oh.distanceToSquared(e)) }, }, { key: 'distanceSqToSegment', value: function (e, t, n, r) { ;(Fh.copy(e).add(t).multiplyScalar(0.5), Bh.copy(t).sub(e).normalize(), Uh.copy(this.origin).sub(Fh)) var i, a, o, s, u = 0.5 * e.distanceTo(t), l = -this.direction.dot(Bh), c = Uh.dot(this.direction), h = -Uh.dot(Bh), d = Uh.lengthSq(), f = Math.abs(1 - l * l) if (f > 0) if (((a = l * c - h), (s = u * f), (i = l * h - c) >= 0)) if (a >= -s) if (a <= s) { var p = 1 / f o = (i *= p) * (i + l * (a *= p) + 2 * c) + a * (l * i + a + 2 * h) + d } else ((a = u), (o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d)) else ((a = -u), (o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d)) else a <= -s ? (o = -(i = Math.max(0, -(-l * u + c))) * i + (a = i > 0 ? -u : Math.min(Math.max(-u, -h), u)) * (a + 2 * h) + d) : a <= s ? ((i = 0), (o = (a = Math.min(Math.max(-u, -h), u)) * (a + 2 * h) + d)) : (o = -(i = Math.max(0, -(l * u + c))) * i + (a = i > 0 ? u : Math.min(Math.max(-u, -h), u)) * (a + 2 * h) + d) else ((a = l > 0 ? -u : u), (o = -(i = Math.max(0, -(l * a + c))) * i + a * (a + 2 * h) + d)) return ( n && n.copy(this.origin).addScaledVector(this.direction, i), r && r.copy(Fh).addScaledVector(Bh, a), o ) }, }, { key: 'intersectSphere', value: function (e, t) { Oh.subVectors(e.center, this.origin) var n = Oh.dot(this.direction), r = Oh.dot(Oh) - n * n, i = e.radius * e.radius if (r > i) return null var a = Math.sqrt(i - r), o = n - a, s = n + a return s < 0 ? null : o < 0 ? this.at(s, t) : this.at(o, t) }, }, { key: 'intersectsSphere', value: function (e) { return this.distanceSqToPoint(e.center) <= e.radius * e.radius }, }, { key: 'distanceToPlane', value: function (e) { var t = e.normal.dot(this.direction) if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null var n = -(this.origin.dot(e.normal) + e.constant) / t return n >= 0 ? n : null }, }, { key: 'intersectPlane', value: function (e, t) { var n = this.distanceToPlane(e) return null === n ? null : this.at(n, t) }, }, { key: 'intersectsPlane', value: function (e) { var t = e.distanceToPoint(this.origin) return 0 === t || e.normal.dot(this.direction) * t < 0 }, }, { key: 'intersectBox', value: function (e, t) { var n, r, i, a, o, s, u = 1 / this.direction.x, l = 1 / this.direction.y, c = 1 / this.direction.z, h = this.origin return ( u >= 0 ? ((n = (e.min.x - h.x) * u), (r = (e.max.x - h.x) * u)) : ((n = (e.max.x - h.x) * u), (r = (e.min.x - h.x) * u)), l >= 0 ? ((i = (e.min.y - h.y) * l), (a = (e.max.y - h.y) * l)) : ((i = (e.max.y - h.y) * l), (a = (e.min.y - h.y) * l)), n > a || i > r ? null : ((i > n || isNaN(n)) && (n = i), (a < r || isNaN(r)) && (r = a), c >= 0 ? ((o = (e.min.z - h.z) * c), (s = (e.max.z - h.z) * c)) : ((o = (e.max.z - h.z) * c), (s = (e.min.z - h.z) * c)), n > s || o > r ? null : ((o > n || n != n) && (n = o), (s < r || r != r) && (r = s), r < 0 ? null : this.at(n >= 0 ? n : r, t))) ) }, }, { key: 'intersectsBox', value: function (e) { return null !== this.intersectBox(e, Oh) }, }, { key: 'intersectTriangle', value: function (e, t, n, r, i) { ;(zh.subVectors(t, e), Vh.subVectors(n, e), Hh.crossVectors(zh, Vh)) var a, o = this.direction.dot(Hh) if (o > 0) { if (r) return null a = 1 } else { if (!(o < 0)) return null ;((a = -1), (o = -o)) } Uh.subVectors(this.origin, e) var s = a * this.direction.dot(Vh.crossVectors(Uh, Vh)) if (s < 0) return null var u = a * this.direction.dot(zh.cross(Uh)) if (u < 0) return null if (s + u > o) return null var l = -a * Uh.dot(Hh) return l < 0 ? null : this.at(l / o, i) }, }, { key: 'applyMatrix4', value: function (e) { return ( this.origin.applyMatrix4(e), this.direction.transformDirection(e), this ) }, }, { key: 'equals', value: function (e) { return e.origin.equals(this.origin) && e.direction.equals(this.direction) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ] ) })(), Gh = (function () { function e(t, n, r, i, a, o, s, u, l, c, h, d, f, p, v, m) { ;(A(this, e), (e.prototype.isMatrix4 = !0), (this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), void 0 !== t && this.set(t, n, r, i, a, o, s, u, l, c, h, d, f, p, v, m)) } return T(e, [ { key: 'set', value: function (e, t, n, r, i, a, o, s, u, l, c, h, d, f, p, v) { var m = this.elements return ( (m[0] = e), (m[4] = t), (m[8] = n), (m[12] = r), (m[1] = i), (m[5] = a), (m[9] = o), (m[13] = s), (m[2] = u), (m[6] = l), (m[10] = c), (m[14] = h), (m[3] = d), (m[7] = f), (m[11] = p), (m[15] = v), this ) }, }, { key: 'identity', value: function () { return (this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this) }, }, { key: 'clone', value: function () { return new e().fromArray(this.elements) }, }, { key: 'copy', value: function (e) { var t = this.elements, n = e.elements return ( (t[0] = n[0]), (t[1] = n[1]), (t[2] = n[2]), (t[3] = n[3]), (t[4] = n[4]), (t[5] = n[5]), (t[6] = n[6]), (t[7] = n[7]), (t[8] = n[8]), (t[9] = n[9]), (t[10] = n[10]), (t[11] = n[11]), (t[12] = n[12]), (t[13] = n[13]), (t[14] = n[14]), (t[15] = n[15]), this ) }, }, { key: 'copyPosition', value: function (e) { var t = this.elements, n = e.elements return ((t[12] = n[12]), (t[13] = n[13]), (t[14] = n[14]), this) }, }, { key: 'setFromMatrix3', value: function (e) { var t = e.elements return ( this.set( t[0], t[3], t[6], 0, t[1], t[4], t[7], 0, t[2], t[5], t[8], 0, 0, 0, 0, 1 ), this ) }, }, { key: 'extractBasis', value: function (e, t, n) { return ( e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this ) }, }, { key: 'makeBasis', value: function (e, t, n) { return ( this.set(e.x, t.x, n.x, 0, e.y, t.y, n.y, 0, e.z, t.z, n.z, 0, 0, 0, 0, 1), this ) }, }, { key: 'extractRotation', value: function (e) { var t = this.elements, n = e.elements, r = 1 / jh.setFromMatrixColumn(e, 0).length(), i = 1 / jh.setFromMatrixColumn(e, 1).length(), a = 1 / jh.setFromMatrixColumn(e, 2).length() return ( (t[0] = n[0] * r), (t[1] = n[1] * r), (t[2] = n[2] * r), (t[3] = 0), (t[4] = n[4] * i), (t[5] = n[5] * i), (t[6] = n[6] * i), (t[7] = 0), (t[8] = n[8] * a), (t[9] = n[9] * a), (t[10] = n[10] * a), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this ) }, }, { key: 'makeRotationFromEuler', value: function (e) { var t = this.elements, n = e.x, r = e.y, i = e.z, a = Math.cos(n), o = Math.sin(n), s = Math.cos(r), u = Math.sin(r), l = Math.cos(i), c = Math.sin(i) if ('XYZ' === e.order) { var h = a * l, d = a * c, f = o * l, p = o * c ;((t[0] = s * l), (t[4] = -s * c), (t[8] = u), (t[1] = d + f * u), (t[5] = h - p * u), (t[9] = -o * s), (t[2] = p - h * u), (t[6] = f + d * u), (t[10] = a * s)) } else if ('YXZ' === e.order) { var v = s * l, m = s * c, g = u * l, y = u * c ;((t[0] = v + y * o), (t[4] = g * o - m), (t[8] = a * u), (t[1] = a * c), (t[5] = a * l), (t[9] = -o), (t[2] = m * o - g), (t[6] = y + v * o), (t[10] = a * s)) } else if ('ZXY' === e.order) { var _ = s * l, b = s * c, x = u * l, S = u * c ;((t[0] = _ - S * o), (t[4] = -a * c), (t[8] = x + b * o), (t[1] = b + x * o), (t[5] = a * l), (t[9] = S - _ * o), (t[2] = -a * u), (t[6] = o), (t[10] = a * s)) } else if ('ZYX' === e.order) { var A = a * l, w = a * c, T = o * l, M = o * c ;((t[0] = s * l), (t[4] = T * u - w), (t[8] = A * u + M), (t[1] = s * c), (t[5] = M * u + A), (t[9] = w * u - T), (t[2] = -u), (t[6] = o * s), (t[10] = a * s)) } else if ('YZX' === e.order) { var E = a * s, C = a * u, k = o * s, R = o * u ;((t[0] = s * l), (t[4] = R - E * c), (t[8] = k * c + C), (t[1] = c), (t[5] = a * l), (t[9] = -o * l), (t[2] = -u * l), (t[6] = C * c + k), (t[10] = E - R * c)) } else if ('XZY' === e.order) { var I = a * s, N = a * u, P = o * s, L = o * u ;((t[0] = s * l), (t[4] = -c), (t[8] = u * l), (t[1] = I * c + L), (t[5] = a * l), (t[9] = N * c - P), (t[2] = P * c - N), (t[6] = o * l), (t[10] = L * c + I)) } return ( (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this ) }, }, { key: 'makeRotationFromQuaternion', value: function (e) { return this.compose(qh, e, Xh) }, }, { key: 'lookAt', value: function (e, t, n) { var r = this.elements return ( Zh.subVectors(e, t), 0 === Zh.lengthSq() && (Zh.z = 1), Zh.normalize(), Yh.crossVectors(n, Zh), 0 === Yh.lengthSq() && (1 === Math.abs(n.z) ? (Zh.x += 1e-4) : (Zh.z += 1e-4), Zh.normalize(), Yh.crossVectors(n, Zh)), Yh.normalize(), Kh.crossVectors(Zh, Yh), (r[0] = Yh.x), (r[4] = Kh.x), (r[8] = Zh.x), (r[1] = Yh.y), (r[5] = Kh.y), (r[9] = Zh.y), (r[2] = Yh.z), (r[6] = Kh.z), (r[10] = Zh.z), this ) }, }, { key: 'multiply', value: function (e) { return this.multiplyMatrices(this, e) }, }, { key: 'premultiply', value: function (e) { return this.multiplyMatrices(e, this) }, }, { key: 'multiplyMatrices', value: function (e, t) { var n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], u = n[12], l = n[1], c = n[5], h = n[9], d = n[13], f = n[2], p = n[6], v = n[10], m = n[14], g = n[3], y = n[7], _ = n[11], b = n[15], x = r[0], S = r[4], A = r[8], w = r[12], T = r[1], M = r[5], E = r[9], C = r[13], k = r[2], R = r[6], I = r[10], N = r[14], P = r[3], L = r[7], D = r[11], O = r[15] return ( (i[0] = a * x + o * T + s * k + u * P), (i[4] = a * S + o * M + s * R + u * L), (i[8] = a * A + o * E + s * I + u * D), (i[12] = a * w + o * C + s * N + u * O), (i[1] = l * x + c * T + h * k + d * P), (i[5] = l * S + c * M + h * R + d * L), (i[9] = l * A + c * E + h * I + d * D), (i[13] = l * w + c * C + h * N + d * O), (i[2] = f * x + p * T + v * k + m * P), (i[6] = f * S + p * M + v * R + m * L), (i[10] = f * A + p * E + v * I + m * D), (i[14] = f * w + p * C + v * N + m * O), (i[3] = g * x + y * T + _ * k + b * P), (i[7] = g * S + y * M + _ * R + b * L), (i[11] = g * A + y * E + _ * I + b * D), (i[15] = g * w + y * C + _ * N + b * O), this ) }, }, { key: 'multiplyScalar', value: function (e) { var t = this.elements return ( (t[0] *= e), (t[4] *= e), (t[8] *= e), (t[12] *= e), (t[1] *= e), (t[5] *= e), (t[9] *= e), (t[13] *= e), (t[2] *= e), (t[6] *= e), (t[10] *= e), (t[14] *= e), (t[3] *= e), (t[7] *= e), (t[11] *= e), (t[15] *= e), this ) }, }, { key: 'determinant', value: function () { var e = this.elements, t = e[0], n = e[4], r = e[8], i = e[12], a = e[1], o = e[5], s = e[9], u = e[13], l = e[2], c = e[6], h = e[10], d = e[14] return ( e[3] * (+i * s * c - r * u * c - i * o * h + n * u * h + r * o * d - n * s * d) + e[7] * (+t * s * d - t * u * h + i * a * h - r * a * d + r * u * l - i * s * l) + e[11] * (+t * u * c - t * o * d - i * a * c + n * a * d + i * o * l - n * u * l) + e[15] * (-r * o * l - t * s * c + t * o * h + r * a * c - n * a * h + n * s * l) ) }, }, { key: 'transpose', value: function () { var e, t = this.elements return ( (e = t[1]), (t[1] = t[4]), (t[4] = e), (e = t[2]), (t[2] = t[8]), (t[8] = e), (e = t[6]), (t[6] = t[9]), (t[9] = e), (e = t[3]), (t[3] = t[12]), (t[12] = e), (e = t[7]), (t[7] = t[13]), (t[13] = e), (e = t[11]), (t[11] = t[14]), (t[14] = e), this ) }, }, { key: 'setPosition', value: function (e, t, n) { var r = this.elements return ( e.isVector3 ? ((r[12] = e.x), (r[13] = e.y), (r[14] = e.z)) : ((r[12] = e), (r[13] = t), (r[14] = n)), this ) }, }, { key: 'invert', value: function () { var e = this.elements, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], u = e[7], l = e[8], c = e[9], h = e[10], d = e[11], f = e[12], p = e[13], v = e[14], m = e[15], g = c * v * u - p * h * u + p * s * d - o * v * d - c * s * m + o * h * m, y = f * h * u - l * v * u - f * s * d + a * v * d + l * s * m - a * h * m, _ = l * p * u - f * c * u + f * o * d - a * p * d - l * o * m + a * c * m, b = f * c * s - l * p * s - f * o * h + a * p * h + l * o * v - a * c * v, x = t * g + n * y + r * _ + i * b if (0 === x) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) var S = 1 / x return ( (e[0] = g * S), (e[1] = (p * h * i - c * v * i - p * r * d + n * v * d + c * r * m - n * h * m) * S), (e[2] = (o * v * i - p * s * i + p * r * u - n * v * u - o * r * m + n * s * m) * S), (e[3] = (c * s * i - o * h * i - c * r * u + n * h * u + o * r * d - n * s * d) * S), (e[4] = y * S), (e[5] = (l * v * i - f * h * i + f * r * d - t * v * d - l * r * m + t * h * m) * S), (e[6] = (f * s * i - a * v * i - f * r * u + t * v * u + a * r * m - t * s * m) * S), (e[7] = (a * h * i - l * s * i + l * r * u - t * h * u - a * r * d + t * s * d) * S), (e[8] = _ * S), (e[9] = (f * c * i - l * p * i - f * n * d + t * p * d + l * n * m - t * c * m) * S), (e[10] = (a * p * i - f * o * i + f * n * u - t * p * u - a * n * m + t * o * m) * S), (e[11] = (l * o * i - a * c * i - l * n * u + t * c * u + a * n * d - t * o * d) * S), (e[12] = b * S), (e[13] = (l * p * r - f * c * r + f * n * h - t * p * h - l * n * v + t * c * v) * S), (e[14] = (f * o * r - a * p * r - f * n * s + t * p * s + a * n * v - t * o * v) * S), (e[15] = (a * c * r - l * o * r + l * n * s - t * c * s - a * n * h + t * o * h) * S), this ) }, }, { key: 'scale', value: function (e) { var t = this.elements, n = e.x, r = e.y, i = e.z return ( (t[0] *= n), (t[4] *= r), (t[8] *= i), (t[1] *= n), (t[5] *= r), (t[9] *= i), (t[2] *= n), (t[6] *= r), (t[10] *= i), (t[3] *= n), (t[7] *= r), (t[11] *= i), this ) }, }, { key: 'getMaxScaleOnAxis', value: function () { var e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10] return Math.sqrt(Math.max(t, n, r)) }, }, { key: 'makeTranslation', value: function (e, t, n) { return ( e.isVector3 ? this.set(1, 0, 0, e.x, 0, 1, 0, e.y, 0, 0, 1, e.z, 0, 0, 0, 1) : this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1), this ) }, }, { key: 'makeRotationX', value: function (e) { var t = Math.cos(e), n = Math.sin(e) return (this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this) }, }, { key: 'makeRotationY', value: function (e) { var t = Math.cos(e), n = Math.sin(e) return (this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this) }, }, { key: 'makeRotationZ', value: function (e) { var t = Math.cos(e), n = Math.sin(e) return (this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this) }, }, { key: 'makeRotationAxis', value: function (e, t) { var n = Math.cos(t), r = Math.sin(t), i = 1 - n, a = e.x, o = e.y, s = e.z, u = i * a, l = i * o return ( this.set( u * a + n, u * o - r * s, u * s + r * o, 0, u * o + r * s, l * o + n, l * s - r * a, 0, u * s - r * o, l * s + r * a, i * s * s + n, 0, 0, 0, 0, 1 ), this ) }, }, { key: 'makeScale', value: function (e, t, n) { return (this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this) }, }, { key: 'makeShear', value: function (e, t, n, r, i, a) { return (this.set(1, n, i, 0, e, 1, a, 0, t, r, 1, 0, 0, 0, 0, 1), this) }, }, { key: 'compose', value: function (e, t, n) { var r = this.elements, i = t._x, a = t._y, o = t._z, s = t._w, u = i + i, l = a + a, c = o + o, h = i * u, d = i * l, f = i * c, p = a * l, v = a * c, m = o * c, g = s * u, y = s * l, _ = s * c, b = n.x, x = n.y, S = n.z return ( (r[0] = (1 - (p + m)) * b), (r[1] = (d + _) * b), (r[2] = (f - y) * b), (r[3] = 0), (r[4] = (d - _) * x), (r[5] = (1 - (h + m)) * x), (r[6] = (v + g) * x), (r[7] = 0), (r[8] = (f + y) * S), (r[9] = (v - g) * S), (r[10] = (1 - (h + p)) * S), (r[11] = 0), (r[12] = e.x), (r[13] = e.y), (r[14] = e.z), (r[15] = 1), this ) }, }, { key: 'decompose', value: function (e, t, n) { var r = this.elements, i = jh.set(r[0], r[1], r[2]).length(), a = jh.set(r[4], r[5], r[6]).length(), o = jh.set(r[8], r[9], r[10]).length() ;(this.determinant() < 0 && (i = -i), (e.x = r[12]), (e.y = r[13]), (e.z = r[14]), Qh.copy(this)) var s = 1 / i, u = 1 / a, l = 1 / o return ( (Qh.elements[0] *= s), (Qh.elements[1] *= s), (Qh.elements[2] *= s), (Qh.elements[4] *= u), (Qh.elements[5] *= u), (Qh.elements[6] *= u), (Qh.elements[8] *= l), (Qh.elements[9] *= l), (Qh.elements[10] *= l), t.setFromRotationMatrix(Qh), (n.x = i), (n.y = a), (n.z = o), this ) }, }, { key: 'makePerspective', value: function (e, t, n, r, i, a) { var o, s, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Ec, l = this.elements, c = (2 * i) / (t - e), h = (2 * i) / (n - r), d = (t + e) / (t - e), f = (n + r) / (n - r) if (u === Ec) ((o = -(a + i) / (a - i)), (s = (-2 * a * i) / (a - i))) else { if (u !== Cc) throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + u ) ;((o = -a / (a - i)), (s = (-a * i) / (a - i))) } return ( (l[0] = c), (l[4] = 0), (l[8] = d), (l[12] = 0), (l[1] = 0), (l[5] = h), (l[9] = f), (l[13] = 0), (l[2] = 0), (l[6] = 0), (l[10] = o), (l[14] = s), (l[3] = 0), (l[7] = 0), (l[11] = -1), (l[15] = 0), this ) }, }, { key: 'makeOrthographic', value: function (e, t, n, r, i, a) { var o, s, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Ec, l = this.elements, c = 1 / (t - e), h = 1 / (n - r), d = 1 / (a - i), f = (t + e) * c, p = (n + r) * h if (u === Ec) ((o = (a + i) * d), (s = -2 * d)) else { if (u !== Cc) throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + u ) ;((o = i * d), (s = -1 * d)) } return ( (l[0] = 2 * c), (l[4] = 0), (l[8] = 0), (l[12] = -f), (l[1] = 0), (l[5] = 2 * h), (l[9] = 0), (l[13] = -p), (l[2] = 0), (l[6] = 0), (l[10] = s), (l[14] = -o), (l[3] = 0), (l[7] = 0), (l[11] = 0), (l[15] = 1), this ) }, }, { key: 'equals', value: function (e) { for (var t = this.elements, n = e.elements, r = 0; r < 16; r++) if (t[r] !== n[r]) return !1 return !0 }, }, { key: 'fromArray', value: function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = 0; n < 16; n++ ) this.elements[n] = e[n + t] return this }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = this.elements return ( (e[t] = n[0]), (e[t + 1] = n[1]), (e[t + 2] = n[2]), (e[t + 3] = n[3]), (e[t + 4] = n[4]), (e[t + 5] = n[5]), (e[t + 6] = n[6]), (e[t + 7] = n[7]), (e[t + 8] = n[8]), (e[t + 9] = n[9]), (e[t + 10] = n[10]), (e[t + 11] = n[11]), (e[t + 12] = n[12]), (e[t + 13] = n[13]), (e[t + 14] = n[14]), (e[t + 15] = n[15]), e ) }, }, ]) })(), jh = new ph(), Qh = new Gh(), qh = new ph(0, 0, 0), Xh = new ph(1, 1, 1), Yh = new ph(), Kh = new ph(), Zh = new ph(), Jh = new Gh(), $h = new fh(), ed = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : e.DEFAULT_ORDER ;(A(this, e), (this.isEuler = !0), (this._x = t), (this._y = n), (this._z = r), (this._order = i)) }, [ { key: 'x', get: function () { return this._x }, set: function (e) { ;((this._x = e), this._onChangeCallback()) }, }, { key: 'y', get: function () { return this._y }, set: function (e) { ;((this._y = e), this._onChangeCallback()) }, }, { key: 'z', get: function () { return this._z }, set: function (e) { ;((this._z = e), this._onChangeCallback()) }, }, { key: 'order', get: function () { return this._order }, set: function (e) { ;((this._order = e), this._onChangeCallback()) }, }, { key: 'set', value: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : this._order return ( (this._x = e), (this._y = t), (this._z = n), (this._order = r), this._onChangeCallback(), this ) }, }, { key: 'clone', value: function () { return new this.constructor(this._x, this._y, this._z, this._order) }, }, { key: 'copy', value: function (e) { return ( (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this._onChangeCallback(), this ) }, }, { key: 'setFromRotationMatrix', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._order, n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r = e.elements, i = r[0], a = r[4], o = r[8], s = r[1], u = r[5], l = r[9], c = r[2], h = r[6], d = r[10] switch (t) { case 'XYZ': ;((this._y = Math.asin(Dc(o, -1, 1))), Math.abs(o) < 0.9999999 ? ((this._x = Math.atan2(-l, d)), (this._z = Math.atan2(-a, i))) : ((this._x = Math.atan2(h, u)), (this._z = 0))) break case 'YXZ': ;((this._x = Math.asin(-Dc(l, -1, 1))), Math.abs(l) < 0.9999999 ? ((this._y = Math.atan2(o, d)), (this._z = Math.atan2(s, u))) : ((this._y = Math.atan2(-c, i)), (this._z = 0))) break case 'ZXY': ;((this._x = Math.asin(Dc(h, -1, 1))), Math.abs(h) < 0.9999999 ? ((this._y = Math.atan2(-c, d)), (this._z = Math.atan2(-a, u))) : ((this._y = 0), (this._z = Math.atan2(s, i)))) break case 'ZYX': ;((this._y = Math.asin(-Dc(c, -1, 1))), Math.abs(c) < 0.9999999 ? ((this._x = Math.atan2(h, d)), (this._z = Math.atan2(s, i))) : ((this._x = 0), (this._z = Math.atan2(-a, u)))) break case 'YZX': ;((this._z = Math.asin(Dc(s, -1, 1))), Math.abs(s) < 0.9999999 ? ((this._x = Math.atan2(-l, u)), (this._y = Math.atan2(-c, i))) : ((this._x = 0), (this._y = Math.atan2(o, d)))) break case 'XZY': ;((this._z = Math.asin(-Dc(a, -1, 1))), Math.abs(a) < 0.9999999 ? ((this._x = Math.atan2(h, u)), (this._y = Math.atan2(o, i))) : ((this._x = Math.atan2(-l, d)), (this._y = 0))) break default: console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + t ) } return ((this._order = t), !0 === n && this._onChangeCallback(), this) }, }, { key: 'setFromQuaternion', value: function (e, t, n) { return ( Jh.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Jh, t, n) ) }, }, { key: 'setFromVector3', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._order return this.set(e.x, e.y, e.z, t) }, }, { key: 'reorder', value: function (e) { return ($h.setFromEuler(this), this.setFromQuaternion($h, e)) }, }, { key: 'equals', value: function (e) { return ( e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order ) }, }, { key: 'fromArray', value: function (e) { return ( (this._x = e[0]), (this._y = e[1]), (this._z = e[2]), void 0 !== e[3] && (this._order = e[3]), this._onChangeCallback(), this ) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ( (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._order), e ) }, }, { key: '_onChange', value: function (e) { return ((this._onChangeCallback = e), this) }, }, { key: '_onChangeCallback', value: function () {} }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this._x) case 1: return ((e.n = 2), this._y) case 2: return ((e.n = 3), this._z) case 3: return ((e.n = 4), this._order) case 4: return e.a(2) } }, e, this ) }), }, ] ) })() ed.DEFAULT_ORDER = 'XYZ' var td = (function () { return T( function e() { ;(A(this, e), (this.mask = 1)) }, [ { key: 'set', value: function (e) { this.mask = (1 << e) >>> 0 }, }, { key: 'enable', value: function (e) { this.mask |= 1 << e }, }, { key: 'enableAll', value: function () { this.mask = -1 }, }, { key: 'toggle', value: function (e) { this.mask ^= 1 << e }, }, { key: 'disable', value: function (e) { this.mask &= ~(1 << e) }, }, { key: 'disableAll', value: function () { this.mask = 0 }, }, { key: 'test', value: function (e) { return 0 !== (this.mask & e.mask) }, }, { key: 'isEnabled', value: function (e) { return !!(this.mask & (1 << e)) }, }, ] ) })(), nd = 0, rd = new ph(), id = new fh(), ad = new Gh(), od = new ph(), sd = new ph(), ud = new ph(), ld = new fh(), cd = new ph(1, 0, 0), hd = new ph(0, 1, 0), dd = new ph(0, 0, 1), fd = { type: 'added' }, pd = { type: 'removed' }, vd = { type: 'childadded', child: null }, md = { type: 'childremoved', child: null }, gd = (function (e) { function t() { var e ;(A(this, t), ((e = y(this, t)).isObject3D = !0), Object.defineProperty(e, 'id', { value: nd++ }), (e.uuid = Lc()), (e.name = ''), (e.type = 'Object3D'), (e.parent = null), (e.children = []), (e.up = t.DEFAULT_UP.clone())) var n = new ph(), r = new ed(), i = new fh(), a = new ph(1, 1, 1) return ( r._onChange(function () { i.setFromEuler(r, !1) }), i._onChange(function () { r.setFromQuaternion(i, void 0, !1) }), Object.defineProperties(e, { position: { configurable: !0, enumerable: !0, value: n }, rotation: { configurable: !0, enumerable: !0, value: r }, quaternion: { configurable: !0, enumerable: !0, value: i }, scale: { configurable: !0, enumerable: !0, value: a }, modelViewMatrix: { value: new Gh() }, normalMatrix: { value: new Hc() }, }), (e.matrix = new Gh()), (e.matrixWorld = new Gh()), (e.matrixAutoUpdate = t.DEFAULT_MATRIX_AUTO_UPDATE), (e.matrixWorldAutoUpdate = t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE), (e.matrixWorldNeedsUpdate = !1), (e.layers = new td()), (e.visible = !0), (e.castShadow = !1), (e.receiveShadow = !1), (e.frustumCulled = !0), (e.renderOrder = 0), (e.animations = []), (e.userData = {}), e ) } return ( x(t, e), T(t, [ { key: 'onBeforeShadow', value: function () {} }, { key: 'onAfterShadow', value: function () {} }, { key: 'onBeforeRender', value: function () {} }, { key: 'onAfterRender', value: function () {} }, { key: 'applyMatrix4', value: function (e) { ;(this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale)) }, }, { key: 'applyQuaternion', value: function (e) { return (this.quaternion.premultiply(e), this) }, }, { key: 'setRotationFromAxisAngle', value: function (e, t) { this.quaternion.setFromAxisAngle(e, t) }, }, { key: 'setRotationFromEuler', value: function (e) { this.quaternion.setFromEuler(e, !0) }, }, { key: 'setRotationFromMatrix', value: function (e) { this.quaternion.setFromRotationMatrix(e) }, }, { key: 'setRotationFromQuaternion', value: function (e) { this.quaternion.copy(e) }, }, { key: 'rotateOnAxis', value: function (e, t) { return (id.setFromAxisAngle(e, t), this.quaternion.multiply(id), this) }, }, { key: 'rotateOnWorldAxis', value: function (e, t) { return (id.setFromAxisAngle(e, t), this.quaternion.premultiply(id), this) }, }, { key: 'rotateX', value: function (e) { return this.rotateOnAxis(cd, e) }, }, { key: 'rotateY', value: function (e) { return this.rotateOnAxis(hd, e) }, }, { key: 'rotateZ', value: function (e) { return this.rotateOnAxis(dd, e) }, }, { key: 'translateOnAxis', value: function (e, t) { return ( rd.copy(e).applyQuaternion(this.quaternion), this.position.add(rd.multiplyScalar(t)), this ) }, }, { key: 'translateX', value: function (e) { return this.translateOnAxis(cd, e) }, }, { key: 'translateY', value: function (e) { return this.translateOnAxis(hd, e) }, }, { key: 'translateZ', value: function (e) { return this.translateOnAxis(dd, e) }, }, { key: 'localToWorld', value: function (e) { return (this.updateWorldMatrix(!0, !1), e.applyMatrix4(this.matrixWorld)) }, }, { key: 'worldToLocal', value: function (e) { return ( this.updateWorldMatrix(!0, !1), e.applyMatrix4(ad.copy(this.matrixWorld).invert()) ) }, }, { key: 'lookAt', value: function (e, t, n) { e.isVector3 ? od.copy(e) : od.set(e, t, n) var r = this.parent ;(this.updateWorldMatrix(!0, !1), sd.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? ad.lookAt(sd, od, this.up) : ad.lookAt(od, sd, this.up), this.quaternion.setFromRotationMatrix(ad), r && (ad.extractRotation(r.matrixWorld), id.setFromRotationMatrix(ad), this.quaternion.premultiply(id.invert()))) }, }, { key: 'add', value: function (e) { if (arguments.length > 1) { for (var t = 0; t < arguments.length; t++) this.add(arguments[t]) return this } return e === this ? (console.error( "THREE.Object3D.add: object can't be added as a child of itself.", e ), this) : (e && e.isObject3D ? (e.removeFromParent(), (e.parent = this), this.children.push(e), e.dispatchEvent(fd), (vd.child = e), this.dispatchEvent(vd), (vd.child = null)) : console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', e ), this) }, }, { key: 'remove', value: function (e) { if (arguments.length > 1) { for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]) return this } var n = this.children.indexOf(e) return ( -1 !== n && ((e.parent = null), this.children.splice(n, 1), e.dispatchEvent(pd), (md.child = e), this.dispatchEvent(md), (md.child = null)), this ) }, }, { key: 'removeFromParent', value: function () { var e = this.parent return (null !== e && e.remove(this), this) }, }, { key: 'clear', value: function () { return this.remove.apply(this, I(this.children)) }, }, { key: 'attach', value: function (e) { return ( this.updateWorldMatrix(!0, !1), ad.copy(this.matrixWorld).invert(), null !== e.parent && (e.parent.updateWorldMatrix(!0, !1), ad.multiply(e.parent.matrixWorld)), e.applyMatrix4(ad), e.removeFromParent(), (e.parent = this), this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(fd), (vd.child = e), this.dispatchEvent(vd), (vd.child = null), this ) }, }, { key: 'getObjectById', value: function (e) { return this.getObjectByProperty('id', e) }, }, { key: 'getObjectByName', value: function (e) { return this.getObjectByProperty('name', e) }, }, { key: 'getObjectByProperty', value: function (e, t) { if (this[e] === t) return this for (var n = 0, r = this.children.length; n < r; n++) { var i = this.children[n].getObjectByProperty(e, t) if (void 0 !== i) return i } }, }, { key: 'getObjectsByProperty', value: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [] this[e] === t && n.push(this) for (var r = this.children, i = 0, a = r.length; i < a; i++) r[i].getObjectsByProperty(e, t, n) return n }, }, { key: 'getWorldPosition', value: function (e) { return ( this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld) ) }, }, { key: 'getWorldQuaternion', value: function (e) { return ( this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(sd, e, ud), e ) }, }, { key: 'getWorldScale', value: function (e) { return ( this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(sd, ld, e), e ) }, }, { key: 'getWorldDirection', value: function (e) { this.updateWorldMatrix(!0, !1) var t = this.matrixWorld.elements return e.set(t[8], t[9], t[10]).normalize() }, }, { key: 'raycast', value: function () {} }, { key: 'traverse', value: function (e) { e(this) for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverse(e) }, }, { key: 'traverseVisible', value: function (e) { if (!1 !== this.visible) { e(this) for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverseVisible(e) } }, }, { key: 'traverseAncestors', value: function (e) { var t = this.parent null !== t && (e(t), t.traverseAncestors(e)) }, }, { key: 'updateMatrix', value: function () { ;(this.matrix.compose(this.position, this.quaternion, this.scale), (this.matrixWorldNeedsUpdate = !0)) }, }, { key: 'updateMatrixWorld', value: function (e) { ;(this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (!0 === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix )), (this.matrixWorldNeedsUpdate = !1), (e = !0))) for (var t = this.children, n = 0, r = t.length; n < r; n++) { t[n].updateMatrixWorld(e) } }, }, { key: 'updateWorldMatrix', value: function (e, t) { var n = this.parent if ( (!0 === e && null !== n && n.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), !0 === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix )), !0 === t) ) for (var r = this.children, i = 0, a = r.length; i < a; i++) { r[i].updateWorldMatrix(!1, !0) } }, }, { key: 'toJSON', value: function (e) { var t = void 0 === e || 'string' == typeof e, n = {} t && ((e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {}, nodes: {}, }), (n.metadata = { version: 4.6, type: 'Object', generator: 'Object3D.toJSON', })) var r = {} function i(t, n) { return (void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)), n.uuid) } if ( ((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), !0 === this.castShadow && (r.castShadow = !0), !0 === this.receiveShadow && (r.receiveShadow = !0), !1 === this.visible && (r.visible = !1), !1 === this.frustumCulled && (r.frustumCulled = !1), 0 !== this.renderOrder && (r.renderOrder = this.renderOrder), Object.keys(this.userData).length > 0 && (r.userData = this.userData), (r.layers = this.layers.mask), (r.matrix = this.matrix.toArray()), (r.up = this.up.toArray()), !1 === this.matrixAutoUpdate && (r.matrixAutoUpdate = !1), this.isInstancedMesh && ((r.type = 'InstancedMesh'), (r.count = this.count), (r.instanceMatrix = this.instanceMatrix.toJSON()), null !== this.instanceColor && (r.instanceColor = this.instanceColor.toJSON())), this.isBatchedMesh && ((r.type = 'BatchedMesh'), (r.perObjectFrustumCulled = this.perObjectFrustumCulled), (r.sortObjects = this.sortObjects), (r.drawRanges = this._drawRanges), (r.reservedRanges = this._reservedRanges), (r.visibility = this._visibility), (r.active = this._active), (r.bounds = this._bounds.map(function (e) { return { boxInitialized: e.boxInitialized, boxMin: e.box.min.toArray(), boxMax: e.box.max.toArray(), sphereInitialized: e.sphereInitialized, sphereRadius: e.sphere.radius, sphereCenter: e.sphere.center.toArray(), } })), (r.maxInstanceCount = this._maxInstanceCount), (r.maxVertexCount = this._maxVertexCount), (r.maxIndexCount = this._maxIndexCount), (r.geometryInitialized = this._geometryInitialized), (r.geometryCount = this._geometryCount), (r.matricesTexture = this._matricesTexture.toJSON(e)), null !== this._colorsTexture && (r.colorsTexture = this._colorsTexture.toJSON(e)), null !== this.boundingSphere && (r.boundingSphere = { center: r.boundingSphere.center.toArray(), radius: r.boundingSphere.radius, }), null !== this.boundingBox && (r.boundingBox = { min: r.boundingBox.min.toArray(), max: r.boundingBox.max.toArray(), })), this.isScene) ) (this.background && (this.background.isColor ? (r.background = this.background.toJSON()) : this.background.isTexture && (r.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && !0 !== this.environment.isRenderTargetTexture && (r.environment = this.environment.toJSON(e).uuid)) else if (this.isMesh || this.isLine || this.isPoints) { r.geometry = i(e.geometries, this.geometry) var a = this.geometry.parameters if (void 0 !== a && void 0 !== a.shapes) { var o = a.shapes if (Array.isArray(o)) for (var s = 0, u = o.length; s < u; s++) { var l = o[s] i(e.shapes, l) } else i(e.shapes, o) } } if ( (this.isSkinnedMesh && ((r.bindMode = this.bindMode), (r.bindMatrix = this.bindMatrix.toArray()), void 0 !== this.skeleton && (i(e.skeletons, this.skeleton), (r.skeleton = this.skeleton.uuid))), void 0 !== this.material) ) if (Array.isArray(this.material)) { for (var c = [], h = 0, d = this.material.length; h < d; h++) c.push(i(e.materials, this.material[h])) r.material = c } else r.material = i(e.materials, this.material) if (this.children.length > 0) { r.children = [] for (var f = 0; f < this.children.length; f++) r.children.push(this.children[f].toJSON(e).object) } if (this.animations.length > 0) { r.animations = [] for (var p = 0; p < this.animations.length; p++) { var v = this.animations[p] r.animations.push(i(e.animations, v)) } } if (t) { var m = w(e.geometries), g = w(e.materials), y = w(e.textures), _ = w(e.images), b = w(e.shapes), x = w(e.skeletons), S = w(e.animations), A = w(e.nodes) ;(m.length > 0 && (n.geometries = m), g.length > 0 && (n.materials = g), y.length > 0 && (n.textures = y), _.length > 0 && (n.images = _), b.length > 0 && (n.shapes = b), x.length > 0 && (n.skeletons = x), S.length > 0 && (n.animations = S), A.length > 0 && (n.nodes = A)) } return ((n.object = r), n) function w(e) { var t = [] for (var n in e) { var r = e[n] ;(delete r.metadata, t.push(r)) } return t } }, }, { key: 'clone', value: function (e) { return new this.constructor().copy(this, e) }, }, { key: 'copy', value: function (e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] if ( ((this.name = e.name), this.up.copy(e.up), this.position.copy(e.position), (this.rotation.order = e.rotation.order), this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), (this.matrixAutoUpdate = e.matrixAutoUpdate), (this.matrixWorldAutoUpdate = e.matrixWorldAutoUpdate), (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate), (this.layers.mask = e.layers.mask), (this.visible = e.visible), (this.castShadow = e.castShadow), (this.receiveShadow = e.receiveShadow), (this.frustumCulled = e.frustumCulled), (this.renderOrder = e.renderOrder), (this.animations = e.animations.slice()), (this.userData = JSON.parse(JSON.stringify(e.userData))), !0 === t) ) for (var n = 0; n < e.children.length; n++) { var r = e.children[n] this.add(r.clone()) } return this }, }, ]) ) })(kc) ;((gd.DEFAULT_UP = new ph(0, 1, 0)), (gd.DEFAULT_MATRIX_AUTO_UPDATE = !0), (gd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0)) var yd = new ph(), _d = new ph(), bd = new ph(), xd = new ph(), Sd = new ph(), Ad = new ph(), wd = new ph(), Td = new ph(), Md = new ph(), Ed = new ph(), Cd = new uh(), kd = new uh(), Rd = new uh(), Id = (function () { function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(), r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new ph() ;(A(this, e), (this.a = t), (this.b = n), (this.c = r)) } return T( e, [ { key: 'set', value: function (e, t, n) { return (this.a.copy(e), this.b.copy(t), this.c.copy(n), this) }, }, { key: 'setFromPointsAndIndices', value: function (e, t, n, r) { return (this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this) }, }, { key: 'setFromAttributeAndIndices', value: function (e, t, n, r) { return ( this.a.fromBufferAttribute(e, t), this.b.fromBufferAttribute(e, n), this.c.fromBufferAttribute(e, r), this ) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { return (this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this) }, }, { key: 'getArea', value: function () { return ( yd.subVectors(this.c, this.b), _d.subVectors(this.a, this.b), 0.5 * yd.cross(_d).length() ) }, }, { key: 'getMidpoint', value: function (e) { return e .addVectors(this.a, this.b) .add(this.c) .multiplyScalar(1 / 3) }, }, { key: 'getNormal', value: function (t) { return e.getNormal(this.a, this.b, this.c, t) }, }, { key: 'getPlane', value: function (e) { return e.setFromCoplanarPoints(this.a, this.b, this.c) }, }, { key: 'getBarycoord', value: function (t, n) { return e.getBarycoord(t, this.a, this.b, this.c, n) }, }, { key: 'getInterpolation', value: function (t, n, r, i, a) { return e.getInterpolation(t, this.a, this.b, this.c, n, r, i, a) }, }, { key: 'containsPoint', value: function (t) { return e.containsPoint(t, this.a, this.b, this.c) }, }, { key: 'isFrontFacing', value: function (t) { return e.isFrontFacing(this.a, this.b, this.c, t) }, }, { key: 'intersectsBox', value: function (e) { return e.intersectsTriangle(this) }, }, { key: 'closestPointToPoint', value: function (e, t) { var n, r, i = this.a, a = this.b, o = this.c ;(Sd.subVectors(a, i), Ad.subVectors(o, i), Td.subVectors(e, i)) var s = Sd.dot(Td), u = Ad.dot(Td) if (s <= 0 && u <= 0) return t.copy(i) Md.subVectors(e, a) var l = Sd.dot(Md), c = Ad.dot(Md) if (l >= 0 && c <= l) return t.copy(a) var h = s * c - l * u if (h <= 0 && s >= 0 && l <= 0) return ((n = s / (s - l)), t.copy(i).addScaledVector(Sd, n)) Ed.subVectors(e, o) var d = Sd.dot(Ed), f = Ad.dot(Ed) if (f >= 0 && d <= f) return t.copy(o) var p = d * u - s * f if (p <= 0 && u >= 0 && f <= 0) return ((r = u / (u - f)), t.copy(i).addScaledVector(Ad, r)) var v = l * f - d * c if (v <= 0 && c - l >= 0 && d - f >= 0) return ( wd.subVectors(o, a), (r = (c - l) / (c - l + (d - f))), t.copy(a).addScaledVector(wd, r) ) var m = 1 / (v + p + h) return ( (n = p * m), (r = h * m), t.copy(i).addScaledVector(Sd, n).addScaledVector(Ad, r) ) }, }, { key: 'equals', value: function (e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c) }, }, ], [ { key: 'getNormal', value: function (e, t, n, r) { ;(r.subVectors(n, t), yd.subVectors(e, t), r.cross(yd)) var i = r.lengthSq() return i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0) }, }, { key: 'getBarycoord', value: function (e, t, n, r, i) { ;(yd.subVectors(r, t), _d.subVectors(n, t), bd.subVectors(e, t)) var a = yd.dot(yd), o = yd.dot(_d), s = yd.dot(bd), u = _d.dot(_d), l = _d.dot(bd), c = a * u - o * o if (0 === c) return (i.set(0, 0, 0), null) var h = 1 / c, d = (u * s - o * l) * h, f = (a * l - o * s) * h return i.set(1 - d - f, f, d) }, }, { key: 'containsPoint', value: function (e, t, n, r) { return ( null !== this.getBarycoord(e, t, n, r, xd) && xd.x >= 0 && xd.y >= 0 && xd.x + xd.y <= 1 ) }, }, { key: 'getInterpolation', value: function (e, t, n, r, i, a, o, s) { return null === this.getBarycoord(e, t, n, r, xd) ? ((s.x = 0), (s.y = 0), 'z' in s && (s.z = 0), 'w' in s && (s.w = 0), null) : (s.setScalar(0), s.addScaledVector(i, xd.x), s.addScaledVector(a, xd.y), s.addScaledVector(o, xd.z), s) }, }, { key: 'getInterpolatedAttribute', value: function (e, t, n, r, i, a) { return ( Cd.setScalar(0), kd.setScalar(0), Rd.setScalar(0), Cd.fromBufferAttribute(e, t), kd.fromBufferAttribute(e, n), Rd.fromBufferAttribute(e, r), a.setScalar(0), a.addScaledVector(Cd, i.x), a.addScaledVector(kd, i.y), a.addScaledVector(Rd, i.z), a ) }, }, { key: 'isFrontFacing', value: function (e, t, n, r) { return (yd.subVectors(n, t), _d.subVectors(e, t), yd.cross(_d).dot(r) < 0) }, }, ] ) })(), Nd = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074, }, Pd = { h: 0, s: 0, l: 0 }, Ld = { h: 0, s: 0, l: 0 } function Dd(e, t, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + 6 * (t - e) * n : n < 0.5 ? t : n < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - n) : e ) } var Od = (function () { return T( function e(t, n, r) { return ( A(this, e), (this.isColor = !0), (this.r = 1), (this.g = 1), (this.b = 1), this.set(t, n, r) ) }, [ { key: 'set', value: function (e, t, n) { if (void 0 === t && void 0 === n) { var r = e r && r.isColor ? this.copy(r) : 'number' == typeof r ? this.setHex(r) : 'string' == typeof r && this.setStyle(r) } else this.setRGB(e, t, n) return this }, }, { key: 'setScalar', value: function (e) { return ((this.r = e), (this.g = e), (this.b = e), this) }, }, { key: 'setHex', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c return ( (e = Math.floor(e)), (this.r = ((e >> 16) & 255) / 255), (this.g = ((e >> 8) & 255) / 255), (this.b = (255 & e) / 255), $c.toWorkingColorSpace(this, t), this ) }, }, { key: 'setRGB', value: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $c.workingColorSpace return ( (this.r = e), (this.g = t), (this.b = n), $c.toWorkingColorSpace(this, r), this ) }, }, { key: 'setHSL', value: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $c.workingColorSpace if (((e = Oc(e, 1)), (t = Dc(t, 0, 1)), (n = Dc(n, 0, 1)), 0 === t)) this.r = this.g = this.b = n else { var i = n <= 0.5 ? n * (1 + t) : n + t - n * t, a = 2 * n - i ;((this.r = Dd(a, i, e + 1 / 3)), (this.g = Dd(a, i, e)), (this.b = Dd(a, i, e - 1 / 3))) } return ($c.toWorkingColorSpace(this, r), this) }, }, { key: 'setStyle', value: function (e) { var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c function r(t) { void 0 !== t && parseFloat(t) < 1 && console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.') } if ((t = /^(\w+)\(([^\)]*)\)/.exec(e))) { var i, a = t[1], o = t[2] switch (a) { case 'rgb': case 'rgba': if ( (i = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o )) ) return ( r(i[4]), this.setRGB( Math.min(255, parseInt(i[1], 10)) / 255, Math.min(255, parseInt(i[2], 10)) / 255, Math.min(255, parseInt(i[3], 10)) / 255, n ) ) if ( (i = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o )) ) return ( r(i[4]), this.setRGB( Math.min(100, parseInt(i[1], 10)) / 100, Math.min(100, parseInt(i[2], 10)) / 100, Math.min(100, parseInt(i[3], 10)) / 100, n ) ) break case 'hsl': case 'hsla': if ( (i = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( o )) ) return ( r(i[4]), this.setHSL( parseFloat(i[1]) / 360, parseFloat(i[2]) / 100, parseFloat(i[3]) / 100, n ) ) break default: console.warn('THREE.Color: Unknown color model ' + e) } } else if ((t = /^\#([A-Fa-f\d]+)$/.exec(e))) { var s = t[1], u = s.length if (3 === u) return this.setRGB( parseInt(s.charAt(0), 16) / 15, parseInt(s.charAt(1), 16) / 15, parseInt(s.charAt(2), 16) / 15, n ) if (6 === u) return this.setHex(parseInt(s, 16), n) console.warn('THREE.Color: Invalid hex color ' + e) } else if (e && e.length > 0) return this.setColorName(e, n) return this }, }, { key: 'setColorName', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _c, n = Nd[e.toLowerCase()] return ( void 0 !== n ? this.setHex(n, t) : console.warn('THREE.Color: Unknown color ' + e), this ) }, }, { key: 'clone', value: function () { return new this.constructor(this.r, this.g, this.b) }, }, { key: 'copy', value: function (e) { return ((this.r = e.r), (this.g = e.g), (this.b = e.b), this) }, }, { key: 'copySRGBToLinear', value: function (e) { return ((this.r = eh(e.r)), (this.g = eh(e.g)), (this.b = eh(e.b)), this) }, }, { key: 'copyLinearToSRGB', value: function (e) { return ((this.r = th(e.r)), (this.g = th(e.g)), (this.b = th(e.b)), this) }, }, { key: 'convertSRGBToLinear', value: function () { return (this.copySRGBToLinear(this), this) }, }, { key: 'convertLinearToSRGB', value: function () { return (this.copyLinearToSRGB(this), this) }, }, { key: 'getHex', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c return ( $c.fromWorkingColorSpace(Fd.copy(this), e), 65536 * Math.round(Dc(255 * Fd.r, 0, 255)) + 256 * Math.round(Dc(255 * Fd.g, 0, 255)) + Math.round(Dc(255 * Fd.b, 0, 255)) ) }, }, { key: 'getHexString', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c return ('000000' + this.getHex(e).toString(16)).slice(-6) }, }, { key: 'getHSL', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : $c.workingColorSpace $c.fromWorkingColorSpace(Fd.copy(this), t) var n, r, i = Fd.r, a = Fd.g, o = Fd.b, s = Math.max(i, a, o), u = Math.min(i, a, o), l = (u + s) / 2 if (u === s) ((n = 0), (r = 0)) else { var c = s - u switch (((r = l <= 0.5 ? c / (s + u) : c / (2 - s - u)), s)) { case i: n = (a - o) / c + (a < o ? 6 : 0) break case a: n = (o - i) / c + 2 break case o: n = (i - a) / c + 4 } n /= 6 } return ((e.h = n), (e.s = r), (e.l = l), e) }, }, { key: 'getRGB', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : $c.workingColorSpace return ( $c.fromWorkingColorSpace(Fd.copy(this), t), (e.r = Fd.r), (e.g = Fd.g), (e.b = Fd.b), e ) }, }, { key: 'getStyle', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : _c $c.fromWorkingColorSpace(Fd.copy(this), e) var t = Fd.r, n = Fd.g, r = Fd.b return e !== _c ? 'color(' .concat(e, ' ') .concat(t.toFixed(3), ' ') .concat(n.toFixed(3), ' ') .concat(r.toFixed(3), ')') : 'rgb(' .concat(Math.round(255 * t), ',') .concat(Math.round(255 * n), ',') .concat(Math.round(255 * r), ')') }, }, { key: 'offsetHSL', value: function (e, t, n) { return (this.getHSL(Pd), this.setHSL(Pd.h + e, Pd.s + t, Pd.l + n)) }, }, { key: 'add', value: function (e) { return ((this.r += e.r), (this.g += e.g), (this.b += e.b), this) }, }, { key: 'addColors', value: function (e, t) { return ( (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this ) }, }, { key: 'addScalar', value: function (e) { return ((this.r += e), (this.g += e), (this.b += e), this) }, }, { key: 'sub', value: function (e) { return ( (this.r = Math.max(0, this.r - e.r)), (this.g = Math.max(0, this.g - e.g)), (this.b = Math.max(0, this.b - e.b)), this ) }, }, { key: 'multiply', value: function (e) { return ((this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this) }, }, { key: 'multiplyScalar', value: function (e) { return ((this.r *= e), (this.g *= e), (this.b *= e), this) }, }, { key: 'lerp', value: function (e, t) { return ( (this.r += (e.r - this.r) * t), (this.g += (e.g - this.g) * t), (this.b += (e.b - this.b) * t), this ) }, }, { key: 'lerpColors', value: function (e, t, n) { return ( (this.r = e.r + (t.r - e.r) * n), (this.g = e.g + (t.g - e.g) * n), (this.b = e.b + (t.b - e.b) * n), this ) }, }, { key: 'lerpHSL', value: function (e, t) { ;(this.getHSL(Pd), e.getHSL(Ld)) var n = Fc(Pd.h, Ld.h, t), r = Fc(Pd.s, Ld.s, t), i = Fc(Pd.l, Ld.l, t) return (this.setHSL(n, r, i), this) }, }, { key: 'setFromVector3', value: function (e) { return ((this.r = e.x), (this.g = e.y), (this.b = e.z), this) }, }, { key: 'applyMatrix3', value: function (e) { var t = this.r, n = this.g, r = this.b, i = e.elements return ( (this.r = i[0] * t + i[3] * n + i[6] * r), (this.g = i[1] * t + i[4] * n + i[7] * r), (this.b = i[2] * t + i[5] * n + i[8] * r), this ) }, }, { key: 'equals', value: function (e) { return e.r === this.r && e.g === this.g && e.b === this.b }, }, { key: 'fromArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this) }, }, { key: 'toArray', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return ((e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e) }, }, { key: 'fromBufferAttribute', value: function (e, t) { return ( (this.r = e.getX(t)), (this.g = e.getY(t)), (this.b = e.getZ(t)), this ) }, }, { key: 'toJSON', value: function () { return this.getHex() }, }, { key: Symbol.iterator, value: d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.n = 1), this.r) case 1: return ((e.n = 2), this.g) case 2: return ((e.n = 3), this.b) case 3: return e.a(2) } }, e, this ) }), }, ] ) })(), Fd = new Od() Od.NAMES = Nd var Bd = 0, Ud = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isMaterial = !0), Object.defineProperty(e, 'id', { value: Bd++ }), (e.uuid = Lc()), (e.name = ''), (e.type = 'Material'), (e.blending = 1), (e.side = 0), (e.vertexColors = !1), (e.opacity = 1), (e.transparent = !1), (e.alphaHash = !1), (e.blendSrc = Ju), (e.blendDst = $u), (e.blendEquation = Zu), (e.blendSrcAlpha = null), (e.blendDstAlpha = null), (e.blendEquationAlpha = null), (e.blendColor = new Od(0, 0, 0)), (e.blendAlpha = 0), (e.depthFunc = 3), (e.depthTest = !0), (e.depthWrite = !0), (e.stencilWriteMask = 255), (e.stencilFunc = 519), (e.stencilRef = 0), (e.stencilFuncMask = 255), (e.stencilFail = Ac), (e.stencilZFail = Ac), (e.stencilZPass = Ac), (e.stencilWrite = !1), (e.clippingPlanes = null), (e.clipIntersection = !1), (e.clipShadows = !1), (e.shadowSide = null), (e.colorWrite = !0), (e.precision = null), (e.polygonOffset = !1), (e.polygonOffsetFactor = 0), (e.polygonOffsetUnits = 0), (e.dithering = !1), (e.alphaToCoverage = !1), (e.premultipliedAlpha = !1), (e.forceSinglePass = !1), (e.visible = !0), (e.toneMapped = !0), (e.userData = {}), (e.version = 0), (e._alphaTest = 0), e ) } return ( x(t, e), T(t, [ { key: 'alphaTest', get: function () { return this._alphaTest }, set: function (e) { ;(this._alphaTest > 0 != e > 0 && this.version++, (this._alphaTest = e)) }, }, { key: 'onBeforeRender', value: function () {} }, { key: 'onBeforeCompile', value: function () {} }, { key: 'customProgramCacheKey', value: function () { return this.onBeforeCompile.toString() }, }, { key: 'setValues', value: function (e) { if (void 0 !== e) for (var t in e) { var n = e[t] if (void 0 !== n) { var r = this[t] void 0 !== r ? r && r.isColor ? r.set(n) : r && r.isVector3 && n && n.isVector3 ? r.copy(n) : (this[t] = n) : console.warn( "THREE.Material: '" .concat(t, "' is not a property of THREE.") .concat(this.type, '.') ) } else console.warn( "THREE.Material: parameter '".concat(t, "' has value of undefined.") ) } }, }, { key: 'toJSON', value: function (e) { var t = void 0 === e || 'string' == typeof e t && (e = { textures: {}, images: {} }) var n = { metadata: { version: 4.6, type: 'Material', generator: 'Material.toJSON' }, } function r(e) { var t = [] for (var n in e) { var r = e[n] ;(delete r.metadata, t.push(r)) } return t } if ( ((n.uuid = this.uuid), (n.type = this.type), '' !== this.name && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), void 0 !== this.roughness && (n.roughness = this.roughness), void 0 !== this.metalness && (n.metalness = this.metalness), void 0 !== this.sheen && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), void 0 !== this.sheenRoughness && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), void 0 !== this.emissiveIntensity && 1 !== this.emissiveIntensity && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), void 0 !== this.specularIntensity && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), void 0 !== this.shininess && (n.shininess = this.shininess), void 0 !== this.clearcoat && (n.clearcoat = this.clearcoat), void 0 !== this.clearcoatRoughness && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && ((n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid), (n.clearcoatNormalScale = this.clearcoatNormalScale.toArray())), void 0 !== this.dispersion && (n.dispersion = this.dispersion), void 0 !== this.iridescence && (n.iridescence = this.iridescence), void 0 !== this.iridescenceIOR && (n.iridescenceIOR = this.iridescenceIOR), void 0 !== this.iridescenceThicknessRange && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), void 0 !== this.anisotropy && (n.anisotropy = this.anisotropy), void 0 !== this.anisotropyRotation && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && ((n.lightMap = this.lightMap.toJSON(e).uuid), (n.lightMapIntensity = this.lightMapIntensity)), this.aoMap && this.aoMap.isTexture && ((n.aoMap = this.aoMap.toJSON(e).uuid), (n.aoMapIntensity = this.aoMapIntensity)), this.bumpMap && this.bumpMap.isTexture && ((n.bumpMap = this.bumpMap.toJSON(e).uuid), (n.bumpScale = this.bumpScale)), this.normalMap && this.normalMap.isTexture && ((n.normalMap = this.normalMap.toJSON(e).uuid), (n.normalMapType = this.normalMapType), (n.normalScale = this.normalScale.toArray())), this.displacementMap && this.displacementMap.isTexture && ((n.displacementMap = this.displacementMap.toJSON(e).uuid), (n.displacementScale = this.displacementScale), (n.displacementBias = this.displacementBias)), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && ((n.envMap = this.envMap.toJSON(e).uuid), void 0 !== this.combine && (n.combine = this.combine)), void 0 !== this.envMapRotation && (n.envMapRotation = this.envMapRotation.toArray()), void 0 !== this.envMapIntensity && (n.envMapIntensity = this.envMapIntensity), void 0 !== this.reflectivity && (n.reflectivity = this.reflectivity), void 0 !== this.refractionRatio && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), void 0 !== this.transmission && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), void 0 !== this.thickness && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), void 0 !== this.attenuationDistance && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), void 0 !== this.attenuationColor && (n.attenuationColor = this.attenuationColor.getHex()), void 0 !== this.size && (n.size = this.size), null !== this.shadowSide && (n.shadowSide = this.shadowSide), void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation), 1 !== this.blending && (n.blending = this.blending), 0 !== this.side && (n.side = this.side), !0 === this.vertexColors && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), !0 === this.transparent && (n.transparent = !0), this.blendSrc !== Ju && (n.blendSrc = this.blendSrc), this.blendDst !== $u && (n.blendDst = this.blendDst), this.blendEquation !== Zu && (n.blendEquation = this.blendEquation), null !== this.blendSrcAlpha && (n.blendSrcAlpha = this.blendSrcAlpha), null !== this.blendDstAlpha && (n.blendDstAlpha = this.blendDstAlpha), null !== this.blendEquationAlpha && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), 0 !== this.blendAlpha && (n.blendAlpha = this.blendAlpha), 3 !== this.depthFunc && (n.depthFunc = this.depthFunc), !1 === this.depthTest && (n.depthTest = this.depthTest), !1 === this.depthWrite && (n.depthWrite = this.depthWrite), !1 === this.colorWrite && (n.colorWrite = this.colorWrite), 255 !== this.stencilWriteMask && (n.stencilWriteMask = this.stencilWriteMask), 519 !== this.stencilFunc && (n.stencilFunc = this.stencilFunc), 0 !== this.stencilRef && (n.stencilRef = this.stencilRef), 255 !== this.stencilFuncMask && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Ac && (n.stencilFail = this.stencilFail), this.stencilZFail !== Ac && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Ac && (n.stencilZPass = this.stencilZPass), !0 === this.stencilWrite && (n.stencilWrite = this.stencilWrite), void 0 !== this.rotation && 0 !== this.rotation && (n.rotation = this.rotation), !0 === this.polygonOffset && (n.polygonOffset = !0), 0 !== this.polygonOffsetFactor && (n.polygonOffsetFactor = this.polygonOffsetFactor), 0 !== this.polygonOffsetUnits && (n.polygonOffsetUnits = this.polygonOffsetUnits), void 0 !== this.linewidth && 1 !== this.linewidth && (n.linewidth = this.linewidth), void 0 !== this.dashSize && (n.dashSize = this.dashSize), void 0 !== this.gapSize && (n.gapSize = this.gapSize), void 0 !== this.scale && (n.scale = this.scale), !0 === this.dithering && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), !0 === this.alphaHash && (n.alphaHash = !0), !0 === this.alphaToCoverage && (n.alphaToCoverage = !0), !0 === this.premultipliedAlpha && (n.premultipliedAlpha = !0), !0 === this.forceSinglePass && (n.forceSinglePass = !0), !0 === this.wireframe && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), 'round' !== this.wireframeLinecap && (n.wireframeLinecap = this.wireframeLinecap), 'round' !== this.wireframeLinejoin && (n.wireframeLinejoin = this.wireframeLinejoin), !0 === this.flatShading && (n.flatShading = !0), !1 === this.visible && (n.visible = !1), !1 === this.toneMapped && (n.toneMapped = !1), !1 === this.fog && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData), t) ) { var i = r(e.textures), a = r(e.images) ;(i.length > 0 && (n.textures = i), a.length > 0 && (n.images = a)) } return n }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { ;((this.name = e.name), (this.blending = e.blending), (this.side = e.side), (this.vertexColors = e.vertexColors), (this.opacity = e.opacity), (this.transparent = e.transparent), (this.blendSrc = e.blendSrc), (this.blendDst = e.blendDst), (this.blendEquation = e.blendEquation), (this.blendSrcAlpha = e.blendSrcAlpha), (this.blendDstAlpha = e.blendDstAlpha), (this.blendEquationAlpha = e.blendEquationAlpha), this.blendColor.copy(e.blendColor), (this.blendAlpha = e.blendAlpha), (this.depthFunc = e.depthFunc), (this.depthTest = e.depthTest), (this.depthWrite = e.depthWrite), (this.stencilWriteMask = e.stencilWriteMask), (this.stencilFunc = e.stencilFunc), (this.stencilRef = e.stencilRef), (this.stencilFuncMask = e.stencilFuncMask), (this.stencilFail = e.stencilFail), (this.stencilZFail = e.stencilZFail), (this.stencilZPass = e.stencilZPass), (this.stencilWrite = e.stencilWrite)) var t = e.clippingPlanes, n = null if (null !== t) { var r = t.length n = new Array(r) for (var i = 0; i !== r; ++i) n[i] = t[i].clone() } return ( (this.clippingPlanes = n), (this.clipIntersection = e.clipIntersection), (this.clipShadows = e.clipShadows), (this.shadowSide = e.shadowSide), (this.colorWrite = e.colorWrite), (this.precision = e.precision), (this.polygonOffset = e.polygonOffset), (this.polygonOffsetFactor = e.polygonOffsetFactor), (this.polygonOffsetUnits = e.polygonOffsetUnits), (this.dithering = e.dithering), (this.alphaTest = e.alphaTest), (this.alphaHash = e.alphaHash), (this.alphaToCoverage = e.alphaToCoverage), (this.premultipliedAlpha = e.premultipliedAlpha), (this.forceSinglePass = e.forceSinglePass), (this.visible = e.visible), (this.toneMapped = e.toneMapped), (this.userData = JSON.parse(JSON.stringify(e.userData))), this ) }, }, { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, { key: 'needsUpdate', set: function (e) { !0 === e && this.version++ }, }, { key: 'onBuild', value: function () { console.warn('Material: onBuild() has been removed.') }, }, ]) ) })(kc), zd = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isMeshBasicMaterial = !0), (n.type = 'MeshBasicMaterial'), (n.color = new Od(16777215)), (n.map = null), (n.lightMap = null), (n.lightMapIntensity = 1), (n.aoMap = null), (n.aoMapIntensity = 1), (n.specularMap = null), (n.alphaMap = null), (n.envMap = null), (n.envMapRotation = new ed()), (n.combine = 0), (n.reflectivity = 1), (n.refractionRatio = 0.98), (n.wireframe = !1), (n.wireframeLinewidth = 1), (n.wireframeLinecap = 'round'), (n.wireframeLinejoin = 'round'), (n.fog = !0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), this.color.copy(e.color), (this.map = e.map), (this.lightMap = e.lightMap), (this.lightMapIntensity = e.lightMapIntensity), (this.aoMap = e.aoMap), (this.aoMapIntensity = e.aoMapIntensity), (this.specularMap = e.specularMap), (this.alphaMap = e.alphaMap), (this.envMap = e.envMap), this.envMapRotation.copy(e.envMapRotation), (this.combine = e.combine), (this.reflectivity = e.reflectivity), (this.refractionRatio = e.refractionRatio), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), (this.wireframeLinecap = e.wireframeLinecap), (this.wireframeLinejoin = e.wireframeLinejoin), (this.fog = e.fog), this ) }, }, ]) ) })(Ud), Vd = Hd() function Hd() { for ( var e = new ArrayBuffer(4), t = new Float32Array(e), n = new Uint32Array(e), r = new Uint32Array(512), i = new Uint32Array(512), a = 0; a < 256; ++a ) { var o = a - 127 o < -27 ? ((r[a] = 0), (r[256 | a] = 32768), (i[a] = 24), (i[256 | a] = 24)) : o < -14 ? ((r[a] = 1024 >> (-o - 14)), (r[256 | a] = (1024 >> (-o - 14)) | 32768), (i[a] = -o - 1), (i[256 | a] = -o - 1)) : o <= 15 ? ((r[a] = (o + 15) << 10), (r[256 | a] = ((o + 15) << 10) | 32768), (i[a] = 13), (i[256 | a] = 13)) : o < 128 ? ((r[a] = 31744), (r[256 | a] = 64512), (i[a] = 24), (i[256 | a] = 24)) : ((r[a] = 31744), (r[256 | a] = 64512), (i[a] = 13), (i[256 | a] = 13)) } for ( var s = new Uint32Array(2048), u = new Uint32Array(64), l = new Uint32Array(64), c = 1; c < 1024; ++c ) { for (var h = c << 13, d = 0; !(8388608 & h); ) ((h <<= 1), (d -= 8388608)) ;((h &= -8388609), (d += 947912704), (s[c] = h | d)) } for (var f = 1024; f < 2048; ++f) s[f] = 939524096 + ((f - 1024) << 13) for (var p = 1; p < 31; ++p) u[p] = p << 23 ;((u[31] = 1199570944), (u[32] = 2147483648)) for (var v = 33; v < 63; ++v) u[v] = 2147483648 + ((v - 32) << 23) u[63] = 3347054592 for (var m = 1; m < 64; ++m) 32 !== m && (l[m] = 1024) return { floatView: t, uint32View: n, baseTable: r, shiftTable: i, mantissaTable: s, exponentTable: u, offsetTable: l, } } var Wd = { toHalfFloat: function (e) { ;(Math.abs(e) > 65504 && console.warn('THREE.DataUtils.toHalfFloat(): Value out of range.'), (e = Dc(e, -65504, 65504)), (Vd.floatView[0] = e)) var t = Vd.uint32View[0], n = (t >> 23) & 511 return Vd.baseTable[n] + ((8388607 & t) >> Vd.shiftTable[n]) }, fromHalfFloat: function (e) { var t = e >> 10 return ( (Vd.uint32View[0] = Vd.mantissaTable[Vd.offsetTable[t] + (1023 & e)] + Vd.exponentTable[t]), Vd.floatView[0] ) }, }, Gd = new ph(), jd = new Vc(), Qd = 0, qd = (function () { return T( function e(t, n) { var r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] if ((A(this, e), Array.isArray(t))) throw new TypeError('THREE.BufferAttribute: array should be a Typed Array.') ;((this.isBufferAttribute = !0), Object.defineProperty(this, 'id', { value: Qd++ }), (this.name = ''), (this.array = t), (this.itemSize = n), (this.count = void 0 !== t ? t.length / n : 0), (this.normalized = r), (this.usage = wc), (this.updateRanges = []), (this.gpuType = yl), (this.version = 0)) }, [ { key: 'onUploadCallback', value: function () {} }, { key: 'needsUpdate', set: function (e) { !0 === e && this.version++ }, }, { key: 'setUsage', value: function (e) { return ((this.usage = e), this) }, }, { key: 'addUpdateRange', value: function (e, t) { this.updateRanges.push({ start: e, count: t }) }, }, { key: 'clearUpdateRanges', value: function () { this.updateRanges.length = 0 }, }, { key: 'copy', value: function (e) { return ( (this.name = e.name), (this.array = new e.array.constructor(e.array)), (this.itemSize = e.itemSize), (this.count = e.count), (this.normalized = e.normalized), (this.usage = e.usage), (this.gpuType = e.gpuType), this ) }, }, { key: 'copyAt', value: function (e, t, n) { ;((e *= this.itemSize), (n *= t.itemSize)) for (var r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r] return this }, }, { key: 'copyArray', value: function (e) { return (this.array.set(e), this) }, }, { key: 'applyMatrix3', value: function (e) { if (2 === this.itemSize) for (var t = 0, n = this.count; t < n; t++) (jd.fromBufferAttribute(this, t), jd.applyMatrix3(e), this.setXY(t, jd.x, jd.y)) else if (3 === this.itemSize) for (var r = 0, i = this.count; r < i; r++) (Gd.fromBufferAttribute(this, r), Gd.applyMatrix3(e), this.setXYZ(r, Gd.x, Gd.y, Gd.z)) return this }, }, { key: 'applyMatrix4', value: function (e) { for (var t = 0, n = this.count; t < n; t++) (Gd.fromBufferAttribute(this, t), Gd.applyMatrix4(e), this.setXYZ(t, Gd.x, Gd.y, Gd.z)) return this }, }, { key: 'applyNormalMatrix', value: function (e) { for (var t = 0, n = this.count; t < n; t++) (Gd.fromBufferAttribute(this, t), Gd.applyNormalMatrix(e), this.setXYZ(t, Gd.x, Gd.y, Gd.z)) return this }, }, { key: 'transformDirection', value: function (e) { for (var t = 0, n = this.count; t < n; t++) (Gd.fromBufferAttribute(this, t), Gd.transformDirection(e), this.setXYZ(t, Gd.x, Gd.y, Gd.z)) return this }, }, { key: 'set', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return (this.array.set(e, t), this) }, }, { key: 'getComponent', value: function (e, t) { var n = this.array[e * this.itemSize + t] return (this.normalized && (n = Bc(n, this.array)), n) }, }, { key: 'setComponent', value: function (e, t, n) { return ( this.normalized && (n = Uc(n, this.array)), (this.array[e * this.itemSize + t] = n), this ) }, }, { key: 'getX', value: function (e) { var t = this.array[e * this.itemSize] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'setX', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.array[e * this.itemSize] = t), this ) }, }, { key: 'getY', value: function (e) { var t = this.array[e * this.itemSize + 1] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'setY', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.array[e * this.itemSize + 1] = t), this ) }, }, { key: 'getZ', value: function (e) { var t = this.array[e * this.itemSize + 2] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'setZ', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.array[e * this.itemSize + 2] = t), this ) }, }, { key: 'getW', value: function (e) { var t = this.array[e * this.itemSize + 3] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'setW', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.array[e * this.itemSize + 3] = t), this ) }, }, { key: 'setXY', value: function (e, t, n) { return ( (e *= this.itemSize), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array))), (this.array[e + 0] = t), (this.array[e + 1] = n), this ) }, }, { key: 'setXYZ', value: function (e, t, n, r) { return ( (e *= this.itemSize), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array)), (r = Uc(r, this.array))), (this.array[e + 0] = t), (this.array[e + 1] = n), (this.array[e + 2] = r), this ) }, }, { key: 'setXYZW', value: function (e, t, n, r, i) { return ( (e *= this.itemSize), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array)), (r = Uc(r, this.array)), (i = Uc(i, this.array))), (this.array[e + 0] = t), (this.array[e + 1] = n), (this.array[e + 2] = r), (this.array[e + 3] = i), this ) }, }, { key: 'onUpload', value: function (e) { return ((this.onUploadCallback = e), this) }, }, { key: 'clone', value: function () { return new this.constructor(this.array, this.itemSize).copy(this) }, }, { key: 'toJSON', value: function () { var e = { itemSize: this.itemSize, type: this.array.constructor.name, array: Array.from(this.array), normalized: this.normalized, } return ( '' !== this.name && (e.name = this.name), this.usage !== wc && (e.usage = this.usage), e ) }, }, ] ) })(), Xd = (function (e) { function t(e, n, r) { return (A(this, t), y(this, t, [new Uint16Array(e), n, r])) } return (x(t, e), T(t)) })(qd), Yd = (function (e) { function t(e, n, r) { return (A(this, t), y(this, t, [new Uint32Array(e), n, r])) } return (x(t, e), T(t)) })(qd), Kd = (function (e) { function t(e, n, r) { return (A(this, t), y(this, t, [new Float32Array(e), n, r])) } return (x(t, e), T(t)) })(qd), Zd = 0, Jd = new Gh(), $d = new gd(), ef = new ph(), tf = new gh(), nf = new gh(), rf = new ph(), af = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isBufferGeometry = !0), Object.defineProperty(e, 'id', { value: Zd++ }), (e.uuid = Lc()), (e.name = ''), (e.type = 'BufferGeometry'), (e.index = null), (e.indirect = null), (e.attributes = {}), (e.morphAttributes = {}), (e.morphTargetsRelative = !1), (e.groups = []), (e.boundingBox = null), (e.boundingSphere = null), (e.drawRange = { start: 0, count: 1 / 0 }), (e.userData = {}), e ) } return ( x(t, e), T(t, [ { key: 'getIndex', value: function () { return this.index }, }, { key: 'setIndex', value: function (e) { return ( Array.isArray(e) ? (this.index = new (Gc(e) ? Yd : Xd)(e, 1)) : (this.index = e), this ) }, }, { key: 'setIndirect', value: function (e) { return ((this.indirect = e), this) }, }, { key: 'getIndirect', value: function () { return this.indirect }, }, { key: 'getAttribute', value: function (e) { return this.attributes[e] }, }, { key: 'setAttribute', value: function (e, t) { return ((this.attributes[e] = t), this) }, }, { key: 'deleteAttribute', value: function (e) { return (delete this.attributes[e], this) }, }, { key: 'hasAttribute', value: function (e) { return void 0 !== this.attributes[e] }, }, { key: 'addGroup', value: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 this.groups.push({ start: e, count: t, materialIndex: n }) }, }, { key: 'clearGroups', value: function () { this.groups = [] }, }, { key: 'setDrawRange', value: function (e, t) { ;((this.drawRange.start = e), (this.drawRange.count = t)) }, }, { key: 'applyMatrix4', value: function (e) { var t = this.attributes.position void 0 !== t && (t.applyMatrix4(e), (t.needsUpdate = !0)) var n = this.attributes.normal if (void 0 !== n) { var r = new Hc().getNormalMatrix(e) ;(n.applyNormalMatrix(r), (n.needsUpdate = !0)) } var i = this.attributes.tangent return ( void 0 !== i && (i.transformDirection(e), (i.needsUpdate = !0)), null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this ) }, }, { key: 'applyQuaternion', value: function (e) { return (Jd.makeRotationFromQuaternion(e), this.applyMatrix4(Jd), this) }, }, { key: 'rotateX', value: function (e) { return (Jd.makeRotationX(e), this.applyMatrix4(Jd), this) }, }, { key: 'rotateY', value: function (e) { return (Jd.makeRotationY(e), this.applyMatrix4(Jd), this) }, }, { key: 'rotateZ', value: function (e) { return (Jd.makeRotationZ(e), this.applyMatrix4(Jd), this) }, }, { key: 'translate', value: function (e, t, n) { return (Jd.makeTranslation(e, t, n), this.applyMatrix4(Jd), this) }, }, { key: 'scale', value: function (e, t, n) { return (Jd.makeScale(e, t, n), this.applyMatrix4(Jd), this) }, }, { key: 'lookAt', value: function (e) { return ($d.lookAt(e), $d.updateMatrix(), this.applyMatrix4($d.matrix), this) }, }, { key: 'center', value: function () { return ( this.computeBoundingBox(), this.boundingBox.getCenter(ef).negate(), this.translate(ef.x, ef.y, ef.z), this ) }, }, { key: 'setFromPoints', value: function (e) { var t = this.getAttribute('position') if (void 0 === t) { for (var n = [], r = 0, i = e.length; r < i; r++) { var a = e[r] n.push(a.x, a.y, a.z || 0) } this.setAttribute('position', new Kd(n, 3)) } else { for (var o = Math.min(e.length, t.count), s = 0; s < o; s++) { var u = e[s] t.setXYZ(s, u.x, u.y, u.z || 0) } ;(e.length > t.count && console.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' ), (t.needsUpdate = !0)) } return this }, }, { key: 'computeBoundingBox', value: function () { null === this.boundingBox && (this.boundingBox = new gh()) var e = this.attributes.position, t = this.morphAttributes.position if (e && e.isGLBufferAttribute) return ( console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this ), void this.boundingBox.set( new ph(-1 / 0, -1 / 0, -1 / 0), new ph(1 / 0, 1 / 0, 1 / 0) ) ) if (void 0 !== e) { if ((this.boundingBox.setFromBufferAttribute(e), t)) for (var n = 0, r = t.length; n < r; n++) { var i = t[n] ;(tf.setFromBufferAttribute(i), this.morphTargetsRelative ? (rf.addVectors(this.boundingBox.min, tf.min), this.boundingBox.expandByPoint(rf), rf.addVectors(this.boundingBox.max, tf.max), this.boundingBox.expandByPoint(rf)) : (this.boundingBox.expandByPoint(tf.min), this.boundingBox.expandByPoint(tf.max))) } } else this.boundingBox.makeEmpty() ;(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ) }, }, { key: 'computeBoundingSphere', value: function () { null === this.boundingSphere && (this.boundingSphere = new Dh()) var e = this.attributes.position, t = this.morphAttributes.position if (e && e.isGLBufferAttribute) return ( console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this ), void this.boundingSphere.set(new ph(), 1 / 0) ) if (e) { var n = this.boundingSphere.center if ((tf.setFromBufferAttribute(e), t)) for (var r = 0, i = t.length; r < i; r++) { var a = t[r] ;(nf.setFromBufferAttribute(a), this.morphTargetsRelative ? (rf.addVectors(tf.min, nf.min), tf.expandByPoint(rf), rf.addVectors(tf.max, nf.max), tf.expandByPoint(rf)) : (tf.expandByPoint(nf.min), tf.expandByPoint(nf.max))) } tf.getCenter(n) for (var o = 0, s = 0, u = e.count; s < u; s++) (rf.fromBufferAttribute(e, s), (o = Math.max(o, n.distanceToSquared(rf)))) if (t) for (var l = 0, c = t.length; l < c; l++) for ( var h = t[l], d = this.morphTargetsRelative, f = 0, p = h.count; f < p; f++ ) (rf.fromBufferAttribute(h, f), d && (ef.fromBufferAttribute(e, f), rf.add(ef)), (o = Math.max(o, n.distanceToSquared(rf)))) ;((this.boundingSphere.radius = Math.sqrt(o)), isNaN(this.boundingSphere.radius) && console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this )) } }, }, { key: 'computeTangents', value: function () { var e = this.index, t = this.attributes if ( null !== e && void 0 !== t.position && void 0 !== t.normal && void 0 !== t.uv ) { var n = t.position, r = t.normal, i = t.uv !1 === this.hasAttribute('tangent') && this.setAttribute('tangent', new qd(new Float32Array(4 * n.count), 4)) for ( var a = this.getAttribute('tangent'), o = [], s = [], u = 0; u < n.count; u++ ) ((o[u] = new ph()), (s[u] = new ph())) var l = new ph(), c = new ph(), h = new ph(), d = new Vc(), f = new Vc(), p = new Vc(), v = new ph(), m = new ph(), g = this.groups 0 === g.length && (g = [{ start: 0, count: e.count }]) for (var y = 0, _ = g.length; y < _; ++y) for (var b = g[y], x = b.start, S = x, A = x + b.count; S < A; S += 3) L(e.getX(S + 0), e.getX(S + 1), e.getX(S + 2)) for ( var w = new ph(), T = new ph(), M = new ph(), E = new ph(), C = 0, k = g.length; C < k; ++C ) for (var R = g[C], I = R.start, N = I, P = I + R.count; N < P; N += 3) (D(e.getX(N + 0)), D(e.getX(N + 1)), D(e.getX(N + 2))) } else console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' ) function L(e, t, r) { ;(l.fromBufferAttribute(n, e), c.fromBufferAttribute(n, t), h.fromBufferAttribute(n, r), d.fromBufferAttribute(i, e), f.fromBufferAttribute(i, t), p.fromBufferAttribute(i, r), c.sub(l), h.sub(l), f.sub(d), p.sub(d)) var a = 1 / (f.x * p.y - p.x * f.y) isFinite(a) && (v.copy(c).multiplyScalar(p.y).addScaledVector(h, -f.y).multiplyScalar(a), m.copy(h).multiplyScalar(f.x).addScaledVector(c, -p.x).multiplyScalar(a), o[e].add(v), o[t].add(v), o[r].add(v), s[e].add(m), s[t].add(m), s[r].add(m)) } function D(e) { ;(M.fromBufferAttribute(r, e), E.copy(M)) var t = o[e] ;(w.copy(t), w.sub(M.multiplyScalar(M.dot(t))).normalize(), T.crossVectors(E, t)) var n = T.dot(s[e]) < 0 ? -1 : 1 a.setXYZW(e, w.x, w.y, w.z, n) } }, }, { key: 'computeVertexNormals', value: function () { var e = this.index, t = this.getAttribute('position') if (void 0 !== t) { var n = this.getAttribute('normal') if (void 0 === n) ((n = new qd(new Float32Array(3 * t.count), 3)), this.setAttribute('normal', n)) else for (var r = 0, i = n.count; r < i; r++) n.setXYZ(r, 0, 0, 0) var a = new ph(), o = new ph(), s = new ph(), u = new ph(), l = new ph(), c = new ph(), h = new ph(), d = new ph() if (e) for (var f = 0, p = e.count; f < p; f += 3) { var v = e.getX(f + 0), m = e.getX(f + 1), g = e.getX(f + 2) ;(a.fromBufferAttribute(t, v), o.fromBufferAttribute(t, m), s.fromBufferAttribute(t, g), h.subVectors(s, o), d.subVectors(a, o), h.cross(d), u.fromBufferAttribute(n, v), l.fromBufferAttribute(n, m), c.fromBufferAttribute(n, g), u.add(h), l.add(h), c.add(h), n.setXYZ(v, u.x, u.y, u.z), n.setXYZ(m, l.x, l.y, l.z), n.setXYZ(g, c.x, c.y, c.z)) } else for (var y = 0, _ = t.count; y < _; y += 3) (a.fromBufferAttribute(t, y + 0), o.fromBufferAttribute(t, y + 1), s.fromBufferAttribute(t, y + 2), h.subVectors(s, o), d.subVectors(a, o), h.cross(d), n.setXYZ(y + 0, h.x, h.y, h.z), n.setXYZ(y + 1, h.x, h.y, h.z), n.setXYZ(y + 2, h.x, h.y, h.z)) ;(this.normalizeNormals(), (n.needsUpdate = !0)) } }, }, { key: 'normalizeNormals', value: function () { for (var e = this.attributes.normal, t = 0, n = e.count; t < n; t++) (rf.fromBufferAttribute(e, t), rf.normalize(), e.setXYZ(t, rf.x, rf.y, rf.z)) }, }, { key: 'toNonIndexed', value: function () { function e(e, t) { for ( var n = e.array, r = e.itemSize, i = e.normalized, a = new n.constructor(t.length * r), o = 0, s = 0, u = 0, l = t.length; u < l; u++ ) { o = e.isInterleavedBufferAttribute ? t[u] * e.data.stride + e.offset : t[u] * r for (var c = 0; c < r; c++) a[s++] = n[o++] } return new qd(a, r, i) } if (null === this.index) return ( console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' ), this ) var n = new t(), r = this.index.array, i = this.attributes for (var a in i) { var o = e(i[a], r) n.setAttribute(a, o) } var s = this.morphAttributes for (var u in s) { for (var l = [], c = s[u], h = 0, d = c.length; h < d; h++) { var f = e(c[h], r) l.push(f) } n.morphAttributes[u] = l } n.morphTargetsRelative = this.morphTargetsRelative for (var p = this.groups, v = 0, m = p.length; v < m; v++) { var g = p[v] n.addGroup(g.start, g.count, g.materialIndex) } return n }, }, { key: 'toJSON', value: function () { var e = { metadata: { version: 4.6, type: 'BufferGeometry', generator: 'BufferGeometry.toJSON', }, } if ( ((e.uuid = this.uuid), (e.type = this.type), '' !== this.name && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), void 0 !== this.parameters) ) { var t = this.parameters for (var n in t) void 0 !== t[n] && (e[n] = t[n]) return e } e.data = { attributes: {} } var r = this.index null !== r && (e.data.index = { type: r.array.constructor.name, array: Array.prototype.slice.call(r.array), }) var i = this.attributes for (var a in i) { var o = i[a] e.data.attributes[a] = o.toJSON(e.data) } var s = {}, u = !1 for (var l in this.morphAttributes) { for ( var c = this.morphAttributes[l], h = [], d = 0, f = c.length; d < f; d++ ) { var p = c[d] h.push(p.toJSON(e.data)) } h.length > 0 && ((s[l] = h), (u = !0)) } u && ((e.data.morphAttributes = s), (e.data.morphTargetsRelative = this.morphTargetsRelative)) var v = this.groups v.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(v))) var m = this.boundingSphere return ( null !== m && (e.data.boundingSphere = { center: m.center.toArray(), radius: m.radius, }), e ) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'copy', value: function (e) { ;((this.index = null), (this.attributes = {}), (this.morphAttributes = {}), (this.groups = []), (this.boundingBox = null), (this.boundingSphere = null)) var t = {} this.name = e.name var n = e.index null !== n && this.setIndex(n.clone(t)) var r = e.attributes for (var i in r) { var a = r[i] this.setAttribute(i, a.clone(t)) } var o = e.morphAttributes for (var s in o) { for (var u = [], l = o[s], c = 0, h = l.length; c < h; c++) u.push(l[c].clone(t)) this.morphAttributes[s] = u } this.morphTargetsRelative = e.morphTargetsRelative for (var d = e.groups, f = 0, p = d.length; f < p; f++) { var v = d[f] this.addGroup(v.start, v.count, v.materialIndex) } var m = e.boundingBox null !== m && (this.boundingBox = m.clone()) var g = e.boundingSphere return ( null !== g && (this.boundingSphere = g.clone()), (this.drawRange.start = e.drawRange.start), (this.drawRange.count = e.drawRange.count), (this.userData = e.userData), this ) }, }, { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, ]) ) })(kc), of = new Gh(), sf = new Wh(), uf = new Dh(), lf = new ph(), cf = new ph(), hf = new ph(), df = new ph(), ff = new ph(), pf = new ph(), vf = new ph(), mf = new ph(), gf = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(), r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new zd() return ( A(this, t), ((e = y(this, t)).isMesh = !0), (e.type = 'Mesh'), (e.geometry = n), (e.material = r), e.updateMorphTargets(), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), void 0 !== e.morphTargetInfluences && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), void 0 !== e.morphTargetDictionary && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), (this.material = Array.isArray(e.material) ? e.material.slice() : e.material), (this.geometry = e.geometry), this ) }, }, { key: 'updateMorphTargets', value: function () { var e = this.geometry.morphAttributes, t = Object.keys(e) if (t.length > 0) { var n = e[t[0]] if (void 0 !== n) { ;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {})) for (var r = 0, i = n.length; r < i; r++) { var a = n[r].name || String(r) ;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = r)) } } } }, }, { key: 'getVertexPosition', value: function (e, t) { var n = this.geometry, r = n.attributes.position, i = n.morphAttributes.position, a = n.morphTargetsRelative t.fromBufferAttribute(r, e) var o = this.morphTargetInfluences if (i && o) { pf.set(0, 0, 0) for (var s = 0, u = i.length; s < u; s++) { var l = o[s], c = i[s] 0 !== l && (ff.fromBufferAttribute(c, e), a ? pf.addScaledVector(ff, l) : pf.addScaledVector(ff.sub(t), l)) } t.add(pf) } return t }, }, { key: 'raycast', value: function (e, t) { var n = this.geometry, r = this.material, i = this.matrixWorld if (void 0 !== r) { if ( (null === n.boundingSphere && n.computeBoundingSphere(), uf.copy(n.boundingSphere), uf.applyMatrix4(i), sf.copy(e.ray).recast(e.near), !1 === uf.containsPoint(sf.origin)) ) { if (null === sf.intersectSphere(uf, lf)) return if (sf.origin.distanceToSquared(lf) > Math.pow(e.far - e.near, 2)) return } ;(of.copy(i).invert(), sf.copy(e.ray).applyMatrix4(of), (null !== n.boundingBox && !1 === sf.intersectsBox(n.boundingBox)) || this._computeIntersections(e, t, sf)) } }, }, { key: '_computeIntersections', value: function (e, t, n) { var r, i = this.geometry, a = this.material, o = i.index, s = i.attributes.position, u = i.attributes.uv, l = i.attributes.uv1, c = i.attributes.normal, h = i.groups, d = i.drawRange if (null !== o) if (Array.isArray(a)) for (var f = 0, p = h.length; f < p; f++) for ( var v = h[f], m = a[v.materialIndex], g = Math.max(v.start, d.start), y = Math.min( o.count, Math.min(v.start + v.count, d.start + d.count) ); g < y; g += 3 ) { ;(r = yf( this, m, e, n, u, l, c, o.getX(g), o.getX(g + 1), o.getX(g + 2) )) && ((r.faceIndex = Math.floor(g / 3)), (r.face.materialIndex = v.materialIndex), t.push(r)) } else for ( var _ = Math.max(0, d.start), b = Math.min(o.count, d.start + d.count); _ < b; _ += 3 ) { ;(r = yf( this, a, e, n, u, l, c, o.getX(_), o.getX(_ + 1), o.getX(_ + 2) )) && ((r.faceIndex = Math.floor(_ / 3)), t.push(r)) } else if (void 0 !== s) if (Array.isArray(a)) for (var x = 0, S = h.length; x < S; x++) for ( var A = h[x], w = a[A.materialIndex], T = Math.max(A.start, d.start), M = Math.min( s.count, Math.min(A.start + A.count, d.start + d.count) ); T < M; T += 3 ) { ;(r = yf(this, w, e, n, u, l, c, T, T + 1, T + 2)) && ((r.faceIndex = Math.floor(T / 3)), (r.face.materialIndex = A.materialIndex), t.push(r)) } else for ( var E = Math.max(0, d.start), C = Math.min(s.count, d.start + d.count); E < C; E += 3 ) { ;(r = yf(this, a, e, n, u, l, c, E, E + 1, E + 2)) && ((r.faceIndex = Math.floor(E / 3)), t.push(r)) } }, }, ]) ) })(gd) function yf(e, t, n, r, i, a, o, s, u, l) { ;(e.getVertexPosition(s, cf), e.getVertexPosition(u, hf), e.getVertexPosition(l, df)) var c = (function (e, t, n, r, i, a, o, s) { if ( null === (1 === t.side ? r.intersectTriangle(o, a, i, !0, s) : r.intersectTriangle(i, a, o, 0 === t.side, s)) ) return null ;(mf.copy(s), mf.applyMatrix4(e.matrixWorld)) var u = n.ray.origin.distanceTo(mf) return u < n.near || u > n.far ? null : { distance: u, point: mf.clone(), object: e } })(e, t, n, r, cf, hf, df, vf) if (c) { var h = new ph() ;(Id.getBarycoord(vf, cf, hf, df, h), i && (c.uv = Id.getInterpolatedAttribute(i, s, u, l, h, new Vc())), a && (c.uv1 = Id.getInterpolatedAttribute(a, s, u, l, h, new Vc())), o && ((c.normal = Id.getInterpolatedAttribute(o, s, u, l, h, new ph())), c.normal.dot(r.direction) > 0 && c.normal.multiplyScalar(-1))) var d = { a: s, b: u, c: l, normal: new ph(), materialIndex: 0 } ;(Id.getNormal(cf, hf, df, d.normal), (c.face = d), (c.barycoord = h)) } return c } var _f = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 1 ;(A(this, t), ((e = y(this, t)).type = 'BoxGeometry'), (e.parameters = { width: n, height: r, depth: i, widthSegments: a, heightSegments: o, depthSegments: s, })) var u = e ;((a = Math.floor(a)), (o = Math.floor(o)), (s = Math.floor(s))) var l = [], c = [], h = [], d = [], f = 0, p = 0 function v(e, t, n, r, i, a, o, s, v, m, g) { for ( var y = a / v, _ = o / m, b = a / 2, x = o / 2, S = s / 2, A = v + 1, w = m + 1, T = 0, M = 0, E = new ph(), C = 0; C < w; C++ ) for (var k = C * _ - x, R = 0; R < A; R++) { var I = R * y - b ;((E[e] = I * r), (E[t] = k * i), (E[n] = S), c.push(E.x, E.y, E.z), (E[e] = 0), (E[t] = 0), (E[n] = s > 0 ? 1 : -1), h.push(E.x, E.y, E.z), d.push(R / v), d.push(1 - C / m), (T += 1)) } for (var N = 0; N < m; N++) for (var P = 0; P < v; P++) { var L = f + P + A * N, D = f + P + A * (N + 1), O = f + (P + 1) + A * (N + 1), F = f + (P + 1) + A * N ;(l.push(L, D, F), l.push(D, O, F), (M += 6)) } ;(u.addGroup(p, M, g), (p += M), (f += T)) } return ( v('z', 'y', 'x', -1, -1, i, r, n, s, o, 0), v('z', 'y', 'x', 1, -1, i, r, -n, s, o, 1), v('x', 'z', 'y', 1, 1, n, i, r, a, s, 2), v('x', 'z', 'y', 1, -1, n, i, -r, a, s, 3), v('x', 'y', 'z', 1, -1, n, r, i, a, o, 4), v('x', 'y', 'z', -1, -1, n, r, -i, a, o, 5), e.setIndex(l), e.setAttribute('position', new Kd(c, 3)), e.setAttribute('normal', new Kd(h, 3)), e.setAttribute('uv', new Kd(d, 2)), e ) } return ( x(t, e), T( t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.parameters = Object.assign({}, e.parameters)), this ) }, }, ], [ { key: 'fromJSON', value: function (e) { return new t( e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments ) }, }, ] ) ) })(af) function bf(e) { var t = {} for (var n in e) for (var r in ((t[n] = {}), e[n])) { var i = e[n][r] i && (i.isColor || i.isMatrix3 || i.isMatrix4 || i.isVector2 || i.isVector3 || i.isVector4 || i.isTexture || i.isQuaternion) ? i.isRenderTargetTexture ? (console.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' ), (t[n][r] = null)) : (t[n][r] = i.clone()) : Array.isArray(i) ? (t[n][r] = i.slice()) : (t[n][r] = i) } return t } function xf(e) { for (var t = {}, n = 0; n < e.length; n++) { var r = bf(e[n]) for (var i in r) t[i] = r[i] } return t } function Sf(e) { var t = e.getRenderTarget() return null === t ? e.outputColorSpace : !0 === t.isXRRenderTarget ? t.texture.colorSpace : $c.workingColorSpace } var Af = { clone: bf, merge: xf }, wf = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isShaderMaterial = !0), (n.type = 'ShaderMaterial'), (n.defines = {}), (n.uniforms = {}), (n.uniformsGroups = []), (n.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'), (n.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'), (n.linewidth = 1), (n.wireframe = !1), (n.wireframeLinewidth = 1), (n.fog = !1), (n.lights = !1), (n.clipping = !1), (n.forceSinglePass = !0), (n.extensions = { clipCullDistance: !1, multiDraw: !1 }), (n.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv1: [0, 0] }), (n.index0AttributeName = void 0), (n.uniformsNeedUpdate = !1), (n.glslVersion = null), void 0 !== e && n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.fragmentShader = e.fragmentShader), (this.vertexShader = e.vertexShader), (this.uniforms = bf(e.uniforms)), (this.uniformsGroups = (function (e) { for (var t = [], n = 0; n < e.length; n++) t.push(e[n].clone()) return t })(e.uniformsGroups)), (this.defines = Object.assign({}, e.defines)), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), (this.fog = e.fog), (this.lights = e.lights), (this.clipping = e.clipping), (this.extensions = Object.assign({}, e.extensions)), (this.glslVersion = e.glslVersion), this ) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) for (var i in ((r.glslVersion = this.glslVersion), (r.uniforms = {}), this.uniforms)) { var a = this.uniforms[i].value a && a.isTexture ? (r.uniforms[i] = { type: 't', value: a.toJSON(e).uuid }) : a && a.isColor ? (r.uniforms[i] = { type: 'c', value: a.getHex() }) : a && a.isVector2 ? (r.uniforms[i] = { type: 'v2', value: a.toArray() }) : a && a.isVector3 ? (r.uniforms[i] = { type: 'v3', value: a.toArray() }) : a && a.isVector4 ? (r.uniforms[i] = { type: 'v4', value: a.toArray() }) : a && a.isMatrix3 ? (r.uniforms[i] = { type: 'm3', value: a.toArray() }) : a && a.isMatrix4 ? (r.uniforms[i] = { type: 'm4', value: a.toArray() }) : (r.uniforms[i] = { value: a }) } ;(Object.keys(this.defines).length > 0 && (r.defines = this.defines), (r.vertexShader = this.vertexShader), (r.fragmentShader = this.fragmentShader), (r.lights = this.lights), (r.clipping = this.clipping)) var o = {} for (var s in this.extensions) !0 === this.extensions[s] && (o[s] = !0) return (Object.keys(o).length > 0 && (r.extensions = o), r) }, }, ]) ) })(Ud), Tf = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isCamera = !0), (e.type = 'Camera'), (e.matrixWorldInverse = new Gh()), (e.projectionMatrix = new Gh()), (e.projectionMatrixInverse = new Gh()), (e.coordinateSystem = Ec), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), (this.coordinateSystem = e.coordinateSystem), this ) }, }, { key: 'getWorldDirection', value: function (e) { return n(t, 'getWorldDirection', this, 3)([e]).negate() }, }, { key: 'updateMatrixWorld', value: function (e) { ;(n(t, 'updateMatrixWorld', this, 3)([e]), this.matrixWorldInverse.copy(this.matrixWorld).invert()) }, }, { key: 'updateWorldMatrix', value: function (e, r) { ;(n(t, 'updateWorldMatrix', this, 3)([e, r]), this.matrixWorldInverse.copy(this.matrixWorld).invert()) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ]) ) })(gd), Mf = new ph(), Ef = new Vc(), Cf = new Vc(), kf = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 50, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0.1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 2e3 return ( A(this, t), ((e = y(this, t)).isPerspectiveCamera = !0), (e.type = 'PerspectiveCamera'), (e.fov = n), (e.zoom = 1), (e.near = i), (e.far = a), (e.focus = 10), (e.aspect = r), (e.view = null), (e.filmGauge = 35), (e.filmOffset = 0), e.updateProjectionMatrix(), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.fov = e.fov), (this.zoom = e.zoom), (this.near = e.near), (this.far = e.far), (this.focus = e.focus), (this.aspect = e.aspect), (this.view = null === e.view ? null : Object.assign({}, e.view)), (this.filmGauge = e.filmGauge), (this.filmOffset = e.filmOffset), this ) }, }, { key: 'setFocalLength', value: function (e) { var t = (0.5 * this.getFilmHeight()) / e ;((this.fov = 2 * Pc * Math.atan(t)), this.updateProjectionMatrix()) }, }, { key: 'getFocalLength', value: function () { var e = Math.tan(0.5 * Nc * this.fov) return (0.5 * this.getFilmHeight()) / e }, }, { key: 'getEffectiveFOV', value: function () { return 2 * Pc * Math.atan(Math.tan(0.5 * Nc * this.fov) / this.zoom) }, }, { key: 'getFilmWidth', value: function () { return this.filmGauge * Math.min(this.aspect, 1) }, }, { key: 'getFilmHeight', value: function () { return this.filmGauge / Math.max(this.aspect, 1) }, }, { key: 'getViewBounds', value: function (e, t, n) { ;(Mf.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse), t.set(Mf.x, Mf.y).multiplyScalar(-e / Mf.z), Mf.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse), n.set(Mf.x, Mf.y).multiplyScalar(-e / Mf.z)) }, }, { key: 'getViewSize', value: function (e, t) { return (this.getViewBounds(e, Ef, Cf), t.subVectors(Cf, Ef)) }, }, { key: 'setViewOffset', value: function (e, t, n, r, i, a) { ;((this.aspect = e / t), null === this.view && (this.view = { enabled: !0, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1, }), (this.view.enabled = !0), (this.view.fullWidth = e), (this.view.fullHeight = t), (this.view.offsetX = n), (this.view.offsetY = r), (this.view.width = i), (this.view.height = a), this.updateProjectionMatrix()) }, }, { key: 'clearViewOffset', value: function () { ;(null !== this.view && (this.view.enabled = !1), this.updateProjectionMatrix()) }, }, { key: 'updateProjectionMatrix', value: function () { var e = this.near, t = (e * Math.tan(0.5 * Nc * this.fov)) / this.zoom, n = 2 * t, r = this.aspect * n, i = -0.5 * r, a = this.view if (null !== this.view && this.view.enabled) { var o = a.fullWidth, s = a.fullHeight ;((i += (a.offsetX * r) / o), (t -= (a.offsetY * n) / s), (r *= a.width / o), (n *= a.height / s)) } var u = this.filmOffset ;(0 !== u && (i += (e * u) / this.getFilmWidth()), this.projectionMatrix.makePerspective( i, i + r, t, t - n, e, this.far, this.coordinateSystem ), this.projectionMatrixInverse.copy(this.projectionMatrix).invert()) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( (r.object.fov = this.fov), (r.object.zoom = this.zoom), (r.object.near = this.near), (r.object.far = this.far), (r.object.focus = this.focus), (r.object.aspect = this.aspect), null !== this.view && (r.object.view = Object.assign({}, this.view)), (r.object.filmGauge = this.filmGauge), (r.object.filmOffset = this.filmOffset), r ) }, }, ]) ) })(Tf), Rf = -90, If = (function (e) { function t(e, n, r) { var i ;(A(this, t), ((i = y(this, t)).type = 'CubeCamera'), (i.renderTarget = r), (i.coordinateSystem = null), (i.activeMipmapLevel = 0)) var a = new kf(Rf, 1, e, n) ;((a.layers = i.layers), i.add(a)) var o = new kf(Rf, 1, e, n) ;((o.layers = i.layers), i.add(o)) var s = new kf(Rf, 1, e, n) ;((s.layers = i.layers), i.add(s)) var u = new kf(Rf, 1, e, n) ;((u.layers = i.layers), i.add(u)) var l = new kf(Rf, 1, e, n) ;((l.layers = i.layers), i.add(l)) var c = new kf(Rf, 1, e, n) return ((c.layers = i.layers), i.add(c), i) } return ( x(t, e), T(t, [ { key: 'updateCoordinateSystem', value: function () { var e, t = this.coordinateSystem, n = this.children.concat(), r = C(n, 6), i = r[0], a = r[1], o = r[2], s = r[3], u = r[4], l = r[5], c = L(n) try { for (c.s(); !(e = c.n()).done; ) { var h = e.value this.remove(h) } } catch (v) { c.e(v) } finally { c.f() } if (t === Ec) (i.up.set(0, 1, 0), i.lookAt(1, 0, 0), a.up.set(0, 1, 0), a.lookAt(-1, 0, 0), o.up.set(0, 0, -1), o.lookAt(0, 1, 0), s.up.set(0, 0, 1), s.lookAt(0, -1, 0), u.up.set(0, 1, 0), u.lookAt(0, 0, 1), l.up.set(0, 1, 0), l.lookAt(0, 0, -1)) else { if (t !== Cc) throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + t ) ;(i.up.set(0, -1, 0), i.lookAt(-1, 0, 0), a.up.set(0, -1, 0), a.lookAt(1, 0, 0), o.up.set(0, 0, 1), o.lookAt(0, 1, 0), s.up.set(0, 0, -1), s.lookAt(0, -1, 0), u.up.set(0, -1, 0), u.lookAt(0, 0, 1), l.up.set(0, -1, 0), l.lookAt(0, 0, -1)) } var d, f = L(n) try { for (f.s(); !(d = f.n()).done; ) { var p = d.value ;(this.add(p), p.updateMatrixWorld()) } } catch (v) { f.e(v) } finally { f.f() } }, }, { key: 'update', value: function (e, t) { null === this.parent && this.updateMatrixWorld() var n = this.renderTarget, r = this.activeMipmapLevel this.coordinateSystem !== e.coordinateSystem && ((this.coordinateSystem = e.coordinateSystem), this.updateCoordinateSystem()) var i = C(this.children, 6), a = i[0], o = i[1], s = i[2], u = i[3], l = i[4], c = i[5], h = e.getRenderTarget(), d = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), p = e.xr.enabled e.xr.enabled = !1 var v = n.texture.generateMipmaps ;((n.texture.generateMipmaps = !1), e.setRenderTarget(n, 0, r), e.render(t, a), e.setRenderTarget(n, 1, r), e.render(t, o), e.setRenderTarget(n, 2, r), e.render(t, s), e.setRenderTarget(n, 3, r), e.render(t, u), e.setRenderTarget(n, 4, r), e.render(t, l), (n.texture.generateMipmaps = v), e.setRenderTarget(n, 5, r), e.render(t, c), e.setRenderTarget(h, d, f), (e.xr.enabled = p), (n.texture.needsPMREMUpdate = !0)) }, }, ]) ) })(gd), Nf = (function (e) { function t(e, n, r, i, a, o, s, u, l, c) { var h return ( A(this, t), ((h = y(this, t, [ (e = void 0 !== e ? e : []), (n = void 0 !== n ? n : tl), r, i, a, o, s, u, l, c, ])).isCubeTexture = !0), (h.flipY = !1), h ) } return ( x(t, e), T(t, [ { key: 'images', get: function () { return this.image }, set: function (e) { this.image = e }, }, ]) ) })(sh), Pf = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} ;(A(this, t), ((e = y(this, t, [n, n, r])).isWebGLCubeRenderTarget = !0)) var i = { width: n, height: n, depth: 1 }, a = [i, i, i, i, i, i] return ( (e.texture = new Nf( a, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.colorSpace )), (e.texture.isRenderTargetTexture = !0), (e.texture.generateMipmaps = void 0 !== r.generateMipmaps && r.generateMipmaps), (e.texture.minFilter = void 0 !== r.minFilter ? r.minFilter : ll), e ) } return ( x(t, e), T(t, [ { key: 'fromEquirectangularTexture', value: function (e, t) { ;((this.texture.type = t.type), (this.texture.colorSpace = t.colorSpace), (this.texture.generateMipmaps = t.generateMipmaps), (this.texture.minFilter = t.minFilter), (this.texture.magFilter = t.magFilter)) var n = { tEquirect: { value: null } }, r = '\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t', i = '\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t', a = new _f(5, 5, 5), o = new wf({ name: 'CubemapFromEquirect', uniforms: bf(n), vertexShader: r, fragmentShader: i, side: 1, blending: 0, }) o.uniforms.tEquirect.value = t var s = new gf(a, o), u = t.minFilter return ( t.minFilter === hl && (t.minFilter = ll), new If(1, 10, this).update(e, s), (t.minFilter = u), s.geometry.dispose(), s.material.dispose(), this ) }, }, { key: 'clear', value: function (e, t, n, r) { for (var i = e.getRenderTarget(), a = 0; a < 6; a++) (e.setRenderTarget(this, a), e.clear(t, n, r)) e.setRenderTarget(i) }, }, ]) ) })(ch), Lf = (function (e) { function t() { var e return (A(this, t), ((e = y(this, t)).isGroup = !0), (e.type = 'Group'), e) } return (x(t, e), T(t)) })(gd), Df = { type: 'move' }, Of = (function () { return T( function e() { ;(A(this, e), (this._targetRay = null), (this._grip = null), (this._hand = null)) }, [ { key: 'getHandSpace', value: function () { return ( null === this._hand && ((this._hand = new Lf()), (this._hand.matrixAutoUpdate = !1), (this._hand.visible = !1), (this._hand.joints = {}), (this._hand.inputState = { pinching: !1 })), this._hand ) }, }, { key: 'getTargetRaySpace', value: function () { return ( null === this._targetRay && ((this._targetRay = new Lf()), (this._targetRay.matrixAutoUpdate = !1), (this._targetRay.visible = !1), (this._targetRay.hasLinearVelocity = !1), (this._targetRay.linearVelocity = new ph()), (this._targetRay.hasAngularVelocity = !1), (this._targetRay.angularVelocity = new ph())), this._targetRay ) }, }, { key: 'getGripSpace', value: function () { return ( null === this._grip && ((this._grip = new Lf()), (this._grip.matrixAutoUpdate = !1), (this._grip.visible = !1), (this._grip.hasLinearVelocity = !1), (this._grip.linearVelocity = new ph()), (this._grip.hasAngularVelocity = !1), (this._grip.angularVelocity = new ph())), this._grip ) }, }, { key: 'dispatchEvent', value: function (e) { return ( null !== this._targetRay && this._targetRay.dispatchEvent(e), null !== this._grip && this._grip.dispatchEvent(e), null !== this._hand && this._hand.dispatchEvent(e), this ) }, }, { key: 'connect', value: function (e) { if (e && e.hand) { var t = this._hand if (t) { var n, r = L(e.hand.values()) try { for (r.s(); !(n = r.n()).done; ) { var i = n.value this._getHandJoint(t, i) } } catch (a) { r.e(a) } finally { r.f() } } } return (this.dispatchEvent({ type: 'connected', data: e }), this) }, }, { key: 'disconnect', value: function (e) { return ( this.dispatchEvent({ type: 'disconnected', data: e }), null !== this._targetRay && (this._targetRay.visible = !1), null !== this._grip && (this._grip.visible = !1), null !== this._hand && (this._hand.visible = !1), this ) }, }, { key: 'update', value: function (e, t, n) { var r = null, i = null, a = null, o = this._targetRay, s = this._grip, u = this._hand if (e && 'visible-blurred' !== t.session.visibilityState) { if (u && e.hand) { a = !0 var l, c = L(e.hand.values()) try { for (c.s(); !(l = c.n()).done; ) { var h = l.value, d = t.getJointPose(h, n), f = this._getHandJoint(u, h) ;(null !== d && (f.matrix.fromArray(d.transform.matrix), f.matrix.decompose(f.position, f.rotation, f.scale), (f.matrixWorldNeedsUpdate = !0), (f.jointRadius = d.radius)), (f.visible = null !== d)) } } catch (g) { c.e(g) } finally { c.f() } var p = u.joints['index-finger-tip'], v = u.joints['thumb-tip'], m = p.position.distanceTo(v.position) u.inputState.pinching && m > 0.025 ? ((u.inputState.pinching = !1), this.dispatchEvent({ type: 'pinchend', handedness: e.handedness, target: this, })) : !u.inputState.pinching && m <= 0.015 && ((u.inputState.pinching = !0), this.dispatchEvent({ type: 'pinchstart', handedness: e.handedness, target: this, })) } else null !== s && e.gripSpace && null !== (i = t.getPose(e.gripSpace, n)) && (s.matrix.fromArray(i.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), (s.matrixWorldNeedsUpdate = !0), i.linearVelocity ? ((s.hasLinearVelocity = !0), s.linearVelocity.copy(i.linearVelocity)) : (s.hasLinearVelocity = !1), i.angularVelocity ? ((s.hasAngularVelocity = !0), s.angularVelocity.copy(i.angularVelocity)) : (s.hasAngularVelocity = !1)) null !== o && (null === (r = t.getPose(e.targetRaySpace, n)) && null !== i && (r = i), null !== r && (o.matrix.fromArray(r.transform.matrix), o.matrix.decompose(o.position, o.rotation, o.scale), (o.matrixWorldNeedsUpdate = !0), r.linearVelocity ? ((o.hasLinearVelocity = !0), o.linearVelocity.copy(r.linearVelocity)) : (o.hasLinearVelocity = !1), r.angularVelocity ? ((o.hasAngularVelocity = !0), o.angularVelocity.copy(r.angularVelocity)) : (o.hasAngularVelocity = !1), this.dispatchEvent(Df))) } return ( null !== o && (o.visible = null !== r), null !== s && (s.visible = null !== i), null !== u && (u.visible = null !== a), this ) }, }, { key: '_getHandJoint', value: function (e, t) { if (void 0 === e.joints[t.jointName]) { var n = new Lf() ;((n.matrixAutoUpdate = !1), (n.visible = !1), (e.joints[t.jointName] = n), e.add(n)) } return e.joints[t.jointName] }, }, ] ) })(), Ff = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isScene = !0), (e.type = 'Scene'), (e.background = null), (e.environment = null), (e.fog = null), (e.backgroundBlurriness = 0), (e.backgroundIntensity = 1), (e.backgroundRotation = new ed()), (e.environmentIntensity = 1), (e.environmentRotation = new ed()), (e.overrideMaterial = null), 'undefined' != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: e })), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), null !== e.background && (this.background = e.background.clone()), null !== e.environment && (this.environment = e.environment.clone()), null !== e.fog && (this.fog = e.fog.clone()), (this.backgroundBlurriness = e.backgroundBlurriness), (this.backgroundIntensity = e.backgroundIntensity), this.backgroundRotation.copy(e.backgroundRotation), (this.environmentIntensity = e.environmentIntensity), this.environmentRotation.copy(e.environmentRotation), null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()), (this.matrixAutoUpdate = e.matrixAutoUpdate), this ) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( null !== this.fog && (r.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (r.object.backgroundBlurriness = this.backgroundBlurriness), 1 !== this.backgroundIntensity && (r.object.backgroundIntensity = this.backgroundIntensity), (r.object.backgroundRotation = this.backgroundRotation.toArray()), 1 !== this.environmentIntensity && (r.object.environmentIntensity = this.environmentIntensity), (r.object.environmentRotation = this.environmentRotation.toArray()), r ) }, }, ]) ) })(gd), Bf = (function () { return T( function e(t, n) { ;(A(this, e), (this.isInterleavedBuffer = !0), (this.array = t), (this.stride = n), (this.count = void 0 !== t ? t.length / n : 0), (this.usage = wc), (this.updateRanges = []), (this.version = 0), (this.uuid = Lc())) }, [ { key: 'onUploadCallback', value: function () {} }, { key: 'needsUpdate', set: function (e) { !0 === e && this.version++ }, }, { key: 'setUsage', value: function (e) { return ((this.usage = e), this) }, }, { key: 'addUpdateRange', value: function (e, t) { this.updateRanges.push({ start: e, count: t }) }, }, { key: 'clearUpdateRanges', value: function () { this.updateRanges.length = 0 }, }, { key: 'copy', value: function (e) { return ( (this.array = new e.array.constructor(e.array)), (this.count = e.count), (this.stride = e.stride), (this.usage = e.usage), this ) }, }, { key: 'copyAt', value: function (e, t, n) { ;((e *= this.stride), (n *= t.stride)) for (var r = 0, i = this.stride; r < i; r++) this.array[e + r] = t.array[n + r] return this }, }, { key: 'set', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return (this.array.set(e, t), this) }, }, { key: 'clone', value: function (e) { ;(void 0 === e.arrayBuffers && (e.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Lc()), void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer)) var t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), n = new this.constructor(t, this.stride) return (n.setUsage(this.usage), n) }, }, { key: 'onUpload', value: function (e) { return ((this.onUploadCallback = e), this) }, }, { key: 'toJSON', value: function (e) { return ( void 0 === e.arrayBuffers && (e.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Lc()), void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = Array.from( new Uint32Array(this.array.buffer) )), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, stride: this.stride, } ) }, }, ] ) })(), Uf = new ph(), zf = (function () { function e(t, n, r) { var i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] ;(A(this, e), (this.isInterleavedBufferAttribute = !0), (this.name = ''), (this.data = t), (this.itemSize = n), (this.offset = r), (this.normalized = i)) } return T(e, [ { key: 'count', get: function () { return this.data.count }, }, { key: 'array', get: function () { return this.data.array }, }, { key: 'needsUpdate', set: function (e) { this.data.needsUpdate = e }, }, { key: 'applyMatrix4', value: function (e) { for (var t = 0, n = this.data.count; t < n; t++) (Uf.fromBufferAttribute(this, t), Uf.applyMatrix4(e), this.setXYZ(t, Uf.x, Uf.y, Uf.z)) return this }, }, { key: 'applyNormalMatrix', value: function (e) { for (var t = 0, n = this.count; t < n; t++) (Uf.fromBufferAttribute(this, t), Uf.applyNormalMatrix(e), this.setXYZ(t, Uf.x, Uf.y, Uf.z)) return this }, }, { key: 'transformDirection', value: function (e) { for (var t = 0, n = this.count; t < n; t++) (Uf.fromBufferAttribute(this, t), Uf.transformDirection(e), this.setXYZ(t, Uf.x, Uf.y, Uf.z)) return this }, }, { key: 'getComponent', value: function (e, t) { var n = this.array[e * this.data.stride + this.offset + t] return (this.normalized && (n = Bc(n, this.array)), n) }, }, { key: 'setComponent', value: function (e, t, n) { return ( this.normalized && (n = Uc(n, this.array)), (this.data.array[e * this.data.stride + this.offset + t] = n), this ) }, }, { key: 'setX', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.data.array[e * this.data.stride + this.offset] = t), this ) }, }, { key: 'setY', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.data.array[e * this.data.stride + this.offset + 1] = t), this ) }, }, { key: 'setZ', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.data.array[e * this.data.stride + this.offset + 2] = t), this ) }, }, { key: 'setW', value: function (e, t) { return ( this.normalized && (t = Uc(t, this.array)), (this.data.array[e * this.data.stride + this.offset + 3] = t), this ) }, }, { key: 'getX', value: function (e) { var t = this.data.array[e * this.data.stride + this.offset] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'getY', value: function (e) { var t = this.data.array[e * this.data.stride + this.offset + 1] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'getZ', value: function (e) { var t = this.data.array[e * this.data.stride + this.offset + 2] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'getW', value: function (e) { var t = this.data.array[e * this.data.stride + this.offset + 3] return (this.normalized && (t = Bc(t, this.array)), t) }, }, { key: 'setXY', value: function (e, t, n) { return ( (e = e * this.data.stride + this.offset), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array))), (this.data.array[e + 0] = t), (this.data.array[e + 1] = n), this ) }, }, { key: 'setXYZ', value: function (e, t, n, r) { return ( (e = e * this.data.stride + this.offset), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array)), (r = Uc(r, this.array))), (this.data.array[e + 0] = t), (this.data.array[e + 1] = n), (this.data.array[e + 2] = r), this ) }, }, { key: 'setXYZW', value: function (e, t, n, r, i) { return ( (e = e * this.data.stride + this.offset), this.normalized && ((t = Uc(t, this.array)), (n = Uc(n, this.array)), (r = Uc(r, this.array)), (i = Uc(i, this.array))), (this.data.array[e + 0] = t), (this.data.array[e + 1] = n), (this.data.array[e + 2] = r), (this.data.array[e + 3] = i), this ) }, }, { key: 'clone', value: function (t) { if (void 0 === t) { console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' ) for (var n = [], r = 0; r < this.count; r++) for ( var i = r * this.data.stride + this.offset, a = 0; a < this.itemSize; a++ ) n.push(this.data.array[i + a]) return new qd(new this.array.constructor(n), this.itemSize, this.normalized) } return ( void 0 === t.interleavedBuffers && (t.interleavedBuffers = {}), void 0 === t.interleavedBuffers[this.data.uuid] && (t.interleavedBuffers[this.data.uuid] = this.data.clone(t)), new e( t.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized ) ) }, }, { key: 'toJSON', value: function (e) { if (void 0 === e) { console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' ) for (var t = [], n = 0; n < this.count; n++) for ( var r = n * this.data.stride + this.offset, i = 0; i < this.itemSize; i++ ) t.push(this.data.array[r + i]) return { itemSize: this.itemSize, type: this.array.constructor.name, array: t, normalized: this.normalized, } } return ( void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}), void 0 === e.interleavedBuffers[this.data.uuid] && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), { isInterleavedBufferAttribute: !0, itemSize: this.itemSize, data: this.data.uuid, offset: this.offset, normalized: this.normalized, } ) }, }, ]) })(), Vf = new ph(), Hf = new uh(), Wf = new uh(), Gf = new ph(), jf = new Gh(), Qf = new ph(), qf = new Dh(), Xf = new Gh(), Yf = new Wh(), Kf = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).isSkinnedMesh = !0), (r.type = 'SkinnedMesh'), (r.bindMode = el), (r.bindMatrix = new Gh()), (r.bindMatrixInverse = new Gh()), (r.boundingBox = null), (r.boundingSphere = null), r ) } return ( x(t, e), T(t, [ { key: 'computeBoundingBox', value: function () { var e = this.geometry ;(null === this.boundingBox && (this.boundingBox = new gh()), this.boundingBox.makeEmpty()) for (var t = e.getAttribute('position'), n = 0; n < t.count; n++) (this.getVertexPosition(n, Qf), this.boundingBox.expandByPoint(Qf)) }, }, { key: 'computeBoundingSphere', value: function () { var e = this.geometry ;(null === this.boundingSphere && (this.boundingSphere = new Dh()), this.boundingSphere.makeEmpty()) for (var t = e.getAttribute('position'), n = 0; n < t.count; n++) (this.getVertexPosition(n, Qf), this.boundingSphere.expandByPoint(Qf)) }, }, { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.bindMode = e.bindMode), this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), (this.skeleton = e.skeleton), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this ) }, }, { key: 'raycast', value: function (e, t) { var n = this.material, r = this.matrixWorld void 0 !== n && (null === this.boundingSphere && this.computeBoundingSphere(), qf.copy(this.boundingSphere), qf.applyMatrix4(r), !1 !== e.ray.intersectsSphere(qf) && (Xf.copy(r).invert(), Yf.copy(e.ray).applyMatrix4(Xf), (null !== this.boundingBox && !1 === Yf.intersectsBox(this.boundingBox)) || this._computeIntersections(e, t, Yf))) }, }, { key: 'getVertexPosition', value: function (e, r) { return ( n(t, 'getVertexPosition', this, 3)([e, r]), this.applyBoneTransform(e, r), r ) }, }, { key: 'bind', value: function (e, t) { ;((this.skeleton = e), void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)), this.bindMatrix.copy(t), this.bindMatrixInverse.copy(t).invert()) }, }, { key: 'pose', value: function () { this.skeleton.pose() }, }, { key: 'normalizeSkinWeights', value: function () { for ( var e = new uh(), t = this.geometry.attributes.skinWeight, n = 0, r = t.count; n < r; n++ ) { e.fromBufferAttribute(t, n) var i = 1 / e.manhattanLength() ;(i !== 1 / 0 ? e.multiplyScalar(i) : e.set(1, 0, 0, 0), t.setXYZW(n, e.x, e.y, e.z, e.w)) } }, }, { key: 'updateMatrixWorld', value: function (e) { ;(n(t, 'updateMatrixWorld', this, 3)([e]), this.bindMode === el ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : 'detached' === this.bindMode ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode )) }, }, { key: 'applyBoneTransform', value: function (e, t) { var n = this.skeleton, r = this.geometry ;(Hf.fromBufferAttribute(r.attributes.skinIndex, e), Wf.fromBufferAttribute(r.attributes.skinWeight, e), Vf.copy(t).applyMatrix4(this.bindMatrix), t.set(0, 0, 0)) for (var i = 0; i < 4; i++) { var a = Wf.getComponent(i) if (0 !== a) { var o = Hf.getComponent(i) ;(jf.multiplyMatrices(n.bones[o].matrixWorld, n.boneInverses[o]), t.addScaledVector(Gf.copy(Vf).applyMatrix4(jf), a)) } } return t.applyMatrix4(this.bindMatrixInverse) }, }, ]) ) })(gf), Zf = (function (e) { function t() { var e return (A(this, t), ((e = y(this, t)).isBone = !0), (e.type = 'Bone'), e) } return (x(t, e), T(t)) })(gd), Jf = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 ? arguments[3] : void 0, o = arguments.length > 4 ? arguments[4] : void 0, s = arguments.length > 5 ? arguments[5] : void 0, u = arguments.length > 6 ? arguments[6] : void 0, l = arguments.length > 7 ? arguments[7] : void 0, c = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : sl, h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : sl, d = arguments.length > 10 ? arguments[10] : void 0, f = arguments.length > 11 ? arguments[11] : void 0 return ( A(this, t), ((e = y(this, t, [null, s, u, l, c, h, a, o, d, f])).isDataTexture = !0), (e.image = { data: n, width: r, height: i }), (e.generateMipmaps = !1), (e.flipY = !1), (e.unpackAlignment = 1), e ) } return (x(t, e), T(t)) })(sh), $f = new Gh(), ep = new Gh(), tp = (function () { function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [] ;(A(this, e), (this.uuid = Lc()), (this.bones = t.slice(0)), (this.boneInverses = n), (this.boneMatrices = null), (this.boneTexture = null), this.init()) } return T(e, [ { key: 'init', value: function () { var e = this.bones, t = this.boneInverses if (((this.boneMatrices = new Float32Array(16 * e.length)), 0 === t.length)) this.calculateInverses() else if (e.length !== t.length) { ;(console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' ), (this.boneInverses = [])) for (var n = 0, r = this.bones.length; n < r; n++) this.boneInverses.push(new Gh()) } }, }, { key: 'calculateInverses', value: function () { this.boneInverses.length = 0 for (var e = 0, t = this.bones.length; e < t; e++) { var n = new Gh() ;(this.bones[e] && n.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(n)) } }, }, { key: 'pose', value: function () { for (var e = 0, t = this.bones.length; e < t; e++) { var n = this.bones[e] n && n.matrixWorld.copy(this.boneInverses[e]).invert() } for (var r = 0, i = this.bones.length; r < i; r++) { var a = this.bones[r] a && (a.parent && a.parent.isBone ? (a.matrix.copy(a.parent.matrixWorld).invert(), a.matrix.multiply(a.matrixWorld)) : a.matrix.copy(a.matrixWorld), a.matrix.decompose(a.position, a.quaternion, a.scale)) } }, }, { key: 'update', value: function () { for ( var e = this.bones, t = this.boneInverses, n = this.boneMatrices, r = this.boneTexture, i = 0, a = e.length; i < a; i++ ) { var o = e[i] ? e[i].matrixWorld : ep ;($f.multiplyMatrices(o, t[i]), $f.toArray(n, 16 * i)) } null !== r && (r.needsUpdate = !0) }, }, { key: 'clone', value: function () { return new e(this.bones, this.boneInverses) }, }, { key: 'computeBoneTexture', value: function () { var e = Math.sqrt(4 * this.bones.length) ;((e = 4 * Math.ceil(e / 4)), (e = Math.max(e, 4))) var t = new Float32Array(e * e * 4) t.set(this.boneMatrices) var n = new Jf(t, e, e, wl, yl) return ( (n.needsUpdate = !0), (this.boneMatrices = t), (this.boneTexture = n), this ) }, }, { key: 'getBoneByName', value: function (e) { for (var t = 0, n = this.bones.length; t < n; t++) { var r = this.bones[t] if (r.name === e) return r } }, }, { key: 'dispose', value: function () { null !== this.boneTexture && (this.boneTexture.dispose(), (this.boneTexture = null)) }, }, { key: 'fromJSON', value: function (e, t) { this.uuid = e.uuid for (var n = 0, r = e.bones.length; n < r; n++) { var i = e.bones[n], a = t[i] ;(void 0 === a && (console.warn('THREE.Skeleton: No bone found with UUID:', i), (a = new Zf())), this.bones.push(a), this.boneInverses.push(new Gh().fromArray(e.boneInverses[n]))) } return (this.init(), this) }, }, { key: 'toJSON', value: function () { var e = { metadata: { version: 4.6, type: 'Skeleton', generator: 'Skeleton.toJSON' }, bones: [], boneInverses: [], } e.uuid = this.uuid for ( var t = this.bones, n = this.boneInverses, r = 0, i = t.length; r < i; r++ ) { var a = t[r] e.bones.push(a.uuid) var o = n[r] e.boneInverses.push(o.toArray()) } return e }, }, ]) })(), np = (function (e) { function t(e, n, r) { var i, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 return ( A(this, t), ((i = y(this, t, [e, n, r])).isInstancedBufferAttribute = !0), (i.meshPerAttribute = a), i ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.meshPerAttribute = e.meshPerAttribute), this ) }, }, { key: 'toJSON', value: function () { var e = n(t, 'toJSON', this, 3)([]) return ( (e.meshPerAttribute = this.meshPerAttribute), (e.isInstancedBufferAttribute = !0), e ) }, }, ]) ) })(qd), rp = new Gh(), ip = new Gh(), ap = [], op = new gh(), sp = new Gh(), up = new gf(), lp = new Dh(), cp = (function (e) { function t(e, n, r) { var i ;(A(this, t), ((i = y(this, t, [e, n])).isInstancedMesh = !0), (i.instanceMatrix = new np(new Float32Array(16 * r), 16)), (i.instanceColor = null), (i.morphTexture = null), (i.count = r), (i.boundingBox = null), (i.boundingSphere = null)) for (var a = 0; a < r; a++) i.setMatrixAt(a, sp) return i } return ( x(t, e), T(t, [ { key: 'computeBoundingBox', value: function () { var e = this.geometry, t = this.count ;(null === this.boundingBox && (this.boundingBox = new gh()), null === e.boundingBox && e.computeBoundingBox(), this.boundingBox.makeEmpty()) for (var n = 0; n < t; n++) (this.getMatrixAt(n, rp), op.copy(e.boundingBox).applyMatrix4(rp), this.boundingBox.union(op)) }, }, { key: 'computeBoundingSphere', value: function () { var e = this.geometry, t = this.count ;(null === this.boundingSphere && (this.boundingSphere = new Dh()), null === e.boundingSphere && e.computeBoundingSphere(), this.boundingSphere.makeEmpty()) for (var n = 0; n < t; n++) (this.getMatrixAt(n, rp), lp.copy(e.boundingSphere).applyMatrix4(rp), this.boundingSphere.union(lp)) }, }, { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), this.instanceMatrix.copy(e.instanceMatrix), null !== e.morphTexture && (this.morphTexture = e.morphTexture.clone()), null !== e.instanceColor && (this.instanceColor = e.instanceColor.clone()), (this.count = e.count), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this ) }, }, { key: 'getColorAt', value: function (e, t) { t.fromArray(this.instanceColor.array, 3 * e) }, }, { key: 'getMatrixAt', value: function (e, t) { t.fromArray(this.instanceMatrix.array, 16 * e) }, }, { key: 'getMorphAt', value: function (e, t) { for ( var n = t.morphTargetInfluences, r = this.morphTexture.source.data.data, i = e * (n.length + 1) + 1, a = 0; a < n.length; a++ ) n[a] = r[i + a] }, }, { key: 'raycast', value: function (e, t) { var n = this.matrixWorld, r = this.count if ( ((up.geometry = this.geometry), (up.material = this.material), void 0 !== up.material && (null === this.boundingSphere && this.computeBoundingSphere(), lp.copy(this.boundingSphere), lp.applyMatrix4(n), !1 !== e.ray.intersectsSphere(lp))) ) for (var i = 0; i < r; i++) { ;(this.getMatrixAt(i, rp), ip.multiplyMatrices(n, rp), (up.matrixWorld = ip), up.raycast(e, ap)) for (var a = 0, o = ap.length; a < o; a++) { var s = ap[a] ;((s.instanceId = i), (s.object = this), t.push(s)) } ap.length = 0 } }, }, { key: 'setColorAt', value: function (e, t) { ;(null === this.instanceColor && (this.instanceColor = new np( new Float32Array(3 * this.instanceMatrix.count).fill(1), 3 )), t.toArray(this.instanceColor.array, 3 * e)) }, }, { key: 'setMatrixAt', value: function (e, t) { t.toArray(this.instanceMatrix.array, 16 * e) }, }, { key: 'setMorphAt', value: function (e, t) { var n = t.morphTargetInfluences, r = n.length + 1 null === this.morphTexture && (this.morphTexture = new Jf( new Float32Array(r * this.count), r, this.count, El, yl )) for ( var i = this.morphTexture.source.data.data, a = 0, o = 0; o < n.length; o++ ) a += n[o] var s = this.geometry.morphTargetsRelative ? 1 : 1 - a, u = r * e ;((i[u] = s), i.set(n, u + 1)) }, }, { key: 'updateMorphTargets', value: function () {} }, { key: 'dispose', value: function () { return ( this.dispatchEvent({ type: 'dispose' }), null !== this.morphTexture && (this.morphTexture.dispose(), (this.morphTexture = null)), this ) }, }, ]) ) })(gf), hp = new ph(), dp = new ph(), fp = new Hc(), pp = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(1, 0, 0), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 ;(A(this, e), (this.isPlane = !0), (this.normal = t), (this.constant = n)) }, [ { key: 'set', value: function (e, t) { return (this.normal.copy(e), (this.constant = t), this) }, }, { key: 'setComponents', value: function (e, t, n, r) { return (this.normal.set(e, t, n), (this.constant = r), this) }, }, { key: 'setFromNormalAndCoplanarPoint', value: function (e, t) { return (this.normal.copy(e), (this.constant = -t.dot(this.normal)), this) }, }, { key: 'setFromCoplanarPoints', value: function (e, t, n) { var r = hp.subVectors(n, t).cross(dp.subVectors(e, t)).normalize() return (this.setFromNormalAndCoplanarPoint(r, e), this) }, }, { key: 'copy', value: function (e) { return (this.normal.copy(e.normal), (this.constant = e.constant), this) }, }, { key: 'normalize', value: function () { var e = 1 / this.normal.length() return (this.normal.multiplyScalar(e), (this.constant *= e), this) }, }, { key: 'negate', value: function () { return ((this.constant *= -1), this.normal.negate(), this) }, }, { key: 'distanceToPoint', value: function (e) { return this.normal.dot(e) + this.constant }, }, { key: 'distanceToSphere', value: function (e) { return this.distanceToPoint(e.center) - e.radius }, }, { key: 'projectPoint', value: function (e, t) { return t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e)) }, }, { key: 'intersectLine', value: function (e, t) { var n = e.delta(hp), r = this.normal.dot(n) if (0 === r) return 0 === this.distanceToPoint(e.start) ? t.copy(e.start) : null var i = -(e.start.dot(this.normal) + this.constant) / r return i < 0 || i > 1 ? null : t.copy(e.start).addScaledVector(n, i) }, }, { key: 'intersectsLine', value: function (e) { var t = this.distanceToPoint(e.start), n = this.distanceToPoint(e.end) return (t < 0 && n > 0) || (n < 0 && t > 0) }, }, { key: 'intersectsBox', value: function (e) { return e.intersectsPlane(this) }, }, { key: 'intersectsSphere', value: function (e) { return e.intersectsPlane(this) }, }, { key: 'coplanarPoint', value: function (e) { return e.copy(this.normal).multiplyScalar(-this.constant) }, }, { key: 'applyMatrix4', value: function (e, t) { var n = t || fp.getNormalMatrix(e), r = this.coplanarPoint(hp).applyMatrix4(e), i = this.normal.applyMatrix3(n).normalize() return ((this.constant = -r.dot(i)), this) }, }, { key: 'translate', value: function (e) { return ((this.constant -= e.dot(this.normal)), this) }, }, { key: 'equals', value: function (e) { return e.normal.equals(this.normal) && e.constant === this.constant }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ] ) })(), vp = new Dh(), mp = new ph(), gp = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new pp(), n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new pp(), r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new pp(), i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : new pp(), a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : new pp(), o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : new pp() ;(A(this, e), (this.planes = [t, n, r, i, a, o])) }, [ { key: 'set', value: function (e, t, n, r, i, a) { var o = this.planes return ( o[0].copy(e), o[1].copy(t), o[2].copy(n), o[3].copy(r), o[4].copy(i), o[5].copy(a), this ) }, }, { key: 'copy', value: function (e) { for (var t = this.planes, n = 0; n < 6; n++) t[n].copy(e.planes[n]) return this }, }, { key: 'setFromProjectionMatrix', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ec, n = this.planes, r = e.elements, i = r[0], a = r[1], o = r[2], s = r[3], u = r[4], l = r[5], c = r[6], h = r[7], d = r[8], f = r[9], p = r[10], v = r[11], m = r[12], g = r[13], y = r[14], _ = r[15] if ( (n[0].setComponents(s - i, h - u, v - d, _ - m).normalize(), n[1].setComponents(s + i, h + u, v + d, _ + m).normalize(), n[2].setComponents(s + a, h + l, v + f, _ + g).normalize(), n[3].setComponents(s - a, h - l, v - f, _ - g).normalize(), n[4].setComponents(s - o, h - c, v - p, _ - y).normalize(), t === Ec) ) n[5].setComponents(s + o, h + c, v + p, _ + y).normalize() else { if (t !== Cc) throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + t ) n[5].setComponents(o, c, p, y).normalize() } return this }, }, { key: 'intersectsObject', value: function (e) { if (void 0 !== e.boundingSphere) (null === e.boundingSphere && e.computeBoundingSphere(), vp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld)) else { var t = e.geometry ;(null === t.boundingSphere && t.computeBoundingSphere(), vp.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)) } return this.intersectsSphere(vp) }, }, { key: 'intersectsSprite', value: function (e) { return ( vp.center.set(0, 0, 0), (vp.radius = 0.7071067811865476), vp.applyMatrix4(e.matrixWorld), this.intersectsSphere(vp) ) }, }, { key: 'intersectsSphere', value: function (e) { for (var t = this.planes, n = e.center, r = -e.radius, i = 0; i < 6; i++) { if (t[i].distanceToPoint(n) < r) return !1 } return !0 }, }, { key: 'intersectsBox', value: function (e) { for (var t = this.planes, n = 0; n < 6; n++) { var r = t[n] if ( ((mp.x = r.normal.x > 0 ? e.max.x : e.min.x), (mp.y = r.normal.y > 0 ? e.max.y : e.min.y), (mp.z = r.normal.z > 0 ? e.max.z : e.min.z), r.distanceToPoint(mp) < 0) ) return !1 } return !0 }, }, { key: 'containsPoint', value: function (e) { for (var t = this.planes, n = 0; n < 6; n++) if (t[n].distanceToPoint(e) < 0) return !1 return !0 }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ] ) })(), yp = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isLineBasicMaterial = !0), (n.type = 'LineBasicMaterial'), (n.color = new Od(16777215)), (n.map = null), (n.linewidth = 1), (n.linecap = 'round'), (n.linejoin = 'round'), (n.fog = !0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), this.color.copy(e.color), (this.map = e.map), (this.linewidth = e.linewidth), (this.linecap = e.linecap), (this.linejoin = e.linejoin), (this.fog = e.fog), this ) }, }, ]) ) })(Ud), _p = new ph(), bp = new ph(), xp = new Gh(), Sp = new Wh(), Ap = new Dh(), wp = new ph(), Tp = new ph(), Mp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(), r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new yp() return ( A(this, t), ((e = y(this, t)).isLine = !0), (e.type = 'Line'), (e.geometry = n), (e.material = r), e.updateMorphTargets(), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.material = Array.isArray(e.material) ? e.material.slice() : e.material), (this.geometry = e.geometry), this ) }, }, { key: 'computeLineDistances', value: function () { var e = this.geometry if (null === e.index) { for (var t = e.attributes.position, n = [0], r = 1, i = t.count; r < i; r++) (_p.fromBufferAttribute(t, r - 1), bp.fromBufferAttribute(t, r), (n[r] = n[r - 1]), (n[r] += _p.distanceTo(bp))) e.setAttribute('lineDistance', new Kd(n, 1)) } else console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ) return this }, }, { key: 'raycast', value: function (e, t) { var n = this.geometry, r = this.matrixWorld, i = e.params.Line.threshold, a = n.drawRange if ( (null === n.boundingSphere && n.computeBoundingSphere(), Ap.copy(n.boundingSphere), Ap.applyMatrix4(r), (Ap.radius += i), !1 !== e.ray.intersectsSphere(Ap)) ) { ;(xp.copy(r).invert(), Sp.copy(e.ray).applyMatrix4(xp)) var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3), s = o * o, u = this.isLineSegments ? 2 : 1, l = n.index, c = n.attributes.position if (null !== l) { for ( var h = Math.max(0, a.start), d = Math.min(l.count, a.start + a.count), f = h, p = d - 1; f < p; f += u ) { var v = l.getX(f), m = l.getX(f + 1), g = Ep(this, e, Sp, s, v, m, f) g && t.push(g) } if (this.isLineLoop) { var y = l.getX(d - 1), _ = l.getX(h), b = Ep(this, e, Sp, s, y, _, d - 1) b && t.push(b) } } else { for ( var x = Math.max(0, a.start), S = Math.min(c.count, a.start + a.count), A = x, w = S - 1; A < w; A += u ) { var T = Ep(this, e, Sp, s, A, A + 1, A) T && t.push(T) } if (this.isLineLoop) { var M = Ep(this, e, Sp, s, S - 1, x, S - 1) M && t.push(M) } } } }, }, { key: 'updateMorphTargets', value: function () { var e = this.geometry.morphAttributes, t = Object.keys(e) if (t.length > 0) { var n = e[t[0]] if (void 0 !== n) { ;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {})) for (var r = 0, i = n.length; r < i; r++) { var a = n[r].name || String(r) ;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = r)) } } } }, }, ]) ) })(gd) function Ep(e, t, n, r, i, a, o) { var s = e.geometry.attributes.position if ( (_p.fromBufferAttribute(s, i), bp.fromBufferAttribute(s, a), !(n.distanceSqToSegment(_p, bp, wp, Tp) > r)) ) { wp.applyMatrix4(e.matrixWorld) var u = t.ray.origin.distanceTo(wp) if (!(u < t.near || u > t.far)) return { distance: u, point: Tp.clone().applyMatrix4(e.matrixWorld), index: o, face: null, faceIndex: null, barycoord: null, object: e, } } } var Cp = new ph(), kp = new ph(), Rp = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).isLineSegments = !0), (r.type = 'LineSegments'), r ) } return ( x(t, e), T(t, [ { key: 'computeLineDistances', value: function () { var e = this.geometry if (null === e.index) { for ( var t = e.attributes.position, n = [], r = 0, i = t.count; r < i; r += 2 ) (Cp.fromBufferAttribute(t, r), kp.fromBufferAttribute(t, r + 1), (n[r] = 0 === r ? 0 : n[r - 1]), (n[r + 1] = n[r] + Cp.distanceTo(kp))) e.setAttribute('lineDistance', new Kd(n, 1)) } else console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ) return this }, }, ]) ) })(Mp), Ip = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).isLineLoop = !0), (r.type = 'LineLoop'), r ) } return (x(t, e), T(t)) })(Mp), Np = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isPointsMaterial = !0), (n.type = 'PointsMaterial'), (n.color = new Od(16777215)), (n.map = null), (n.alphaMap = null), (n.size = 1), (n.sizeAttenuation = !0), (n.fog = !0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), this.color.copy(e.color), (this.map = e.map), (this.alphaMap = e.alphaMap), (this.size = e.size), (this.sizeAttenuation = e.sizeAttenuation), (this.fog = e.fog), this ) }, }, ]) ) })(Ud), Pp = new Gh(), Lp = new Wh(), Dp = new Dh(), Op = new ph(), Fp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new af(), r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Np() return ( A(this, t), ((e = y(this, t)).isPoints = !0), (e.type = 'Points'), (e.geometry = n), (e.material = r), e.updateMorphTargets(), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.material = Array.isArray(e.material) ? e.material.slice() : e.material), (this.geometry = e.geometry), this ) }, }, { key: 'raycast', value: function (e, t) { var n = this.geometry, r = this.matrixWorld, i = e.params.Points.threshold, a = n.drawRange if ( (null === n.boundingSphere && n.computeBoundingSphere(), Dp.copy(n.boundingSphere), Dp.applyMatrix4(r), (Dp.radius += i), !1 !== e.ray.intersectsSphere(Dp)) ) { ;(Pp.copy(r).invert(), Lp.copy(e.ray).applyMatrix4(Pp)) var o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3), s = o * o, u = n.index, l = n.attributes.position if (null !== u) for ( var c = Math.max(0, a.start), h = Math.min(u.count, a.start + a.count); c < h; c++ ) { var d = u.getX(c) ;(Op.fromBufferAttribute(l, d), Bp(Op, d, s, r, e, t, this)) } else for ( var f = Math.max(0, a.start), p = Math.min(l.count, a.start + a.count); f < p; f++ ) (Op.fromBufferAttribute(l, f), Bp(Op, f, s, r, e, t, this)) } }, }, { key: 'updateMorphTargets', value: function () { var e = this.geometry.morphAttributes, t = Object.keys(e) if (t.length > 0) { var n = e[t[0]] if (void 0 !== n) { ;((this.morphTargetInfluences = []), (this.morphTargetDictionary = {})) for (var r = 0, i = n.length; r < i; r++) { var a = n[r].name || String(r) ;(this.morphTargetInfluences.push(0), (this.morphTargetDictionary[a] = r)) } } } }, }, ]) ) })(gd) function Bp(e, t, n, r, i, a, o) { var s = Lp.distanceSqToPoint(e) if (s < n) { var u = new ph() ;(Lp.closestPointToPoint(e, u), u.applyMatrix4(r)) var l = i.ray.origin.distanceTo(u) if (l < i.near || l > i.far) return a.push({ distance: l, distanceToRay: Math.sqrt(s), point: u, index: t, face: null, faceIndex: null, barycoord: null, object: o, }) } } var Up = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [{ width: e, height: n }])).isFramebufferTexture = !0), (r.magFilter = sl), (r.minFilter = sl), (r.generateMipmaps = !1), (r.needsUpdate = !0), r ) } return (x(t, e), T(t)) })(sh), zp = (function (e) { function t(e, n, r, i, a, o, s, u, l) { var c, h = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : Tl if ((A(this, t), h !== Tl && h !== Ml)) throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ) return ( void 0 === r && h === Tl && (r = gl), void 0 === r && h === Ml && (r = Sl), ((c = y(this, t, [null, i, a, o, s, u, h, r, l])).isDepthTexture = !0), (c.image = { width: e, height: n }), (c.magFilter = void 0 !== s ? s : sl), (c.minFilter = void 0 !== u ? u : sl), (c.flipY = !1), (c.generateMipmaps = !1), (c.compareFunction = null), c ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.compareFunction = e.compareFunction), this ) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( null !== this.compareFunction && (r.compareFunction = this.compareFunction), r ) }, }, ]) ) })(sh), Vp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 32, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1, s = arguments.length > 5 && void 0 !== arguments[5] && arguments[5], u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0, l = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 2 * Math.PI ;(A(this, t), ((e = y(this, t)).type = 'CylinderGeometry'), (e.parameters = { radiusTop: n, radiusBottom: r, height: i, radialSegments: a, heightSegments: o, openEnded: s, thetaStart: u, thetaLength: l, })) var c = e ;((a = Math.floor(a)), (o = Math.floor(o))) var h = [], d = [], f = [], p = [], v = 0, m = [], g = i / 2, _ = 0 function b(e) { for ( var t = v, i = new Vc(), o = new ph(), s = 0, m = !0 === e ? n : r, y = !0 === e ? 1 : -1, b = 1; b <= a; b++ ) (d.push(0, g * y, 0), f.push(0, y, 0), p.push(0.5, 0.5), v++) for (var x = v, S = 0; S <= a; S++) { var A = (S / a) * l + u, w = Math.cos(A), T = Math.sin(A) ;((o.x = m * T), (o.y = g * y), (o.z = m * w), d.push(o.x, o.y, o.z), f.push(0, y, 0), (i.x = 0.5 * w + 0.5), (i.y = 0.5 * T * y + 0.5), p.push(i.x, i.y), v++) } for (var M = 0; M < a; M++) { var E = t + M, C = x + M ;(!0 === e ? h.push(C, C + 1, E) : h.push(C + 1, C, E), (s += 3)) } ;(c.addGroup(_, s, !0 === e ? 1 : 2), (_ += s)) } return ( (function () { for ( var e = new ph(), t = new ph(), s = 0, y = (r - n) / i, b = 0; b <= o; b++ ) { for (var x = [], S = b / o, A = S * (r - n) + n, w = 0; w <= a; w++) { var T = w / a, M = T * l + u, E = Math.sin(M), C = Math.cos(M) ;((t.x = A * E), (t.y = -S * i + g), (t.z = A * C), d.push(t.x, t.y, t.z), e.set(E, y, C).normalize(), f.push(e.x, e.y, e.z), p.push(T, 1 - S), x.push(v++)) } m.push(x) } for (var k = 0; k < a; k++) for (var R = 0; R < o; R++) { var I = m[R][k], N = m[R + 1][k], P = m[R + 1][k + 1], L = m[R][k + 1] ;((n > 0 || 0 !== R) && (h.push(I, N, L), (s += 3)), (r > 0 || R !== o - 1) && (h.push(N, P, L), (s += 3))) } ;(c.addGroup(_, s, 0), (_ += s)) })(), !1 === s && (n > 0 && b(!0), r > 0 && b(!1)), e.setIndex(h), e.setAttribute('position', new Kd(d, 3)), e.setAttribute('normal', new Kd(f, 3)), e.setAttribute('uv', new Kd(p, 2)), e ) } return ( x(t, e), T( t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.parameters = Object.assign({}, e.parameters)), this ) }, }, ], [ { key: 'fromJSON', value: function (e) { return new t( e.radiusTop, e.radiusBottom, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength ) }, }, ] ) ) })(af), Hp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 32, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1, o = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 2 * Math.PI return ( A(this, t), ((e = y(this, t, [0, n, r, i, a, o, s, u])).type = 'ConeGeometry'), (e.parameters = { radius: n, height: r, radialSegments: i, heightSegments: a, openEnded: o, thetaStart: s, thetaLength: u, }), e ) } return ( x(t, e), T(t, null, [ { key: 'fromJSON', value: function (e) { return new t( e.radius, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength ) }, }, ]) ) })(Vp), Wp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 ;(A(this, t), ((e = y(this, t)).type = 'PlaneGeometry'), (e.parameters = { width: n, height: r, widthSegments: i, heightSegments: a })) for ( var o = n / 2, s = r / 2, u = Math.floor(i), l = Math.floor(a), c = u + 1, h = l + 1, d = n / u, f = r / l, p = [], v = [], m = [], g = [], _ = 0; _ < h; _++ ) for (var b = _ * f - s, x = 0; x < c; x++) { var S = x * d - o ;(v.push(S, -b, 0), m.push(0, 0, 1), g.push(x / u), g.push(1 - _ / l)) } for (var w = 0; w < l; w++) for (var T = 0; T < u; T++) { var M = T + c * w, E = T + c * (w + 1), C = T + 1 + c * (w + 1), k = T + 1 + c * w ;(p.push(M, E, k), p.push(E, C, k)) } return ( e.setIndex(p), e.setAttribute('position', new Kd(v, 3)), e.setAttribute('normal', new Kd(m, 3)), e.setAttribute('uv', new Kd(g, 2)), e ) } return ( x(t, e), T( t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.parameters = Object.assign({}, e.parameters)), this ) }, }, ], [ { key: 'fromJSON', value: function (e) { return new t(e.width, e.height, e.widthSegments, e.heightSegments) }, }, ] ) ) })(af), Gp = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 32, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 16, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 2 * Math.PI, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : Math.PI ;(A(this, t), ((e = y(this, t)).type = 'SphereGeometry'), (e.parameters = { radius: n, widthSegments: r, heightSegments: i, phiStart: a, phiLength: o, thetaStart: s, thetaLength: u, }), (r = Math.max(3, Math.floor(r))), (i = Math.max(2, Math.floor(i)))) for ( var l = Math.min(s + u, Math.PI), c = 0, h = [], d = new ph(), f = new ph(), p = [], v = [], m = [], g = [], _ = 0; _ <= i; _++ ) { var b = [], x = _ / i, S = 0 0 === _ && 0 === s ? (S = 0.5 / r) : _ === i && l === Math.PI && (S = -0.5 / r) for (var w = 0; w <= r; w++) { var T = w / r ;((d.x = -n * Math.cos(a + T * o) * Math.sin(s + x * u)), (d.y = n * Math.cos(s + x * u)), (d.z = n * Math.sin(a + T * o) * Math.sin(s + x * u)), v.push(d.x, d.y, d.z), f.copy(d).normalize(), m.push(f.x, f.y, f.z), g.push(T + S, 1 - x), b.push(c++)) } h.push(b) } for (var M = 0; M < i; M++) for (var E = 0; E < r; E++) { var C = h[M][E + 1], k = h[M][E], R = h[M + 1][E], I = h[M + 1][E + 1] ;((0 !== M || s > 0) && p.push(C, k, I), (M !== i - 1 || l < Math.PI) && p.push(k, R, I)) } return ( e.setIndex(p), e.setAttribute('position', new Kd(v, 3)), e.setAttribute('normal', new Kd(m, 3)), e.setAttribute('uv', new Kd(g, 2)), e ) } return ( x(t, e), T( t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.parameters = Object.assign({}, e.parameters)), this ) }, }, ], [ { key: 'fromJSON', value: function (e) { return new t( e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength ) }, }, ] ) ) })(af), jp = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isMeshStandardMaterial = !0), (n.type = 'MeshStandardMaterial'), (n.defines = { STANDARD: '' }), (n.color = new Od(16777215)), (n.roughness = 1), (n.metalness = 0), (n.map = null), (n.lightMap = null), (n.lightMapIntensity = 1), (n.aoMap = null), (n.aoMapIntensity = 1), (n.emissive = new Od(0)), (n.emissiveIntensity = 1), (n.emissiveMap = null), (n.bumpMap = null), (n.bumpScale = 1), (n.normalMap = null), (n.normalMapType = 0), (n.normalScale = new Vc(1, 1)), (n.displacementMap = null), (n.displacementScale = 1), (n.displacementBias = 0), (n.roughnessMap = null), (n.metalnessMap = null), (n.alphaMap = null), (n.envMap = null), (n.envMapRotation = new ed()), (n.envMapIntensity = 1), (n.wireframe = !1), (n.wireframeLinewidth = 1), (n.wireframeLinecap = 'round'), (n.wireframeLinejoin = 'round'), (n.flatShading = !1), (n.fog = !0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.defines = { STANDARD: '' }), this.color.copy(e.color), (this.roughness = e.roughness), (this.metalness = e.metalness), (this.map = e.map), (this.lightMap = e.lightMap), (this.lightMapIntensity = e.lightMapIntensity), (this.aoMap = e.aoMap), (this.aoMapIntensity = e.aoMapIntensity), this.emissive.copy(e.emissive), (this.emissiveMap = e.emissiveMap), (this.emissiveIntensity = e.emissiveIntensity), (this.bumpMap = e.bumpMap), (this.bumpScale = e.bumpScale), (this.normalMap = e.normalMap), (this.normalMapType = e.normalMapType), this.normalScale.copy(e.normalScale), (this.displacementMap = e.displacementMap), (this.displacementScale = e.displacementScale), (this.displacementBias = e.displacementBias), (this.roughnessMap = e.roughnessMap), (this.metalnessMap = e.metalnessMap), (this.alphaMap = e.alphaMap), (this.envMap = e.envMap), this.envMapRotation.copy(e.envMapRotation), (this.envMapIntensity = e.envMapIntensity), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), (this.wireframeLinecap = e.wireframeLinecap), (this.wireframeLinejoin = e.wireframeLinejoin), (this.flatShading = e.flatShading), (this.fog = e.fog), this ) }, }, ]) ) })(Ud), Qp = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isMeshPhysicalMaterial = !0), (n.defines = { STANDARD: '', PHYSICAL: '' }), (n.type = 'MeshPhysicalMaterial'), (n.anisotropyRotation = 0), (n.anisotropyMap = null), (n.clearcoatMap = null), (n.clearcoatRoughness = 0), (n.clearcoatRoughnessMap = null), (n.clearcoatNormalScale = new Vc(1, 1)), (n.clearcoatNormalMap = null), (n.ior = 1.5), Object.defineProperty(n, 'reflectivity', { get: function () { return Dc((2.5 * (this.ior - 1)) / (this.ior + 1), 0, 1) }, set: function (e) { this.ior = (1 + 0.4 * e) / (1 - 0.4 * e) }, }), (n.iridescenceMap = null), (n.iridescenceIOR = 1.3), (n.iridescenceThicknessRange = [100, 400]), (n.iridescenceThicknessMap = null), (n.sheenColor = new Od(0)), (n.sheenColorMap = null), (n.sheenRoughness = 1), (n.sheenRoughnessMap = null), (n.transmissionMap = null), (n.thickness = 0), (n.thicknessMap = null), (n.attenuationDistance = 1 / 0), (n.attenuationColor = new Od(1, 1, 1)), (n.specularIntensity = 1), (n.specularIntensityMap = null), (n.specularColor = new Od(1, 1, 1)), (n.specularColorMap = null), (n._anisotropy = 0), (n._clearcoat = 0), (n._dispersion = 0), (n._iridescence = 0), (n._sheen = 0), (n._transmission = 0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'anisotropy', get: function () { return this._anisotropy }, set: function (e) { ;(this._anisotropy > 0 != e > 0 && this.version++, (this._anisotropy = e)) }, }, { key: 'clearcoat', get: function () { return this._clearcoat }, set: function (e) { ;(this._clearcoat > 0 != e > 0 && this.version++, (this._clearcoat = e)) }, }, { key: 'iridescence', get: function () { return this._iridescence }, set: function (e) { ;(this._iridescence > 0 != e > 0 && this.version++, (this._iridescence = e)) }, }, { key: 'dispersion', get: function () { return this._dispersion }, set: function (e) { ;(this._dispersion > 0 != e > 0 && this.version++, (this._dispersion = e)) }, }, { key: 'sheen', get: function () { return this._sheen }, set: function (e) { ;(this._sheen > 0 != e > 0 && this.version++, (this._sheen = e)) }, }, { key: 'transmission', get: function () { return this._transmission }, set: function (e) { ;(this._transmission > 0 != e > 0 && this.version++, (this._transmission = e)) }, }, { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.defines = { STANDARD: '', PHYSICAL: '' }), (this.anisotropy = e.anisotropy), (this.anisotropyRotation = e.anisotropyRotation), (this.anisotropyMap = e.anisotropyMap), (this.clearcoat = e.clearcoat), (this.clearcoatMap = e.clearcoatMap), (this.clearcoatRoughness = e.clearcoatRoughness), (this.clearcoatRoughnessMap = e.clearcoatRoughnessMap), (this.clearcoatNormalMap = e.clearcoatNormalMap), this.clearcoatNormalScale.copy(e.clearcoatNormalScale), (this.dispersion = e.dispersion), (this.ior = e.ior), (this.iridescence = e.iridescence), (this.iridescenceMap = e.iridescenceMap), (this.iridescenceIOR = e.iridescenceIOR), (this.iridescenceThicknessRange = I(e.iridescenceThicknessRange)), (this.iridescenceThicknessMap = e.iridescenceThicknessMap), (this.sheen = e.sheen), this.sheenColor.copy(e.sheenColor), (this.sheenColorMap = e.sheenColorMap), (this.sheenRoughness = e.sheenRoughness), (this.sheenRoughnessMap = e.sheenRoughnessMap), (this.transmission = e.transmission), (this.transmissionMap = e.transmissionMap), (this.thickness = e.thickness), (this.thicknessMap = e.thicknessMap), (this.attenuationDistance = e.attenuationDistance), this.attenuationColor.copy(e.attenuationColor), (this.specularIntensity = e.specularIntensity), (this.specularIntensityMap = e.specularIntensityMap), this.specularColor.copy(e.specularColor), (this.specularColorMap = e.specularColorMap), this ) }, }, ]) ) })(jp), qp = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isMeshDepthMaterial = !0), (n.type = 'MeshDepthMaterial'), (n.depthPacking = 3200), (n.map = null), (n.alphaMap = null), (n.displacementMap = null), (n.displacementScale = 1), (n.displacementBias = 0), (n.wireframe = !1), (n.wireframeLinewidth = 1), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.depthPacking = e.depthPacking), (this.map = e.map), (this.alphaMap = e.alphaMap), (this.displacementMap = e.displacementMap), (this.displacementScale = e.displacementScale), (this.displacementBias = e.displacementBias), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this ) }, }, ]) ) })(Ud), Xp = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).isMeshDistanceMaterial = !0), (n.type = 'MeshDistanceMaterial'), (n.map = null), (n.alphaMap = null), (n.displacementMap = null), (n.displacementScale = 1), (n.displacementBias = 0), n.setValues(e), n ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.map = e.map), (this.alphaMap = e.alphaMap), (this.displacementMap = e.displacementMap), (this.displacementScale = e.displacementScale), (this.displacementBias = e.displacementBias), this ) }, }, ]) ) })(Ud) function Yp(e, t, n) { return !e || (!n && e.constructor === t) ? e : 'number' == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e) } function Kp(e) { for (var t = e.length, n = new Array(t), r = 0; r !== t; ++r) n[r] = r return ( n.sort(function (t, n) { return e[t] - e[n] }), n ) } function Zp(e, t, n) { for (var r = e.length, i = new e.constructor(r), a = 0, o = 0; o !== r; ++a) for (var s = n[a] * t, u = 0; u !== t; ++u) i[o++] = e[s + u] return i } function Jp(e, t, n, r) { for (var i = 1, a = e[0]; void 0 !== a && void 0 === a[r]; ) a = e[i++] if (void 0 !== a) { var o = a[r] if (void 0 !== o) if (Array.isArray(o)) do { ;(void 0 !== (o = a[r]) && (t.push(a.time), n.push.apply(n, o)), (a = e[i++])) } while (void 0 !== a) else if (void 0 !== o.toArray) do { ;(void 0 !== (o = a[r]) && (t.push(a.time), o.toArray(n, n.length)), (a = e[i++])) } while (void 0 !== a) else do { ;(void 0 !== (o = a[r]) && (t.push(a.time), n.push(o)), (a = e[i++])) } while (void 0 !== a) } } var $p = (function () { return T( function e(t, n, r, i) { ;(A(this, e), (this.parameterPositions = t), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== i ? i : new n.constructor(r)), (this.sampleValues = n), (this.valueSize = r), (this.settings = null), (this.DefaultSettings_ = {})) }, [ { key: 'evaluate', value: function (e) { var t = this.parameterPositions, n = this._cachedIndex, r = t[n], i = t[n - 1] e: { t: { var a n: { r: if (!(e < r)) { for (var o = n + 2; ; ) { if (void 0 === r) { if (e < i) break r return ( (n = t.length), (this._cachedIndex = n), this.copySampleValue_(n - 1) ) } if (n === o) break if (((i = r), e < (r = t[++n]))) break t } a = t.length break n } if (e >= i) break e var s = t[1] e < s && ((n = 2), (i = s)) for (var u = n - 2; ; ) { if (void 0 === i) return ((this._cachedIndex = 0), this.copySampleValue_(0)) if (n === u) break if (((r = i), e >= (i = t[--n - 1]))) break t } ;((a = n), (n = 0)) } for (; n < a; ) { var l = (n + a) >>> 1 e < t[l] ? (a = l) : (n = l + 1) } if (((r = t[n]), void 0 === (i = t[n - 1]))) return ((this._cachedIndex = 0), this.copySampleValue_(0)) if (void 0 === r) return ( (n = t.length), (this._cachedIndex = n), this.copySampleValue_(n - 1) ) } ;((this._cachedIndex = n), this.intervalChanged_(n, i, r)) } return this.interpolate_(n, i, e, r) }, }, { key: 'getSettings_', value: function () { return this.settings || this.DefaultSettings_ }, }, { key: 'copySampleValue_', value: function (e) { for ( var t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r, a = 0; a !== r; ++a ) t[a] = n[i + a] return t }, }, { key: 'interpolate_', value: function () { throw new Error('call to abstract method') }, }, { key: 'intervalChanged_', value: function () {} }, ] ) })(), ev = (function (e) { function t(e, n, r, i) { var a return ( A(this, t), ((a = y(this, t, [e, n, r, i]))._weightPrev = -0), (a._offsetPrev = -0), (a._weightNext = -0), (a._offsetNext = -0), (a.DefaultSettings_ = { endingStart: pc, endingEnd: pc }), a ) } return ( x(t, e), T(t, [ { key: 'intervalChanged_', value: function (e, t, n) { var r = this.parameterPositions, i = e - 2, a = e + 1, o = r[i], s = r[a] if (void 0 === o) switch (this.getSettings_().endingStart) { case vc: ;((i = e), (o = 2 * t - n)) break case mc: o = t + r[(i = r.length - 2)] - r[i + 1] break default: ;((i = e), (o = n)) } if (void 0 === s) switch (this.getSettings_().endingEnd) { case vc: ;((a = e), (s = 2 * n - t)) break case mc: ;((a = 1), (s = n + r[1] - r[0])) break default: ;((a = e - 1), (s = t)) } var u = 0.5 * (n - t), l = this.valueSize ;((this._weightPrev = u / (t - o)), (this._weightNext = u / (s - n)), (this._offsetPrev = i * l), (this._offsetNext = a * l)) }, }, { key: 'interpolate_', value: function (e, t, n, r) { for ( var i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = e * o, u = s - o, l = this._offsetPrev, c = this._offsetNext, h = this._weightPrev, d = this._weightNext, f = (n - t) / (r - t), p = f * f, v = p * f, m = -h * v + 2 * h * p - h * f, g = (1 + h) * v + (-1.5 - 2 * h) * p + (-0.5 + h) * f + 1, y = (-1 - d) * v + (1.5 + d) * p + 0.5 * f, _ = d * v - d * p, b = 0; b !== o; ++b ) i[b] = m * a[l + b] + g * a[u + b] + y * a[s + b] + _ * a[c + b] return i }, }, ]) ) })($p), tv = (function (e) { function t(e, n, r, i) { return (A(this, t), y(this, t, [e, n, r, i])) } return ( x(t, e), T(t, [ { key: 'interpolate_', value: function (e, t, n, r) { for ( var i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = e * o, u = s - o, l = (n - t) / (r - t), c = 1 - l, h = 0; h !== o; ++h ) i[h] = a[u + h] * c + a[s + h] * l return i }, }, ]) ) })($p), nv = (function (e) { function t(e, n, r, i) { return (A(this, t), y(this, t, [e, n, r, i])) } return ( x(t, e), T(t, [ { key: 'interpolate_', value: function (e) { return this.copySampleValue_(e - 1) }, }, ]) ) })($p), rv = (function () { return T( function e(t, n, r, i) { if ((A(this, e), void 0 === t)) throw new Error('THREE.KeyframeTrack: track name is undefined') if (void 0 === n || 0 === n.length) throw new Error('THREE.KeyframeTrack: no keyframes in track named ' + t) ;((this.name = t), (this.times = Yp(n, this.TimeBufferType)), (this.values = Yp(r, this.ValueBufferType)), this.setInterpolation(i || this.DefaultInterpolation)) }, [ { key: 'InterpolantFactoryMethodDiscrete', value: function (e) { return new nv(this.times, this.values, this.getValueSize(), e) }, }, { key: 'InterpolantFactoryMethodLinear', value: function (e) { return new tv(this.times, this.values, this.getValueSize(), e) }, }, { key: 'InterpolantFactoryMethodSmooth', value: function (e) { return new ev(this.times, this.values, this.getValueSize(), e) }, }, { key: 'setInterpolation', value: function (e) { var t switch (e) { case hc: t = this.InterpolantFactoryMethodDiscrete break case dc: t = this.InterpolantFactoryMethodLinear break case fc: t = this.InterpolantFactoryMethodSmooth } if (void 0 === t) { var n = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name if (void 0 === this.createInterpolant) { if (e === this.DefaultInterpolation) throw new Error(n) this.setInterpolation(this.DefaultInterpolation) } return (console.warn('THREE.KeyframeTrack:', n), this) } return ((this.createInterpolant = t), this) }, }, { key: 'getInterpolation', value: function () { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return hc case this.InterpolantFactoryMethodLinear: return dc case this.InterpolantFactoryMethodSmooth: return fc } }, }, { key: 'getValueSize', value: function () { return this.values.length / this.times.length }, }, { key: 'shift', value: function (e) { if (0 !== e) for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] += e return this }, }, { key: 'scale', value: function (e) { if (1 !== e) for (var t = this.times, n = 0, r = t.length; n !== r; ++n) t[n] *= e return this }, }, { key: 'trim', value: function (e, t) { for ( var n = this.times, r = n.length, i = 0, a = r - 1; i !== r && n[i] < e; ) ++i for (; -1 !== a && n[a] > t; ) --a if ((++a, 0 !== i || a !== r)) { i >= a && (i = (a = Math.max(a, 1)) - 1) var o = this.getValueSize() ;((this.times = n.slice(i, a)), (this.values = this.values.slice(i * o, a * o))) } return this }, }, { key: 'validate', value: function () { var e = !0, t = this.getValueSize() t - Math.floor(t) !== 0 && (console.error('THREE.KeyframeTrack: Invalid value size in track.', this), (e = !1)) var n = this.times, r = this.values, i = n.length 0 === i && (console.error('THREE.KeyframeTrack: Track is empty.', this), (e = !1)) for (var a, o = null, s = 0; s !== i; s++) { var u = n[s] if ('number' == typeof u && isNaN(u)) { ;(console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, s, u ), (e = !1)) break } if (null !== o && o > u) { ;(console.error('THREE.KeyframeTrack: Out of order keys.', this, s, u, o), (e = !1)) break } o = u } if ( void 0 !== r && ((a = r), ArrayBuffer.isView(a) && !(a instanceof DataView)) ) for (var l = 0, c = r.length; l !== c; ++l) { var h = r[l] if (isNaN(h)) { ;(console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, l, h ), (e = !1)) break } } return e }, }, { key: 'optimize', value: function () { for ( var e = this.times.slice(), t = this.values.slice(), n = this.getValueSize(), r = this.getInterpolation() === fc, i = e.length - 1, a = 1, o = 1; o < i; ++o ) { var s = !1, u = e[o] if (u !== e[o + 1] && (1 !== o || u !== e[0])) if (r) s = !0 else for (var l = o * n, c = l - n, h = l + n, d = 0; d !== n; ++d) { var f = t[l + d] if (f !== t[c + d] || f !== t[h + d]) { s = !0 break } } if (s) { if (o !== a) { e[a] = e[o] for (var p = o * n, v = a * n, m = 0; m !== n; ++m) t[v + m] = t[p + m] } ++a } } if (i > 0) { e[a] = e[i] for (var g = i * n, y = a * n, _ = 0; _ !== n; ++_) t[y + _] = t[g + _] ++a } return ( a !== e.length ? ((this.times = e.slice(0, a)), (this.values = t.slice(0, a * n))) : ((this.times = e), (this.values = t)), this ) }, }, { key: 'clone', value: function () { var e = this.times.slice(), t = this.values.slice(), n = new (0, this.constructor)(this.name, e, t) return ((n.createInterpolant = this.createInterpolant), n) }, }, ], [ { key: 'toJSON', value: function (e) { var t, n = e.constructor if (n.toJSON !== this.toJSON) t = n.toJSON(e) else { t = { name: e.name, times: Yp(e.times, Array), values: Yp(e.values, Array) } var r = e.getInterpolation() r !== e.DefaultInterpolation && (t.interpolation = r) } return ((t.type = e.ValueTypeName), t) }, }, ] ) })() ;((rv.prototype.TimeBufferType = Float32Array), (rv.prototype.ValueBufferType = Float32Array), (rv.prototype.DefaultInterpolation = dc)) var iv = (function (e) { function t(e, n, r) { return (A(this, t), y(this, t, [e, n, r])) } return (x(t, e), T(t)) })(rv) ;((iv.prototype.ValueTypeName = 'bool'), (iv.prototype.ValueBufferType = Array), (iv.prototype.DefaultInterpolation = hc), (iv.prototype.InterpolantFactoryMethodLinear = void 0), (iv.prototype.InterpolantFactoryMethodSmooth = void 0)) var av = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return (x(t, e), T(t)) })(rv) av.prototype.ValueTypeName = 'color' var ov = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return (x(t, e), T(t)) })(rv) ov.prototype.ValueTypeName = 'number' var sv = (function (e) { function t(e, n, r, i) { return (A(this, t), y(this, t, [e, n, r, i])) } return ( x(t, e), T(t, [ { key: 'interpolate_', value: function (e, t, n, r) { for ( var i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = (n - t) / (r - t), u = e * o, l = u + o; u !== l; u += 4 ) fh.slerpFlat(i, 0, a, u - o, a, u, s) return i }, }, ]) ) })($p), uv = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return ( x(t, e), T(t, [ { key: 'InterpolantFactoryMethodLinear', value: function (e) { return new sv(this.times, this.values, this.getValueSize(), e) }, }, ]) ) })(rv) ;((uv.prototype.ValueTypeName = 'quaternion'), (uv.prototype.InterpolantFactoryMethodSmooth = void 0)) var lv = (function (e) { function t(e, n, r) { return (A(this, t), y(this, t, [e, n, r])) } return (x(t, e), T(t)) })(rv) ;((lv.prototype.ValueTypeName = 'string'), (lv.prototype.ValueBufferType = Array), (lv.prototype.DefaultInterpolation = hc), (lv.prototype.InterpolantFactoryMethodLinear = void 0), (lv.prototype.InterpolantFactoryMethodSmooth = void 0)) var cv = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return (x(t, e), T(t)) })(rv) cv.prototype.ValueTypeName = 'vector' var hv = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '', n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : gc ;(A(this, e), (this.name = t), (this.tracks = r), (this.duration = n), (this.blendMode = i), (this.uuid = Lc()), this.duration < 0 && this.resetDuration()) }, [ { key: 'resetDuration', value: function () { for (var e = 0, t = 0, n = this.tracks.length; t !== n; ++t) { var r = this.tracks[t] e = Math.max(e, r.times[r.times.length - 1]) } return ((this.duration = e), this) }, }, { key: 'trim', value: function () { for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration) return this }, }, { key: 'validate', value: function () { for (var e = !0, t = 0; t < this.tracks.length; t++) e = e && this.tracks[t].validate() return e }, }, { key: 'optimize', value: function () { for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize() return this }, }, { key: 'clone', value: function () { for (var e = [], t = 0; t < this.tracks.length; t++) e.push(this.tracks[t].clone()) return new this.constructor(this.name, this.duration, e, this.blendMode) }, }, { key: 'toJSON', value: function () { return this.constructor.toJSON(this) }, }, ], [ { key: 'parse', value: function (e) { for ( var t = [], n = e.tracks, r = 1 / (e.fps || 1), i = 0, a = n.length; i !== a; ++i ) t.push(dv(n[i]).scale(r)) var o = new this(e.name, e.duration, t, e.blendMode) return ((o.uuid = e.uuid), o) }, }, { key: 'toJSON', value: function (e) { for ( var t = [], n = e.tracks, r = { name: e.name, duration: e.duration, tracks: t, uuid: e.uuid, blendMode: e.blendMode, }, i = 0, a = n.length; i !== a; ++i ) t.push(rv.toJSON(n[i])) return r }, }, { key: 'CreateFromMorphTargetSequence', value: function (e, t, n, r) { for (var i = t.length, a = [], o = 0; o < i; o++) { var s = [], u = [] ;(s.push((o + i - 1) % i, o, (o + 1) % i), u.push(0, 1, 0)) var l = Kp(s) ;((s = Zp(s, 1, l)), (u = Zp(u, 1, l)), r || 0 !== s[0] || (s.push(i), u.push(u[0])), a.push( new ov('.morphTargetInfluences[' + t[o].name + ']', s, u).scale(1 / n) )) } return new this(e, -1, a) }, }, { key: 'findByName', value: function (e, t) { var n = e if (!Array.isArray(e)) { var r = e n = (r.geometry && r.geometry.animations) || r.animations } for (var i = 0; i < n.length; i++) if (n[i].name === t) return n[i] return null }, }, { key: 'CreateClipsFromMorphTargetSequences', value: function (e, t, n) { for (var r = {}, i = /^([\w-]*?)([\d]+)$/, a = 0, o = e.length; a < o; a++) { var s = e[a], u = s.name.match(i) if (u && u.length > 1) { var l = u[1], c = r[l] ;(c || (r[l] = c = []), c.push(s)) } } var h = [] for (var d in r) h.push(this.CreateFromMorphTargetSequence(d, r[d], t, n)) return h }, }, { key: 'parseAnimation', value: function (e, t) { if (!e) return ( console.error('THREE.AnimationClip: No animation in JSONLoader data.'), null ) for ( var n = function (e, t, n, r, i) { if (0 !== n.length) { var a = [], o = [] ;(Jp(n, a, o, r), 0 !== a.length && i.push(new e(t, a, o))) } }, r = [], i = e.name || 'default', a = e.fps || 30, o = e.blendMode, s = e.length || -1, u = e.hierarchy || [], l = 0; l < u.length; l++ ) { var c = u[l].keys if (c && 0 !== c.length) if (c[0].morphTargets) { var h = {}, d = void 0 for (d = 0; d < c.length; d++) if (c[d].morphTargets) for (var f = 0; f < c[d].morphTargets.length; f++) h[c[d].morphTargets[f]] = -1 for (var p in h) { for (var v = [], m = [], g = 0; g !== c[d].morphTargets.length; ++g) { var y = c[d] ;(v.push(y.time), m.push(y.morphTarget === p ? 1 : 0)) } r.push(new ov('.morphTargetInfluence[' + p + ']', v, m)) } s = h.length * a } else { var _ = '.bones[' + t[l].name + ']' ;(n(cv, _ + '.position', c, 'pos', r), n(uv, _ + '.quaternion', c, 'rot', r), n(cv, _ + '.scale', c, 'scl', r)) } } return 0 === r.length ? null : new this(i, s, r, o) }, }, ] ) })() function dv(e) { if (void 0 === e.type) throw new Error('THREE.KeyframeTrack: track type undefined, can not parse') var t = (function (e) { switch (e.toLowerCase()) { case 'scalar': case 'double': case 'float': case 'number': case 'integer': return ov case 'vector': case 'vector2': case 'vector3': case 'vector4': return cv case 'color': return av case 'quaternion': return uv case 'bool': case 'boolean': return iv case 'string': return lv } throw new Error('THREE.KeyframeTrack: Unsupported typeName: ' + e) })(e.type) if (void 0 === e.times) { var n = [], r = [] ;(Jp(e.keys, n, r, 'value'), (e.times = n), (e.values = r)) } return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation) } var fv = { enabled: !1, files: {}, add: function (e, t) { !1 !== this.enabled && (this.files[e] = t) }, get: function (e) { if (!1 !== this.enabled) return this.files[e] }, remove: function (e) { delete this.files[e] }, clear: function () { this.files = {} }, }, pv = T(function e(t, n, r) { A(this, e) var i = this, a = !1, o = 0, s = 0, u = void 0, l = [] ;((this.onStart = void 0), (this.onLoad = t), (this.onProgress = n), (this.onError = r), (this.itemStart = function (e) { ;(s++, !1 === a && void 0 !== i.onStart && i.onStart(e, o, s), (a = !0)) }), (this.itemEnd = function (e) { ;(o++, void 0 !== i.onProgress && i.onProgress(e, o, s), o === s && ((a = !1), void 0 !== i.onLoad && i.onLoad())) }), (this.itemError = function (e) { void 0 !== i.onError && i.onError(e) }), (this.resolveURL = function (e) { return u ? u(e) : e }), (this.setURLModifier = function (e) { return ((u = e), this) }), (this.addHandler = function (e, t) { return (l.push(e, t), this) }), (this.removeHandler = function (e) { var t = l.indexOf(e) return (-1 !== t && l.splice(t, 2), this) }), (this.getHandler = function (e) { for (var t = 0, n = l.length; t < n; t += 2) { var r = l[t], i = l[t + 1] if ((r.global && (r.lastIndex = 0), r.test(e))) return i } return null })) }), vv = new pv(), mv = (function () { return T( function e(t) { ;(A(this, e), (this.manager = void 0 !== t ? t : vv), (this.crossOrigin = 'anonymous'), (this.withCredentials = !1), (this.path = ''), (this.resourcePath = ''), (this.requestHeader = {})) }, [ { key: 'load', value: function () {} }, { key: 'loadAsync', value: function (e, t) { var n = this return new Promise(function (r, i) { n.load(e, r, t, i) }) }, }, { key: 'parse', value: function () {} }, { key: 'setCrossOrigin', value: function (e) { return ((this.crossOrigin = e), this) }, }, { key: 'setWithCredentials', value: function (e) { return ((this.withCredentials = e), this) }, }, { key: 'setPath', value: function (e) { return ((this.path = e), this) }, }, { key: 'setResourcePath', value: function (e) { return ((this.resourcePath = e), this) }, }, { key: 'setRequestHeader', value: function (e) { return ((this.requestHeader = e), this) }, }, ] ) })() mv.DEFAULT_MATERIAL_NAME = '__DEFAULT' var gv = {}, yv = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [e])).response = n), r) } return (x(t, e), T(t)) })(m(Error)), _v = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return ( x(t, e), T(t, [ { key: 'load', value: function (e, t, n, r) { var i = this ;(void 0 === e && (e = ''), void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e))) var a = fv.get(e) if (void 0 !== a) return ( this.manager.itemStart(e), setTimeout(function () { ;(t && t(a), i.manager.itemEnd(e)) }, 0), a ) if (void 0 === gv[e]) { ;((gv[e] = []), gv[e].push({ onLoad: t, onProgress: n, onError: r })) var o = new Request(e, { headers: new Headers(this.requestHeader), credentials: this.withCredentials ? 'include' : 'same-origin', }), s = this.mimeType, u = this.responseType ;(fetch(o) .then(function (t) { if (200 === t.status || 0 === t.status) { if ( (0 === t.status && console.warn('THREE.FileLoader: HTTP Status 0 received.'), 'undefined' == typeof ReadableStream || void 0 === t.body || void 0 === t.body.getReader) ) return t var n = gv[e], r = t.body.getReader(), i = t.headers.get('X-File-Size') || t.headers.get('Content-Length'), a = i ? parseInt(i) : 0, o = 0 !== a, s = 0, u = new ReadableStream({ start: function (e) { !(function t() { r.read().then( function (r) { var i = r.done, u = r.value if (i) e.close() else { s += u.byteLength for ( var l = new ProgressEvent('progress', { lengthComputable: o, loaded: s, total: a, }), c = 0, h = n.length; c < h; c++ ) { var d = n[c] d.onProgress && d.onProgress(l) } ;(e.enqueue(u), t()) } }, function (t) { e.error(t) } ) })() }, }) return new Response(u) } throw new yv( 'fetch for "' .concat(t.url, '" responded with ') .concat(t.status, ': ') .concat(t.statusText), t ) }) .then(function (e) { switch (u) { case 'arraybuffer': return e.arrayBuffer() case 'blob': return e.blob() case 'document': return e.text().then(function (e) { return new DOMParser().parseFromString(e, s) }) case 'json': return e.json() default: if (void 0 === s) return e.text() var t = /charset="?([^;"\s]*)"?/i.exec(s), n = t && t[1] ? t[1].toLowerCase() : void 0, r = new TextDecoder(n) return e.arrayBuffer().then(function (e) { return r.decode(e) }) } }) .then(function (t) { fv.add(e, t) var n = gv[e] delete gv[e] for (var r = 0, i = n.length; r < i; r++) { var a = n[r] a.onLoad && a.onLoad(t) } }) .catch(function (t) { var n = gv[e] if (void 0 === n) throw (i.manager.itemError(e), t) delete gv[e] for (var r = 0, a = n.length; r < a; r++) { var o = n[r] o.onError && o.onError(t) } i.manager.itemError(e) }) .finally(function () { i.manager.itemEnd(e) }), this.manager.itemStart(e)) } else gv[e].push({ onLoad: t, onProgress: n, onError: r }) }, }, { key: 'setResponseType', value: function (e) { return ((this.responseType = e), this) }, }, { key: 'setMimeType', value: function (e) { return ((this.mimeType = e), this) }, }, ]) ) })(mv), bv = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return ( x(t, e), T(t, [ { key: 'load', value: function (e, t, n, r) { ;(void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e))) var i = this, a = fv.get(e) if (void 0 !== a) return ( i.manager.itemStart(e), setTimeout(function () { ;(t && t(a), i.manager.itemEnd(e)) }, 0), a ) var o = jc('img') function s() { ;(l(), fv.add(e, this), t && t(this), i.manager.itemEnd(e)) } function u(t) { ;(l(), r && r(t), i.manager.itemError(e), i.manager.itemEnd(e)) } function l() { ;(o.removeEventListener('load', s, !1), o.removeEventListener('error', u, !1)) } return ( o.addEventListener('load', s, !1), o.addEventListener('error', u, !1), 'data:' !== e.slice(0, 5) && void 0 !== this.crossOrigin && (o.crossOrigin = this.crossOrigin), i.manager.itemStart(e), (o.src = e), o ) }, }, ]) ) })(mv), xv = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return ( x(t, e), T(t, [ { key: 'load', value: function (e, t, n, r) { var i = new sh(), a = new bv(this.manager) return ( a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load( e, function (e) { ;((i.image = e), (i.needsUpdate = !0), void 0 !== t && t(i)) }, n, r ), i ) }, }, ]) ) })(mv), Sv = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return ( A(this, t), ((n = y(this, t)).isLight = !0), (n.type = 'Light'), (n.color = new Od(e)), (n.intensity = r), n ) } return ( x(t, e), T(t, [ { key: 'dispose', value: function () {} }, { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), this.color.copy(e.color), (this.intensity = e.intensity), this ) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( (r.object.color = this.color.getHex()), (r.object.intensity = this.intensity), void 0 !== this.groundColor && (r.object.groundColor = this.groundColor.getHex()), void 0 !== this.distance && (r.object.distance = this.distance), void 0 !== this.angle && (r.object.angle = this.angle), void 0 !== this.decay && (r.object.decay = this.decay), void 0 !== this.penumbra && (r.object.penumbra = this.penumbra), void 0 !== this.shadow && (r.object.shadow = this.shadow.toJSON()), void 0 !== this.target && (r.object.target = this.target.uuid), r ) }, }, ]) ) })(gd), Av = new Gh(), wv = new ph(), Tv = new ph(), Mv = (function () { return T( function e(t) { ;(A(this, e), (this.camera = t), (this.intensity = 1), (this.bias = 0), (this.normalBias = 0), (this.radius = 1), (this.blurSamples = 8), (this.mapSize = new Vc(512, 512)), (this.map = null), (this.mapPass = null), (this.matrix = new Gh()), (this.autoUpdate = !0), (this.needsUpdate = !1), (this._frustum = new gp()), (this._frameExtents = new Vc(1, 1)), (this._viewportCount = 1), (this._viewports = [new uh(0, 0, 1, 1)])) }, [ { key: 'getViewportCount', value: function () { return this._viewportCount }, }, { key: 'getFrustum', value: function () { return this._frustum }, }, { key: 'updateMatrices', value: function (e) { var t = this.camera, n = this.matrix ;(wv.setFromMatrixPosition(e.matrixWorld), t.position.copy(wv), Tv.setFromMatrixPosition(e.target.matrixWorld), t.lookAt(Tv), t.updateMatrixWorld(), Av.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Av), n.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1), n.multiply(Av)) }, }, { key: 'getViewport', value: function (e) { return this._viewports[e] }, }, { key: 'getFrameExtents', value: function () { return this._frameExtents }, }, { key: 'dispose', value: function () { ;(this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose()) }, }, { key: 'copy', value: function (e) { return ( (this.camera = e.camera.clone()), (this.intensity = e.intensity), (this.bias = e.bias), (this.radius = e.radius), this.mapSize.copy(e.mapSize), this ) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, { key: 'toJSON', value: function () { var e = {} return ( 1 !== this.intensity && (e.intensity = this.intensity), 0 !== this.bias && (e.bias = this.bias), 0 !== this.normalBias && (e.normalBias = this.normalBias), 1 !== this.radius && (e.radius = this.radius), (512 === this.mapSize.x && 512 === this.mapSize.y) || (e.mapSize = this.mapSize.toArray()), (e.camera = this.camera.toJSON(!1).object), delete e.camera.matrix, e ) }, }, ] ) })(), Ev = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t, [new kf(50, 1, 0.5, 500)])).isSpotLightShadow = !0), (e.focus = 1), e ) } return ( x(t, e), T(t, [ { key: 'updateMatrices', value: function (e) { var r = this.camera, i = 2 * Pc * e.angle * this.focus, a = this.mapSize.width / this.mapSize.height, o = e.distance || r.far ;((i === r.fov && a === r.aspect && o === r.far) || ((r.fov = i), (r.aspect = a), (r.far = o), r.updateProjectionMatrix()), n(t, 'updateMatrices', this, 3)([e])) }, }, { key: 'copy', value: function (e) { return (n(t, 'copy', this, 3)([e]), (this.focus = e.focus), this) }, }, ]) ) })(Mv), Cv = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Math.PI / 3, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 2 return ( A(this, t), ((r = y(this, t, [e, n])).isSpotLight = !0), (r.type = 'SpotLight'), r.position.copy(gd.DEFAULT_UP), r.updateMatrix(), (r.target = new gd()), (r.distance = i), (r.angle = a), (r.penumbra = o), (r.decay = s), (r.map = null), (r.shadow = new Ev()), r ) } return ( x(t, e), T(t, [ { key: 'power', get: function () { return this.intensity * Math.PI }, set: function (e) { this.intensity = e / Math.PI }, }, { key: 'dispose', value: function () { this.shadow.dispose() }, }, { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.distance = e.distance), (this.angle = e.angle), (this.penumbra = e.penumbra), (this.decay = e.decay), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this ) }, }, ]) ) })(Sv), kv = new Gh(), Rv = new ph(), Iv = new ph(), Nv = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t, [new kf(90, 1, 0.5, 500)])).isPointLightShadow = !0), (e._frameExtents = new Vc(4, 2)), (e._viewportCount = 6), (e._viewports = [ new uh(2, 1, 1, 1), new uh(0, 1, 1, 1), new uh(3, 1, 1, 1), new uh(1, 1, 1, 1), new uh(3, 0, 1, 1), new uh(1, 0, 1, 1), ]), (e._cubeDirections = [ new ph(1, 0, 0), new ph(-1, 0, 0), new ph(0, 0, 1), new ph(0, 0, -1), new ph(0, 1, 0), new ph(0, -1, 0), ]), (e._cubeUps = [ new ph(0, 1, 0), new ph(0, 1, 0), new ph(0, 1, 0), new ph(0, 1, 0), new ph(0, 0, 1), new ph(0, 0, -1), ]), e ) } return ( x(t, e), T(t, [ { key: 'updateMatrices', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = this.camera, r = this.matrix, i = e.distance || n.far ;(i !== n.far && ((n.far = i), n.updateProjectionMatrix()), Rv.setFromMatrixPosition(e.matrixWorld), n.position.copy(Rv), Iv.copy(n.position), Iv.add(this._cubeDirections[t]), n.up.copy(this._cubeUps[t]), n.lookAt(Iv), n.updateMatrixWorld(), r.makeTranslation(-Rv.x, -Rv.y, -Rv.z), kv.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse), this._frustum.setFromProjectionMatrix(kv)) }, }, ]) ) })(Mv), Pv = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 2 return ( A(this, t), ((r = y(this, t, [e, n])).isPointLight = !0), (r.type = 'PointLight'), (r.distance = i), (r.decay = a), (r.shadow = new Nv()), r ) } return ( x(t, e), T(t, [ { key: 'power', get: function () { return 4 * this.intensity * Math.PI }, set: function (e) { this.intensity = e / (4 * Math.PI) }, }, { key: 'dispose', value: function () { this.shadow.dispose() }, }, { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this ) }, }, ]) ) })(Sv), Lv = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : -1, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : -1, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0.1, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 2e3 return ( A(this, t), ((e = y(this, t)).isOrthographicCamera = !0), (e.type = 'OrthographicCamera'), (e.zoom = 1), (e.view = null), (e.left = n), (e.right = r), (e.top = i), (e.bottom = a), (e.near = o), (e.far = s), e.updateProjectionMatrix(), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e, r) { return ( n(t, 'copy', this, 3)([e, r]), (this.left = e.left), (this.right = e.right), (this.top = e.top), (this.bottom = e.bottom), (this.near = e.near), (this.far = e.far), (this.zoom = e.zoom), (this.view = null === e.view ? null : Object.assign({}, e.view)), this ) }, }, { key: 'setViewOffset', value: function (e, t, n, r, i, a) { ;(null === this.view && (this.view = { enabled: !0, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1, }), (this.view.enabled = !0), (this.view.fullWidth = e), (this.view.fullHeight = t), (this.view.offsetX = n), (this.view.offsetY = r), (this.view.width = i), (this.view.height = a), this.updateProjectionMatrix()) }, }, { key: 'clearViewOffset', value: function () { ;(null !== this.view && (this.view.enabled = !1), this.updateProjectionMatrix()) }, }, { key: 'updateProjectionMatrix', value: function () { var e = (this.right - this.left) / (2 * this.zoom), t = (this.top - this.bottom) / (2 * this.zoom), n = (this.right + this.left) / 2, r = (this.top + this.bottom) / 2, i = n - e, a = n + e, o = r + t, s = r - t if (null !== this.view && this.view.enabled) { var u = (this.right - this.left) / this.view.fullWidth / this.zoom, l = (this.top - this.bottom) / this.view.fullHeight / this.zoom ;((a = (i += u * this.view.offsetX) + u * this.view.width), (s = (o -= l * this.view.offsetY) - l * this.view.height)) } ;(this.projectionMatrix.makeOrthographic( i, a, o, s, this.near, this.far, this.coordinateSystem ), this.projectionMatrixInverse.copy(this.projectionMatrix).invert()) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( (r.object.zoom = this.zoom), (r.object.left = this.left), (r.object.right = this.right), (r.object.top = this.top), (r.object.bottom = this.bottom), (r.object.near = this.near), (r.object.far = this.far), null !== this.view && (r.object.view = Object.assign({}, this.view)), r ) }, }, ]) ) })(Tf), Dv = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t, [new Lv(-5, 5, 5, -5, 0.5, 500)])).isDirectionalLightShadow = !0), e ) } return (x(t, e), T(t)) })(Mv), Ov = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).isDirectionalLight = !0), (r.type = 'DirectionalLight'), r.position.copy(gd.DEFAULT_UP), r.updateMatrix(), (r.target = new gd()), (r.shadow = new Dv()), r ) } return ( x(t, e), T(t, [ { key: 'dispose', value: function () { this.shadow.dispose() }, }, { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this ) }, }, ]) ) })(Sv), Fv = (function () { return T( function e() { A(this, e) }, null, [ { key: 'decodeText', value: function (e) { if ( (console.warn( 'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.' ), 'undefined' != typeof TextDecoder) ) return new TextDecoder().decode(e) for (var t = '', n = 0, r = e.length; n < r; n++) t += String.fromCharCode(e[n]) try { return decodeURIComponent(escape(t)) } catch (ZJ) { return t } }, }, { key: 'extractUrlBase', value: function (e) { var t = e.lastIndexOf('/') return -1 === t ? './' : e.slice(0, t + 1) }, }, { key: 'resolveURL', value: function (e, t) { return 'string' != typeof e || '' === e ? '' : (/^https?:\/\//i.test(t) && /^\//.test(e) && (t = t.replace(/(^https?:\/\/[^\/]+).*/i, '$1')), /^(https?:)?\/\//i.test(e) || /^data:.*,.*$/i.test(e) || /^blob:.*$/i.test(e) ? e : t + e) }, }, ] ) })(), Bv = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isInstancedBufferGeometry = !0), (e.type = 'InstancedBufferGeometry'), (e.instanceCount = 1 / 0), e ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.instanceCount = e.instanceCount), this ) }, }, { key: 'toJSON', value: function () { var e = n(t, 'toJSON', this, 3)([]) return ( (e.instanceCount = this.instanceCount), (e.isInstancedBufferGeometry = !0), e ) }, }, ]) ) })(af), Uv = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, [e])).isImageBitmapLoader = !0), 'undefined' == typeof createImageBitmap && console.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.'), 'undefined' == typeof fetch && console.warn('THREE.ImageBitmapLoader: fetch() not supported.'), (n.options = { premultiplyAlpha: 'none' }), n ) } return ( x(t, e), T(t, [ { key: 'setOptions', value: function (e) { return ((this.options = e), this) }, }, { key: 'load', value: function (e, t, n, r) { ;(void 0 === e && (e = ''), void 0 !== this.path && (e = this.path + e), (e = this.manager.resolveURL(e))) var i = this, a = fv.get(e) if (void 0 !== a) return ( i.manager.itemStart(e), a.then ? void a .then(function (n) { ;(t && t(n), i.manager.itemEnd(e)) }) .catch(function (e) { r && r(e) }) : (setTimeout(function () { ;(t && t(a), i.manager.itemEnd(e)) }, 0), a) ) var o = {} ;((o.credentials = 'anonymous' === this.crossOrigin ? 'same-origin' : 'include'), (o.headers = this.requestHeader)) var s = fetch(e, o) .then(function (e) { return e.blob() }) .then(function (e) { return createImageBitmap( e, Object.assign(i.options, { colorSpaceConversion: 'none' }) ) }) .then(function (n) { return (fv.add(e, n), t && t(n), i.manager.itemEnd(e), n) }) .catch(function (t) { ;(r && r(t), fv.remove(e), i.manager.itemError(e), i.manager.itemEnd(e)) }) ;(fv.add(e, s), i.manager.itemStart(e)) }, }, ]) ) })(mv), zv = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [] return ( A(this, t), ((e = y(this, t)).isArrayCamera = !0), (e.cameras = n), (e.index = 0), e ) } return (x(t, e), T(t)) })(kf), Vv = (function () { return T( function e() { var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0] ;(A(this, e), (this.autoStart = t), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1)) }, [ { key: 'start', value: function () { ;((this.startTime = Hv()), (this.oldTime = this.startTime), (this.elapsedTime = 0), (this.running = !0)) }, }, { key: 'stop', value: function () { ;(this.getElapsedTime(), (this.running = !1), (this.autoStart = !1)) }, }, { key: 'getElapsedTime', value: function () { return (this.getDelta(), this.elapsedTime) }, }, { key: 'getDelta', value: function () { var e = 0 if (this.autoStart && !this.running) return (this.start(), 0) if (this.running) { var t = Hv() ;((e = (t - this.oldTime) / 1e3), (this.oldTime = t), (this.elapsedTime += e)) } return e }, }, ] ) })() function Hv() { return performance.now() } var Wv = (function () { return T( function e(t, n, r) { var i, a, o switch ((A(this, e), (this.binding = t), (this.valueSize = r), n)) { case 'quaternion': ;((i = this._slerp), (a = this._slerpAdditive), (o = this._setAdditiveIdentityQuaternion), (this.buffer = new Float64Array(6 * r)), (this._workIndex = 5)) break case 'string': case 'bool': ;((i = this._select), (a = this._select), (o = this._setAdditiveIdentityOther), (this.buffer = new Array(5 * r))) break default: ;((i = this._lerp), (a = this._lerpAdditive), (o = this._setAdditiveIdentityNumeric), (this.buffer = new Float64Array(5 * r))) } ;((this._mixBufferRegion = i), (this._mixBufferRegionAdditive = a), (this._setIdentity = o), (this._origIndex = 3), (this._addIndex = 4), (this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), (this.useCount = 0), (this.referenceCount = 0)) }, [ { key: 'accumulate', value: function (e, t) { var n = this.buffer, r = this.valueSize, i = e * r + r, a = this.cumulativeWeight if (0 === a) { for (var o = 0; o !== r; ++o) n[i + o] = n[o] a = t } else { var s = t / (a += t) this._mixBufferRegion(n, i, 0, s, r) } this.cumulativeWeight = a }, }, { key: 'accumulateAdditive', value: function (e) { var t = this.buffer, n = this.valueSize, r = n * this._addIndex ;(0 === this.cumulativeWeightAdditive && this._setIdentity(), this._mixBufferRegionAdditive(t, r, 0, e, n), (this.cumulativeWeightAdditive += e)) }, }, { key: 'apply', value: function (e) { var t = this.valueSize, n = this.buffer, r = e * t + t, i = this.cumulativeWeight, a = this.cumulativeWeightAdditive, o = this.binding if ( ((this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0), i < 1) ) { var s = t * this._origIndex this._mixBufferRegion(n, r, s, 1 - i, t) } a > 0 && this._mixBufferRegionAdditive(n, r, this._addIndex * t, 1, t) for (var u = t, l = t + t; u !== l; ++u) if (n[u] !== n[u + t]) { o.setValue(n, r) break } }, }, { key: 'saveOriginalState', value: function () { var e = this.binding, t = this.buffer, n = this.valueSize, r = n * this._origIndex e.getValue(t, r) for (var i = n, a = r; i !== a; ++i) t[i] = t[r + (i % n)] ;(this._setIdentity(), (this.cumulativeWeight = 0), (this.cumulativeWeightAdditive = 0)) }, }, { key: 'restoreOriginalState', value: function () { var e = 3 * this.valueSize this.binding.setValue(this.buffer, e) }, }, { key: '_setAdditiveIdentityNumeric', value: function () { for ( var e = this._addIndex * this.valueSize, t = e + this.valueSize, n = e; n < t; n++ ) this.buffer[n] = 0 }, }, { key: '_setAdditiveIdentityQuaternion', value: function () { ;(this._setAdditiveIdentityNumeric(), (this.buffer[this._addIndex * this.valueSize + 3] = 1)) }, }, { key: '_setAdditiveIdentityOther', value: function () { for ( var e = this._origIndex * this.valueSize, t = this._addIndex * this.valueSize, n = 0; n < this.valueSize; n++ ) this.buffer[t + n] = this.buffer[e + n] }, }, { key: '_select', value: function (e, t, n, r, i) { if (r >= 0.5) for (var a = 0; a !== i; ++a) e[t + a] = e[n + a] }, }, { key: '_slerp', value: function (e, t, n, r) { fh.slerpFlat(e, t, e, t, e, n, r) }, }, { key: '_slerpAdditive', value: function (e, t, n, r, i) { var a = this._workIndex * i ;(fh.multiplyQuaternionsFlat(e, a, e, t, e, n), fh.slerpFlat(e, t, e, t, e, a, r)) }, }, { key: '_lerp', value: function (e, t, n, r, i) { for (var a = 1 - r, o = 0; o !== i; ++o) { var s = t + o e[s] = e[s] * a + e[n + o] * r } }, }, { key: '_lerpAdditive', value: function (e, t, n, r, i) { for (var a = 0; a !== i; ++a) { var o = t + a e[o] = e[o] + e[n + a] * r } }, }, ] ) })(), Gv = '\\[\\]\\.:\\/', jv = new RegExp('[' + Gv + ']', 'g'), Qv = '[^' + Gv + ']', qv = '[^' + Gv.replace('\\.', '') + ']', Xv = new RegExp( '^' + /((?:WC+[\/:])*)/.source.replace('WC', Qv) + /(WCOD+)?/.source.replace('WCOD', qv) + /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace('WC', Qv) + /\.(WC+)(?:\[(.+)\])?/.source.replace('WC', Qv) + '$' ), Yv = ['material', 'materials', 'bones', 'map'], Kv = (function () { return T( function e(t, n, r) { A(this, e) var i = r || Zv.parseTrackName(n) ;((this._targetGroup = t), (this._bindings = t.subscribe_(n, i))) }, [ { key: 'getValue', value: function (e, t) { this.bind() var n = this._targetGroup.nCachedObjects_, r = this._bindings[n] void 0 !== r && r.getValue(e, t) }, }, { key: 'setValue', value: function (e, t) { for ( var n = this._bindings, r = this._targetGroup.nCachedObjects_, i = n.length; r !== i; ++r ) n[r].setValue(e, t) }, }, { key: 'bind', value: function () { for ( var e = this._bindings, t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t ) e[t].bind() }, }, { key: 'unbind', value: function () { for ( var e = this._bindings, t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t ) e[t].unbind() }, }, ] ) })(), Zv = (function () { function e(t, n, r) { ;(A(this, e), (this.path = n), (this.parsedPath = r || e.parseTrackName(n)), (this.node = e.findNode(t, this.parsedPath.nodeName)), (this.rootNode = t), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)) } return T( e, [ { key: '_getValue_unavailable', value: function () {} }, { key: '_setValue_unavailable', value: function () {} }, { key: '_getValue_direct', value: function (e, t) { e[t] = this.targetObject[this.propertyName] }, }, { key: '_getValue_array', value: function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) e[t++] = n[r] }, }, { key: '_getValue_arrayElement', value: function (e, t) { e[t] = this.resolvedProperty[this.propertyIndex] }, }, { key: '_getValue_toArray', value: function (e, t) { this.resolvedProperty.toArray(e, t) }, }, { key: '_setValue_direct', value: function (e, t) { this.targetObject[this.propertyName] = e[t] }, }, { key: '_setValue_direct_setNeedsUpdate', value: function (e, t) { ;((this.targetObject[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)) }, }, { key: '_setValue_direct_setMatrixWorldNeedsUpdate', value: function (e, t) { ;((this.targetObject[this.propertyName] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)) }, }, { key: '_setValue_array', value: function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) n[r] = e[t++] }, }, { key: '_setValue_array_setNeedsUpdate', value: function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) n[r] = e[t++] this.targetObject.needsUpdate = !0 }, }, { key: '_setValue_array_setMatrixWorldNeedsUpdate', value: function (e, t) { for (var n = this.resolvedProperty, r = 0, i = n.length; r !== i; ++r) n[r] = e[t++] this.targetObject.matrixWorldNeedsUpdate = !0 }, }, { key: '_setValue_arrayElement', value: function (e, t) { this.resolvedProperty[this.propertyIndex] = e[t] }, }, { key: '_setValue_arrayElement_setNeedsUpdate', value: function (e, t) { ;((this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0)) }, }, { key: '_setValue_arrayElement_setMatrixWorldNeedsUpdate', value: function (e, t) { ;((this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)) }, }, { key: '_setValue_fromArray', value: function (e, t) { this.resolvedProperty.fromArray(e, t) }, }, { key: '_setValue_fromArray_setNeedsUpdate', value: function (e, t) { ;(this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)) }, }, { key: '_setValue_fromArray_setMatrixWorldNeedsUpdate', value: function (e, t) { ;(this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0)) }, }, { key: '_getValue_unbound', value: function (e, t) { ;(this.bind(), this.getValue(e, t)) }, }, { key: '_setValue_unbound', value: function (e, t) { ;(this.bind(), this.setValue(e, t)) }, }, { key: 'bind', value: function () { var t = this.node, n = this.parsedPath, r = n.objectName, i = n.propertyName, a = n.propertyIndex if ( (t || ((t = e.findNode(this.rootNode, n.nodeName)), (this.node = t)), (this.getValue = this._getValue_unavailable), (this.setValue = this._setValue_unavailable), t) ) { if (r) { var o = n.objectIndex switch (r) { case 'materials': if (!t.material) return void console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ) if (!t.material.materials) return void console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this ) t = t.material.materials break case 'bones': if (!t.skeleton) return void console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this ) t = t.skeleton.bones for (var s = 0; s < t.length; s++) if (t[s].name === o) { o = s break } break case 'map': if ('map' in t) { t = t.map break } if (!t.material) return void console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ) if (!t.material.map) return void console.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this ) t = t.material.map break default: if (void 0 === t[r]) return void console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this ) t = t[r] } if (void 0 !== o) { if (void 0 === t[o]) return void console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, t ) t = t[o] } } var u = t[i] if (void 0 !== u) { var l = this.Versioning.None ;((this.targetObject = t), !0 === t.isMaterial ? (l = this.Versioning.NeedsUpdate) : !0 === t.isObject3D && (l = this.Versioning.MatrixWorldNeedsUpdate)) var c = this.BindingType.Direct if (void 0 !== a) { if ('morphTargetInfluences' === i) { if (!t.geometry) return void console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this ) if (!t.geometry.morphAttributes) return void console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this ) void 0 !== t.morphTargetDictionary[a] && (a = t.morphTargetDictionary[a]) } ;((c = this.BindingType.ArrayElement), (this.resolvedProperty = u), (this.propertyIndex = a)) } else void 0 !== u.fromArray && void 0 !== u.toArray ? ((c = this.BindingType.HasFromToArray), (this.resolvedProperty = u)) : Array.isArray(u) ? ((c = this.BindingType.EntireArray), (this.resolvedProperty = u)) : (this.propertyName = i) ;((this.getValue = this.GetterByBindingType[c]), (this.setValue = this.SetterByBindingTypeAndVersioning[c][l])) } else { var h = n.nodeName console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + h + '.' + i + " but it wasn't found.", t ) } } else console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' ) }, }, { key: 'unbind', value: function () { ;((this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)) }, }, ], [ { key: 'create', value: function (t, n, r) { return t && t.isAnimationObjectGroup ? new e.Composite(t, n, r) : new e(t, n, r) }, }, { key: 'sanitizeNodeName', value: function (e) { return e.replace(/\s/g, '_').replace(jv, '') }, }, { key: 'parseTrackName', value: function (e) { var t = Xv.exec(e) if (null === t) throw new Error('PropertyBinding: Cannot parse trackName: ' + e) var n = { nodeName: t[2], objectName: t[3], objectIndex: t[4], propertyName: t[5], propertyIndex: t[6], }, r = n.nodeName && n.nodeName.lastIndexOf('.') if (void 0 !== r && -1 !== r) { var i = n.nodeName.substring(r + 1) ;-1 !== Yv.indexOf(i) && ((n.nodeName = n.nodeName.substring(0, r)), (n.objectName = i)) } if (null === n.propertyName || 0 === n.propertyName.length) throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + e ) return n }, }, { key: 'findNode', value: function (e, t) { if ( void 0 === t || '' === t || '.' === t || -1 === t || t === e.name || t === e.uuid ) return e if (e.skeleton) { var n = e.skeleton.getBoneByName(t) if (void 0 !== n) return n } if (e.children) { var r = function (e) { for (var n = 0; n < e.length; n++) { var i = e[n] if (i.name === t || i.uuid === t) return i var a = r(i.children) if (a) return a } return null }, i = r(e.children) if (i) return i } return null }, }, ] ) })() ;((Zv.Composite = Kv), (Zv.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3, }), (Zv.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }), (Zv.prototype.GetterByBindingType = [ Zv.prototype._getValue_direct, Zv.prototype._getValue_array, Zv.prototype._getValue_arrayElement, Zv.prototype._getValue_toArray, ]), (Zv.prototype.SetterByBindingTypeAndVersioning = [ [ Zv.prototype._setValue_direct, Zv.prototype._setValue_direct_setNeedsUpdate, Zv.prototype._setValue_direct_setMatrixWorldNeedsUpdate, ], [ Zv.prototype._setValue_array, Zv.prototype._setValue_array_setNeedsUpdate, Zv.prototype._setValue_array_setMatrixWorldNeedsUpdate, ], [ Zv.prototype._setValue_arrayElement, Zv.prototype._setValue_arrayElement_setNeedsUpdate, Zv.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate, ], [ Zv.prototype._setValue_fromArray, Zv.prototype._setValue_fromArray_setNeedsUpdate, Zv.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate, ], ])) var Jv = (function () { return T( function e(t, n) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n.blendMode ;(A(this, e), (this._mixer = t), (this._clip = n), (this._localRoot = r), (this.blendMode = i)) for ( var a = n.tracks, o = a.length, s = new Array(o), u = { endingStart: pc, endingEnd: pc }, l = 0; l !== o; ++l ) { var c = a[l].createInterpolant(null) ;((s[l] = c), (c.settings = u)) } ;((this._interpolantSettings = u), (this._interpolants = s), (this._propertyBindings = new Array(o)), (this._cacheIndex = null), (this._byClipCacheIndex = null), (this._timeScaleInterpolant = null), (this._weightInterpolant = null), (this.loop = cc), (this._loopCount = -1), (this._startTime = null), (this.time = 0), (this.timeScale = 1), (this._effectiveTimeScale = 1), (this.weight = 1), (this._effectiveWeight = 1), (this.repetitions = 1 / 0), (this.paused = !1), (this.enabled = !0), (this.clampWhenFinished = !1), (this.zeroSlopeAtStart = !0), (this.zeroSlopeAtEnd = !0)) }, [ { key: 'play', value: function () { return (this._mixer._activateAction(this), this) }, }, { key: 'stop', value: function () { return (this._mixer._deactivateAction(this), this.reset()) }, }, { key: 'reset', value: function () { return ( (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping() ) }, }, { key: 'isRunning', value: function () { return ( this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this) ) }, }, { key: 'isScheduled', value: function () { return this._mixer._isActiveAction(this) }, }, { key: 'startAt', value: function (e) { return ((this._startTime = e), this) }, }, { key: 'setLoop', value: function (e, t) { return ((this.loop = e), (this.repetitions = t), this) }, }, { key: 'setEffectiveWeight', value: function (e) { return ( (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading() ) }, }, { key: 'getEffectiveWeight', value: function () { return this._effectiveWeight }, }, { key: 'fadeIn', value: function (e) { return this._scheduleFading(e, 0, 1) }, }, { key: 'fadeOut', value: function (e) { return this._scheduleFading(e, 1, 0) }, }, { key: 'crossFadeFrom', value: function (e, t, n) { if ((e.fadeOut(t), this.fadeIn(t), n)) { var r = this._clip.duration, i = e._clip.duration, a = i / r, o = r / i ;(e.warp(1, a, t), this.warp(o, 1, t)) } return this }, }, { key: 'crossFadeTo', value: function (e, t, n) { return e.crossFadeFrom(this, t, n) }, }, { key: 'stopFading', value: function () { var e = this._weightInterpolant return ( null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this ) }, }, { key: 'setEffectiveTimeScale', value: function (e) { return ( (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping() ) }, }, { key: 'getEffectiveTimeScale', value: function () { return this._effectiveTimeScale }, }, { key: 'setDuration', value: function (e) { return ((this.timeScale = this._clip.duration / e), this.stopWarping()) }, }, { key: 'syncWith', value: function (e) { return ( (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping() ) }, }, { key: 'halt', value: function (e) { return this.warp(this._effectiveTimeScale, 0, e) }, }, { key: 'warp', value: function (e, t, n) { var r = this._mixer, i = r.time, a = this.timeScale, o = this._timeScaleInterpolant null === o && ((o = r._lendControlInterpolant()), (this._timeScaleInterpolant = o)) var s = o.parameterPositions, u = o.sampleValues return ((s[0] = i), (s[1] = i + n), (u[0] = e / a), (u[1] = t / a), this) }, }, { key: 'stopWarping', value: function () { var e = this._timeScaleInterpolant return ( null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this ) }, }, { key: 'getMixer', value: function () { return this._mixer }, }, { key: 'getClip', value: function () { return this._clip }, }, { key: 'getRoot', value: function () { return this._localRoot || this._mixer._root }, }, { key: '_update', value: function (e, t, n, r) { if (this.enabled) { var i = this._startTime if (null !== i) { var a = (e - i) * n a < 0 || 0 === n ? (t = 0) : ((this._startTime = null), (t = n * a)) } t *= this._updateTimeScale(e) var o = this._updateTime(t), s = this._updateWeight(e) if (s > 0) { var u = this._interpolants, l = this._propertyBindings if (2501 === this.blendMode) for (var c = 0, h = u.length; c !== h; ++c) (u[c].evaluate(o), l[c].accumulateAdditive(s)) else for (var d = 0, f = u.length; d !== f; ++d) (u[d].evaluate(o), l[d].accumulate(r, s)) } } else this._updateWeight(e) }, }, { key: '_updateWeight', value: function (e) { var t = 0 if (this.enabled) { t = this.weight var n = this._weightInterpolant if (null !== n) { var r = n.evaluate(e)[0] ;((t *= r), e > n.parameterPositions[1] && (this.stopFading(), 0 === r && (this.enabled = !1))) } } return ((this._effectiveWeight = t), t) }, }, { key: '_updateTimeScale', value: function (e) { var t = 0 if (!this.paused) { t = this.timeScale var n = this._timeScaleInterpolant if (null !== n) ((t *= n.evaluate(e)[0]), e > n.parameterPositions[1] && (this.stopWarping(), 0 === t ? (this.paused = !0) : (this.timeScale = t))) } return ((this._effectiveTimeScale = t), t) }, }, { key: '_updateTime', value: function (e) { var t = this._clip.duration, n = this.loop, r = this.time + e, i = this._loopCount, a = 2202 === n if (0 === e) return -1 === i || !a || 1 & ~i ? r : t - r if (n === lc) { ;-1 === i && ((this._loopCount = 0), this._setEndings(!0, !0, !1)) e: { if (r >= t) r = t else { if (!(r < 0)) { this.time = r break e } r = 0 } ;(this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1), (this.time = r), this._mixer.dispatchEvent({ type: 'finished', action: this, direction: e < 0 ? -1 : 1, })) } } else { if ( (-1 === i && (e >= 0 ? ((i = 0), this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)), r >= t || r < 0) ) { var o = Math.floor(r / t) ;((r -= t * o), (i += Math.abs(o))) var s = this.repetitions - i if (s <= 0) (this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1), (r = e > 0 ? t : 0), (this.time = r), this._mixer.dispatchEvent({ type: 'finished', action: this, direction: e > 0 ? 1 : -1, })) else { if (1 === s) { var u = e < 0 this._setEndings(u, !u, a) } else this._setEndings(!1, !1, a) ;((this._loopCount = i), (this.time = r), this._mixer.dispatchEvent({ type: 'loop', action: this, loopDelta: o, })) } } else this.time = r if (a && !(1 & ~i)) return t - r } return r }, }, { key: '_setEndings', value: function (e, t, n) { var r = this._interpolantSettings n ? ((r.endingStart = vc), (r.endingEnd = vc)) : ((r.endingStart = e ? (this.zeroSlopeAtStart ? vc : pc) : mc), (r.endingEnd = t ? (this.zeroSlopeAtEnd ? vc : pc) : mc)) }, }, { key: '_scheduleFading', value: function (e, t, n) { var r = this._mixer, i = r.time, a = this._weightInterpolant null === a && ((a = r._lendControlInterpolant()), (this._weightInterpolant = a)) var o = a.parameterPositions, s = a.sampleValues return ((o[0] = i), (s[0] = t), (o[1] = i + e), (s[1] = n), this) }, }, ] ) })(), $v = new Float32Array(1), em = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t))._root = e), n._initMemoryManager(), (n._accuIndex = 0), (n.time = 0), (n.timeScale = 1), n ) } return ( x(t, e), T(t, [ { key: '_bindAction', value: function (e, t) { var n = e._localRoot || this._root, r = e._clip.tracks, i = r.length, a = e._propertyBindings, o = e._interpolants, s = n.uuid, u = this._bindingsByRootAndName, l = u[s] void 0 === l && ((l = {}), (u[s] = l)) for (var c = 0; c !== i; ++c) { var h = r[c], d = h.name, f = l[d] if (void 0 !== f) (++f.referenceCount, (a[c] = f)) else { if (void 0 !== (f = a[c])) { null === f._cacheIndex && (++f.referenceCount, this._addInactiveBinding(f, s, d)) continue } var p = t && t._propertyBindings[c].binding.parsedPath ;(++(f = new Wv(Zv.create(n, d, p), h.ValueTypeName, h.getValueSize())) .referenceCount, this._addInactiveBinding(f, s, d), (a[c] = f)) } o[c].resultBuffer = f.buffer } }, }, { key: '_activateAction', value: function (e) { if (!this._isActiveAction(e)) { if (null === e._cacheIndex) { var t = (e._localRoot || this._root).uuid, n = e._clip.uuid, r = this._actionsByClip[n] ;(this._bindAction(e, r && r.knownActions[0]), this._addInactiveAction(e, n, t)) } for (var i = e._propertyBindings, a = 0, o = i.length; a !== o; ++a) { var s = i[a] 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState()) } this._lendAction(e) } }, }, { key: '_deactivateAction', value: function (e) { if (this._isActiveAction(e)) { for (var t = e._propertyBindings, n = 0, r = t.length; n !== r; ++n) { var i = t[n] 0 === --i.useCount && (i.restoreOriginalState(), this._takeBackBinding(i)) } this._takeBackAction(e) } }, }, { key: '_initMemoryManager', value: function () { ;((this._actions = []), (this._nActiveActions = 0), (this._actionsByClip = {}), (this._bindings = []), (this._nActiveBindings = 0), (this._bindingsByRootAndName = {}), (this._controlInterpolants = []), (this._nActiveControlInterpolants = 0)) var e = this this.stats = { actions: { get total() { return e._actions.length }, get inUse() { return e._nActiveActions }, }, bindings: { get total() { return e._bindings.length }, get inUse() { return e._nActiveBindings }, }, controlInterpolants: { get total() { return e._controlInterpolants.length }, get inUse() { return e._nActiveControlInterpolants }, }, } }, }, { key: '_isActiveAction', value: function (e) { var t = e._cacheIndex return null !== t && t < this._nActiveActions }, }, { key: '_addInactiveAction', value: function (e, t, n) { var r = this._actions, i = this._actionsByClip, a = i[t] if (void 0 === a) ((a = { knownActions: [e], actionByRoot: {} }), (e._byClipCacheIndex = 0), (i[t] = a)) else { var o = a.knownActions ;((e._byClipCacheIndex = o.length), o.push(e)) } ;((e._cacheIndex = r.length), r.push(e), (a.actionByRoot[n] = e)) }, }, { key: '_removeInactiveAction', value: function (e) { var t = this._actions, n = t[t.length - 1], r = e._cacheIndex ;((n._cacheIndex = r), (t[r] = n), t.pop(), (e._cacheIndex = null)) var i = e._clip.uuid, a = this._actionsByClip, o = a[i], s = o.knownActions, u = s[s.length - 1], l = e._byClipCacheIndex ;((u._byClipCacheIndex = l), (s[l] = u), s.pop(), (e._byClipCacheIndex = null), delete o.actionByRoot[(e._localRoot || this._root).uuid], 0 === s.length && delete a[i], this._removeInactiveBindingsForAction(e)) }, }, { key: '_removeInactiveBindingsForAction', value: function (e) { for (var t = e._propertyBindings, n = 0, r = t.length; n !== r; ++n) { var i = t[n] 0 === --i.referenceCount && this._removeInactiveBinding(i) } }, }, { key: '_lendAction', value: function (e) { var t = this._actions, n = e._cacheIndex, r = this._nActiveActions++, i = t[r] ;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i)) }, }, { key: '_takeBackAction', value: function (e) { var t = this._actions, n = e._cacheIndex, r = --this._nActiveActions, i = t[r] ;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i)) }, }, { key: '_addInactiveBinding', value: function (e, t, n) { var r = this._bindingsByRootAndName, i = this._bindings, a = r[t] ;(void 0 === a && ((a = {}), (r[t] = a)), (a[n] = e), (e._cacheIndex = i.length), i.push(e)) }, }, { key: '_removeInactiveBinding', value: function (e) { var t = this._bindings, n = e.binding, r = n.rootNode.uuid, i = n.path, a = this._bindingsByRootAndName, o = a[r], s = t[t.length - 1], u = e._cacheIndex ;((s._cacheIndex = u), (t[u] = s), t.pop(), delete o[i], 0 === Object.keys(o).length && delete a[r]) }, }, { key: '_lendBinding', value: function (e) { var t = this._bindings, n = e._cacheIndex, r = this._nActiveBindings++, i = t[r] ;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i)) }, }, { key: '_takeBackBinding', value: function (e) { var t = this._bindings, n = e._cacheIndex, r = --this._nActiveBindings, i = t[r] ;((e._cacheIndex = r), (t[r] = e), (i._cacheIndex = n), (t[n] = i)) }, }, { key: '_lendControlInterpolant', value: function () { var e = this._controlInterpolants, t = this._nActiveControlInterpolants++, n = e[t] return ( void 0 === n && (((n = new tv( new Float32Array(2), new Float32Array(2), 1, $v )).__cacheIndex = t), (e[t] = n)), n ) }, }, { key: '_takeBackControlInterpolant', value: function (e) { var t = this._controlInterpolants, n = e.__cacheIndex, r = --this._nActiveControlInterpolants, i = t[r] ;((e.__cacheIndex = r), (t[r] = e), (i.__cacheIndex = n), (t[n] = i)) }, }, { key: 'clipAction', value: function (e, t, n) { var r = t || this._root, i = r.uuid, a = 'string' == typeof e ? hv.findByName(r, e) : e, o = null !== a ? a.uuid : e, s = this._actionsByClip[o], u = null if ((void 0 === n && (n = null !== a ? a.blendMode : gc), void 0 !== s)) { var l = s.actionByRoot[i] if (void 0 !== l && l.blendMode === n) return l ;((u = s.knownActions[0]), null === a && (a = u._clip)) } if (null === a) return null var c = new Jv(this, a, t, n) return (this._bindAction(c, u), this._addInactiveAction(c, o, i), c) }, }, { key: 'existingAction', value: function (e, t) { var n = t || this._root, r = n.uuid, i = 'string' == typeof e ? hv.findByName(n, e) : e, a = i ? i.uuid : e, o = this._actionsByClip[a] return (void 0 !== o && o.actionByRoot[r]) || null }, }, { key: 'stopAllAction', value: function () { for (var e = this._actions, t = this._nActiveActions - 1; t >= 0; --t) e[t].stop() return this }, }, { key: 'update', value: function (e) { e *= this.timeScale for ( var t = this._actions, n = this._nActiveActions, r = (this.time += e), i = Math.sign(e), a = (this._accuIndex ^= 1), o = 0; o !== n; ++o ) { t[o]._update(r, e, i, a) } for (var s = this._bindings, u = this._nActiveBindings, l = 0; l !== u; ++l) s[l].apply(a) return this }, }, { key: 'setTime', value: function (e) { this.time = 0 for (var t = 0; t < this._actions.length; t++) this._actions[t].time = 0 return this.update(e) }, }, { key: 'getRoot', value: function () { return this._root }, }, { key: 'uncacheClip', value: function (e) { var t = this._actions, n = e.uuid, r = this._actionsByClip, i = r[n] if (void 0 !== i) { for (var a = i.knownActions, o = 0, s = a.length; o !== s; ++o) { var u = a[o] this._deactivateAction(u) var l = u._cacheIndex, c = t[t.length - 1] ;((u._cacheIndex = null), (u._byClipCacheIndex = null), (c._cacheIndex = l), (t[l] = c), t.pop(), this._removeInactiveBindingsForAction(u)) } delete r[n] } }, }, { key: 'uncacheRoot', value: function (e) { var t = e.uuid, n = this._actionsByClip for (var r in n) { var i = n[r].actionByRoot[t] void 0 !== i && (this._deactivateAction(i), this._removeInactiveAction(i)) } var a = this._bindingsByRootAndName[t] if (void 0 !== a) for (var o in a) { var s = a[o] ;(s.restoreOriginalState(), this._removeInactiveBinding(s)) } }, }, { key: 'uncacheAction', value: function (e, t) { var n = this.existingAction(e, t) null !== n && (this._deactivateAction(n), this._removeInactiveAction(n)) }, }, ]) ) })(kc), tm = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 return ( A(this, t), ((r = y(this, t, [e, n])).isInstancedInterleavedBuffer = !0), (r.meshPerAttribute = i), r ) } return ( x(t, e), T(t, [ { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e]), (this.meshPerAttribute = e.meshPerAttribute), this ) }, }, { key: 'clone', value: function (e) { var r = n(t, 'clone', this, 3)([e]) return ((r.meshPerAttribute = this.meshPerAttribute), r) }, }, { key: 'toJSON', value: function (e) { var r = n(t, 'toJSON', this, 3)([e]) return ( (r.isInstancedInterleavedBuffer = !0), (r.meshPerAttribute = this.meshPerAttribute), r ) }, }, ]) ) })(Bf), nm = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return (A(this, e), (this.radius = t), (this.phi = n), (this.theta = r), this) }, [ { key: 'set', value: function (e, t, n) { return ((this.radius = e), (this.phi = t), (this.theta = n), this) }, }, { key: 'copy', value: function (e) { return ( (this.radius = e.radius), (this.phi = e.phi), (this.theta = e.theta), this ) }, }, { key: 'makeSafe', value: function () { var e = 1e-6 return ((this.phi = Dc(this.phi, e, Math.PI - e)), this) }, }, { key: 'setFromVector3', value: function (e) { return this.setFromCartesianCoords(e.x, e.y, e.z) }, }, { key: 'setFromCartesianCoords', value: function (e, t, n) { return ( (this.radius = Math.sqrt(e * e + t * t + n * n)), 0 === this.radius ? ((this.theta = 0), (this.phi = 0)) : ((this.theta = Math.atan2(e, n)), (this.phi = Math.acos(Dc(t / this.radius, -1, 1)))), this ) }, }, { key: 'clone', value: function () { return new this.constructor().copy(this) }, }, ] ) })(), rm = (function () { return T( function e(t, n, r, i) { ;(A(this, e), (e.prototype.isMatrix2 = !0), (this.elements = [1, 0, 0, 1]), void 0 !== t && this.set(t, n, r, i)) }, [ { key: 'identity', value: function () { return (this.set(1, 0, 0, 1), this) }, }, { key: 'fromArray', value: function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = 0; n < 4; n++ ) this.elements[n] = e[n + t] return this }, }, { key: 'set', value: function (e, t, n, r) { var i = this.elements return ((i[0] = e), (i[2] = t), (i[1] = n), (i[3] = r), this) }, }, ] ) })() function im(e, t, n, r) { var i = (function (e) { switch (e) { case dl: case fl: return { byteLength: 1, components: 1 } case vl: case pl: case _l: return { byteLength: 2, components: 1 } case bl: case xl: return { byteLength: 2, components: 4 } case gl: case ml: case yl: return { byteLength: 4, components: 1 } case Al: return { byteLength: 4, components: 3 } } throw new Error('Unknown texture type '.concat(e, '.')) })(r) switch (n) { case 1021: case 1024: return e * t case 1025: return e * t * 2 case El: case Cl: return ((e * t) / i.components) * i.byteLength case kl: case Rl: return ((e * t * 2) / i.components) * i.byteLength case 1022: return ((e * t * 3) / i.components) * i.byteLength case wl: case Il: return ((e * t * 4) / i.components) * i.byteLength case Nl: case Pl: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8 case Ll: case Dl: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16 case Fl: case Ul: return (Math.max(e, 16) * Math.max(t, 8)) / 4 case Ol: case Bl: return (Math.max(e, 8) * Math.max(t, 8)) / 2 case zl: case Vl: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8 case Hl: case Wl: return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16 case Gl: return Math.floor((e + 4) / 5) * Math.floor((t + 3) / 4) * 16 case jl: return Math.floor((e + 4) / 5) * Math.floor((t + 4) / 5) * 16 case Ql: return Math.floor((e + 5) / 6) * Math.floor((t + 4) / 5) * 16 case ql: return Math.floor((e + 5) / 6) * Math.floor((t + 5) / 6) * 16 case Xl: return Math.floor((e + 7) / 8) * Math.floor((t + 4) / 5) * 16 case Yl: return Math.floor((e + 7) / 8) * Math.floor((t + 5) / 6) * 16 case Kl: return Math.floor((e + 7) / 8) * Math.floor((t + 7) / 8) * 16 case Zl: return Math.floor((e + 9) / 10) * Math.floor((t + 4) / 5) * 16 case Jl: return Math.floor((e + 9) / 10) * Math.floor((t + 5) / 6) * 16 case $l: return Math.floor((e + 9) / 10) * Math.floor((t + 7) / 8) * 16 case ec: return Math.floor((e + 9) / 10) * Math.floor((t + 9) / 10) * 16 case tc: return Math.floor((e + 11) / 12) * Math.floor((t + 9) / 10) * 16 case nc: return Math.floor((e + 11) / 12) * Math.floor((t + 11) / 12) * 16 case rc: case ic: case ac: return Math.ceil(e / 4) * Math.ceil(t / 4) * 16 case 36283: case oc: return Math.ceil(e / 4) * Math.ceil(t / 4) * 8 case sc: case uc: return Math.ceil(e / 4) * Math.ceil(t / 4) * 16 } throw new Error('Unable to determine texture byte length for '.concat(n, ' format.')) } /** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ function am() { var e = null, t = !1, n = null, r = null function i(t, a) { ;(n(t, a), (r = e.requestAnimationFrame(i))) } return { start: function () { !0 !== t && null !== n && ((r = e.requestAnimationFrame(i)), (t = !0)) }, stop: function () { ;(e.cancelAnimationFrame(r), (t = !1)) }, setAnimationLoop: function (e) { n = e }, setContext: function (t) { e = t }, } } function om(e) { var t = new WeakMap() return { get: function (e) { return (e.isInterleavedBufferAttribute && (e = e.data), t.get(e)) }, remove: function (n) { n.isInterleavedBufferAttribute && (n = n.data) var r = t.get(n) r && (e.deleteBuffer(r.buffer), t.delete(n)) }, update: function (n, r) { if ((n.isInterleavedBufferAttribute && (n = n.data), n.isGLBufferAttribute)) { var i = t.get(n) ;(!i || i.version < n.version) && t.set(n, { buffer: n.buffer, type: n.type, bytesPerElement: n.elementSize, version: n.version, }) } else { var a = t.get(n) if (void 0 === a) t.set( n, (function (t, n) { var r, i = t.array, a = t.usage, o = i.byteLength, s = e.createBuffer() if ( (e.bindBuffer(n, s), e.bufferData(n, i, a), t.onUploadCallback(), i instanceof Float32Array) ) r = e.FLOAT else if (i instanceof Uint16Array) r = t.isFloat16BufferAttribute ? e.HALF_FLOAT : e.UNSIGNED_SHORT else if (i instanceof Int16Array) r = e.SHORT else if (i instanceof Uint32Array) r = e.UNSIGNED_INT else if (i instanceof Int32Array) r = e.INT else if (i instanceof Int8Array) r = e.BYTE else if (i instanceof Uint8Array) r = e.UNSIGNED_BYTE else { if (!(i instanceof Uint8ClampedArray)) throw new Error( 'THREE.WebGLAttributes: Unsupported buffer data format: ' + i ) r = e.UNSIGNED_BYTE } return { buffer: s, type: r, bytesPerElement: i.BYTES_PER_ELEMENT, version: t.version, size: o, } })(n, r) ) else if (a.version < n.version) { if (a.size !== n.array.byteLength) throw new Error( "THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported." ) ;(!(function (t, n, r) { var i = n.array, a = n.updateRanges if ((e.bindBuffer(r, t), 0 === a.length)) e.bufferSubData(r, 0, i) else { a.sort(function (e, t) { return e.start - t.start }) for (var o = 0, s = 1; s < a.length; s++) { var u = a[o], l = a[s] l.start <= u.start + u.count + 1 ? (u.count = Math.max(u.count, l.start + l.count - u.start)) : (a[++o] = l) } a.length = o + 1 for (var c = 0, h = a.length; c < h; c++) { var d = a[c] e.bufferSubData(r, d.start * i.BYTES_PER_ELEMENT, i, d.start, d.count) } n.clearUpdateRanges() } n.onUploadCallback() })(a.buffer, n, r), (a.version = n.version)) } } }, } } ;('undefined' != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent('register', { detail: { revision: Wu } }) ), 'undefined' != typeof window && (window.__THREE__ ? console.warn('WARNING: Multiple instances of Three.js being imported.') : (window.__THREE__ = Wu))) var sm = { alphahash_fragment: '#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif', alphahash_pars_fragment: '#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif', alphamap_fragment: '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif', alphamap_pars_fragment: '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif', alphatest_fragment: '#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif', alphatest_pars_fragment: '#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif', aomap_fragment: '#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif', aomap_pars_fragment: '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif', batching_pars_vertex: '#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif', batching_vertex: '#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif', begin_vertex: 'vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif', beginnormal_vertex: 'vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif', bsdfs: 'float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated', iridescence_fragment: '#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif', bumpmap_pars_fragment: '#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif', clipping_planes_fragment: '#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif', clipping_planes_pars_fragment: '#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif', clipping_planes_pars_vertex: '#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif', clipping_planes_vertex: '#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif', color_fragment: '#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif', color_pars_fragment: '#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif', color_pars_vertex: '#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif', color_vertex: '#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif', common: '#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated', cube_uv_reflection_fragment: '#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif', defaultnormal_vertex: 'vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif', displacementmap_pars_vertex: '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif', displacementmap_vertex: '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif', emissivemap_fragment: '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif', emissivemap_pars_fragment: '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif', colorspace_fragment: 'gl_FragColor = linearToOutputTexel( gl_FragColor );', colorspace_pars_fragment: 'vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}', envmap_fragment: '#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif', envmap_common_pars_fragment: '#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif', envmap_pars_fragment: '#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif', envmap_pars_vertex: '#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif', envmap_physical_pars_fragment: '#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif', envmap_vertex: '#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif', fog_vertex: '#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif', fog_pars_vertex: '#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif', fog_fragment: '#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif', fog_pars_fragment: '#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif', gradientmap_pars_fragment: '#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}', lightmap_pars_fragment: '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif', lights_lambert_fragment: 'LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;', lights_lambert_pars_fragment: 'varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert', lights_pars_begin: 'uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif', lights_toon_fragment: 'ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;', lights_toon_pars_fragment: 'varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon', lights_phong_fragment: 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;', lights_phong_pars_fragment: 'varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong', lights_physical_fragment: 'PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif', lights_physical_pars_fragment: 'struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}', lights_fragment_begin: '\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif', lights_fragment_maps: '#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif', lights_fragment_end: '#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif', logdepthbuf_fragment: '#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif', logdepthbuf_pars_fragment: '#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif', logdepthbuf_pars_vertex: '#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif', logdepthbuf_vertex: '#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif', map_fragment: '#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif', map_pars_fragment: '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif', map_particle_fragment: '#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif', map_particle_pars_fragment: '#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif', metalnessmap_fragment: 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif', metalnessmap_pars_fragment: '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif', morphinstance_vertex: '#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif', morphcolor_vertex: '#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif', morphnormal_vertex: '#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif', morphtarget_pars_vertex: '#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif', morphtarget_vertex: '#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif', normal_fragment_begin: 'float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;', normal_fragment_maps: '#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif', normal_pars_fragment: '#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif', normal_pars_vertex: '#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif', normal_vertex: '#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif', normalmap_pars_fragment: '#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif', clearcoat_normal_fragment_begin: '#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif', clearcoat_normal_fragment_maps: '#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif', clearcoat_pars_fragment: '#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif', iridescence_pars_fragment: '#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif', opaque_fragment: '#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );', packing: 'vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}', premultiplied_alpha_fragment: '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif', project_vertex: 'vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;', dithering_fragment: '#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif', dithering_pars_fragment: '#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif', roughnessmap_fragment: 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif', roughnessmap_pars_fragment: '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif', shadowmap_pars_fragment: '#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif', shadowmap_pars_vertex: '#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif', shadowmap_vertex: '#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif', shadowmask_pars_fragment: 'float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}', skinbase_vertex: '#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif', skinning_pars_vertex: '#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif', skinning_vertex: '#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif', skinnormal_vertex: '#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif', specularmap_fragment: 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif', specularmap_pars_fragment: '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif', tonemapping_fragment: '#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif', tonemapping_pars_fragment: '#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }', transmission_fragment: '#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif', transmission_pars_fragment: '#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif', uv_pars_fragment: '#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif', uv_pars_vertex: '#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif', uv_vertex: '#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif', worldpos_vertex: '#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif', background_vert: 'varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}', background_frag: 'uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}', backgroundCube_vert: 'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}', backgroundCube_frag: '#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}', cube_vert: 'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}', cube_frag: 'uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}', depth_vert: '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}', depth_frag: '#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}', distanceRGBA_vert: '#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}', distanceRGBA_frag: '#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}', equirect_vert: 'varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}', equirect_frag: 'uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}', linedashed_vert: 'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', linedashed_frag: 'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshbasic_vert: '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshbasic_frag: 'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshlambert_vert: '#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}', meshlambert_frag: '#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshmatcap_vert: '#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}', meshmatcap_frag: '#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshnormal_vert: '#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}', meshnormal_frag: '#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}', meshphong_vert: '#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}', meshphong_frag: '#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshphysical_vert: '#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}', meshphysical_frag: '#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', meshtoon_vert: '#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}', meshtoon_frag: '#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', points_vert: 'uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}', points_frag: 'uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', shadow_vert: '#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}', shadow_frag: 'uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}', sprite_vert: 'uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}', sprite_frag: 'uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}', }, um = { common: { diffuse: { value: new Od(16777215) }, opacity: { value: 1 }, map: { value: null }, mapTransform: { value: new Hc() }, alphaMap: { value: null }, alphaMapTransform: { value: new Hc() }, alphaTest: { value: 0 }, }, specularmap: { specularMap: { value: null }, specularMapTransform: { value: new Hc() }, }, envmap: { envMap: { value: null }, envMapRotation: { value: new Hc() }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, ior: { value: 1.5 }, refractionRatio: { value: 0.98 }, }, aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 }, aoMapTransform: { value: new Hc() }, }, lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 }, lightMapTransform: { value: new Hc() }, }, bumpmap: { bumpMap: { value: null }, bumpMapTransform: { value: new Hc() }, bumpScale: { value: 1 }, }, normalmap: { normalMap: { value: null }, normalMapTransform: { value: new Hc() }, normalScale: { value: new Vc(1, 1) }, }, displacementmap: { displacementMap: { value: null }, displacementMapTransform: { value: new Hc() }, displacementScale: { value: 1 }, displacementBias: { value: 0 }, }, emissivemap: { emissiveMap: { value: null }, emissiveMapTransform: { value: new Hc() }, }, metalnessmap: { metalnessMap: { value: null }, metalnessMapTransform: { value: new Hc() }, }, roughnessmap: { roughnessMap: { value: null }, roughnessMapTransform: { value: new Hc() }, }, gradientmap: { gradientMap: { value: null } }, fog: { fogDensity: { value: 25e-5 }, fogNear: { value: 1 }, fogFar: { value: 2e3 }, fogColor: { value: new Od(16777215) }, }, lights: { ambientLightColor: { value: [] }, lightProbe: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {} } }, directionalLightShadows: { value: [], properties: { shadowIntensity: 1, shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, }, }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {}, }, }, spotLightShadows: { value: [], properties: { shadowIntensity: 1, shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, }, }, spotLightMap: { value: [] }, spotShadowMap: { value: [] }, spotLightMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} }, }, pointLightShadows: { value: [], properties: { shadowIntensity: 1, shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, shadowCameraNear: {}, shadowCameraFar: {}, }, }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} }, }, rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} }, }, ltc_1: { value: null }, ltc_2: { value: null }, }, points: { diffuse: { value: new Od(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, alphaMapTransform: { value: new Hc() }, alphaTest: { value: 0 }, uvTransform: { value: new Hc() }, }, sprite: { diffuse: { value: new Od(16777215) }, opacity: { value: 1 }, center: { value: new Vc(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, mapTransform: { value: new Hc() }, alphaMap: { value: null }, alphaMapTransform: { value: new Hc() }, alphaTest: { value: 0 }, }, }, lm = { basic: { uniforms: xf([um.common, um.specularmap, um.envmap, um.aomap, um.lightmap, um.fog]), vertexShader: sm.meshbasic_vert, fragmentShader: sm.meshbasic_frag, }, lambert: { uniforms: xf([ um.common, um.specularmap, um.envmap, um.aomap, um.lightmap, um.emissivemap, um.bumpmap, um.normalmap, um.displacementmap, um.fog, um.lights, { emissive: { value: new Od(0) } }, ]), vertexShader: sm.meshlambert_vert, fragmentShader: sm.meshlambert_frag, }, phong: { uniforms: xf([ um.common, um.specularmap, um.envmap, um.aomap, um.lightmap, um.emissivemap, um.bumpmap, um.normalmap, um.displacementmap, um.fog, um.lights, { emissive: { value: new Od(0) }, specular: { value: new Od(1118481) }, shininess: { value: 30 }, }, ]), vertexShader: sm.meshphong_vert, fragmentShader: sm.meshphong_frag, }, standard: { uniforms: xf([ um.common, um.envmap, um.aomap, um.lightmap, um.emissivemap, um.bumpmap, um.normalmap, um.displacementmap, um.roughnessmap, um.metalnessmap, um.fog, um.lights, { emissive: { value: new Od(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 }, }, ]), vertexShader: sm.meshphysical_vert, fragmentShader: sm.meshphysical_frag, }, toon: { uniforms: xf([ um.common, um.aomap, um.lightmap, um.emissivemap, um.bumpmap, um.normalmap, um.displacementmap, um.gradientmap, um.fog, um.lights, { emissive: { value: new Od(0) } }, ]), vertexShader: sm.meshtoon_vert, fragmentShader: sm.meshtoon_frag, }, matcap: { uniforms: xf([ um.common, um.bumpmap, um.normalmap, um.displacementmap, um.fog, { matcap: { value: null } }, ]), vertexShader: sm.meshmatcap_vert, fragmentShader: sm.meshmatcap_frag, }, points: { uniforms: xf([um.points, um.fog]), vertexShader: sm.points_vert, fragmentShader: sm.points_frag, }, dashed: { uniforms: xf([ um.common, um.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } }, ]), vertexShader: sm.linedashed_vert, fragmentShader: sm.linedashed_frag, }, depth: { uniforms: xf([um.common, um.displacementmap]), vertexShader: sm.depth_vert, fragmentShader: sm.depth_frag, }, normal: { uniforms: xf([ um.common, um.bumpmap, um.normalmap, um.displacementmap, { opacity: { value: 1 } }, ]), vertexShader: sm.meshnormal_vert, fragmentShader: sm.meshnormal_frag, }, sprite: { uniforms: xf([um.sprite, um.fog]), vertexShader: sm.sprite_vert, fragmentShader: sm.sprite_frag, }, background: { uniforms: { uvTransform: { value: new Hc() }, t2D: { value: null }, backgroundIntensity: { value: 1 }, }, vertexShader: sm.background_vert, fragmentShader: sm.background_frag, }, backgroundCube: { uniforms: { envMap: { value: null }, flipEnvMap: { value: -1 }, backgroundBlurriness: { value: 0 }, backgroundIntensity: { value: 1 }, backgroundRotation: { value: new Hc() }, }, vertexShader: sm.backgroundCube_vert, fragmentShader: sm.backgroundCube_frag, }, cube: { uniforms: { tCube: { value: null }, tFlip: { value: -1 }, opacity: { value: 1 } }, vertexShader: sm.cube_vert, fragmentShader: sm.cube_frag, }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: sm.equirect_vert, fragmentShader: sm.equirect_frag, }, distanceRGBA: { uniforms: xf([ um.common, um.displacementmap, { referencePosition: { value: new ph() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 }, }, ]), vertexShader: sm.distanceRGBA_vert, fragmentShader: sm.distanceRGBA_frag, }, shadow: { uniforms: xf([ um.lights, um.fog, { color: { value: new Od(0) }, opacity: { value: 1 } }, ]), vertexShader: sm.shadow_vert, fragmentShader: sm.shadow_frag, }, } lm.physical = { uniforms: xf([ lm.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatMapTransform: { value: new Hc() }, clearcoatNormalMap: { value: null }, clearcoatNormalMapTransform: { value: new Hc() }, clearcoatNormalScale: { value: new Vc(1, 1) }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatRoughnessMapTransform: { value: new Hc() }, dispersion: { value: 0 }, iridescence: { value: 0 }, iridescenceMap: { value: null }, iridescenceMapTransform: { value: new Hc() }, iridescenceIOR: { value: 1.3 }, iridescenceThicknessMinimum: { value: 100 }, iridescenceThicknessMaximum: { value: 400 }, iridescenceThicknessMap: { value: null }, iridescenceThicknessMapTransform: { value: new Hc() }, sheen: { value: 0 }, sheenColor: { value: new Od(0) }, sheenColorMap: { value: null }, sheenColorMapTransform: { value: new Hc() }, sheenRoughness: { value: 1 }, sheenRoughnessMap: { value: null }, sheenRoughnessMapTransform: { value: new Hc() }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionMapTransform: { value: new Hc() }, transmissionSamplerSize: { value: new Vc() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, thicknessMapTransform: { value: new Hc() }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Od(0) }, specularColor: { value: new Od(1, 1, 1) }, specularColorMap: { value: null }, specularColorMapTransform: { value: new Hc() }, specularIntensity: { value: 1 }, specularIntensityMap: { value: null }, specularIntensityMapTransform: { value: new Hc() }, anisotropyVector: { value: new Vc() }, anisotropyMap: { value: null }, anisotropyMapTransform: { value: new Hc() }, }, ]), vertexShader: sm.meshphysical_vert, fragmentShader: sm.meshphysical_frag, } var cm = { r: 0, b: 0, g: 0 }, hm = new ed(), dm = new Gh() function fm(e, t, n, r, i, a, o) { var s, u, l = new Od(0), c = !0 === a ? 0 : 1, h = null, d = 0, f = null function p(e) { var r = !0 === e.isScene ? e.background : null r && r.isTexture && (r = (e.backgroundBlurriness > 0 ? n : t).get(r)) return r } function v(t, n) { ;(t.getRGB(cm, Sf(e)), r.buffers.color.setClear(cm.r, cm.g, cm.b, n, o)) } return { getClearColor: function () { return l }, setClearColor: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 ;(l.set(e), v(l, (c = t))) }, getClearAlpha: function () { return c }, setClearAlpha: function (e) { v(l, (c = e)) }, render: function (t) { var n = !1, i = p(t) null === i ? v(l, c) : i && i.isColor && (v(i, 1), (n = !0)) var a = e.xr.getEnvironmentBlendMode() ;('additive' === a ? r.buffers.color.setClear(0, 0, 0, 1, o) : 'alpha-blend' === a && r.buffers.color.setClear(0, 0, 0, 0, o), (e.autoClear || n) && (r.buffers.depth.setTest(!0), r.buffers.depth.setMask(!0), r.buffers.color.setMask(!0), e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil))) }, addToRenderList: function (t, n) { var r = p(n) r && (r.isCubeTexture || r.mapping === rl) ? (void 0 === u && ((u = new gf( new _f(1, 1, 1), new wf({ name: 'BackgroundCubeMaterial', uniforms: bf(lm.backgroundCube.uniforms), vertexShader: lm.backgroundCube.vertexShader, fragmentShader: lm.backgroundCube.fragmentShader, side: 1, depthTest: !1, depthWrite: !1, fog: !1, }) )).geometry.deleteAttribute('normal'), u.geometry.deleteAttribute('uv'), (u.onBeforeRender = function (e, t, n) { this.matrixWorld.copyPosition(n.matrixWorld) }), Object.defineProperty(u.material, 'envMap', { get: function () { return this.uniforms.envMap.value }, }), i.update(u)), hm.copy(n.backgroundRotation), (hm.x *= -1), (hm.y *= -1), (hm.z *= -1), r.isCubeTexture && !1 === r.isRenderTargetTexture && ((hm.y *= -1), (hm.z *= -1)), (u.material.uniforms.envMap.value = r), (u.material.uniforms.flipEnvMap.value = r.isCubeTexture && !1 === r.isRenderTargetTexture ? -1 : 1), (u.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness), (u.material.uniforms.backgroundIntensity.value = n.backgroundIntensity), u.material.uniforms.backgroundRotation.value.setFromMatrix4( dm.makeRotationFromEuler(hm) ), (u.material.toneMapped = $c.getTransfer(r.colorSpace) !== Sc), (h === r && d === r.version && f === e.toneMapping) || ((u.material.needsUpdate = !0), (h = r), (d = r.version), (f = e.toneMapping)), u.layers.enableAll(), t.unshift(u, u.geometry, u.material, 0, 0, null)) : r && r.isTexture && (void 0 === s && ((s = new gf( new Wp(2, 2), new wf({ name: 'BackgroundMaterial', uniforms: bf(lm.background.uniforms), vertexShader: lm.background.vertexShader, fragmentShader: lm.background.fragmentShader, side: 0, depthTest: !1, depthWrite: !1, fog: !1, }) )).geometry.deleteAttribute('normal'), Object.defineProperty(s.material, 'map', { get: function () { return this.uniforms.t2D.value }, }), i.update(s)), (s.material.uniforms.t2D.value = r), (s.material.uniforms.backgroundIntensity.value = n.backgroundIntensity), (s.material.toneMapped = $c.getTransfer(r.colorSpace) !== Sc), !0 === r.matrixAutoUpdate && r.updateMatrix(), s.material.uniforms.uvTransform.value.copy(r.matrix), (h === r && d === r.version && f === e.toneMapping) || ((s.material.needsUpdate = !0), (h = r), (d = r.version), (f = e.toneMapping)), s.layers.enableAll(), t.unshift(s, s.geometry, s.material, 0, 0, null)) }, dispose: function () { ;(void 0 !== u && (u.geometry.dispose(), u.material.dispose(), (u = void 0)), void 0 !== s && (s.geometry.dispose(), s.material.dispose(), (s = void 0))) }, } } function pm(e, t) { var n = e.getParameter(e.MAX_VERTEX_ATTRIBS), r = {}, i = l(null), a = i, o = !1 function s(t) { return e.bindVertexArray(t) } function u(t) { return e.deleteVertexArray(t) } function l(e) { for (var t = [], r = [], i = [], a = 0; a < n; a++) ((t[a] = 0), (r[a] = 0), (i[a] = 0)) return { geometry: null, program: null, wireframe: !1, newAttributes: t, enabledAttributes: r, attributeDivisors: i, object: e, attributes: {}, index: null, } } function c() { for (var e = a.newAttributes, t = 0, n = e.length; t < n; t++) e[t] = 0 } function h(e) { d(e, 0) } function d(t, n) { var r = a.newAttributes, i = a.enabledAttributes, o = a.attributeDivisors ;((r[t] = 1), 0 === i[t] && (e.enableVertexAttribArray(t), (i[t] = 1)), o[t] !== n && (e.vertexAttribDivisor(t, n), (o[t] = n))) } function f() { for ( var t = a.newAttributes, n = a.enabledAttributes, r = 0, i = n.length; r < i; r++ ) n[r] !== t[r] && (e.disableVertexAttribArray(r), (n[r] = 0)) } function p(t, n, r, i, a, o, s) { !0 === s ? e.vertexAttribIPointer(t, n, r, a, o) : e.vertexAttribPointer(t, n, r, i, a, o) } function v() { ;(m(), (o = !0), a !== i && s((a = i).object)) } function m() { ;((i.geometry = null), (i.program = null), (i.wireframe = !1)) } return { setup: function (n, i, u, v, m) { var g, y = (function (t, n, i) { var a = !0 === i.wireframe, o = r[t.id] void 0 === o && ((o = {}), (r[t.id] = o)) var s = o[n.id] void 0 === s && ((s = {}), (o[n.id] = s)) var u = s[a] void 0 === u && ((u = l(e.createVertexArray())), (s[a] = u)) return u })(v, u, i) ;(a !== y && s((a = y).object), (g = (function (e, t, n, r) { var i = a.attributes, o = t.attributes, s = 0, u = n.getAttributes() for (var l in u) { if (u[l].location >= 0) { var c = i[l], h = o[l] if ( (void 0 === h && ('instanceMatrix' === l && e.instanceMatrix && (h = e.instanceMatrix), 'instanceColor' === l && e.instanceColor && (h = e.instanceColor)), void 0 === c) ) return !0 if (c.attribute !== h) return !0 if (h && c.data !== h.data) return !0 s++ } } return a.attributesNum !== s || a.index !== r })(n, v, u, m)) && (function (e, t, n, r) { var i = {}, o = t.attributes, s = 0, u = n.getAttributes() for (var l in u) { if (u[l].location >= 0) { var c = o[l] void 0 === c && ('instanceMatrix' === l && e.instanceMatrix && (c = e.instanceMatrix), 'instanceColor' === l && e.instanceColor && (c = e.instanceColor)) var h = {} ;((h.attribute = c), c && c.data && (h.data = c.data), (i[l] = h), s++) } } ;((a.attributes = i), (a.attributesNum = s), (a.index = r)) })(n, v, u, m), null !== m && t.update(m, e.ELEMENT_ARRAY_BUFFER), (g || o) && ((o = !1), (function (n, r, i, a) { c() var o = a.attributes, s = i.getAttributes(), u = r.defaultAttributeValues for (var l in s) { var v = s[l] if (v.location >= 0) { var m = o[l] if ( (void 0 === m && ('instanceMatrix' === l && n.instanceMatrix && (m = n.instanceMatrix), 'instanceColor' === l && n.instanceColor && (m = n.instanceColor)), void 0 !== m) ) { var g = m.normalized, y = m.itemSize, _ = t.get(m) if (void 0 === _) continue var b = _.buffer, x = _.type, S = _.bytesPerElement, A = x === e.INT || x === e.UNSIGNED_INT || m.gpuType === ml if (m.isInterleavedBufferAttribute) { var w = m.data, T = w.stride, M = m.offset if (w.isInstancedInterleavedBuffer) { for (var E = 0; E < v.locationSize; E++) d(v.location + E, w.meshPerAttribute) !0 !== n.isInstancedMesh && void 0 === a._maxInstanceCount && (a._maxInstanceCount = w.meshPerAttribute * w.count) } else for (var C = 0; C < v.locationSize; C++) h(v.location + C) e.bindBuffer(e.ARRAY_BUFFER, b) for (var k = 0; k < v.locationSize; k++) p( v.location + k, y / v.locationSize, x, g, T * S, (M + (y / v.locationSize) * k) * S, A ) } else { if (m.isInstancedBufferAttribute) { for (var R = 0; R < v.locationSize; R++) d(v.location + R, m.meshPerAttribute) !0 !== n.isInstancedMesh && void 0 === a._maxInstanceCount && (a._maxInstanceCount = m.meshPerAttribute * m.count) } else for (var I = 0; I < v.locationSize; I++) h(v.location + I) e.bindBuffer(e.ARRAY_BUFFER, b) for (var N = 0; N < v.locationSize; N++) p( v.location + N, y / v.locationSize, x, g, y * S, (y / v.locationSize) * N * S, A ) } } else if (void 0 !== u) { var P = u[l] if (void 0 !== P) switch (P.length) { case 2: e.vertexAttrib2fv(v.location, P) break case 3: e.vertexAttrib3fv(v.location, P) break case 4: e.vertexAttrib4fv(v.location, P) break default: e.vertexAttrib1fv(v.location, P) } } } } f() })(n, i, u, v), null !== m && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, t.get(m).buffer))) }, reset: v, resetDefaultState: m, dispose: function () { for (var e in (v(), r)) { var t = r[e] for (var n in t) { var i = t[n] for (var a in i) (u(i[a].object), delete i[a]) delete t[n] } delete r[e] } }, releaseStatesOfGeometry: function (e) { if (void 0 !== r[e.id]) { var t = r[e.id] for (var n in t) { var i = t[n] for (var a in i) (u(i[a].object), delete i[a]) delete t[n] } delete r[e.id] } }, releaseStatesOfProgram: function (e) { for (var t in r) { var n = r[t] if (void 0 !== n[e.id]) { var i = n[e.id] for (var a in i) (u(i[a].object), delete i[a]) delete n[e.id] } } }, initAttributes: c, enableAttribute: h, disableUnusedAttributes: f, } } function vm(e, t, n) { var r function i(t, i, a) { 0 !== a && (e.drawArraysInstanced(r, t, i, a), n.update(i, r, a)) } ;((this.setMode = function (e) { r = e }), (this.render = function (t, i) { ;(e.drawArrays(r, t, i), n.update(i, r, 1)) }), (this.renderInstances = i), (this.renderMultiDraw = function (e, i, a) { if (0 !== a) { t.get('WEBGL_multi_draw').multiDrawArraysWEBGL(r, e, 0, i, 0, a) for (var o = 0, s = 0; s < a; s++) o += i[s] n.update(o, r, 1) } }), (this.renderMultiDrawInstances = function (e, a, o, s) { if (0 !== o) { var u = t.get('WEBGL_multi_draw') if (null === u) for (var l = 0; l < e.length; l++) i(e[l], a[l], s[l]) else { u.multiDrawArraysInstancedWEBGL(r, e, 0, a, 0, s, 0, o) for (var c = 0, h = 0; h < o; h++) c += a[h] * s[h] n.update(c, r, 1) } } })) } function mm(e, t, n, r) { var i function a(t) { if ('highp' === t) { if ( e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0 ) return 'highp' t = 'mediump' } return 'mediump' === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? 'mediump' : 'lowp' } var o = void 0 !== n.precision ? n.precision : 'highp', s = a(o) s !== o && (console.warn('THREE.WebGLRenderer:', o, 'not supported, using', s, 'instead.'), (o = s)) var u = !0 === n.logarithmicDepthBuffer, l = !0 === n.reverseDepthBuffer && t.has('EXT_clip_control'), c = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS) return { isWebGL2: !0, getMaxAnisotropy: function () { if (void 0 !== i) return i if (!0 === t.has('EXT_texture_filter_anisotropic')) { var n = t.get('EXT_texture_filter_anisotropic') i = e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT) } else i = 0 return i }, getMaxPrecision: a, textureFormatReadable: function (t) { return ( t === wl || r.convert(t) === e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT) ) }, textureTypeReadable: function (n) { var i = n === _l && (t.has('EXT_color_buffer_half_float') || t.has('EXT_color_buffer_float')) return !( n !== dl && r.convert(n) !== e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE) && n !== yl && !i ) }, precision: o, logarithmicDepthBuffer: u, reverseDepthBuffer: l, maxTextures: c, maxVertexTextures: h, maxTextureSize: e.getParameter(e.MAX_TEXTURE_SIZE), maxCubemapSize: e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), maxAttributes: e.getParameter(e.MAX_VERTEX_ATTRIBS), maxVertexUniforms: e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), maxVaryings: e.getParameter(e.MAX_VARYING_VECTORS), maxFragmentUniforms: e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), vertexTextures: h > 0, maxSamples: e.getParameter(e.MAX_SAMPLES), } } function gm(e) { var t = this, n = null, r = 0, i = !1, a = !1, o = new pp(), s = new Hc(), u = { value: null, needsUpdate: !1 } function l(e, n, r, i) { var a = null !== e ? e.length : 0, l = null if (0 !== a) { if (((l = u.value), !0 !== i || null === l)) { var c = r + 4 * a, h = n.matrixWorldInverse ;(s.getNormalMatrix(h), (null === l || l.length < c) && (l = new Float32Array(c))) for (var d = 0, f = r; d !== a; ++d, f += 4) (o.copy(e[d]).applyMatrix4(h, s), o.normal.toArray(l, f), (l[f + 3] = o.constant)) } ;((u.value = l), (u.needsUpdate = !0)) } return ((t.numPlanes = a), (t.numIntersection = 0), l) } ;((this.uniform = u), (this.numPlanes = 0), (this.numIntersection = 0), (this.init = function (e, t) { var n = 0 !== e.length || t || 0 !== r || i return ((i = t), (r = e.length), n) }), (this.beginShadows = function () { ;((a = !0), l(null)) }), (this.endShadows = function () { a = !1 }), (this.setGlobalState = function (e, t) { n = l(e, t, 0) }), (this.setState = function (o, s, c) { var h = o.clippingPlanes, d = o.clipIntersection, f = o.clipShadows, p = e.get(o) if (!i || null === h || 0 === h.length || (a && !f)) a ? l(null) : (function () { u.value !== n && ((u.value = n), (u.needsUpdate = r > 0)) ;((t.numPlanes = r), (t.numIntersection = 0)) })() else { var v = a ? 0 : r, m = 4 * v, g = p.clippingState || null ;((u.value = g), (g = l(h, s, m, c))) for (var y = 0; y !== m; ++y) g[y] = n[y] ;((p.clippingState = g), (this.numIntersection = d ? this.numPlanes : 0), (this.numPlanes += v)) } })) } function ym(e) { var t = new WeakMap() function n(e, t) { return (303 === t ? (e.mapping = tl) : 304 === t && (e.mapping = nl), e) } function r(e) { var n = e.target n.removeEventListener('dispose', r) var i = t.get(n) void 0 !== i && (t.delete(n), i.dispose()) } return { get: function (i) { if (i && i.isTexture) { var a = i.mapping if (303 === a || 304 === a) { if (t.has(i)) return n(t.get(i).texture, i.mapping) var o = i.image if (o && o.height > 0) { var s = new Pf(o.height) return ( s.fromEquirectangularTexture(e, i), t.set(i, s), i.addEventListener('dispose', r), n(s.texture, i.mapping) ) } return null } } return i }, dispose: function () { t = new WeakMap() }, } } var _m = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], bm = 20, xm = new Lv(), Sm = new Od(), Am = null, wm = 0, Tm = 0, Mm = !1, Em = (1 + Math.sqrt(5)) / 2, Cm = 1 / Em, km = [ new ph(-Em, Cm, 0), new ph(Em, Cm, 0), new ph(-Cm, 0, Em), new ph(Cm, 0, Em), new ph(0, Em, -Cm), new ph(0, Em, Cm), new ph(-1, 1, -1), new ph(1, 1, -1), new ph(-1, 1, 1), new ph(1, 1, 1), ], Rm = (function () { return T( function e(t) { ;(A(this, e), (this._renderer = t), (this._pingPongRenderTarget = null), (this._lodMax = 0), (this._cubeSize = 0), (this._lodPlanes = []), (this._sizeLods = []), (this._sigmas = []), (this._blurMaterial = null), (this._cubemapMaterial = null), (this._equirectMaterial = null), this._compileMaterial(this._blurMaterial)) }, [ { key: 'fromScene', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0.1, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 100 ;((Am = this._renderer.getRenderTarget()), (wm = this._renderer.getActiveCubeFace()), (Tm = this._renderer.getActiveMipmapLevel()), (Mm = this._renderer.xr.enabled), (this._renderer.xr.enabled = !1), this._setSize(256)) var i = this._allocateTargets() return ( (i.depthBuffer = !0), this._sceneToCubeUV(e, n, r, i), t > 0 && this._blur(i, 0, 0, t), this._applyPMREM(i), this._cleanup(i), i ) }, }, { key: 'fromEquirectangular', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return this._fromTexture(e, t) }, }, { key: 'fromCubemap', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return this._fromTexture(e, t) }, }, { key: 'compileCubemapShader', value: function () { null === this._cubemapMaterial && ((this._cubemapMaterial = Lm()), this._compileMaterial(this._cubemapMaterial)) }, }, { key: 'compileEquirectangularShader', value: function () { null === this._equirectMaterial && ((this._equirectMaterial = Pm()), this._compileMaterial(this._equirectMaterial)) }, }, { key: 'dispose', value: function () { ;(this._dispose(), null !== this._cubemapMaterial && this._cubemapMaterial.dispose(), null !== this._equirectMaterial && this._equirectMaterial.dispose()) }, }, { key: '_setSize', value: function (e) { ;((this._lodMax = Math.floor(Math.log2(e))), (this._cubeSize = Math.pow(2, this._lodMax))) }, }, { key: '_dispose', value: function () { ;(null !== this._blurMaterial && this._blurMaterial.dispose(), null !== this._pingPongRenderTarget && this._pingPongRenderTarget.dispose()) for (var e = 0; e < this._lodPlanes.length; e++) this._lodPlanes[e].dispose() }, }, { key: '_cleanup', value: function (e) { ;(this._renderer.setRenderTarget(Am, wm, Tm), (this._renderer.xr.enabled = Mm), (e.scissorTest = !1), Nm(e, 0, 0, e.width, e.height)) }, }, { key: '_fromTexture', value: function (e, t) { ;(e.mapping === tl || e.mapping === nl ? this._setSize( 0 === e.image.length ? 16 : e.image[0].width || e.image[0].image.width ) : this._setSize(e.image.width / 4), (Am = this._renderer.getRenderTarget()), (wm = this._renderer.getActiveCubeFace()), (Tm = this._renderer.getActiveMipmapLevel()), (Mm = this._renderer.xr.enabled), (this._renderer.xr.enabled = !1)) var n = t || this._allocateTargets() return (this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n) }, }, { key: '_allocateTargets', value: function () { var e = 3 * Math.max(this._cubeSize, 112), t = 4 * this._cubeSize, n = { magFilter: ll, minFilter: ll, generateMipmaps: !1, type: _l, format: wl, colorSpace: bc, depthBuffer: !1, }, r = Im(e, t, n) if ( null === this._pingPongRenderTarget || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t ) { ;(null !== this._pingPongRenderTarget && this._dispose(), (this._pingPongRenderTarget = Im(e, t, n))) var i = this._lodMax, a = (function (e) { for ( var t = [], n = [], r = [], i = e, a = e - 4 + 1 + _m.length, o = 0; o < a; o++ ) { var s = Math.pow(2, i) n.push(s) var u = 1 / s ;(o > e - 4 ? (u = _m[o - e + 4 - 1]) : 0 === o && (u = 0), r.push(u)) for ( var l = 1 / (s - 2), c = -l, h = 1 + l, d = [c, c, h, c, h, h, c, c, h, h, c, h], f = 6, p = 6, v = 3, m = 2, g = 1, y = new Float32Array(v * p * f), _ = new Float32Array(m * p * f), b = new Float32Array(g * p * f), x = 0; x < f; x++ ) { var S = ((x % 3) * 2) / 3 - 1, A = x > 2 ? 0 : -1, w = [ S, A, 0, S + 2 / 3, A, 0, S + 2 / 3, A + 1, 0, S, A, 0, S + 2 / 3, A + 1, 0, S, A + 1, 0, ] ;(y.set(w, v * p * x), _.set(d, m * p * x)) var T = [x, x, x, x, x, x] b.set(T, g * p * x) } var M = new af() ;(M.setAttribute('position', new qd(y, v)), M.setAttribute('uv', new qd(_, m)), M.setAttribute('faceIndex', new qd(b, g)), t.push(M), i > 4 && i--) } return { lodPlanes: t, sizeLods: n, sigmas: r } })(i) ;((this._sizeLods = a.sizeLods), (this._lodPlanes = a.lodPlanes), (this._sigmas = a.sigmas), (this._blurMaterial = (function (e, t, n) { var r = new Float32Array(bm), i = new ph(0, 1, 0), a = new wf({ name: 'SphericalGaussianBlur', defines: { n: bm, CUBEUV_TEXEL_WIDTH: 1 / t, CUBEUV_TEXEL_HEIGHT: 1 / n, CUBEUV_MAX_MIP: ''.concat(e, '.0'), }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: r }, latitudinal: { value: !1 }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: i }, }, vertexShader: '\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t', fragmentShader: "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t", blending: 0, depthTest: !1, depthWrite: !1, }) return a })(i, e, t))) } return r }, }, { key: '_compileMaterial', value: function (e) { var t = new gf(this._lodPlanes[0], e) this._renderer.compile(t, xm) }, }, { key: '_sceneToCubeUV', value: function (e, t, n, r) { var i = new kf(90, 1, t, n), a = [1, -1, 1, 1, 1, 1], o = [1, 1, 1, -1, -1, -1], s = this._renderer, u = s.autoClear, l = s.toneMapping ;(s.getClearColor(Sm), (s.toneMapping = 0), (s.autoClear = !1)) var c = new zd({ name: 'PMREM.Background', side: 1, depthWrite: !1, depthTest: !1, }), h = new gf(new _f(), c), d = !1, f = e.background f ? f.isColor && (c.color.copy(f), (e.background = null), (d = !0)) : (c.color.copy(Sm), (d = !0)) for (var p = 0; p < 6; p++) { var v = p % 3 0 === v ? (i.up.set(0, a[p], 0), i.lookAt(o[p], 0, 0)) : 1 === v ? (i.up.set(0, 0, a[p]), i.lookAt(0, o[p], 0)) : (i.up.set(0, a[p], 0), i.lookAt(0, 0, o[p])) var m = this._cubeSize ;(Nm(r, v * m, p > 2 ? m : 0, m, m), s.setRenderTarget(r), d && s.render(h, i), s.render(e, i)) } ;(h.geometry.dispose(), h.material.dispose(), (s.toneMapping = l), (s.autoClear = u), (e.background = f)) }, }, { key: '_textureToCubeUV', value: function (e, t) { var n = this._renderer, r = e.mapping === tl || e.mapping === nl r ? (null === this._cubemapMaterial && (this._cubemapMaterial = Lm()), (this._cubemapMaterial.uniforms.flipEnvMap.value = !1 === e.isRenderTargetTexture ? -1 : 1)) : null === this._equirectMaterial && (this._equirectMaterial = Pm()) var i = r ? this._cubemapMaterial : this._equirectMaterial, a = new gf(this._lodPlanes[0], i) i.uniforms.envMap.value = e var o = this._cubeSize ;(Nm(t, 0, 0, 3 * o, 2 * o), n.setRenderTarget(t), n.render(a, xm)) }, }, { key: '_applyPMREM', value: function (e) { var t = this._renderer, n = t.autoClear t.autoClear = !1 for (var r = this._lodPlanes.length, i = 1; i < r; i++) { var a = Math.sqrt( this._sigmas[i] * this._sigmas[i] - this._sigmas[i - 1] * this._sigmas[i - 1] ), o = km[(r - i - 1) % km.length] this._blur(e, i - 1, i, a, o) } t.autoClear = n }, }, { key: '_blur', value: function (e, t, n, r, i) { var a = this._pingPongRenderTarget ;(this._halfBlur(e, a, t, n, r, 'latitudinal', i), this._halfBlur(a, e, n, n, r, 'longitudinal', i)) }, }, { key: '_halfBlur', value: function (e, t, n, r, i, a, o) { var s = this._renderer, u = this._blurMaterial 'latitudinal' !== a && 'longitudinal' !== a && console.error('blur direction must be either latitudinal or longitudinal!') var l = new gf(this._lodPlanes[r], u), c = u.uniforms, h = this._sizeLods[n] - 1, d = isFinite(i) ? Math.PI / (2 * h) : (2 * Math.PI) / 39, f = i / d, p = isFinite(i) ? 1 + Math.floor(3 * f) : bm p > bm && console.warn( 'sigmaRadians, ' .concat(i, ', is too large and will clip, as it requested ') .concat(p, ' samples when the maximum is set to ') .concat(bm) ) for (var v = [], m = 0, g = 0; g < bm; ++g) { var y = g / f, _ = Math.exp((-y * y) / 2) ;(v.push(_), 0 === g ? (m += _) : g < p && (m += 2 * _)) } for (var b = 0; b < v.length; b++) v[b] = v[b] / m ;((c.envMap.value = e.texture), (c.samples.value = p), (c.weights.value = v), (c.latitudinal.value = 'latitudinal' === a), o && (c.poleAxis.value = o)) var x = this._lodMax ;((c.dTheta.value = d), (c.mipInt.value = x - n)) var S = this._sizeLods[r] ;(Nm( t, 3 * S * (r > x - 4 ? r - x + 4 : 0), 4 * (this._cubeSize - S), 3 * S, 2 * S ), s.setRenderTarget(t), s.render(l, xm)) }, }, ] ) })() function Im(e, t, n) { var r = new ch(e, t, n) return ( (r.texture.mapping = rl), (r.texture.name = 'PMREM.cubeUv'), (r.scissorTest = !0), r ) } function Nm(e, t, n, r, i) { ;(e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i)) } function Pm() { return new wf({ name: 'EquirectangularToCubeUV', uniforms: { envMap: { value: null } }, vertexShader: '\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t', fragmentShader: '\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t', blending: 0, depthTest: !1, depthWrite: !1, }) } function Lm() { return new wf({ name: 'CubemapToCubeUV', uniforms: { envMap: { value: null }, flipEnvMap: { value: -1 } }, vertexShader: '\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t', fragmentShader: '\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t', blending: 0, depthTest: !1, depthWrite: !1, }) } function Dm(e) { var t = new WeakMap(), n = null function r(e) { var n = e.target n.removeEventListener('dispose', r) var i = t.get(n) void 0 !== i && (t.delete(n), i.dispose()) } return { get: function (i) { if (i && i.isTexture) { var a = i.mapping, o = 303 === a || 304 === a, s = a === tl || a === nl if (o || s) { var u = t.get(i), l = void 0 !== u ? u.texture.pmremVersion : 0 if (i.isRenderTargetTexture && i.pmremVersion !== l) return ( null === n && (n = new Rm(e)), ((u = o ? n.fromEquirectangular(i, u) : n.fromCubemap(i, u)).texture.pmremVersion = i.pmremVersion), t.set(i, u), u.texture ) if (void 0 !== u) return u.texture var c = i.image return (o && c && c.height > 0) || (s && c && (function (e) { for (var t = 0, n = 6, r = 0; r < n; r++) void 0 !== e[r] && t++ return t === n })(c)) ? (null === n && (n = new Rm(e)), ((u = o ? n.fromEquirectangular(i) : n.fromCubemap(i)).texture.pmremVersion = i.pmremVersion), t.set(i, u), i.addEventListener('dispose', r), u.texture) : null } } return i }, dispose: function () { ;((t = new WeakMap()), null !== n && (n.dispose(), (n = null))) }, } } function Om(e) { var t = {} function n(n) { if (void 0 !== t[n]) return t[n] var r switch (n) { case 'WEBGL_depth_texture': r = e.getExtension('WEBGL_depth_texture') || e.getExtension('MOZ_WEBGL_depth_texture') || e.getExtension('WEBKIT_WEBGL_depth_texture') break case 'EXT_texture_filter_anisotropic': r = e.getExtension('EXT_texture_filter_anisotropic') || e.getExtension('MOZ_EXT_texture_filter_anisotropic') || e.getExtension('WEBKIT_EXT_texture_filter_anisotropic') break case 'WEBGL_compressed_texture_s3tc': r = e.getExtension('WEBGL_compressed_texture_s3tc') || e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc') break case 'WEBGL_compressed_texture_pvrtc': r = e.getExtension('WEBGL_compressed_texture_pvrtc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc') break default: r = e.getExtension(n) } return ((t[n] = r), r) } return { has: function (e) { return null !== n(e) }, init: function () { ;(n('EXT_color_buffer_float'), n('WEBGL_clip_cull_distance'), n('OES_texture_float_linear'), n('EXT_color_buffer_half_float'), n('WEBGL_multisampled_render_to_texture'), n('WEBGL_render_shared_exponent')) }, get: function (e) { var t = n(e) return ( null === t && qc('THREE.WebGLRenderer: ' + e + ' extension not supported.'), t ) }, } } function Fm(e, t, n, r) { var i = {}, a = new WeakMap() function o(e) { var s = e.target for (var u in (null !== s.index && t.remove(s.index), s.attributes)) t.remove(s.attributes[u]) ;(s.removeEventListener('dispose', o), delete i[s.id]) var l = a.get(s) ;(l && (t.remove(l), a.delete(s)), r.releaseStatesOfGeometry(s), !0 === s.isInstancedBufferGeometry && delete s._maxInstanceCount, n.memory.geometries--) } function s(e) { var n = [], r = e.index, i = e.attributes.position, o = 0 if (null !== r) { var s = r.array o = r.version for (var u = 0, l = s.length; u < l; u += 3) { var c = s[u + 0], h = s[u + 1], d = s[u + 2] n.push(c, h, h, d, d, c) } } else { if (void 0 === i) return var f = i.array o = i.version for (var p = 0, v = f.length / 3 - 1; p < v; p += 3) { var m = p + 0, g = p + 1, y = p + 2 n.push(m, g, g, y, y, m) } } var _ = new (Gc(n) ? Yd : Xd)(n, 1) _.version = o var b = a.get(e) ;(b && t.remove(b), a.set(e, _)) } return { get: function (e, t) { return ( !0 === i[t.id] || (t.addEventListener('dispose', o), (i[t.id] = !0), n.memory.geometries++), t ) }, update: function (n) { var r = n.attributes for (var i in r) t.update(r[i], e.ARRAY_BUFFER) }, getWireframeAttribute: function (e) { var t = a.get(e) if (t) { var n = e.index null !== n && t.version < n.version && s(e) } else s(e) return a.get(e) }, } } function Bm(e, t, n) { var r, i, a function o(t, o, s) { 0 !== s && (e.drawElementsInstanced(r, o, i, t * a, s), n.update(o, r, s)) } ;((this.setMode = function (e) { r = e }), (this.setIndex = function (e) { ;((i = e.type), (a = e.bytesPerElement)) }), (this.render = function (t, o) { ;(e.drawElements(r, o, i, t * a), n.update(o, r, 1)) }), (this.renderInstances = o), (this.renderMultiDraw = function (e, a, o) { if (0 !== o) { t.get('WEBGL_multi_draw').multiDrawElementsWEBGL(r, a, 0, i, e, 0, o) for (var s = 0, u = 0; u < o; u++) s += a[u] n.update(s, r, 1) } }), (this.renderMultiDrawInstances = function (e, s, u, l) { if (0 !== u) { var c = t.get('WEBGL_multi_draw') if (null === c) for (var h = 0; h < e.length; h++) o(e[h] / a, s[h], l[h]) else { c.multiDrawElementsInstancedWEBGL(r, s, 0, i, e, 0, l, 0, u) for (var d = 0, f = 0; f < u; f++) d += s[f] * l[f] n.update(d, r, 1) } } })) } function Um(e) { var t = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 } return { memory: { geometries: 0, textures: 0 }, render: t, programs: null, autoReset: !0, reset: function () { ;((t.calls = 0), (t.triangles = 0), (t.points = 0), (t.lines = 0)) }, update: function (n, r, i) { switch ((t.calls++, r)) { case e.TRIANGLES: t.triangles += i * (n / 3) break case e.LINES: t.lines += i * (n / 2) break case e.LINE_STRIP: t.lines += i * (n - 1) break case e.LINE_LOOP: t.lines += i * n break case e.POINTS: t.points += i * n break default: console.error('THREE.WebGLInfo: Unknown draw mode:', r) } }, } } function zm(e, t, n) { var r = new WeakMap(), i = new uh() return { update: function (a, o, s) { var u = a.morphTargetInfluences, l = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, c = void 0 !== l ? l.length : 0, h = r.get(o) if (void 0 === h || h.count !== c) { void 0 !== h && h.texture.dispose() var d = void 0 !== o.morphAttributes.position, f = void 0 !== o.morphAttributes.normal, p = void 0 !== o.morphAttributes.color, v = o.morphAttributes.position || [], m = o.morphAttributes.normal || [], g = o.morphAttributes.color || [], y = 0 ;(!0 === d && (y = 1), !0 === f && (y = 2), !0 === p && (y = 3)) var _ = o.attributes.position.count * y, b = 1 _ > t.maxTextureSize && ((b = Math.ceil(_ / t.maxTextureSize)), (_ = t.maxTextureSize)) var x = new Float32Array(_ * b * 4 * c), S = new hh(x, _, b, c) ;((S.type = yl), (S.needsUpdate = !0)) for (var A = 4 * y, w = 0; w < c; w++) for ( var T = v[w], M = m[w], E = g[w], C = _ * b * 4 * w, k = 0; k < T.count; k++ ) { var R = k * A ;(!0 === d && (i.fromBufferAttribute(T, k), (x[C + R + 0] = i.x), (x[C + R + 1] = i.y), (x[C + R + 2] = i.z), (x[C + R + 3] = 0)), !0 === f && (i.fromBufferAttribute(M, k), (x[C + R + 4] = i.x), (x[C + R + 5] = i.y), (x[C + R + 6] = i.z), (x[C + R + 7] = 0)), !0 === p && (i.fromBufferAttribute(E, k), (x[C + R + 8] = i.x), (x[C + R + 9] = i.y), (x[C + R + 10] = i.z), (x[C + R + 11] = 4 === E.itemSize ? i.w : 1))) } function L() { ;(S.dispose(), r.delete(o), o.removeEventListener('dispose', L)) } ;((h = { count: c, texture: S, size: new Vc(_, b) }), r.set(o, h), o.addEventListener('dispose', L)) } if (!0 === a.isInstancedMesh && null !== a.morphTexture) s.getUniforms().setValue(e, 'morphTexture', a.morphTexture, n) else { for (var I = 0, N = 0; N < u.length; N++) I += u[N] var P = o.morphTargetsRelative ? 1 : 1 - I ;(s.getUniforms().setValue(e, 'morphTargetBaseInfluence', P), s.getUniforms().setValue(e, 'morphTargetInfluences', u)) } ;(s.getUniforms().setValue(e, 'morphTargetsTexture', h.texture, n), s.getUniforms().setValue(e, 'morphTargetsTextureSize', h.size)) }, } } function Vm(e, t, n, r) { var i = new WeakMap() function a(e) { var t = e.target ;(t.removeEventListener('dispose', a), n.remove(t.instanceMatrix), null !== t.instanceColor && n.remove(t.instanceColor)) } return { update: function (o) { var s = r.render.frame, u = o.geometry, l = t.get(o, u) if ( (i.get(l) !== s && (t.update(l), i.set(l, s)), o.isInstancedMesh && (!1 === o.hasEventListener('dispose', a) && o.addEventListener('dispose', a), i.get(o) !== s && (n.update(o.instanceMatrix, e.ARRAY_BUFFER), null !== o.instanceColor && n.update(o.instanceColor, e.ARRAY_BUFFER), i.set(o, s))), o.isSkinnedMesh) ) { var c = o.skeleton i.get(c) !== s && (c.update(), i.set(c, s)) } return l }, dispose: function () { i = new WeakMap() }, } } var Hm = new sh(), Wm = new zp(1, 1), Gm = new hh(), jm = new dh(), Qm = new Nf(), qm = [], Xm = [], Ym = new Float32Array(16), Km = new Float32Array(9), Zm = new Float32Array(4) function Jm(e, t, n) { var r = e[0] if (r <= 0 || r > 0) return e var i = t * n, a = qm[i] if ((void 0 === a && ((a = new Float32Array(i)), (qm[i] = a)), 0 !== t)) { r.toArray(a, 0) for (var o = 1, s = 0; o !== t; ++o) ((s += n), e[o].toArray(a, s)) } return a } function $m(e, t) { if (e.length !== t.length) return !1 for (var n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1 return !0 } function eg(e, t) { for (var n = 0, r = t.length; n < r; n++) e[n] = t[n] } function tg(e, t) { var n = Xm[t] void 0 === n && ((n = new Int32Array(t)), (Xm[t] = n)) for (var r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit() return n } function ng(e, t) { var n = this.cache n[0] !== t && (e.uniform1f(this.addr, t), (n[0] = t)) } function rg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y) || (e.uniform2f(this.addr, t.x, t.y), (n[0] = t.x), (n[1] = t.y)) else { if ($m(n, t)) return ;(e.uniform2fv(this.addr, t), eg(n, t)) } } function ig(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z) || (e.uniform3f(this.addr, t.x, t.y, t.z), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z)) else if (void 0 !== t.r) (n[0] === t.r && n[1] === t.g && n[2] === t.b) || (e.uniform3f(this.addr, t.r, t.g, t.b), (n[0] = t.r), (n[1] = t.g), (n[2] = t.b)) else { if ($m(n, t)) return ;(e.uniform3fv(this.addr, t), eg(n, t)) } } function ag(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w) || (e.uniform4f(this.addr, t.x, t.y, t.z, t.w), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z), (n[3] = t.w)) else { if ($m(n, t)) return ;(e.uniform4fv(this.addr, t), eg(n, t)) } } function og(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if ($m(n, t)) return ;(e.uniformMatrix2fv(this.addr, !1, t), eg(n, t)) } else { if ($m(n, r)) return ;(Zm.set(r), e.uniformMatrix2fv(this.addr, !1, Zm), eg(n, r)) } } function sg(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if ($m(n, t)) return ;(e.uniformMatrix3fv(this.addr, !1, t), eg(n, t)) } else { if ($m(n, r)) return ;(Km.set(r), e.uniformMatrix3fv(this.addr, !1, Km), eg(n, r)) } } function ug(e, t) { var n = this.cache, r = t.elements if (void 0 === r) { if ($m(n, t)) return ;(e.uniformMatrix4fv(this.addr, !1, t), eg(n, t)) } else { if ($m(n, r)) return ;(Ym.set(r), e.uniformMatrix4fv(this.addr, !1, Ym), eg(n, r)) } } function lg(e, t) { var n = this.cache n[0] !== t && (e.uniform1i(this.addr, t), (n[0] = t)) } function cg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y) || (e.uniform2i(this.addr, t.x, t.y), (n[0] = t.x), (n[1] = t.y)) else { if ($m(n, t)) return ;(e.uniform2iv(this.addr, t), eg(n, t)) } } function hg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z) || (e.uniform3i(this.addr, t.x, t.y, t.z), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z)) else { if ($m(n, t)) return ;(e.uniform3iv(this.addr, t), eg(n, t)) } } function dg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w) || (e.uniform4i(this.addr, t.x, t.y, t.z, t.w), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z), (n[3] = t.w)) else { if ($m(n, t)) return ;(e.uniform4iv(this.addr, t), eg(n, t)) } } function fg(e, t) { var n = this.cache n[0] !== t && (e.uniform1ui(this.addr, t), (n[0] = t)) } function pg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y) || (e.uniform2ui(this.addr, t.x, t.y), (n[0] = t.x), (n[1] = t.y)) else { if ($m(n, t)) return ;(e.uniform2uiv(this.addr, t), eg(n, t)) } } function vg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z) || (e.uniform3ui(this.addr, t.x, t.y, t.z), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z)) else { if ($m(n, t)) return ;(e.uniform3uiv(this.addr, t), eg(n, t)) } } function mg(e, t) { var n = this.cache if (void 0 !== t.x) (n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w) || (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w), (n[0] = t.x), (n[1] = t.y), (n[2] = t.z), (n[3] = t.w)) else { if ($m(n, t)) return ;(e.uniform4uiv(this.addr, t), eg(n, t)) } } function gg(e, t, n) { var r, i = this.cache, a = n.allocateTextureUnit() ;(i[0] !== a && (e.uniform1i(this.addr, a), (i[0] = a)), this.type === e.SAMPLER_2D_SHADOW ? ((Wm.compareFunction = 515), (r = Wm)) : (r = Hm), n.setTexture2D(t || r, a)) } function yg(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() ;(r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.setTexture3D(t || jm, i)) } function _g(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() ;(r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.setTextureCube(t || Qm, i)) } function bg(e, t, n) { var r = this.cache, i = n.allocateTextureUnit() ;(r[0] !== i && (e.uniform1i(this.addr, i), (r[0] = i)), n.setTexture2DArray(t || Gm, i)) } function xg(e, t) { e.uniform1fv(this.addr, t) } function Sg(e, t) { var n = Jm(t, this.size, 2) e.uniform2fv(this.addr, n) } function Ag(e, t) { var n = Jm(t, this.size, 3) e.uniform3fv(this.addr, n) } function wg(e, t) { var n = Jm(t, this.size, 4) e.uniform4fv(this.addr, n) } function Tg(e, t) { var n = Jm(t, this.size, 4) e.uniformMatrix2fv(this.addr, !1, n) } function Mg(e, t) { var n = Jm(t, this.size, 9) e.uniformMatrix3fv(this.addr, !1, n) } function Eg(e, t) { var n = Jm(t, this.size, 16) e.uniformMatrix4fv(this.addr, !1, n) } function Cg(e, t) { e.uniform1iv(this.addr, t) } function kg(e, t) { e.uniform2iv(this.addr, t) } function Rg(e, t) { e.uniform3iv(this.addr, t) } function Ig(e, t) { e.uniform4iv(this.addr, t) } function Ng(e, t) { e.uniform1uiv(this.addr, t) } function Pg(e, t) { e.uniform2uiv(this.addr, t) } function Lg(e, t) { e.uniform3uiv(this.addr, t) } function Dg(e, t) { e.uniform4uiv(this.addr, t) } function Og(e, t, n) { var r = this.cache, i = t.length, a = tg(n, i) $m(r, a) || (e.uniform1iv(this.addr, a), eg(r, a)) for (var o = 0; o !== i; ++o) n.setTexture2D(t[o] || Hm, a[o]) } function Fg(e, t, n) { var r = this.cache, i = t.length, a = tg(n, i) $m(r, a) || (e.uniform1iv(this.addr, a), eg(r, a)) for (var o = 0; o !== i; ++o) n.setTexture3D(t[o] || jm, a[o]) } function Bg(e, t, n) { var r = this.cache, i = t.length, a = tg(n, i) $m(r, a) || (e.uniform1iv(this.addr, a), eg(r, a)) for (var o = 0; o !== i; ++o) n.setTextureCube(t[o] || Qm, a[o]) } function Ug(e, t, n) { var r = this.cache, i = t.length, a = tg(n, i) $m(r, a) || (e.uniform1iv(this.addr, a), eg(r, a)) for (var o = 0; o !== i; ++o) n.setTexture2DArray(t[o] || Gm, a[o]) } var zg = T(function e(t, n, r) { ;(A(this, e), (this.id = t), (this.addr = r), (this.cache = []), (this.type = n.type), (this.setValue = (function (e) { switch (e) { case 5126: return ng case 35664: return rg case 35665: return ig case 35666: return ag case 35674: return og case 35675: return sg case 35676: return ug case 5124: case 35670: return lg case 35667: case 35671: return cg case 35668: case 35672: return hg case 35669: case 35673: return dg case 5125: return fg case 36294: return pg case 36295: return vg case 36296: return mg case 35678: case 36198: case 36298: case 36306: case 35682: return gg case 35679: case 36299: case 36307: return yg case 35680: case 36300: case 36308: case 36293: return _g case 36289: case 36303: case 36311: case 36292: return bg } })(n.type))) }), Vg = T(function e(t, n, r) { ;(A(this, e), (this.id = t), (this.addr = r), (this.cache = []), (this.type = n.type), (this.size = n.size), (this.setValue = (function (e) { switch (e) { case 5126: return xg case 35664: return Sg case 35665: return Ag case 35666: return wg case 35674: return Tg case 35675: return Mg case 35676: return Eg case 5124: case 35670: return Cg case 35667: case 35671: return kg case 35668: case 35672: return Rg case 35669: case 35673: return Ig case 5125: return Ng case 36294: return Pg case 36295: return Lg case 36296: return Dg case 35678: case 36198: case 36298: case 36306: case 35682: return Og case 35679: case 36299: case 36307: return Fg case 35680: case 36300: case 36308: case 36293: return Bg case 36289: case 36303: case 36311: case 36292: return Ug } })(n.type))) }), Hg = (function () { return T( function e(t) { ;(A(this, e), (this.id = t), (this.seq = []), (this.map = {})) }, [ { key: 'setValue', value: function (e, t, n) { for (var r = this.seq, i = 0, a = r.length; i !== a; ++i) { var o = r[i] o.setValue(e, t[o.id], n) } }, }, ] ) })(), Wg = /(\w+)(\])?(\[|\.)?/g function Gg(e, t) { ;(e.seq.push(t), (e.map[t.id] = t)) } function jg(e, t, n) { var r = e.name, i = r.length for (Wg.lastIndex = 0; ; ) { var a = Wg.exec(r), o = Wg.lastIndex, s = a[1], u = ']' === a[2], l = a[3] if ((u && (s |= 0), void 0 === l || ('[' === l && o + 2 === i))) { Gg(n, void 0 === l ? new zg(s, e, t) : new Vg(s, e, t)) break } var c = n.map[s] ;(void 0 === c && Gg(n, (c = new Hg(s))), (n = c)) } } var Qg = (function () { return T( function e(t, n) { ;(A(this, e), (this.seq = []), (this.map = {})) for (var r = t.getProgramParameter(n, t.ACTIVE_UNIFORMS), i = 0; i < r; ++i) { var a = t.getActiveUniform(n, i) jg(a, t.getUniformLocation(n, a.name), this) } }, [ { key: 'setValue', value: function (e, t, n, r) { var i = this.map[t] void 0 !== i && i.setValue(e, n, r) }, }, { key: 'setOptional', value: function (e, t, n) { var r = t[n] void 0 !== r && this.setValue(e, n, r) }, }, ], [ { key: 'upload', value: function (e, t, n, r) { for (var i = 0, a = t.length; i !== a; ++i) { var o = t[i], s = n[o.id] !1 !== s.needsUpdate && o.setValue(e, s.value, r) } }, }, { key: 'seqWithValue', value: function (e, t) { for (var n = [], r = 0, i = e.length; r !== i; ++r) { var a = e[r] a.id in t && n.push(a) } return n }, }, ] ) })() function qg(e, t, n) { var r = e.createShader(t) return (e.shaderSource(r, n), e.compileShader(r), r) } var Xg = 0 var Yg = new Hc() function Kg(e, t, n) { var r = e.getShaderParameter(t, e.COMPILE_STATUS), i = e.getShaderInfoLog(t).trim() if (r && '' === i) return '' var a = /ERROR: 0:(\d+)/.exec(i) if (a) { var o = parseInt(a[1]) return ( n.toUpperCase() + '\n\n' + i + '\n\n' + (function (e, t) { for ( var n = e.split('\n'), r = [], i = Math.max(t - 6, 0), a = Math.min(t + 6, n.length), o = i; o < a; o++ ) { var s = o + 1 r.push( '' .concat(s === t ? '>' : ' ', ' ') .concat(s, ': ') .concat(n[o]) ) } return r.join('\n') })(e.getShaderSource(t), o) ) } return i } function Zg(e, t) { var n = (function (e) { $c._getMatrix(Yg, $c.workingColorSpace, e) var t = 'mat3( '.concat( Yg.elements.map(function (e) { return e.toFixed(4) }), ' )' ) switch ($c.getTransfer(e)) { case xc: return [t, 'LinearTransferOETF'] case Sc: return [t, 'sRGBTransferOETF'] default: return ( console.warn('THREE.WebGLProgram: Unsupported color space: ', e), [t, 'LinearTransferOETF'] ) } })(t) return [ 'vec4 '.concat(e, '( vec4 value ) {'), '\treturn '.concat(n[1], '( vec4( value.rgb * ').concat(n[0], ', value.a ) );'), '}', ].join('\n') } function Jg(e, t) { var n switch (t) { case 1: n = 'Linear' break case 2: n = 'Reinhard' break case 3: n = 'Cineon' break case 4: n = 'ACESFilmic' break case 6: n = 'AgX' break case 7: n = 'Neutral' break case 5: n = 'Custom' break default: ;(console.warn('THREE.WebGLProgram: Unsupported toneMapping:', t), (n = 'Linear')) } return 'vec3 ' + e + '( vec3 color ) { return ' + n + 'ToneMapping( color ); }' } var $g = new ph() function ey() { $c.getLuminanceCoefficients($g) var e = $g.x.toFixed(4), t = $g.y.toFixed(4), n = $g.z.toFixed(4) return [ 'float luminance( const in vec3 rgb ) {', '\tconst vec3 weights = vec3( '.concat(e, ', ').concat(t, ', ').concat(n, ' );'), '\treturn dot( weights, rgb );', '}', ].join('\n') } function ty(e) { return '' !== e } function ny(e, t) { var n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps return e .replace(/NUM_DIR_LIGHTS/g, t.numDirLights) .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights) .replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps) .replace(/NUM_SPOT_LIGHT_COORDS/g, n) .replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights) .replace(/NUM_POINT_LIGHTS/g, t.numPointLights) .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights) .replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows) .replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps) .replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows) .replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows) } function ry(e, t) { return e .replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes) .replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection) } var iy = /^[ \t]*#include +<([\w\d./]+)>/gm function ay(e) { return e.replace(iy, sy) } var oy = new Map() function sy(e, t) { var n = sm[t] if (void 0 === n) { var r = oy.get(t) if (void 0 === r) throw new Error('Can not resolve #include <' + t + '>') ;((n = sm[r]), console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', t, r )) } return ay(n) } var uy = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g function ly(e) { return e.replace(uy, cy) } function cy(e, t, n, r) { for (var i = '', a = parseInt(t); a < parseInt(n); a++) i += r.replace(/\[\s*i\s*\]/g, '[ ' + a + ' ]').replace(/UNROLLED_LOOP_INDEX/g, a) return i } function hy(e) { var t = 'precision ' .concat(e.precision, ' float;\n\tprecision ') .concat(e.precision, ' int;\n\tprecision ') .concat(e.precision, ' sampler2D;\n\tprecision ') .concat(e.precision, ' samplerCube;\n\tprecision ') .concat(e.precision, ' sampler3D;\n\tprecision ') .concat(e.precision, ' sampler2DArray;\n\tprecision ') .concat(e.precision, ' sampler2DShadow;\n\tprecision ') .concat(e.precision, ' samplerCubeShadow;\n\tprecision ') .concat(e.precision, ' sampler2DArrayShadow;\n\tprecision ') .concat(e.precision, ' isampler2D;\n\tprecision ') .concat(e.precision, ' isampler3D;\n\tprecision ') .concat(e.precision, ' isamplerCube;\n\tprecision ') .concat(e.precision, ' isampler2DArray;\n\tprecision ') .concat(e.precision, ' usampler2D;\n\tprecision ') .concat(e.precision, ' usampler3D;\n\tprecision ') .concat(e.precision, ' usamplerCube;\n\tprecision ') .concat(e.precision, ' usampler2DArray;\n\t') return ( 'highp' === e.precision ? (t += '\n#define HIGH_PRECISION') : 'mediump' === e.precision ? (t += '\n#define MEDIUM_PRECISION') : 'lowp' === e.precision && (t += '\n#define LOW_PRECISION'), t ) } function dy(e, t, n, r) { var i, a, o = e.getContext(), s = n.defines, u = n.vertexShader, l = n.fragmentShader, c = (function (e) { var t = 'SHADOWMAP_TYPE_BASIC' return ( 1 === e.shadowMapType ? (t = 'SHADOWMAP_TYPE_PCF') : 2 === e.shadowMapType ? (t = 'SHADOWMAP_TYPE_PCF_SOFT') : 3 === e.shadowMapType && (t = 'SHADOWMAP_TYPE_VSM'), t ) })(n), h = (function (e) { var t = 'ENVMAP_TYPE_CUBE' if (e.envMap) switch (e.envMapMode) { case tl: case nl: t = 'ENVMAP_TYPE_CUBE' break case rl: t = 'ENVMAP_TYPE_CUBE_UV' } return t })(n), d = (function (e) { var t = 'ENVMAP_MODE_REFLECTION' e.envMap && e.envMapMode === nl && (t = 'ENVMAP_MODE_REFRACTION') return t })(n), f = (function (e) { var t = 'ENVMAP_BLENDING_NONE' if (e.envMap) switch (e.combine) { case 0: t = 'ENVMAP_BLENDING_MULTIPLY' break case 1: t = 'ENVMAP_BLENDING_MIX' break case 2: t = 'ENVMAP_BLENDING_ADD' } return t })(n), p = (function (e) { var t = e.envMapCubeUVHeight if (null === t) return null var n = Math.log2(t) - 2, r = 1 / t return { texelWidth: 1 / (3 * Math.max(Math.pow(2, n), 112)), texelHeight: r, maxMip: n, } })(n), v = (function (e) { return [ e.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : '', e.extensionMultiDraw ? '#extension GL_ANGLE_multi_draw : require' : '', ] .filter(ty) .join('\n') })(n), m = (function (e) { var t = [] for (var n in e) { var r = e[n] !1 !== r && t.push('#define ' + n + ' ' + r) } return t.join('\n') })(s), g = o.createProgram(), y = n.glslVersion ? '#version ' + n.glslVersion + '\n' : '' ;(n.isRawShaderMaterial ? ((i = [ '#define SHADER_TYPE ' + n.shaderType, '#define SHADER_NAME ' + n.shaderName, m, ] .filter(ty) .join('\n')).length > 0 && (i += '\n'), (a = [ '#define SHADER_TYPE ' + n.shaderType, '#define SHADER_NAME ' + n.shaderName, m, ] .filter(ty) .join('\n')).length > 0 && (a += '\n')) : ((i = [ hy(n), '#define SHADER_TYPE ' + n.shaderType, '#define SHADER_NAME ' + n.shaderName, m, n.extensionClipCullDistance ? '#define USE_CLIP_DISTANCE' : '', n.batching ? '#define USE_BATCHING' : '', n.batchingColor ? '#define USE_BATCHING_COLOR' : '', n.instancing ? '#define USE_INSTANCING' : '', n.instancingColor ? '#define USE_INSTANCING_COLOR' : '', n.instancingMorph ? '#define USE_INSTANCING_MORPH' : '', n.useFog && n.fog ? '#define USE_FOG' : '', n.useFog && n.fogExp2 ? '#define FOG_EXP2' : '', n.map ? '#define USE_MAP' : '', n.envMap ? '#define USE_ENVMAP' : '', n.envMap ? '#define ' + d : '', n.lightMap ? '#define USE_LIGHTMAP' : '', n.aoMap ? '#define USE_AOMAP' : '', n.bumpMap ? '#define USE_BUMPMAP' : '', n.normalMap ? '#define USE_NORMALMAP' : '', n.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '', n.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '', n.displacementMap ? '#define USE_DISPLACEMENTMAP' : '', n.emissiveMap ? '#define USE_EMISSIVEMAP' : '', n.anisotropy ? '#define USE_ANISOTROPY' : '', n.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '', n.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', n.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', n.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', n.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '', n.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '', n.specularMap ? '#define USE_SPECULARMAP' : '', n.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '', n.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '', n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', n.metalnessMap ? '#define USE_METALNESSMAP' : '', n.alphaMap ? '#define USE_ALPHAMAP' : '', n.alphaHash ? '#define USE_ALPHAHASH' : '', n.transmission ? '#define USE_TRANSMISSION' : '', n.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', n.thicknessMap ? '#define USE_THICKNESSMAP' : '', n.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', n.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '', n.mapUv ? '#define MAP_UV ' + n.mapUv : '', n.alphaMapUv ? '#define ALPHAMAP_UV ' + n.alphaMapUv : '', n.lightMapUv ? '#define LIGHTMAP_UV ' + n.lightMapUv : '', n.aoMapUv ? '#define AOMAP_UV ' + n.aoMapUv : '', n.emissiveMapUv ? '#define EMISSIVEMAP_UV ' + n.emissiveMapUv : '', n.bumpMapUv ? '#define BUMPMAP_UV ' + n.bumpMapUv : '', n.normalMapUv ? '#define NORMALMAP_UV ' + n.normalMapUv : '', n.displacementMapUv ? '#define DISPLACEMENTMAP_UV ' + n.displacementMapUv : '', n.metalnessMapUv ? '#define METALNESSMAP_UV ' + n.metalnessMapUv : '', n.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + n.roughnessMapUv : '', n.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + n.anisotropyMapUv : '', n.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + n.clearcoatMapUv : '', n.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + n.clearcoatNormalMapUv : '', n.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + n.clearcoatRoughnessMapUv : '', n.iridescenceMapUv ? '#define IRIDESCENCEMAP_UV ' + n.iridescenceMapUv : '', n.iridescenceThicknessMapUv ? '#define IRIDESCENCE_THICKNESSMAP_UV ' + n.iridescenceThicknessMapUv : '', n.sheenColorMapUv ? '#define SHEEN_COLORMAP_UV ' + n.sheenColorMapUv : '', n.sheenRoughnessMapUv ? '#define SHEEN_ROUGHNESSMAP_UV ' + n.sheenRoughnessMapUv : '', n.specularMapUv ? '#define SPECULARMAP_UV ' + n.specularMapUv : '', n.specularColorMapUv ? '#define SPECULAR_COLORMAP_UV ' + n.specularColorMapUv : '', n.specularIntensityMapUv ? '#define SPECULAR_INTENSITYMAP_UV ' + n.specularIntensityMapUv : '', n.transmissionMapUv ? '#define TRANSMISSIONMAP_UV ' + n.transmissionMapUv : '', n.thicknessMapUv ? '#define THICKNESSMAP_UV ' + n.thicknessMapUv : '', n.vertexTangents && !1 === n.flatShading ? '#define USE_TANGENT' : '', n.vertexColors ? '#define USE_COLOR' : '', n.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', n.vertexUv1s ? '#define USE_UV1' : '', n.vertexUv2s ? '#define USE_UV2' : '', n.vertexUv3s ? '#define USE_UV3' : '', n.pointsUvs ? '#define USE_POINTS_UV' : '', n.flatShading ? '#define FLAT_SHADED' : '', n.skinning ? '#define USE_SKINNING' : '', n.morphTargets ? '#define USE_MORPHTARGETS' : '', n.morphNormals && !1 === n.flatShading ? '#define USE_MORPHNORMALS' : '', n.morphColors ? '#define USE_MORPHCOLORS' : '', n.morphTargetsCount > 0 ? '#define MORPHTARGETS_TEXTURE_STRIDE ' + n.morphTextureStride : '', n.morphTargetsCount > 0 ? '#define MORPHTARGETS_COUNT ' + n.morphTargetsCount : '', n.doubleSided ? '#define DOUBLE_SIDED' : '', n.flipSided ? '#define FLIP_SIDED' : '', n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', n.shadowMapEnabled ? '#define ' + c : '', n.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', n.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '', n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', n.reverseDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '', 'uniform mat4 modelMatrix;', 'uniform mat4 modelViewMatrix;', 'uniform mat4 projectionMatrix;', 'uniform mat4 viewMatrix;', 'uniform mat3 normalMatrix;', 'uniform vec3 cameraPosition;', 'uniform bool isOrthographic;', '#ifdef USE_INSTANCING', '\tattribute mat4 instanceMatrix;', '#endif', '#ifdef USE_INSTANCING_COLOR', '\tattribute vec3 instanceColor;', '#endif', '#ifdef USE_INSTANCING_MORPH', '\tuniform sampler2D morphTexture;', '#endif', 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', '#ifdef USE_UV1', '\tattribute vec2 uv1;', '#endif', '#ifdef USE_UV2', '\tattribute vec2 uv2;', '#endif', '#ifdef USE_UV3', '\tattribute vec2 uv3;', '#endif', '#ifdef USE_TANGENT', '\tattribute vec4 tangent;', '#endif', '#if defined( USE_COLOR_ALPHA )', '\tattribute vec4 color;', '#elif defined( USE_COLOR )', '\tattribute vec3 color;', '#endif', '#ifdef USE_SKINNING', '\tattribute vec4 skinIndex;', '\tattribute vec4 skinWeight;', '#endif', '\n', ] .filter(ty) .join('\n')), (a = [ hy(n), '#define SHADER_TYPE ' + n.shaderType, '#define SHADER_NAME ' + n.shaderName, m, n.useFog && n.fog ? '#define USE_FOG' : '', n.useFog && n.fogExp2 ? '#define FOG_EXP2' : '', n.alphaToCoverage ? '#define ALPHA_TO_COVERAGE' : '', n.map ? '#define USE_MAP' : '', n.matcap ? '#define USE_MATCAP' : '', n.envMap ? '#define USE_ENVMAP' : '', n.envMap ? '#define ' + h : '', n.envMap ? '#define ' + d : '', n.envMap ? '#define ' + f : '', p ? '#define CUBEUV_TEXEL_WIDTH ' + p.texelWidth : '', p ? '#define CUBEUV_TEXEL_HEIGHT ' + p.texelHeight : '', p ? '#define CUBEUV_MAX_MIP ' + p.maxMip + '.0' : '', n.lightMap ? '#define USE_LIGHTMAP' : '', n.aoMap ? '#define USE_AOMAP' : '', n.bumpMap ? '#define USE_BUMPMAP' : '', n.normalMap ? '#define USE_NORMALMAP' : '', n.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '', n.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '', n.emissiveMap ? '#define USE_EMISSIVEMAP' : '', n.anisotropy ? '#define USE_ANISOTROPY' : '', n.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '', n.clearcoat ? '#define USE_CLEARCOAT' : '', n.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', n.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', n.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', n.dispersion ? '#define USE_DISPERSION' : '', n.iridescence ? '#define USE_IRIDESCENCE' : '', n.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '', n.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '', n.specularMap ? '#define USE_SPECULARMAP' : '', n.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '', n.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '', n.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', n.metalnessMap ? '#define USE_METALNESSMAP' : '', n.alphaMap ? '#define USE_ALPHAMAP' : '', n.alphaTest ? '#define USE_ALPHATEST' : '', n.alphaHash ? '#define USE_ALPHAHASH' : '', n.sheen ? '#define USE_SHEEN' : '', n.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', n.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '', n.transmission ? '#define USE_TRANSMISSION' : '', n.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', n.thicknessMap ? '#define USE_THICKNESSMAP' : '', n.vertexTangents && !1 === n.flatShading ? '#define USE_TANGENT' : '', n.vertexColors || n.instancingColor || n.batchingColor ? '#define USE_COLOR' : '', n.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', n.vertexUv1s ? '#define USE_UV1' : '', n.vertexUv2s ? '#define USE_UV2' : '', n.vertexUv3s ? '#define USE_UV3' : '', n.pointsUvs ? '#define USE_POINTS_UV' : '', n.gradientMap ? '#define USE_GRADIENTMAP' : '', n.flatShading ? '#define FLAT_SHADED' : '', n.doubleSided ? '#define DOUBLE_SIDED' : '', n.flipSided ? '#define FLIP_SIDED' : '', n.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', n.shadowMapEnabled ? '#define ' + c : '', n.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', n.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '', n.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '', n.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '', n.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', n.reverseDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '', 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', 'uniform bool isOrthographic;', 0 !== n.toneMapping ? '#define TONE_MAPPING' : '', 0 !== n.toneMapping ? sm.tonemapping_pars_fragment : '', 0 !== n.toneMapping ? Jg('toneMapping', n.toneMapping) : '', n.dithering ? '#define DITHERING' : '', n.opaque ? '#define OPAQUE' : '', sm.colorspace_pars_fragment, Zg('linearToOutputTexel', n.outputColorSpace), ey(), n.useDepthPacking ? '#define DEPTH_PACKING ' + n.depthPacking : '', '\n', ] .filter(ty) .join('\n'))), (u = ry((u = ny((u = ay(u)), n)), n)), (l = ry((l = ny((l = ay(l)), n)), n)), (u = ly(u)), (l = ly(l)), !0 !== n.isRawShaderMaterial && ((y = '#version 300 es\n'), (i = [ v, '#define attribute in', '#define varying out', '#define texture2D texture', ].join('\n') + '\n' + i), (a = [ '#define varying in', n.glslVersion === Mc ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;', n.glslVersion === Mc ? '' : '#define gl_FragColor pc_fragColor', '#define gl_FragDepthEXT gl_FragDepth', '#define texture2D texture', '#define textureCube texture', '#define texture2DProj textureProj', '#define texture2DLodEXT textureLod', '#define texture2DProjLodEXT textureProjLod', '#define textureCubeLodEXT textureLod', '#define texture2DGradEXT textureGrad', '#define texture2DProjGradEXT textureProjGrad', '#define textureCubeGradEXT textureGrad', ].join('\n') + '\n' + a))) var _, b, x = y + i + u, S = y + a + l, A = qg(o, o.VERTEX_SHADER, x), w = qg(o, o.FRAGMENT_SHADER, S) function T(t) { if (e.debug.checkShaderErrors) { var n = o.getProgramInfoLog(g).trim(), r = o.getShaderInfoLog(A).trim(), s = o.getShaderInfoLog(w).trim(), u = !0, l = !0 if (!1 === o.getProgramParameter(g, o.LINK_STATUS)) if (((u = !1), 'function' == typeof e.debug.onShaderError)) e.debug.onShaderError(o, g, A, w) else { var c = Kg(o, A, 'vertex'), h = Kg(o, w, 'fragment') console.error( 'THREE.WebGLProgram: Shader Error ' + o.getError() + ' - VALIDATE_STATUS ' + o.getProgramParameter(g, o.VALIDATE_STATUS) + '\n\nMaterial Name: ' + t.name + '\nMaterial Type: ' + t.type + '\n\nProgram Info Log: ' + n + '\n' + c + '\n' + h ) } else '' !== n ? console.warn('THREE.WebGLProgram: Program Info Log:', n) : ('' !== r && '' !== s) || (l = !1) l && (t.diagnostics = { runnable: u, programLog: n, vertexShader: { log: r, prefix: i }, fragmentShader: { log: s, prefix: a }, }) } ;(o.deleteShader(A), o.deleteShader(w), (_ = new Qg(o, g)), (b = (function (e, t) { for ( var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), i = 0; i < r; i++ ) { var a = e.getActiveAttrib(t, i), o = a.name, s = 1 ;(a.type === e.FLOAT_MAT2 && (s = 2), a.type === e.FLOAT_MAT3 && (s = 3), a.type === e.FLOAT_MAT4 && (s = 4), (n[o] = { type: a.type, location: e.getAttribLocation(t, o), locationSize: s, })) } return n })(o, g))) } ;(o.attachShader(g, A), o.attachShader(g, w), void 0 !== n.index0AttributeName ? o.bindAttribLocation(g, 0, n.index0AttributeName) : !0 === n.morphTargets && o.bindAttribLocation(g, 0, 'position'), o.linkProgram(g), (this.getUniforms = function () { return (void 0 === _ && T(this), _) }), (this.getAttributes = function () { return (void 0 === b && T(this), b) })) var M = !1 === n.rendererExtensionParallelShaderCompile return ( (this.isReady = function () { return (!1 === M && (M = o.getProgramParameter(g, 37297)), M) }), (this.destroy = function () { ;(r.releaseStatesOfProgram(this), o.deleteProgram(g), (this.program = void 0)) }), (this.type = n.shaderType), (this.name = n.shaderName), (this.id = Xg++), (this.cacheKey = t), (this.usedTimes = 1), (this.program = g), (this.vertexShader = A), (this.fragmentShader = w), this ) } var fy = 0, py = (function () { return T( function e() { ;(A(this, e), (this.shaderCache = new Map()), (this.materialCache = new Map())) }, [ { key: 'update', value: function (e) { var t = e.vertexShader, n = e.fragmentShader, r = this._getShaderStage(t), i = this._getShaderStage(n), a = this._getShaderCacheForMaterial(e) return ( !1 === a.has(r) && (a.add(r), r.usedTimes++), !1 === a.has(i) && (a.add(i), i.usedTimes++), this ) }, }, { key: 'remove', value: function (e) { var t, n = L(this.materialCache.get(e)) try { for (n.s(); !(t = n.n()).done; ) { var r = t.value ;(r.usedTimes--, 0 === r.usedTimes && this.shaderCache.delete(r.code)) } } catch (i) { n.e(i) } finally { n.f() } return (this.materialCache.delete(e), this) }, }, { key: 'getVertexShaderID', value: function (e) { return this._getShaderStage(e.vertexShader).id }, }, { key: 'getFragmentShaderID', value: function (e) { return this._getShaderStage(e.fragmentShader).id }, }, { key: 'dispose', value: function () { ;(this.shaderCache.clear(), this.materialCache.clear()) }, }, { key: '_getShaderCacheForMaterial', value: function (e) { var t = this.materialCache, n = t.get(e) return (void 0 === n && ((n = new Set()), t.set(e, n)), n) }, }, { key: '_getShaderStage', value: function (e) { var t = this.shaderCache, n = t.get(e) return (void 0 === n && ((n = new vy(e)), t.set(e, n)), n) }, }, ] ) })(), vy = T(function e(t) { ;(A(this, e), (this.id = fy++), (this.code = t), (this.usedTimes = 0)) }) function my(e, t, n, r, i, a, o) { var s = new td(), u = new py(), l = new Set(), c = [], h = i.logarithmicDepthBuffer, d = i.vertexTextures, f = i.precision, p = { MeshDepthMaterial: 'depth', MeshDistanceMaterial: 'distanceRGBA', MeshNormalMaterial: 'normal', MeshBasicMaterial: 'basic', MeshLambertMaterial: 'lambert', MeshPhongMaterial: 'phong', MeshToonMaterial: 'toon', MeshStandardMaterial: 'physical', MeshPhysicalMaterial: 'physical', MeshMatcapMaterial: 'matcap', LineBasicMaterial: 'basic', LineDashedMaterial: 'dashed', PointsMaterial: 'points', ShadowMaterial: 'shadow', SpriteMaterial: 'sprite', } function v(e) { return (l.add(e), 0 === e ? 'uv' : 'uv'.concat(e)) } return { getParameters: function (a, s, c, m, g) { var y = m.fog, _ = g.geometry, b = a.isMeshStandardMaterial ? m.environment : null, x = (a.isMeshStandardMaterial ? n : t).get(a.envMap || b), S = x && x.mapping === rl ? x.image.height : null, A = p[a.type] null !== a.precision && (f = i.getMaxPrecision(a.precision)) !== a.precision && console.warn( 'THREE.WebGLProgram.getParameters:', a.precision, 'not supported, using', f, 'instead.' ) var w, T, M, E, C = _.morphAttributes.position || _.morphAttributes.normal || _.morphAttributes.color, k = void 0 !== C ? C.length : 0, R = 0 if ( (void 0 !== _.morphAttributes.position && (R = 1), void 0 !== _.morphAttributes.normal && (R = 2), void 0 !== _.morphAttributes.color && (R = 3), A) ) { var I = lm[A] ;((w = I.vertexShader), (T = I.fragmentShader)) } else ((w = a.vertexShader), (T = a.fragmentShader), u.update(a), (M = u.getVertexShaderID(a)), (E = u.getFragmentShaderID(a))) var N = e.getRenderTarget(), P = e.state.buffers.depth.getReversed(), L = !0 === g.isInstancedMesh, D = !0 === g.isBatchedMesh, O = !!a.map, F = !!a.matcap, B = !!x, U = !!a.aoMap, z = !!a.lightMap, V = !!a.bumpMap, H = !!a.normalMap, W = !!a.displacementMap, G = !!a.emissiveMap, j = !!a.metalnessMap, Q = !!a.roughnessMap, q = a.anisotropy > 0, X = a.clearcoat > 0, Y = a.dispersion > 0, K = a.iridescence > 0, Z = a.sheen > 0, J = a.transmission > 0, $ = q && !!a.anisotropyMap, ee = X && !!a.clearcoatMap, te = X && !!a.clearcoatNormalMap, ne = X && !!a.clearcoatRoughnessMap, re = K && !!a.iridescenceMap, ie = K && !!a.iridescenceThicknessMap, ae = Z && !!a.sheenColorMap, oe = Z && !!a.sheenRoughnessMap, se = !!a.specularMap, ue = !!a.specularColorMap, le = !!a.specularIntensityMap, ce = J && !!a.transmissionMap, he = J && !!a.thicknessMap, de = !!a.gradientMap, fe = !!a.alphaMap, pe = a.alphaTest > 0, ve = !!a.alphaHash, me = !!a.extensions, ge = 0 a.toneMapped && ((null !== N && !0 !== N.isXRRenderTarget) || (ge = e.toneMapping)) var ye = { shaderID: A, shaderType: a.type, shaderName: a.name, vertexShader: w, fragmentShader: T, defines: a.defines, customVertexShaderID: M, customFragmentShaderID: E, isRawShaderMaterial: !0 === a.isRawShaderMaterial, glslVersion: a.glslVersion, precision: f, batching: D, batchingColor: D && null !== g._colorsTexture, instancing: L, instancingColor: L && null !== g.instanceColor, instancingMorph: L && null !== g.morphTexture, supportsVertexTextures: d, outputColorSpace: null === N ? e.outputColorSpace : !0 === N.isXRRenderTarget ? N.texture.colorSpace : bc, alphaToCoverage: !!a.alphaToCoverage, map: O, matcap: F, envMap: B, envMapMode: B && x.mapping, envMapCubeUVHeight: S, aoMap: U, lightMap: z, bumpMap: V, normalMap: H, displacementMap: d && W, emissiveMap: G, normalMapObjectSpace: H && 1 === a.normalMapType, normalMapTangentSpace: H && 0 === a.normalMapType, metalnessMap: j, roughnessMap: Q, anisotropy: q, anisotropyMap: $, clearcoat: X, clearcoatMap: ee, clearcoatNormalMap: te, clearcoatRoughnessMap: ne, dispersion: Y, iridescence: K, iridescenceMap: re, iridescenceThicknessMap: ie, sheen: Z, sheenColorMap: ae, sheenRoughnessMap: oe, specularMap: se, specularColorMap: ue, specularIntensityMap: le, transmission: J, transmissionMap: ce, thicknessMap: he, gradientMap: de, opaque: !1 === a.transparent && 1 === a.blending && !1 === a.alphaToCoverage, alphaMap: fe, alphaTest: pe, alphaHash: ve, combine: a.combine, mapUv: O && v(a.map.channel), aoMapUv: U && v(a.aoMap.channel), lightMapUv: z && v(a.lightMap.channel), bumpMapUv: V && v(a.bumpMap.channel), normalMapUv: H && v(a.normalMap.channel), displacementMapUv: W && v(a.displacementMap.channel), emissiveMapUv: G && v(a.emissiveMap.channel), metalnessMapUv: j && v(a.metalnessMap.channel), roughnessMapUv: Q && v(a.roughnessMap.channel), anisotropyMapUv: $ && v(a.anisotropyMap.channel), clearcoatMapUv: ee && v(a.clearcoatMap.channel), clearcoatNormalMapUv: te && v(a.clearcoatNormalMap.channel), clearcoatRoughnessMapUv: ne && v(a.clearcoatRoughnessMap.channel), iridescenceMapUv: re && v(a.iridescenceMap.channel), iridescenceThicknessMapUv: ie && v(a.iridescenceThicknessMap.channel), sheenColorMapUv: ae && v(a.sheenColorMap.channel), sheenRoughnessMapUv: oe && v(a.sheenRoughnessMap.channel), specularMapUv: se && v(a.specularMap.channel), specularColorMapUv: ue && v(a.specularColorMap.channel), specularIntensityMapUv: le && v(a.specularIntensityMap.channel), transmissionMapUv: ce && v(a.transmissionMap.channel), thicknessMapUv: he && v(a.thicknessMap.channel), alphaMapUv: fe && v(a.alphaMap.channel), vertexTangents: !!_.attributes.tangent && (H || q), vertexColors: a.vertexColors, vertexAlphas: !0 === a.vertexColors && !!_.attributes.color && 4 === _.attributes.color.itemSize, pointsUvs: !0 === g.isPoints && !!_.attributes.uv && (O || fe), fog: !!y, useFog: !0 === a.fog, fogExp2: !!y && y.isFogExp2, flatShading: !0 === a.flatShading, sizeAttenuation: !0 === a.sizeAttenuation, logarithmicDepthBuffer: h, reverseDepthBuffer: P, skinning: !0 === g.isSkinnedMesh, morphTargets: void 0 !== _.morphAttributes.position, morphNormals: void 0 !== _.morphAttributes.normal, morphColors: void 0 !== _.morphAttributes.color, morphTargetsCount: k, morphTextureStride: R, numDirLights: s.directional.length, numPointLights: s.point.length, numSpotLights: s.spot.length, numSpotLightMaps: s.spotLightMap.length, numRectAreaLights: s.rectArea.length, numHemiLights: s.hemi.length, numDirLightShadows: s.directionalShadowMap.length, numPointLightShadows: s.pointShadowMap.length, numSpotLightShadows: s.spotShadowMap.length, numSpotLightShadowsWithMaps: s.numSpotLightShadowsWithMaps, numLightProbes: s.numLightProbes, numClippingPlanes: o.numPlanes, numClipIntersection: o.numIntersection, dithering: a.dithering, shadowMapEnabled: e.shadowMap.enabled && c.length > 0, shadowMapType: e.shadowMap.type, toneMapping: ge, decodeVideoTexture: O && !0 === a.map.isVideoTexture && $c.getTransfer(a.map.colorSpace) === Sc, decodeVideoTextureEmissive: G && !0 === a.emissiveMap.isVideoTexture && $c.getTransfer(a.emissiveMap.colorSpace) === Sc, premultipliedAlpha: a.premultipliedAlpha, doubleSided: 2 === a.side, flipSided: 1 === a.side, useDepthPacking: a.depthPacking >= 0, depthPacking: a.depthPacking || 0, index0AttributeName: a.index0AttributeName, extensionClipCullDistance: me && !0 === a.extensions.clipCullDistance && r.has('WEBGL_clip_cull_distance'), extensionMultiDraw: ((me && !0 === a.extensions.multiDraw) || D) && r.has('WEBGL_multi_draw'), rendererExtensionParallelShaderCompile: r.has('KHR_parallel_shader_compile'), customProgramCacheKey: a.customProgramCacheKey(), } return ( (ye.vertexUv1s = l.has(1)), (ye.vertexUv2s = l.has(2)), (ye.vertexUv3s = l.has(3)), l.clear(), ye ) }, getProgramCacheKey: function (t) { var n = [] if ( (t.shaderID ? n.push(t.shaderID) : (n.push(t.customVertexShaderID), n.push(t.customFragmentShaderID)), void 0 !== t.defines) ) for (var r in t.defines) (n.push(r), n.push(t.defines[r])) return ( !1 === t.isRawShaderMaterial && (!(function (e, t) { ;(e.push(t.precision), e.push(t.outputColorSpace), e.push(t.envMapMode), e.push(t.envMapCubeUVHeight), e.push(t.mapUv), e.push(t.alphaMapUv), e.push(t.lightMapUv), e.push(t.aoMapUv), e.push(t.bumpMapUv), e.push(t.normalMapUv), e.push(t.displacementMapUv), e.push(t.emissiveMapUv), e.push(t.metalnessMapUv), e.push(t.roughnessMapUv), e.push(t.anisotropyMapUv), e.push(t.clearcoatMapUv), e.push(t.clearcoatNormalMapUv), e.push(t.clearcoatRoughnessMapUv), e.push(t.iridescenceMapUv), e.push(t.iridescenceThicknessMapUv), e.push(t.sheenColorMapUv), e.push(t.sheenRoughnessMapUv), e.push(t.specularMapUv), e.push(t.specularColorMapUv), e.push(t.specularIntensityMapUv), e.push(t.transmissionMapUv), e.push(t.thicknessMapUv), e.push(t.combine), e.push(t.fogExp2), e.push(t.sizeAttenuation), e.push(t.morphTargetsCount), e.push(t.morphAttributeCount), e.push(t.numDirLights), e.push(t.numPointLights), e.push(t.numSpotLights), e.push(t.numSpotLightMaps), e.push(t.numHemiLights), e.push(t.numRectAreaLights), e.push(t.numDirLightShadows), e.push(t.numPointLightShadows), e.push(t.numSpotLightShadows), e.push(t.numSpotLightShadowsWithMaps), e.push(t.numLightProbes), e.push(t.shadowMapType), e.push(t.toneMapping), e.push(t.numClippingPlanes), e.push(t.numClipIntersection), e.push(t.depthPacking)) })(n, t), (function (e, t) { ;(s.disableAll(), t.supportsVertexTextures && s.enable(0)) t.instancing && s.enable(1) t.instancingColor && s.enable(2) t.instancingMorph && s.enable(3) t.matcap && s.enable(4) t.envMap && s.enable(5) t.normalMapObjectSpace && s.enable(6) t.normalMapTangentSpace && s.enable(7) t.clearcoat && s.enable(8) t.iridescence && s.enable(9) t.alphaTest && s.enable(10) t.vertexColors && s.enable(11) t.vertexAlphas && s.enable(12) t.vertexUv1s && s.enable(13) t.vertexUv2s && s.enable(14) t.vertexUv3s && s.enable(15) t.vertexTangents && s.enable(16) t.anisotropy && s.enable(17) t.alphaHash && s.enable(18) t.batching && s.enable(19) t.dispersion && s.enable(20) t.batchingColor && s.enable(21) ;(e.push(s.mask), s.disableAll(), t.fog && s.enable(0)) t.useFog && s.enable(1) t.flatShading && s.enable(2) t.logarithmicDepthBuffer && s.enable(3) t.reverseDepthBuffer && s.enable(4) t.skinning && s.enable(5) t.morphTargets && s.enable(6) t.morphNormals && s.enable(7) t.morphColors && s.enable(8) t.premultipliedAlpha && s.enable(9) t.shadowMapEnabled && s.enable(10) t.doubleSided && s.enable(11) t.flipSided && s.enable(12) t.useDepthPacking && s.enable(13) t.dithering && s.enable(14) t.transmission && s.enable(15) t.sheen && s.enable(16) t.opaque && s.enable(17) t.pointsUvs && s.enable(18) t.decodeVideoTexture && s.enable(19) t.decodeVideoTextureEmissive && s.enable(20) t.alphaToCoverage && s.enable(21) e.push(s.mask) })(n, t), n.push(e.outputColorSpace)), n.push(t.customProgramCacheKey), n.join() ) }, getUniforms: function (e) { var t, n = p[e.type] if (n) { var r = lm[n] t = Af.clone(r.uniforms) } else t = e.uniforms return t }, acquireProgram: function (t, n) { for (var r, i = 0, o = c.length; i < o; i++) { var s = c[i] if (s.cacheKey === n) { ++(r = s).usedTimes break } } return (void 0 === r && ((r = new dy(e, n, t, a)), c.push(r)), r) }, releaseProgram: function (e) { if (0 === --e.usedTimes) { var t = c.indexOf(e) ;((c[t] = c[c.length - 1]), c.pop(), e.destroy()) } }, releaseShaderCache: function (e) { u.remove(e) }, programs: c, dispose: function () { u.dispose() }, } } function gy() { var e = new WeakMap() return { has: function (t) { return e.has(t) }, get: function (t) { var n = e.get(t) return (void 0 === n && ((n = {}), e.set(t, n)), n) }, remove: function (t) { e.delete(t) }, update: function (t, n, r) { e.get(t)[n] = r }, dispose: function () { e = new WeakMap() }, } } function yy(e, t) { return e.groupOrder !== t.groupOrder ? e.groupOrder - t.groupOrder : e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id } function _y(e, t) { return e.groupOrder !== t.groupOrder ? e.groupOrder - t.groupOrder : e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id } function by() { var e = [], t = 0, n = [], r = [], i = [] function a(n, r, i, a, o, s) { var u = e[t] return ( void 0 === u ? ((u = { id: n.id, object: n, geometry: r, material: i, groupOrder: a, renderOrder: n.renderOrder, z: o, group: s, }), (e[t] = u)) : ((u.id = n.id), (u.object = n), (u.geometry = r), (u.material = i), (u.groupOrder = a), (u.renderOrder = n.renderOrder), (u.z = o), (u.group = s)), t++, u ) } return { opaque: n, transmissive: r, transparent: i, init: function () { ;((t = 0), (n.length = 0), (r.length = 0), (i.length = 0)) }, push: function (e, t, o, s, u, l) { var c = a(e, t, o, s, u, l) o.transmission > 0 ? r.push(c) : !0 === o.transparent ? i.push(c) : n.push(c) }, unshift: function (e, t, o, s, u, l) { var c = a(e, t, o, s, u, l) o.transmission > 0 ? r.unshift(c) : !0 === o.transparent ? i.unshift(c) : n.unshift(c) }, finish: function () { for (var n = t, r = e.length; n < r; n++) { var i = e[n] if (null === i.id) break ;((i.id = null), (i.object = null), (i.geometry = null), (i.material = null), (i.group = null)) } }, sort: function (e, t) { ;(n.length > 1 && n.sort(e || yy), r.length > 1 && r.sort(t || _y), i.length > 1 && i.sort(t || _y)) }, } } function xy() { var e = new WeakMap() return { get: function (t, n) { var r, i = e.get(t) return ( void 0 === i ? ((r = new by()), e.set(t, [r])) : n >= i.length ? ((r = new by()), i.push(r)) : (r = i[n]), r ) }, dispose: function () { e = new WeakMap() }, } } function Sy() { var e = {} return { get: function (t) { if (void 0 !== e[t.id]) return e[t.id] var n switch (t.type) { case 'DirectionalLight': n = { direction: new ph(), color: new Od() } break case 'SpotLight': n = { position: new ph(), direction: new ph(), color: new Od(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0, } break case 'PointLight': n = { position: new ph(), color: new Od(), distance: 0, decay: 0 } break case 'HemisphereLight': n = { direction: new ph(), skyColor: new Od(), groundColor: new Od() } break case 'RectAreaLight': n = { color: new Od(), position: new ph(), halfWidth: new ph(), halfHeight: new ph(), } } return ((e[t.id] = n), n) }, } } var Ay = 0 function wy(e, t) { return ( (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + (t.map ? 1 : 0) - (e.map ? 1 : 0) ) } function Ty(e) { for ( var t, n = new Sy(), r = ((t = {}), { get: function (e) { if (void 0 !== t[e.id]) return t[e.id] var n switch (e.type) { case 'DirectionalLight': case 'SpotLight': n = { shadowIntensity: 1, shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Vc(), } break case 'PointLight': n = { shadowIntensity: 1, shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Vc(), shadowCameraNear: 1, shadowCameraFar: 1e3, } } return ((t[e.id] = n), n) }, }), i = { version: 0, hash: { directionalLength: -1, pointLength: -1, spotLength: -1, rectAreaLength: -1, hemiLength: -1, numDirectionalShadows: -1, numPointShadows: -1, numSpotShadows: -1, numSpotMaps: -1, numLightProbes: -1, }, ambient: [0, 0, 0], probe: [], directional: [], directionalShadow: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotLightMap: [], spotShadow: [], spotShadowMap: [], spotLightMatrix: [], rectArea: [], rectAreaLTC1: null, rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [], numSpotLightShadowsWithMaps: 0, numLightProbes: 0, }, a = 0; a < 9; a++ ) i.probe.push(new ph()) var o = new ph(), s = new Gh(), u = new Gh() return { setup: function (t) { for (var a = 0, o = 0, s = 0, u = 0; u < 9; u++) i.probe[u].set(0, 0, 0) var l = 0, c = 0, h = 0, d = 0, f = 0, p = 0, v = 0, m = 0, g = 0, y = 0, _ = 0 t.sort(wy) for (var b = 0, x = t.length; b < x; b++) { var S = t[b], A = S.color, w = S.intensity, T = S.distance, M = S.shadow && S.shadow.map ? S.shadow.map.texture : null if (S.isAmbientLight) ((a += A.r * w), (o += A.g * w), (s += A.b * w)) else if (S.isLightProbe) { for (var E = 0; E < 9; E++) i.probe[E].addScaledVector(S.sh.coefficients[E], w) _++ } else if (S.isDirectionalLight) { var C = n.get(S) if ((C.color.copy(S.color).multiplyScalar(S.intensity), S.castShadow)) { var k = S.shadow, R = r.get(S) ;((R.shadowIntensity = k.intensity), (R.shadowBias = k.bias), (R.shadowNormalBias = k.normalBias), (R.shadowRadius = k.radius), (R.shadowMapSize = k.mapSize), (i.directionalShadow[l] = R), (i.directionalShadowMap[l] = M), (i.directionalShadowMatrix[l] = S.shadow.matrix), p++) } ;((i.directional[l] = C), l++) } else if (S.isSpotLight) { var I = n.get(S) ;(I.position.setFromMatrixPosition(S.matrixWorld), I.color.copy(A).multiplyScalar(w), (I.distance = T), (I.coneCos = Math.cos(S.angle)), (I.penumbraCos = Math.cos(S.angle * (1 - S.penumbra))), (I.decay = S.decay), (i.spot[h] = I)) var N = S.shadow if ( (S.map && ((i.spotLightMap[g] = S.map), g++, N.updateMatrices(S), S.castShadow && y++), (i.spotLightMatrix[h] = N.matrix), S.castShadow) ) { var P = r.get(S) ;((P.shadowIntensity = N.intensity), (P.shadowBias = N.bias), (P.shadowNormalBias = N.normalBias), (P.shadowRadius = N.radius), (P.shadowMapSize = N.mapSize), (i.spotShadow[h] = P), (i.spotShadowMap[h] = M), m++) } h++ } else if (S.isRectAreaLight) { var L = n.get(S) ;(L.color.copy(A).multiplyScalar(w), L.halfWidth.set(0.5 * S.width, 0, 0), L.halfHeight.set(0, 0.5 * S.height, 0), (i.rectArea[d] = L), d++) } else if (S.isPointLight) { var D = n.get(S) if ( (D.color.copy(S.color).multiplyScalar(S.intensity), (D.distance = S.distance), (D.decay = S.decay), S.castShadow) ) { var O = S.shadow, F = r.get(S) ;((F.shadowIntensity = O.intensity), (F.shadowBias = O.bias), (F.shadowNormalBias = O.normalBias), (F.shadowRadius = O.radius), (F.shadowMapSize = O.mapSize), (F.shadowCameraNear = O.camera.near), (F.shadowCameraFar = O.camera.far), (i.pointShadow[c] = F), (i.pointShadowMap[c] = M), (i.pointShadowMatrix[c] = S.shadow.matrix), v++) } ;((i.point[c] = D), c++) } else if (S.isHemisphereLight) { var B = n.get(S) ;(B.skyColor.copy(S.color).multiplyScalar(w), B.groundColor.copy(S.groundColor).multiplyScalar(w), (i.hemi[f] = B), f++) } } ;(d > 0 && (!0 === e.has('OES_texture_float_linear') ? ((i.rectAreaLTC1 = um.LTC_FLOAT_1), (i.rectAreaLTC2 = um.LTC_FLOAT_2)) : ((i.rectAreaLTC1 = um.LTC_HALF_1), (i.rectAreaLTC2 = um.LTC_HALF_2))), (i.ambient[0] = a), (i.ambient[1] = o), (i.ambient[2] = s)) var U = i.hash ;(U.directionalLength === l && U.pointLength === c && U.spotLength === h && U.rectAreaLength === d && U.hemiLength === f && U.numDirectionalShadows === p && U.numPointShadows === v && U.numSpotShadows === m && U.numSpotMaps === g && U.numLightProbes === _) || ((i.directional.length = l), (i.spot.length = h), (i.rectArea.length = d), (i.point.length = c), (i.hemi.length = f), (i.directionalShadow.length = p), (i.directionalShadowMap.length = p), (i.pointShadow.length = v), (i.pointShadowMap.length = v), (i.spotShadow.length = m), (i.spotShadowMap.length = m), (i.directionalShadowMatrix.length = p), (i.pointShadowMatrix.length = v), (i.spotLightMatrix.length = m + g - y), (i.spotLightMap.length = g), (i.numSpotLightShadowsWithMaps = y), (i.numLightProbes = _), (U.directionalLength = l), (U.pointLength = c), (U.spotLength = h), (U.rectAreaLength = d), (U.hemiLength = f), (U.numDirectionalShadows = p), (U.numPointShadows = v), (U.numSpotShadows = m), (U.numSpotMaps = g), (U.numLightProbes = _), (i.version = Ay++)) }, setupView: function (e, t) { for ( var n = 0, r = 0, a = 0, l = 0, c = 0, h = t.matrixWorldInverse, d = 0, f = e.length; d < f; d++ ) { var p = e[d] if (p.isDirectionalLight) { var v = i.directional[n] ;(v.direction.setFromMatrixPosition(p.matrixWorld), o.setFromMatrixPosition(p.target.matrixWorld), v.direction.sub(o), v.direction.transformDirection(h), n++) } else if (p.isSpotLight) { var m = i.spot[a] ;(m.position.setFromMatrixPosition(p.matrixWorld), m.position.applyMatrix4(h), m.direction.setFromMatrixPosition(p.matrixWorld), o.setFromMatrixPosition(p.target.matrixWorld), m.direction.sub(o), m.direction.transformDirection(h), a++) } else if (p.isRectAreaLight) { var g = i.rectArea[l] ;(g.position.setFromMatrixPosition(p.matrixWorld), g.position.applyMatrix4(h), u.identity(), s.copy(p.matrixWorld), s.premultiply(h), u.extractRotation(s), g.halfWidth.set(0.5 * p.width, 0, 0), g.halfHeight.set(0, 0.5 * p.height, 0), g.halfWidth.applyMatrix4(u), g.halfHeight.applyMatrix4(u), l++) } else if (p.isPointLight) { var y = i.point[r] ;(y.position.setFromMatrixPosition(p.matrixWorld), y.position.applyMatrix4(h), r++) } else if (p.isHemisphereLight) { var _ = i.hemi[c] ;(_.direction.setFromMatrixPosition(p.matrixWorld), _.direction.transformDirection(h), c++) } } }, state: i, } } function My(e) { var t = new Ty(e), n = [], r = [] var i = { lightsArray: n, shadowsArray: r, camera: null, lights: t, transmissionRenderTarget: {}, } return { init: function (e) { ;((i.camera = e), (n.length = 0), (r.length = 0)) }, state: i, setupLights: function () { t.setup(n) }, setupLightsView: function (e) { t.setupView(n, e) }, pushLight: function (e) { n.push(e) }, pushShadow: function (e) { r.push(e) }, } } function Ey(e) { var t = new WeakMap() return { get: function (n) { var r, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, a = t.get(n) return ( void 0 === a ? ((r = new My(e)), t.set(n, [r])) : i >= a.length ? ((r = new My(e)), a.push(r)) : (r = a[i]), r ) }, dispose: function () { t = new WeakMap() }, } } function Cy(e, t, n) { var r = new gp(), i = new Vc(), a = new Vc(), o = new uh(), s = new qp({ depthPacking: 3201 }), u = new Xp(), l = {}, c = n.maxTextureSize, h = M(M(M({}, 0, 1), 1, 0), 2, 2), d = new wf({ defines: { VSM_SAMPLES: 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new Vc() }, radius: { value: 4 }, }, vertexShader: 'void main() {\n\tgl_Position = vec4( position, 1.0 );\n}', fragmentShader: 'uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}', }), f = d.clone() f.defines.HORIZONTAL_PASS = 1 var p = new af() p.setAttribute( 'position', new qd(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3) ) var v = new gf(p, d), m = this ;((this.enabled = !1), (this.autoUpdate = !0), (this.needsUpdate = !1), (this.type = 1)) var g = this.type function y(n, r) { var a = t.update(v) ;(d.defines.VSM_SAMPLES !== n.blurSamples && ((d.defines.VSM_SAMPLES = n.blurSamples), (f.defines.VSM_SAMPLES = n.blurSamples), (d.needsUpdate = !0), (f.needsUpdate = !0)), null === n.mapPass && (n.mapPass = new ch(i.x, i.y)), (d.uniforms.shadow_pass.value = n.map.texture), (d.uniforms.resolution.value = n.mapSize), (d.uniforms.radius.value = n.radius), e.setRenderTarget(n.mapPass), e.clear(), e.renderBufferDirect(r, null, a, d, v, null), (f.uniforms.shadow_pass.value = n.mapPass.texture), (f.uniforms.resolution.value = n.mapSize), (f.uniforms.radius.value = n.radius), e.setRenderTarget(n.map), e.clear(), e.renderBufferDirect(r, null, a, f, v, null)) } function _(t, n, r, i) { var a = null, o = !0 === r.isPointLight ? t.customDistanceMaterial : t.customDepthMaterial if (void 0 !== o) a = o else if ( ((a = !0 === r.isPointLight ? u : s), (e.localClippingEnabled && !0 === n.clipShadows && Array.isArray(n.clippingPlanes) && 0 !== n.clippingPlanes.length) || (n.displacementMap && 0 !== n.displacementScale) || (n.alphaMap && n.alphaTest > 0) || (n.map && n.alphaTest > 0)) ) { var c = a.uuid, d = n.uuid, f = l[c] void 0 === f && ((f = {}), (l[c] = f)) var p = f[d] ;(void 0 === p && ((p = a.clone()), (f[d] = p), n.addEventListener('dispose', x)), (a = p)) } ;((a.visible = n.visible), (a.wireframe = n.wireframe), (a.side = 3 === i ? null !== n.shadowSide ? n.shadowSide : n.side : null !== n.shadowSide ? n.shadowSide : h[n.side]), (a.alphaMap = n.alphaMap), (a.alphaTest = n.alphaTest), (a.map = n.map), (a.clipShadows = n.clipShadows), (a.clippingPlanes = n.clippingPlanes), (a.clipIntersection = n.clipIntersection), (a.displacementMap = n.displacementMap), (a.displacementScale = n.displacementScale), (a.displacementBias = n.displacementBias), (a.wireframeLinewidth = n.wireframeLinewidth), (a.linewidth = n.linewidth), !0 === r.isPointLight && !0 === a.isMeshDistanceMaterial) && (e.properties.get(a).light = r) return a } function b(n, i, a, o, s) { if (!1 !== n.visible) { if ( n.layers.test(i.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || (n.receiveShadow && 3 === s)) && (!n.frustumCulled || r.intersectsObject(n)) ) { n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, n.matrixWorld) var u = t.update(n), l = n.material if (Array.isArray(l)) for (var c = u.groups, h = 0, d = c.length; h < d; h++) { var f = c[h], p = l[f.materialIndex] if (p && p.visible) { var v = _(n, p, o, s) ;(n.onBeforeShadow(e, n, i, a, u, v, f), e.renderBufferDirect(a, null, u, v, n, f), n.onAfterShadow(e, n, i, a, u, v, f)) } } else if (l.visible) { var m = _(n, l, o, s) ;(n.onBeforeShadow(e, n, i, a, u, m, null), e.renderBufferDirect(a, null, u, m, n, null), n.onAfterShadow(e, n, i, a, u, m, null)) } } for (var g = n.children, y = 0, x = g.length; y < x; y++) b(g[y], i, a, o, s) } } function x(e) { var t = e.target for (var n in (t.removeEventListener('dispose', x), l)) { var r = l[n], i = e.target.uuid if (i in r) (r[i].dispose(), delete r[i]) } } this.render = function (t, n, s) { if ( !1 !== m.enabled && (!1 !== m.autoUpdate || !1 !== m.needsUpdate) && 0 !== t.length ) { var u = e.getRenderTarget(), l = e.getActiveCubeFace(), h = e.getActiveMipmapLevel(), d = e.state ;(d.setBlending(0), d.buffers.color.setClear(1, 1, 1, 1), d.buffers.depth.setTest(!0), d.setScissorTest(!1)) for ( var f = 3 !== g && 3 === this.type, p = 3 === g && 3 !== this.type, v = 0, _ = t.length; v < _; v++ ) { var x = t[v], S = x.shadow if (void 0 !== S) { if (!1 !== S.autoUpdate || !1 !== S.needsUpdate) { i.copy(S.mapSize) var A = S.getFrameExtents() if ( (i.multiply(A), a.copy(S.mapSize), (i.x > c || i.y > c) && (i.x > c && ((a.x = Math.floor(c / A.x)), (i.x = a.x * A.x), (S.mapSize.x = a.x)), i.y > c && ((a.y = Math.floor(c / A.y)), (i.y = a.y * A.y), (S.mapSize.y = a.y))), null === S.map || !0 === f || !0 === p) ) { var w = 3 !== this.type ? { minFilter: sl, magFilter: sl } : {} ;(null !== S.map && S.map.dispose(), (S.map = new ch(i.x, i.y, w)), (S.map.texture.name = x.name + '.shadowMap'), S.camera.updateProjectionMatrix()) } ;(e.setRenderTarget(S.map), e.clear()) for (var T = S.getViewportCount(), M = 0; M < T; M++) { var E = S.getViewport(M) ;(o.set(a.x * E.x, a.y * E.y, a.x * E.z, a.y * E.w), d.viewport(o), S.updateMatrices(x, M), (r = S.getFrustum()), b(n, s, S.camera, x, this.type)) } ;(!0 !== S.isPointLightShadow && 3 === this.type && y(S, s), (S.needsUpdate = !1)) } } else console.warn('THREE.WebGLShadowMap:', x, 'has no shadow.') } ;((g = this.type), (m.needsUpdate = !1), e.setRenderTarget(u, l, h)) } } } var ky = M(M(M(M(M(M(M(M({}, 0, 1), 2, 6), 4, 7), 3, 5), 1, 0), 6, 2), 7, 4), 5, 3) function Ry(e, t) { var n var r = new (function () { var t = !1, n = new uh(), r = null, i = new uh(0, 0, 0, 0) return { setMask: function (n) { r === n || t || (e.colorMask(n, n, n, n), (r = n)) }, setLocked: function (e) { t = e }, setClear: function (t, r, a, o, s) { ;(!0 === s && ((t *= o), (r *= o), (a *= o)), n.set(t, r, a, o), !1 === i.equals(n) && (e.clearColor(t, r, a, o), i.copy(n))) }, reset: function () { ;((t = !1), (r = null), i.set(-1, 0, 0, 0)) }, } })(), i = new (function () { var n = !1, r = !1, i = null, a = null, o = null return { setReversed: function (e) { if (r !== e) { var n = t.get('EXT_clip_control') r ? n.clipControlEXT(n.LOWER_LEFT_EXT, n.ZERO_TO_ONE_EXT) : n.clipControlEXT(n.LOWER_LEFT_EXT, n.NEGATIVE_ONE_TO_ONE_EXT) var i = o ;((o = null), this.setClear(i)) } r = e }, getReversed: function () { return r }, setTest: function (t) { t ? H(e.DEPTH_TEST) : W(e.DEPTH_TEST) }, setMask: function (t) { i === t || n || (e.depthMask(t), (i = t)) }, setFunc: function (t) { if ((r && (t = ky[t]), a !== t)) { switch (t) { case 0: e.depthFunc(e.NEVER) break case 1: e.depthFunc(e.ALWAYS) break case 2: e.depthFunc(e.LESS) break case 3: default: e.depthFunc(e.LEQUAL) break case 4: e.depthFunc(e.EQUAL) break case 5: e.depthFunc(e.GEQUAL) break case 6: e.depthFunc(e.GREATER) break case 7: e.depthFunc(e.NOTEQUAL) } a = t } }, setLocked: function (e) { n = e }, setClear: function (t) { o !== t && (r && (t = 1 - t), e.clearDepth(t), (o = t)) }, reset: function () { ;((n = !1), (i = null), (a = null), (o = null), (r = !1)) }, } })(), a = new (function () { var t = !1, n = null, r = null, i = null, a = null, o = null, s = null, u = null, l = null return { setTest: function (n) { t || (n ? H(e.STENCIL_TEST) : W(e.STENCIL_TEST)) }, setMask: function (r) { n === r || t || (e.stencilMask(r), (n = r)) }, setFunc: function (t, n, o) { ;(r === t && i === n && a === o) || (e.stencilFunc(t, n, o), (r = t), (i = n), (a = o)) }, setOp: function (t, n, r) { ;(o === t && s === n && u === r) || (e.stencilOp(t, n, r), (o = t), (s = n), (u = r)) }, setLocked: function (e) { t = e }, setClear: function (t) { l !== t && (e.clearStencil(t), (l = t)) }, reset: function () { ;((t = !1), (n = null), (r = null), (i = null), (a = null), (o = null), (s = null), (u = null), (l = null)) }, } })(), o = new WeakMap(), s = new WeakMap(), u = {}, l = {}, c = new WeakMap(), h = [], d = null, f = !1, p = null, v = null, m = null, g = null, y = null, _ = null, b = null, x = new Od(0, 0, 0), S = 0, A = !1, w = null, T = null, E = null, C = null, k = null, R = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), I = !1, N = 0, P = e.getParameter(e.VERSION) ;-1 !== P.indexOf('WebGL') ? ((N = parseFloat(/^WebGL (\d)/.exec(P)[1])), (I = N >= 1)) : -1 !== P.indexOf('OpenGL ES') && ((N = parseFloat(/^OpenGL ES (\d)/.exec(P)[1])), (I = N >= 2)) var L = null, D = {}, O = e.getParameter(e.SCISSOR_BOX), F = e.getParameter(e.VIEWPORT), B = new uh().fromArray(O), U = new uh().fromArray(F) function z(t, n, r, i) { var a = new Uint8Array(4), o = e.createTexture() ;(e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST)) for (var s = 0; s < r; s++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + s, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a) return o } var V = {} function H(t) { !0 !== u[t] && (e.enable(t), (u[t] = !0)) } function W(t) { !1 !== u[t] && (e.disable(t), (u[t] = !1)) } ;((V[e.TEXTURE_2D] = z(e.TEXTURE_2D, e.TEXTURE_2D, 1)), (V[e.TEXTURE_CUBE_MAP] = z(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6)), (V[e.TEXTURE_2D_ARRAY] = z(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1)), (V[e.TEXTURE_3D] = z(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1)), r.setClear(0, 0, 0, 1), i.setClear(1), a.setClear(0), H(e.DEPTH_TEST), i.setFunc(3), q(!1), X(1), H(e.CULL_FACE), Q(0)) var G = M(M(M({}, Zu, e.FUNC_ADD), 101, e.FUNC_SUBTRACT), 102, e.FUNC_REVERSE_SUBTRACT) ;((G[103] = e.MIN), (G[104] = e.MAX)) var j = (M( M( M( M( M( M( M( M(M(M((n = {}), 200, e.ZERO), 201, e.ONE), 202, e.SRC_COLOR), Ju, e.SRC_ALPHA ), 210, e.SRC_ALPHA_SATURATE ), 208, e.DST_COLOR ), 206, e.DST_ALPHA ), 203, e.ONE_MINUS_SRC_COLOR ), $u, e.ONE_MINUS_SRC_ALPHA ), 209, e.ONE_MINUS_DST_COLOR ), M( M( M( M(M(n, 207, e.ONE_MINUS_DST_ALPHA), 211, e.CONSTANT_COLOR), 212, e.ONE_MINUS_CONSTANT_COLOR ), 213, e.CONSTANT_ALPHA ), 214, e.ONE_MINUS_CONSTANT_ALPHA )) function Q(t, n, r, i, a, o, s, u, l, c) { if (0 !== t) { if ((!1 === f && (H(e.BLEND), (f = !0)), 5 === t)) ((a = a || n), (o = o || r), (s = s || i), (n === v && a === y) || (e.blendEquationSeparate(G[n], G[a]), (v = n), (y = a)), (r === m && i === g && o === _ && s === b) || (e.blendFuncSeparate(j[r], j[i], j[o], j[s]), (m = r), (g = i), (_ = o), (b = s)), (!1 !== u.equals(x) && l === S) || (e.blendColor(u.r, u.g, u.b, l), x.copy(u), (S = l)), (p = t), (A = !1)) else if (t !== p || c !== A) { if ( ((v === Zu && y === Zu) || (e.blendEquation(e.FUNC_ADD), (v = Zu), (y = Zu)), c) ) switch (t) { case 1: e.blendFuncSeparate( e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA ) break case 2: e.blendFunc(e.ONE, e.ONE) break case 3: e.blendFuncSeparate(e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ZERO, e.ONE) break case 4: e.blendFuncSeparate(e.ZERO, e.SRC_COLOR, e.ZERO, e.SRC_ALPHA) break default: console.error('THREE.WebGLState: Invalid blending: ', t) } else switch (t) { case 1: e.blendFuncSeparate( e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA ) break case 2: e.blendFunc(e.SRC_ALPHA, e.ONE) break case 3: e.blendFuncSeparate(e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ZERO, e.ONE) break case 4: e.blendFunc(e.ZERO, e.SRC_COLOR) break default: console.error('THREE.WebGLState: Invalid blending: ', t) } ;((m = null), (g = null), (_ = null), (b = null), x.set(0, 0, 0), (S = 0), (p = t), (A = c)) } } else !0 === f && (W(e.BLEND), (f = !1)) } function q(t) { w !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (w = t)) } function X(t) { ;(0 !== t ? (H(e.CULL_FACE), t !== T && (1 === t ? e.cullFace(e.BACK) : 2 === t ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))) : W(e.CULL_FACE), (T = t)) } function Y(t, n, r) { t ? (H(e.POLYGON_OFFSET_FILL), (C === n && k === r) || (e.polygonOffset(n, r), (C = n), (k = r))) : W(e.POLYGON_OFFSET_FILL) } return { buffers: { color: r, depth: i, stencil: a }, enable: H, disable: W, bindFramebuffer: function (t, n) { return ( l[t] !== n && (e.bindFramebuffer(t, n), (l[t] = n), t === e.DRAW_FRAMEBUFFER && (l[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (l[e.DRAW_FRAMEBUFFER] = n), !0) ) }, drawBuffers: function (t, n) { var r = h, i = !1 if (t) { void 0 === (r = c.get(n)) && ((r = []), c.set(n, r)) var a = t.textures if (r.length !== a.length || r[0] !== e.COLOR_ATTACHMENT0) { for (var o = 0, s = a.length; o < s; o++) r[o] = e.COLOR_ATTACHMENT0 + o ;((r.length = a.length), (i = !0)) } } else r[0] !== e.BACK && ((r[0] = e.BACK), (i = !0)) i && e.drawBuffers(r) }, useProgram: function (t) { return d !== t && (e.useProgram(t), (d = t), !0) }, setBlending: Q, setMaterial: function (t, n) { 2 === t.side ? W(e.CULL_FACE) : H(e.CULL_FACE) var o = 1 === t.side ;(n && (o = !o), q(o), 1 === t.blending && !1 === t.transparent ? Q(0) : Q( t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha ), i.setFunc(t.depthFunc), i.setTest(t.depthTest), i.setMask(t.depthWrite), r.setMask(t.colorWrite)) var s = t.stencilWrite ;(a.setTest(s), s && (a.setMask(t.stencilWriteMask), a.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), a.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), Y(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), !0 === t.alphaToCoverage ? H(e.SAMPLE_ALPHA_TO_COVERAGE) : W(e.SAMPLE_ALPHA_TO_COVERAGE)) }, setFlipSided: q, setCullFace: X, setLineWidth: function (t) { t !== E && (I && e.lineWidth(t), (E = t)) }, setPolygonOffset: Y, setScissorTest: function (t) { t ? H(e.SCISSOR_TEST) : W(e.SCISSOR_TEST) }, activeTexture: function (t) { ;(void 0 === t && (t = e.TEXTURE0 + R - 1), L !== t && (e.activeTexture(t), (L = t))) }, bindTexture: function (t, n, r) { void 0 === r && (r = null === L ? e.TEXTURE0 + R - 1 : L) var i = D[r] ;(void 0 === i && ((i = { type: void 0, texture: void 0 }), (D[r] = i)), (i.type === t && i.texture === n) || (L !== r && (e.activeTexture(r), (L = r)), e.bindTexture(t, n || V[t]), (i.type = t), (i.texture = n))) }, unbindTexture: function () { var t = D[L] void 0 !== t && void 0 !== t.type && (e.bindTexture(t.type, null), (t.type = void 0), (t.texture = void 0)) }, compressedTexImage2D: function () { try { e.compressedTexImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, compressedTexImage3D: function () { try { e.compressedTexImage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, texImage2D: function () { try { e.texImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, texImage3D: function () { try { e.texImage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, updateUBOMapping: function (t, n) { var r = s.get(n) void 0 === r && ((r = new WeakMap()), s.set(n, r)) var i = r.get(t) void 0 === i && ((i = e.getUniformBlockIndex(n, t.name)), r.set(t, i)) }, uniformBlockBinding: function (t, n) { var r = s.get(n).get(t) o.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), o.set(n, r)) }, texStorage2D: function () { try { e.texStorage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, texStorage3D: function () { try { e.texStorage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, texSubImage2D: function () { try { e.texSubImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, texSubImage3D: function () { try { e.texSubImage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, compressedTexSubImage2D: function () { try { e.compressedTexSubImage2D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, compressedTexSubImage3D: function () { try { e.compressedTexSubImage3D.apply(e, arguments) } catch (t) { console.error('THREE.WebGLState:', t) } }, scissor: function (t) { !1 === B.equals(t) && (e.scissor(t.x, t.y, t.z, t.w), B.copy(t)) }, viewport: function (t) { !1 === U.equals(t) && (e.viewport(t.x, t.y, t.z, t.w), U.copy(t)) }, reset: function () { ;(e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), i.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), (u = {}), (L = null), (D = {}), (l = {}), (c = new WeakMap()), (h = []), (d = null), (f = !1), (p = null), (v = null), (m = null), (g = null), (y = null), (_ = null), (b = null), (x = new Od(0, 0, 0)), (S = 0), (A = !1), (w = null), (T = null), (E = null), (C = null), (k = null), B.set(0, 0, e.canvas.width, e.canvas.height), U.set(0, 0, e.canvas.width, e.canvas.height), r.reset(), i.reset(), a.reset()) }, } } function Iy(e, t, n, r, i, a, o) { var s, u = t.has('WEBGL_multisampled_render_to_texture') ? t.get('WEBGL_multisampled_render_to_texture') : null, l = 'undefined' != typeof navigator && /OculusBrowser/g.test(navigator.userAgent), c = new Vc(), h = new WeakMap(), d = new WeakMap(), f = !1 try { f = 'undefined' != typeof OffscreenCanvas && null !== new OffscreenCanvas(1, 1).getContext('2d') } catch (G) {} function p(e, t) { return f ? new OffscreenCanvas(e, t) : jc('canvas') } function v(e, t, n) { var r = 1, i = W(e) if (((i.width > n || i.height > n) && (r = n / Math.max(i.width, i.height)), r < 1)) { if ( ('undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement) || ('undefined' != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement) || ('undefined' != typeof ImageBitmap && e instanceof ImageBitmap) || ('undefined' != typeof VideoFrame && e instanceof VideoFrame) ) { var a = Math.floor(r * i.width), o = Math.floor(r * i.height) void 0 === s && (s = p(a, o)) var u = t ? p(a, o) : s return ( (u.width = a), (u.height = o), u.getContext('2d').drawImage(e, 0, 0, a, o), console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + i.width + 'x' + i.height + ') to (' + a + 'x' + o + ').' ), u ) } return ( 'data' in e && console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + i.width + 'x' + i.height + ').' ), e ) } return e } function m(e) { return e.generateMipmaps } function g(t) { e.generateMipmap(t) } function y(t) { return t.isWebGLCubeRenderTarget ? e.TEXTURE_CUBE_MAP : t.isWebGL3DRenderTarget ? e.TEXTURE_3D : t.isWebGLArrayRenderTarget || t.isCompressedArrayTexture ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D } function _(n, r, i, a) { var o = arguments.length > 4 && void 0 !== arguments[4] && arguments[4] if (null !== n) { if (void 0 !== e[n]) return e[n] console.warn( "THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + n + "'" ) } var s = r if ( (r === e.RED && (i === e.FLOAT && (s = e.R32F), i === e.HALF_FLOAT && (s = e.R16F), i === e.UNSIGNED_BYTE && (s = e.R8)), r === e.RED_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.R8UI), i === e.UNSIGNED_SHORT && (s = e.R16UI), i === e.UNSIGNED_INT && (s = e.R32UI), i === e.BYTE && (s = e.R8I), i === e.SHORT && (s = e.R16I), i === e.INT && (s = e.R32I)), r === e.RG && (i === e.FLOAT && (s = e.RG32F), i === e.HALF_FLOAT && (s = e.RG16F), i === e.UNSIGNED_BYTE && (s = e.RG8)), r === e.RG_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RG8UI), i === e.UNSIGNED_SHORT && (s = e.RG16UI), i === e.UNSIGNED_INT && (s = e.RG32UI), i === e.BYTE && (s = e.RG8I), i === e.SHORT && (s = e.RG16I), i === e.INT && (s = e.RG32I)), r === e.RGB_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RGB8UI), i === e.UNSIGNED_SHORT && (s = e.RGB16UI), i === e.UNSIGNED_INT && (s = e.RGB32UI), i === e.BYTE && (s = e.RGB8I), i === e.SHORT && (s = e.RGB16I), i === e.INT && (s = e.RGB32I)), r === e.RGBA_INTEGER && (i === e.UNSIGNED_BYTE && (s = e.RGBA8UI), i === e.UNSIGNED_SHORT && (s = e.RGBA16UI), i === e.UNSIGNED_INT && (s = e.RGBA32UI), i === e.BYTE && (s = e.RGBA8I), i === e.SHORT && (s = e.RGBA16I), i === e.INT && (s = e.RGBA32I)), r === e.RGB && i === e.UNSIGNED_INT_5_9_9_9_REV && (s = e.RGB9_E5), r === e.RGBA) ) { var u = o ? xc : $c.getTransfer(a) ;(i === e.FLOAT && (s = e.RGBA32F), i === e.HALF_FLOAT && (s = e.RGBA16F), i === e.UNSIGNED_BYTE && (s = u === Sc ? e.SRGB8_ALPHA8 : e.RGBA8), i === e.UNSIGNED_SHORT_4_4_4_4 && (s = e.RGBA4), i === e.UNSIGNED_SHORT_5_5_5_1 && (s = e.RGB5_A1)) } return ( (s !== e.R16F && s !== e.R32F && s !== e.RG16F && s !== e.RG32F && s !== e.RGBA16F && s !== e.RGBA32F) || t.get('EXT_color_buffer_float'), s ) } function b(t, n) { var r return ( t ? null === n || n === gl || n === Sl ? (r = e.DEPTH24_STENCIL8) : n === yl ? (r = e.DEPTH32F_STENCIL8) : n === vl && ((r = e.DEPTH24_STENCIL8), console.warn( 'DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.' )) : null === n || n === gl || n === Sl ? (r = e.DEPTH_COMPONENT24) : n === yl ? (r = e.DEPTH_COMPONENT32F) : n === vl && (r = e.DEPTH_COMPONENT16), r ) } function x(e, t) { return !0 === m(e) || (e.isFramebufferTexture && e.minFilter !== sl && e.minFilter !== ll) ? Math.log2(Math.max(t.width, t.height)) + 1 : void 0 !== e.mipmaps && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1 } function S(e) { var t = e.target ;(t.removeEventListener('dispose', S), (function (e) { var t = r.get(e) if (void 0 === t.__webglInit) return var n = e.source, i = d.get(n) if (i) { var a = i[t.__cacheKey] ;(a.usedTimes--, 0 === a.usedTimes && w(e), 0 === Object.keys(i).length && d.delete(n)) } r.remove(e) })(t), t.isVideoTexture && h.delete(t)) } function A(t) { var n = t.target ;(n.removeEventListener('dispose', A), (function (t) { var n = r.get(t) t.depthTexture && (t.depthTexture.dispose(), r.remove(t.depthTexture)) if (t.isWebGLCubeRenderTarget) for (var i = 0; i < 6; i++) { if (Array.isArray(n.__webglFramebuffer[i])) for (var a = 0; a < n.__webglFramebuffer[i].length; a++) e.deleteFramebuffer(n.__webglFramebuffer[i][a]) else e.deleteFramebuffer(n.__webglFramebuffer[i]) n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer[i]) } else { if (Array.isArray(n.__webglFramebuffer)) for (var s = 0; s < n.__webglFramebuffer.length; s++) e.deleteFramebuffer(n.__webglFramebuffer[s]) else e.deleteFramebuffer(n.__webglFramebuffer) if ( (n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer), n.__webglMultisampledFramebuffer && e.deleteFramebuffer(n.__webglMultisampledFramebuffer), n.__webglColorRenderbuffer) ) for (var u = 0; u < n.__webglColorRenderbuffer.length; u++) n.__webglColorRenderbuffer[u] && e.deleteRenderbuffer(n.__webglColorRenderbuffer[u]) n.__webglDepthRenderbuffer && e.deleteRenderbuffer(n.__webglDepthRenderbuffer) } for (var l = t.textures, c = 0, h = l.length; c < h; c++) { var d = r.get(l[c]) ;(d.__webglTexture && (e.deleteTexture(d.__webglTexture), o.memory.textures--), r.remove(l[c])) } r.remove(t) })(n)) } function w(t) { var n = r.get(t) e.deleteTexture(n.__webglTexture) var i = t.source ;(delete d.get(i)[n.__cacheKey], o.memory.textures--) } var T = 0 function E(t, i) { var a = r.get(t) if ( (t.isVideoTexture && (function (e) { var t = o.render.frame h.get(e) !== t && (h.set(e, t), e.update()) })(t), !1 === t.isRenderTargetTexture && t.version > 0 && a.__version !== t.version) ) { var s = t.image if (null === s) console.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' ) else { if (!1 !== s.complete) return void P(a, t, i) console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' ) } } n.bindTexture(e.TEXTURE_2D, a.__webglTexture, e.TEXTURE0 + i) } var C = M(M(M({}, il, e.REPEAT), al, e.CLAMP_TO_EDGE), ol, e.MIRRORED_REPEAT), k = M( M( M( M( M(M({}, sl, e.NEAREST), 1004, e.NEAREST_MIPMAP_NEAREST), ul, e.NEAREST_MIPMAP_LINEAR ), ll, e.LINEAR ), cl, e.LINEAR_MIPMAP_NEAREST ), hl, e.LINEAR_MIPMAP_LINEAR ), R = M( M( M( M( M(M(M(M({}, 512, e.NEVER), 519, e.ALWAYS), 513, e.LESS), 515, e.LEQUAL), 514, e.EQUAL ), 518, e.GEQUAL ), 516, e.GREATER ), 517, e.NOTEQUAL ) function I(n, a) { if ( (a.type !== yl || !1 !== t.has('OES_texture_float_linear') || (a.magFilter !== ll && a.magFilter !== cl && a.magFilter !== ul && a.magFilter !== hl && a.minFilter !== ll && a.minFilter !== cl && a.minFilter !== ul && a.minFilter !== hl) || console.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' ), e.texParameteri(n, e.TEXTURE_WRAP_S, C[a.wrapS]), e.texParameteri(n, e.TEXTURE_WRAP_T, C[a.wrapT]), (n !== e.TEXTURE_3D && n !== e.TEXTURE_2D_ARRAY) || e.texParameteri(n, e.TEXTURE_WRAP_R, C[a.wrapR]), e.texParameteri(n, e.TEXTURE_MAG_FILTER, k[a.magFilter]), e.texParameteri(n, e.TEXTURE_MIN_FILTER, k[a.minFilter]), a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE), e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, R[a.compareFunction])), !0 === t.has('EXT_texture_filter_anisotropic')) ) { if (a.magFilter === sl) return if (a.minFilter !== ul && a.minFilter !== hl) return if (a.type === yl && !1 === t.has('OES_texture_float_linear')) return if (a.anisotropy > 1 || r.get(a).__currentAnisotropy) { var o = t.get('EXT_texture_filter_anisotropic') ;(e.texParameterf( n, o.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(a.anisotropy, i.getMaxAnisotropy()) ), (r.get(a).__currentAnisotropy = a.anisotropy)) } } } function N(t, n) { var r = !1 void 0 === t.__webglInit && ((t.__webglInit = !0), n.addEventListener('dispose', S)) var i = n.source, a = d.get(i) void 0 === a && ((a = {}), d.set(i, a)) var s = (function (e) { var t = [] return ( t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join() ) })(n) if (s !== t.__cacheKey) { ;(void 0 === a[s] && ((a[s] = { texture: e.createTexture(), usedTimes: 0 }), o.memory.textures++, (r = !0)), a[s].usedTimes++) var u = a[t.__cacheKey] ;(void 0 !== u && (a[t.__cacheKey].usedTimes--, 0 === u.usedTimes && w(n)), (t.__cacheKey = s), (t.__webglTexture = a[s].texture)) } return r } function P(t, o, s) { var u = e.TEXTURE_2D ;((o.isDataArrayTexture || o.isCompressedArrayTexture) && (u = e.TEXTURE_2D_ARRAY), o.isData3DTexture && (u = e.TEXTURE_3D)) var l = N(t, o), c = o.source n.bindTexture(u, t.__webglTexture, e.TEXTURE0 + s) var h = r.get(c) if (c.version !== h.__version || !0 === l) { n.activeTexture(e.TEXTURE0 + s) var d = $c.getPrimaries($c.workingColorSpace), f = o.colorSpace === yc ? null : $c.getPrimaries(o.colorSpace), p = o.colorSpace === yc || d === f ? e.NONE : e.BROWSER_DEFAULT_WEBGL ;(e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), e.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, p)) var y = v(o.image, !1, i.maxTextureSize) y = H(o, y) var S, A = a.convert(o.format, o.colorSpace), w = a.convert(o.type), T = _(o.internalFormat, A, w, o.colorSpace, o.isVideoTexture) I(u, o) var M = o.mipmaps, E = !0 !== o.isVideoTexture, C = void 0 === h.__version || !0 === l, k = c.dataReady, R = x(o, y) if (o.isDepthTexture) ((T = b(o.format === Ml, o.type)), C && (E ? n.texStorage2D(e.TEXTURE_2D, 1, T, y.width, y.height) : n.texImage2D(e.TEXTURE_2D, 0, T, y.width, y.height, 0, A, w, null))) else if (o.isDataTexture) if (M.length > 0) { E && C && n.texStorage2D(e.TEXTURE_2D, R, T, M[0].width, M[0].height) for (var P = 0, D = M.length; P < D; P++) ((S = M[P]), E ? k && n.texSubImage2D(e.TEXTURE_2D, P, 0, 0, S.width, S.height, A, w, S.data) : n.texImage2D(e.TEXTURE_2D, P, T, S.width, S.height, 0, A, w, S.data)) o.generateMipmaps = !1 } else E ? (C && n.texStorage2D(e.TEXTURE_2D, R, T, y.width, y.height), k && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, y.width, y.height, A, w, y.data)) : n.texImage2D(e.TEXTURE_2D, 0, T, y.width, y.height, 0, A, w, y.data) else if (o.isCompressedTexture) if (o.isCompressedArrayTexture) { E && C && n.texStorage3D(e.TEXTURE_2D_ARRAY, R, T, M[0].width, M[0].height, y.depth) for (var O = 0, F = M.length; O < F; O++) if (((S = M[O]), o.format !== wl)) if (null !== A) if (E) { if (k) if (o.layerUpdates.size > 0) { var B, U = im(S.width, S.height, o.format, o.type), z = L(o.layerUpdates) try { for (z.s(); !(B = z.n()).done; ) { var V = B.value, j = S.data.subarray( (V * U) / S.data.BYTES_PER_ELEMENT, ((V + 1) * U) / S.data.BYTES_PER_ELEMENT ) n.compressedTexSubImage3D( e.TEXTURE_2D_ARRAY, O, 0, 0, V, S.width, S.height, 1, A, j ) } } catch (G) { z.e(G) } finally { z.f() } o.clearLayerUpdates() } else n.compressedTexSubImage3D( e.TEXTURE_2D_ARRAY, O, 0, 0, 0, S.width, S.height, y.depth, A, S.data ) } else n.compressedTexImage3D( e.TEXTURE_2D_ARRAY, O, T, S.width, S.height, y.depth, 0, S.data, 0, 0 ) else console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ) else E ? k && n.texSubImage3D( e.TEXTURE_2D_ARRAY, O, 0, 0, 0, S.width, S.height, y.depth, A, w, S.data ) : n.texImage3D( e.TEXTURE_2D_ARRAY, O, T, S.width, S.height, y.depth, 0, A, w, S.data ) } else { E && C && n.texStorage2D(e.TEXTURE_2D, R, T, M[0].width, M[0].height) for (var Q = 0, q = M.length; Q < q; Q++) ((S = M[Q]), o.format !== wl ? null !== A ? E ? k && n.compressedTexSubImage2D( e.TEXTURE_2D, Q, 0, 0, S.width, S.height, A, S.data ) : n.compressedTexImage2D( e.TEXTURE_2D, Q, T, S.width, S.height, 0, S.data ) : console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ) : E ? k && n.texSubImage2D( e.TEXTURE_2D, Q, 0, 0, S.width, S.height, A, w, S.data ) : n.texImage2D(e.TEXTURE_2D, Q, T, S.width, S.height, 0, A, w, S.data)) } else if (o.isDataArrayTexture) if (E) { if ( (C && n.texStorage3D(e.TEXTURE_2D_ARRAY, R, T, y.width, y.height, y.depth), k) ) if (o.layerUpdates.size > 0) { var X, Y = im(y.width, y.height, o.format, o.type), K = L(o.layerUpdates) try { for (K.s(); !(X = K.n()).done; ) { var Z = X.value, J = y.data.subarray( (Z * Y) / y.data.BYTES_PER_ELEMENT, ((Z + 1) * Y) / y.data.BYTES_PER_ELEMENT ) n.texSubImage3D( e.TEXTURE_2D_ARRAY, 0, 0, 0, Z, y.width, y.height, 1, A, w, J ) } } catch (G) { K.e(G) } finally { K.f() } o.clearLayerUpdates() } else n.texSubImage3D( e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, y.width, y.height, y.depth, A, w, y.data ) } else n.texImage3D( e.TEXTURE_2D_ARRAY, 0, T, y.width, y.height, y.depth, 0, A, w, y.data ) else if (o.isData3DTexture) E ? (C && n.texStorage3D(e.TEXTURE_3D, R, T, y.width, y.height, y.depth), k && n.texSubImage3D( e.TEXTURE_3D, 0, 0, 0, 0, y.width, y.height, y.depth, A, w, y.data )) : n.texImage3D(e.TEXTURE_3D, 0, T, y.width, y.height, y.depth, 0, A, w, y.data) else if (o.isFramebufferTexture) { if (C) if (E) n.texStorage2D(e.TEXTURE_2D, R, T, y.width, y.height) else for (var $ = y.width, ee = y.height, te = 0; te < R; te++) (n.texImage2D(e.TEXTURE_2D, te, T, $, ee, 0, A, w, null), ($ >>= 1), (ee >>= 1)) } else if (M.length > 0) { if (E && C) { var ne = W(M[0]) n.texStorage2D(e.TEXTURE_2D, R, T, ne.width, ne.height) } for (var re = 0, ie = M.length; re < ie; re++) ((S = M[re]), E ? k && n.texSubImage2D(e.TEXTURE_2D, re, 0, 0, A, w, S) : n.texImage2D(e.TEXTURE_2D, re, T, A, w, S)) o.generateMipmaps = !1 } else if (E) { if (C) { var ae = W(y) n.texStorage2D(e.TEXTURE_2D, R, T, ae.width, ae.height) } k && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, A, w, y) } else n.texImage2D(e.TEXTURE_2D, 0, T, A, w, y) ;(m(o) && g(u), (h.__version = c.version), o.onUpdate && o.onUpdate(o)) } t.__version = o.version } function D(t, i, o, s, l, c) { var h = a.convert(o.format, o.colorSpace), d = a.convert(o.type), f = _(o.internalFormat, h, d, o.colorSpace), p = r.get(i), v = r.get(o) if (((v.__renderTarget = i), !p.__hasExternalTextures)) { var m = Math.max(1, i.width >> c), g = Math.max(1, i.height >> c) l === e.TEXTURE_3D || l === e.TEXTURE_2D_ARRAY ? n.texImage3D(l, c, f, m, g, i.depth, 0, h, d, null) : n.texImage2D(l, c, f, m, g, 0, h, d, null) } ;(n.bindFramebuffer(e.FRAMEBUFFER, t), V(i) ? u.framebufferTexture2DMultisampleEXT( e.FRAMEBUFFER, s, l, v.__webglTexture, 0, z(i) ) : (l === e.TEXTURE_2D || (l >= e.TEXTURE_CUBE_MAP_POSITIVE_X && l <= e.TEXTURE_CUBE_MAP_NEGATIVE_Z)) && e.framebufferTexture2D(e.FRAMEBUFFER, s, l, v.__webglTexture, c), n.bindFramebuffer(e.FRAMEBUFFER, null)) } function O(t, n, r) { if ((e.bindRenderbuffer(e.RENDERBUFFER, t), n.depthBuffer)) { var i = n.depthTexture, o = i && i.isDepthTexture ? i.type : null, s = b(n.stencilBuffer, o), l = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, c = z(n) ;(V(n) ? u.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, c, s, n.width, n.height) : r ? e.renderbufferStorageMultisample(e.RENDERBUFFER, c, s, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, s, n.width, n.height), e.framebufferRenderbuffer(e.FRAMEBUFFER, l, e.RENDERBUFFER, t)) } else for (var h = n.textures, d = 0; d < h.length; d++) { var f = h[d], p = a.convert(f.format, f.colorSpace), v = a.convert(f.type), m = _(f.internalFormat, p, v, f.colorSpace), g = z(n) r && !1 === V(n) ? e.renderbufferStorageMultisample(e.RENDERBUFFER, g, m, n.width, n.height) : V(n) ? u.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, g, m, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, m, n.width, n.height) } e.bindRenderbuffer(e.RENDERBUFFER, null) } function F(t) { var i = r.get(t), a = !0 === t.isWebGLCubeRenderTarget if (i.__boundDepthTexture !== t.depthTexture) { var o = t.depthTexture if ((i.__depthDisposeCallback && i.__depthDisposeCallback(), o)) { var s = function () { ;(delete i.__boundDepthTexture, delete i.__depthDisposeCallback, o.removeEventListener('dispose', s)) } ;(o.addEventListener('dispose', s), (i.__depthDisposeCallback = s)) } i.__boundDepthTexture = o } if (t.depthTexture && !i.__autoAllocateDepthBuffer) { if (a) throw new Error('target.depthTexture not supported in Cube render targets') !(function (t, i) { if (i && i.isWebGLCubeRenderTarget) throw new Error('Depth Texture with cube render targets is not supported') if ( (n.bindFramebuffer(e.FRAMEBUFFER, t), !i.depthTexture || !i.depthTexture.isDepthTexture) ) throw new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' ) var a = r.get(i.depthTexture) ;((a.__renderTarget = i), (a.__webglTexture && i.depthTexture.image.width === i.width && i.depthTexture.image.height === i.height) || ((i.depthTexture.image.width = i.width), (i.depthTexture.image.height = i.height), (i.depthTexture.needsUpdate = !0)), E(i.depthTexture, 0)) var o = a.__webglTexture, s = z(i) if (i.depthTexture.format === Tl) V(i) ? u.framebufferTexture2DMultisampleEXT( e.FRAMEBUFFER, e.DEPTH_ATTACHMENT, e.TEXTURE_2D, o, 0, s ) : e.framebufferTexture2D( e.FRAMEBUFFER, e.DEPTH_ATTACHMENT, e.TEXTURE_2D, o, 0 ) else { if (i.depthTexture.format !== Ml) throw new Error('Unknown depthTexture format') V(i) ? u.framebufferTexture2DMultisampleEXT( e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.TEXTURE_2D, o, 0, s ) : e.framebufferTexture2D( e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.TEXTURE_2D, o, 0 ) } })(i.__webglFramebuffer, t) } else if (a) { i.__webglDepthbuffer = [] for (var l = 0; l < 6; l++) if ( (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer[l]), void 0 === i.__webglDepthbuffer[l]) ) ((i.__webglDepthbuffer[l] = e.createRenderbuffer()), O(i.__webglDepthbuffer[l], t, !1)) else { var c = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, h = i.__webglDepthbuffer[l] ;(e.bindRenderbuffer(e.RENDERBUFFER, h), e.framebufferRenderbuffer(e.FRAMEBUFFER, c, e.RENDERBUFFER, h)) } } else if ( (n.bindFramebuffer(e.FRAMEBUFFER, i.__webglFramebuffer), void 0 === i.__webglDepthbuffer) ) ((i.__webglDepthbuffer = e.createRenderbuffer()), O(i.__webglDepthbuffer, t, !1)) else { var d = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, f = i.__webglDepthbuffer ;(e.bindRenderbuffer(e.RENDERBUFFER, f), e.framebufferRenderbuffer(e.FRAMEBUFFER, d, e.RENDERBUFFER, f)) } n.bindFramebuffer(e.FRAMEBUFFER, null) } var B = [], U = [] function z(e) { return Math.min(i.maxSamples, e.samples) } function V(e) { var n = r.get(e) return ( e.samples > 0 && !0 === t.has('WEBGL_multisampled_render_to_texture') && !1 !== n.__useRenderToTexture ) } function H(e, t) { var n = e.colorSpace, r = e.format, i = e.type return ( !0 === e.isCompressedTexture || !0 === e.isVideoTexture || (n !== bc && n !== yc && ($c.getTransfer(n) === Sc ? (r === wl && i === dl) || console.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' ) : console.error('THREE.WebGLTextures: Unsupported texture color space:', n))), t ) } function W(e) { return ( 'undefined' != typeof HTMLImageElement && e instanceof HTMLImageElement ? ((c.width = e.naturalWidth || e.width), (c.height = e.naturalHeight || e.height)) : 'undefined' != typeof VideoFrame && e instanceof VideoFrame ? ((c.width = e.displayWidth), (c.height = e.displayHeight)) : ((c.width = e.width), (c.height = e.height)), c ) } ;((this.allocateTextureUnit = function () { var e = T return ( e >= i.maxTextures && console.warn( 'THREE.WebGLTextures: Trying to use ' + e + ' texture units while this GPU supports only ' + i.maxTextures ), (T += 1), e ) }), (this.resetTextureUnits = function () { T = 0 }), (this.setTexture2D = E), (this.setTexture2DArray = function (t, i) { var a = r.get(t) t.version > 0 && a.__version !== t.version ? P(a, t, i) : n.bindTexture(e.TEXTURE_2D_ARRAY, a.__webglTexture, e.TEXTURE0 + i) }), (this.setTexture3D = function (t, i) { var a = r.get(t) t.version > 0 && a.__version !== t.version ? P(a, t, i) : n.bindTexture(e.TEXTURE_3D, a.__webglTexture, e.TEXTURE0 + i) }), (this.setTextureCube = function (t, o) { var s = r.get(t) t.version > 0 && s.__version !== t.version ? (function (t, o, s) { if (6 !== o.image.length) return var u = N(t, o), l = o.source n.bindTexture(e.TEXTURE_CUBE_MAP, t.__webglTexture, e.TEXTURE0 + s) var c = r.get(l) if (l.version !== c.__version || !0 === u) { n.activeTexture(e.TEXTURE0 + s) var h = $c.getPrimaries($c.workingColorSpace), d = o.colorSpace === yc ? null : $c.getPrimaries(o.colorSpace), f = o.colorSpace === yc || h === d ? e.NONE : e.BROWSER_DEFAULT_WEBGL ;(e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, o.flipY), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, o.premultiplyAlpha), e.pixelStorei(e.UNPACK_ALIGNMENT, o.unpackAlignment), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, f)) for ( var p = o.isCompressedTexture || o.image[0].isCompressedTexture, y = o.image[0] && o.image[0].isDataTexture, b = [], S = 0; S < 6; S++ ) ((b[S] = p || y ? y ? o.image[S].image : o.image[S] : v(o.image[S], !0, i.maxCubemapSize)), (b[S] = H(o, b[S]))) var A, w = b[0], T = a.convert(o.format, o.colorSpace), M = a.convert(o.type), E = _(o.internalFormat, T, M, o.colorSpace), C = !0 !== o.isVideoTexture, k = void 0 === c.__version || !0 === u, R = l.dataReady, P = x(o, w) if ((I(e.TEXTURE_CUBE_MAP, o), p)) { C && k && n.texStorage2D(e.TEXTURE_CUBE_MAP, P, E, w.width, w.height) for (var L = 0; L < 6; L++) { A = b[L].mipmaps for (var D = 0; D < A.length; D++) { var O = A[D] o.format !== wl ? null !== T ? C ? R && n.compressedTexSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + L, D, 0, 0, O.width, O.height, T, O.data ) : n.compressedTexImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + L, D, E, O.width, O.height, 0, O.data ) : console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' ) : C ? R && n.texSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + L, D, 0, 0, O.width, O.height, T, M, O.data ) : n.texImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + L, D, E, O.width, O.height, 0, T, M, O.data ) } } } else { if (((A = o.mipmaps), C && k)) { A.length > 0 && P++ var F = W(b[0]) n.texStorage2D(e.TEXTURE_CUBE_MAP, P, E, F.width, F.height) } for (var B = 0; B < 6; B++) if (y) { C ? R && n.texSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, 0, 0, 0, b[B].width, b[B].height, T, M, b[B].data ) : n.texImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, 0, E, b[B].width, b[B].height, 0, T, M, b[B].data ) for (var U = 0; U < A.length; U++) { var z = A[U].image[B].image C ? R && n.texSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, U + 1, 0, 0, z.width, z.height, T, M, z.data ) : n.texImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, U + 1, E, z.width, z.height, 0, T, M, z.data ) } } else { C ? R && n.texSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, 0, 0, 0, T, M, b[B] ) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + B, 0, E, T, M, b[B]) for (var V = 0; V < A.length; V++) { var G = A[V] C ? R && n.texSubImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, V + 1, 0, 0, T, M, G.image[B] ) : n.texImage2D( e.TEXTURE_CUBE_MAP_POSITIVE_X + B, V + 1, E, T, M, G.image[B] ) } } } ;(m(o) && g(e.TEXTURE_CUBE_MAP), (c.__version = l.version), o.onUpdate && o.onUpdate(o)) } t.__version = o.version })(s, t, o) : n.bindTexture(e.TEXTURE_CUBE_MAP, s.__webglTexture, e.TEXTURE0 + o) }), (this.rebindTextures = function (t, n, i) { var a = r.get(t) ;(void 0 !== n && D(a.__webglFramebuffer, t, t.texture, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, 0), void 0 !== i && F(t)) }), (this.setupRenderTarget = function (t) { var i = t.texture, s = r.get(t), u = r.get(i) t.addEventListener('dispose', A) var l = t.textures, c = !0 === t.isWebGLCubeRenderTarget, h = l.length > 1 if ( (h || (void 0 === u.__webglTexture && (u.__webglTexture = e.createTexture()), (u.__version = i.version), o.memory.textures++), c) ) { s.__webglFramebuffer = [] for (var d = 0; d < 6; d++) if (i.mipmaps && i.mipmaps.length > 0) { s.__webglFramebuffer[d] = [] for (var f = 0; f < i.mipmaps.length; f++) s.__webglFramebuffer[d][f] = e.createFramebuffer() } else s.__webglFramebuffer[d] = e.createFramebuffer() } else { if (i.mipmaps && i.mipmaps.length > 0) { s.__webglFramebuffer = [] for (var p = 0; p < i.mipmaps.length; p++) s.__webglFramebuffer[p] = e.createFramebuffer() } else s.__webglFramebuffer = e.createFramebuffer() if (h) for (var v = 0, y = l.length; v < y; v++) { var b = r.get(l[v]) void 0 === b.__webglTexture && ((b.__webglTexture = e.createTexture()), o.memory.textures++) } if (t.samples > 0 && !1 === V(t)) { ;((s.__webglMultisampledFramebuffer = e.createFramebuffer()), (s.__webglColorRenderbuffer = []), n.bindFramebuffer(e.FRAMEBUFFER, s.__webglMultisampledFramebuffer)) for (var x = 0; x < l.length; x++) { var S = l[x] ;((s.__webglColorRenderbuffer[x] = e.createRenderbuffer()), e.bindRenderbuffer(e.RENDERBUFFER, s.__webglColorRenderbuffer[x])) var w = a.convert(S.format, S.colorSpace), T = a.convert(S.type), M = _(S.internalFormat, w, T, S.colorSpace, !0 === t.isXRRenderTarget), E = z(t) ;(e.renderbufferStorageMultisample(e.RENDERBUFFER, E, M, t.width, t.height), e.framebufferRenderbuffer( e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + x, e.RENDERBUFFER, s.__webglColorRenderbuffer[x] )) } ;(e.bindRenderbuffer(e.RENDERBUFFER, null), t.depthBuffer && ((s.__webglDepthRenderbuffer = e.createRenderbuffer()), O(s.__webglDepthRenderbuffer, t, !0)), n.bindFramebuffer(e.FRAMEBUFFER, null)) } } if (c) { ;(n.bindTexture(e.TEXTURE_CUBE_MAP, u.__webglTexture), I(e.TEXTURE_CUBE_MAP, i)) for (var C = 0; C < 6; C++) if (i.mipmaps && i.mipmaps.length > 0) for (var k = 0; k < i.mipmaps.length; k++) D( s.__webglFramebuffer[C][k], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + C, k ) else D( s.__webglFramebuffer[C], t, i, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + C, 0 ) ;(m(i) && g(e.TEXTURE_CUBE_MAP), n.unbindTexture()) } else if (h) { for (var R = 0, N = l.length; R < N; R++) { var P = l[R], L = r.get(P) ;(n.bindTexture(e.TEXTURE_2D, L.__webglTexture), I(e.TEXTURE_2D, P), D(s.__webglFramebuffer, t, P, e.COLOR_ATTACHMENT0 + R, e.TEXTURE_2D, 0), m(P) && g(e.TEXTURE_2D)) } n.unbindTexture() } else { var B = e.TEXTURE_2D if ( ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (B = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY), n.bindTexture(B, u.__webglTexture), I(B, i), i.mipmaps && i.mipmaps.length > 0) ) for (var U = 0; U < i.mipmaps.length; U++) D(s.__webglFramebuffer[U], t, i, e.COLOR_ATTACHMENT0, B, U) else D(s.__webglFramebuffer, t, i, e.COLOR_ATTACHMENT0, B, 0) ;(m(i) && g(B), n.unbindTexture()) } t.depthBuffer && F(t) }), (this.updateRenderTargetMipmap = function (e) { for (var t = e.textures, i = 0, a = t.length; i < a; i++) { var o = t[i] if (m(o)) { var s = y(e), u = r.get(o).__webglTexture ;(n.bindTexture(s, u), g(s), n.unbindTexture()) } } }), (this.updateMultisampleRenderTarget = function (t) { if (t.samples > 0) if (!1 === V(t)) { var i = t.textures, a = t.width, o = t.height, s = e.COLOR_BUFFER_BIT, u = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT, c = r.get(t), h = i.length > 1 if (h) for (var d = 0; d < i.length; d++) (n.bindFramebuffer(e.FRAMEBUFFER, c.__webglMultisampledFramebuffer), e.framebufferRenderbuffer( e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + d, e.RENDERBUFFER, null ), n.bindFramebuffer(e.FRAMEBUFFER, c.__webglFramebuffer), e.framebufferTexture2D( e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + d, e.TEXTURE_2D, null, 0 )) ;(n.bindFramebuffer(e.READ_FRAMEBUFFER, c.__webglMultisampledFramebuffer), n.bindFramebuffer(e.DRAW_FRAMEBUFFER, c.__webglFramebuffer)) for (var f = 0; f < i.length; f++) { if ( (t.resolveDepthBuffer && (t.depthBuffer && (s |= e.DEPTH_BUFFER_BIT), t.stencilBuffer && t.resolveStencilBuffer && (s |= e.STENCIL_BUFFER_BIT)), h) ) { e.framebufferRenderbuffer( e.READ_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.RENDERBUFFER, c.__webglColorRenderbuffer[f] ) var p = r.get(i[f]).__webglTexture e.framebufferTexture2D( e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, p, 0 ) } ;(e.blitFramebuffer(0, 0, a, o, 0, 0, a, o, s, e.NEAREST), !0 === l && ((B.length = 0), (U.length = 0), B.push(e.COLOR_ATTACHMENT0 + f), t.depthBuffer && !1 === t.resolveDepthBuffer && (B.push(u), U.push(u), e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, U)), e.invalidateFramebuffer(e.READ_FRAMEBUFFER, B))) } if ( (n.bindFramebuffer(e.READ_FRAMEBUFFER, null), n.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), h) ) for (var v = 0; v < i.length; v++) { ;(n.bindFramebuffer(e.FRAMEBUFFER, c.__webglMultisampledFramebuffer), e.framebufferRenderbuffer( e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + v, e.RENDERBUFFER, c.__webglColorRenderbuffer[v] )) var m = r.get(i[v]).__webglTexture ;(n.bindFramebuffer(e.FRAMEBUFFER, c.__webglFramebuffer), e.framebufferTexture2D( e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + v, e.TEXTURE_2D, m, 0 )) } n.bindFramebuffer(e.DRAW_FRAMEBUFFER, c.__webglMultisampledFramebuffer) } else if (t.depthBuffer && !1 === t.resolveDepthBuffer && l) { var g = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, [g]) } }), (this.setupDepthRenderbuffer = F), (this.setupFrameBufferTexture = D), (this.useMultisampledRTT = V)) } function Ny(e, t) { return { convert: function (n) { var r, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : yc, a = $c.getTransfer(i) if (n === dl) return e.UNSIGNED_BYTE if (n === bl) return e.UNSIGNED_SHORT_4_4_4_4 if (n === xl) return e.UNSIGNED_SHORT_5_5_5_1 if (n === Al) return e.UNSIGNED_INT_5_9_9_9_REV if (n === fl) return e.BYTE if (n === pl) return e.SHORT if (n === vl) return e.UNSIGNED_SHORT if (n === ml) return e.INT if (n === gl) return e.UNSIGNED_INT if (n === yl) return e.FLOAT if (n === _l) return e.HALF_FLOAT if (1021 === n) return e.ALPHA if (1022 === n) return e.RGB if (n === wl) return e.RGBA if (1024 === n) return e.LUMINANCE if (1025 === n) return e.LUMINANCE_ALPHA if (n === Tl) return e.DEPTH_COMPONENT if (n === Ml) return e.DEPTH_STENCIL if (n === El) return e.RED if (n === Cl) return e.RED_INTEGER if (n === kl) return e.RG if (n === Rl) return e.RG_INTEGER if (n === Il) return e.RGBA_INTEGER if (n === Nl || n === Pl || n === Ll || n === Dl) if (a === Sc) { if (null === (r = t.get('WEBGL_compressed_texture_s3tc_srgb'))) return null if (n === Nl) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT if (n === Pl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT if (n === Ll) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT if (n === Dl) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT } else { if (null === (r = t.get('WEBGL_compressed_texture_s3tc'))) return null if (n === Nl) return r.COMPRESSED_RGB_S3TC_DXT1_EXT if (n === Pl) return r.COMPRESSED_RGBA_S3TC_DXT1_EXT if (n === Ll) return r.COMPRESSED_RGBA_S3TC_DXT3_EXT if (n === Dl) return r.COMPRESSED_RGBA_S3TC_DXT5_EXT } if (n === Ol || n === Fl || n === Bl || n === Ul) { if (null === (r = t.get('WEBGL_compressed_texture_pvrtc'))) return null if (n === Ol) return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG if (n === Fl) return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG if (n === Bl) return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG if (n === Ul) return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG } if (n === zl || n === Vl || n === Hl) { if (null === (r = t.get('WEBGL_compressed_texture_etc'))) return null if (n === zl || n === Vl) return a === Sc ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2 if (n === Hl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC } if ( n === Wl || n === Gl || n === jl || n === Ql || n === ql || n === Xl || n === Yl || n === Kl || n === Zl || n === Jl || n === $l || n === ec || n === tc || n === nc ) { if (null === (r = t.get('WEBGL_compressed_texture_astc'))) return null if (n === Wl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR if (n === Gl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR if (n === jl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR if (n === Ql) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR if (n === ql) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR if (n === Xl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR if (n === Yl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR if (n === Kl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR if (n === Zl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR if (n === Jl) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR if (n === $l) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR if (n === ec) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR if (n === tc) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR if (n === nc) return a === Sc ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR } if (n === rc || n === ic || n === ac) { if (null === (r = t.get('EXT_texture_compression_bptc'))) return null if (n === rc) return a === Sc ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT if (n === ic) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT if (n === ac) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT } if (36283 === n || n === oc || n === sc || n === uc) { if (null === (r = t.get('EXT_texture_compression_rgtc'))) return null if (n === rc) return r.COMPRESSED_RED_RGTC1_EXT if (n === oc) return r.COMPRESSED_SIGNED_RED_RGTC1_EXT if (n === sc) return r.COMPRESSED_RED_GREEN_RGTC2_EXT if (n === uc) return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT } return n === Sl ? e.UNSIGNED_INT_24_8 : void 0 !== e[n] ? e[n] : null }, } } var Py = (function () { return T( function e() { ;(A(this, e), (this.texture = null), (this.mesh = null), (this.depthNear = 0), (this.depthFar = 0)) }, [ { key: 'init', value: function (e, t, n) { if (null === this.texture) { var r = new sh() ;((e.properties.get(r).__webglTexture = t.texture), (t.depthNear === n.depthNear && t.depthFar === n.depthFar) || ((this.depthNear = t.depthNear), (this.depthFar = t.depthFar)), (this.texture = r)) } }, }, { key: 'getMesh', value: function (e) { if (null !== this.texture && null === this.mesh) { var t = e.cameras[0].viewport, n = new wf({ vertexShader: '\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}', fragmentShader: '\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}', uniforms: { depthColor: { value: this.texture }, depthWidth: { value: t.z }, depthHeight: { value: t.w }, }, }) this.mesh = new gf(new Wp(20, 20), n) } return this.mesh }, }, { key: 'reset', value: function () { ;((this.texture = null), (this.mesh = null)) }, }, { key: 'getDepthTexture', value: function () { return this.texture }, }, ] ) })(), Ly = (function (e) { function t(e, n) { var r A(this, t) var i = (r = y(this, t)), a = null, o = 1, s = null, u = 'local-floor', l = 1, c = null, h = null, f = null, p = null, m = null, g = null, _ = new Py(), b = n.getContextAttributes(), x = null, S = null, w = [], T = [], M = new Vc(), E = null, C = new kf() C.viewport = new uh() var k = new kf() k.viewport = new uh() var R = [C, k], I = new zv(), N = null, P = null function L(e) { var t = T.indexOf(e.inputSource) if (-1 !== t) { var n = w[t] void 0 !== n && (n.update(e.inputSource, e.frame, c || s), n.dispatchEvent({ type: e.type, data: e.inputSource })) } } function D() { ;(a.removeEventListener('select', L), a.removeEventListener('selectstart', L), a.removeEventListener('selectend', L), a.removeEventListener('squeeze', L), a.removeEventListener('squeezestart', L), a.removeEventListener('squeezeend', L), a.removeEventListener('end', D), a.removeEventListener('inputsourceschange', O)) for (var t = 0; t < w.length; t++) { var n = T[t] null !== n && ((T[t] = null), w[t].disconnect(n)) } ;((N = null), (P = null), _.reset(), e.setRenderTarget(x), (m = null), (p = null), (f = null), (a = null), (S = null), V.stop(), (i.isPresenting = !1), e.setPixelRatio(E), e.setSize(M.width, M.height, !1), i.dispatchEvent({ type: 'sessionend' })) } function O(e) { for (var t = 0; t < e.removed.length; t++) { var n = e.removed[t], r = T.indexOf(n) r >= 0 && ((T[r] = null), w[r].disconnect(n)) } for (var i = 0; i < e.added.length; i++) { var a = e.added[i], o = T.indexOf(a) if (-1 === o) { for (var s = 0; s < w.length; s++) { if (s >= T.length) { ;(T.push(a), (o = s)) break } if (null === T[s]) { ;((T[s] = a), (o = s)) break } } if (-1 === o) break } var u = w[o] u && u.connect(a) } } ;((r.cameraAutoUpdate = !0), (r.enabled = !1), (r.isPresenting = !1), (r.getController = function (e) { var t = w[e] return (void 0 === t && ((t = new Of()), (w[e] = t)), t.getTargetRaySpace()) }), (r.getControllerGrip = function (e) { var t = w[e] return (void 0 === t && ((t = new Of()), (w[e] = t)), t.getGripSpace()) }), (r.getHand = function (e) { var t = w[e] return (void 0 === t && ((t = new Of()), (w[e] = t)), t.getHandSpace()) }), (r.setFramebufferScaleFactor = function (e) { ;((o = e), !0 === i.isPresenting && console.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' )) }), (r.setReferenceSpaceType = function (e) { ;((u = e), !0 === i.isPresenting && console.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' )) }), (r.getReferenceSpace = function () { return c || s }), (r.setReferenceSpace = function (e) { c = e }), (r.getBaseLayer = function () { return null !== p ? p : m }), (r.getBinding = function () { return f }), (r.getFrame = function () { return g }), (r.getSession = function () { return a }), (r.setSession = (function () { var t = v( d().m(function t(r) { var h, v, g, y, _ return d().w( function (t) { for (;;) switch (t.n) { case 0: if (null === (a = r)) { t.n = 3 break } if ( ((x = e.getRenderTarget()), a.addEventListener('select', L), a.addEventListener('selectstart', L), a.addEventListener('selectend', L), a.addEventListener('squeeze', L), a.addEventListener('squeezestart', L), a.addEventListener('squeezeend', L), a.addEventListener('end', D), a.addEventListener('inputsourceschange', O), !0 === b.xrCompatible) ) { t.n = 1 break } return ((t.n = 1), n.makeXRCompatible()) case 1: return ( (E = e.getPixelRatio()), e.getSize(M), 'undefined' != typeof XRWebGLBinding && 'createProjectionLayer' in XRWebGLBinding.prototype ? ((v = null), (g = null), (y = null), b.depth && ((y = b.stencil ? n.DEPTH24_STENCIL8 : n.DEPTH_COMPONENT24), (v = b.stencil ? Ml : Tl), (g = b.stencil ? Sl : gl)), (_ = { colorFormat: n.RGBA8, depthFormat: y, scaleFactor: o, }), (f = new XRWebGLBinding(a, n)), (p = f.createProjectionLayer(_)), a.updateRenderState({ layers: [p] }), e.setPixelRatio(1), e.setSize(p.textureWidth, p.textureHeight, !1), (S = new ch(p.textureWidth, p.textureHeight, { format: wl, type: dl, depthTexture: new zp( p.textureWidth, p.textureHeight, g, void 0, void 0, void 0, void 0, void 0, void 0, v ), stencilBuffer: b.stencil, colorSpace: e.outputColorSpace, samples: b.antialias ? 4 : 0, resolveDepthBuffer: !1 === p.ignoreDepthValues, }))) : ((h = { antialias: b.antialias, alpha: !0, depth: b.depth, stencil: b.stencil, framebufferScaleFactor: o, }), (m = new XRWebGLLayer(a, n, h)), a.updateRenderState({ baseLayer: m }), e.setPixelRatio(1), e.setSize(m.framebufferWidth, m.framebufferHeight, !1), (S = new ch(m.framebufferWidth, m.framebufferHeight, { format: wl, type: dl, colorSpace: e.outputColorSpace, stencilBuffer: b.stencil, }))), (S.isXRRenderTarget = !0), this.setFoveation(l), (c = null), (t.n = 2), a.requestReferenceSpace(u) ) case 2: ;((s = t.v), V.setContext(a), V.start(), (i.isPresenting = !0), i.dispatchEvent({ type: 'sessionstart' })) case 3: return t.a(2) } }, t, this ) }) ) return function (e) { return t.apply(this, arguments) } })()), (r.getEnvironmentBlendMode = function () { if (null !== a) return a.environmentBlendMode }), (r.getDepthTexture = function () { return _.getDepthTexture() })) var F = new ph(), B = new ph() function U(e, t) { ;(null === t ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert()) } ;((r.updateCamera = function (e) { if (null !== a) { var t = e.near, n = e.far ;(null !== _.texture && (_.depthNear > 0 && (t = _.depthNear), _.depthFar > 0 && (n = _.depthFar)), (I.near = k.near = C.near = t), (I.far = k.far = C.far = n), (N === I.near && P === I.far) || (a.updateRenderState({ depthNear: I.near, depthFar: I.far }), (N = I.near), (P = I.far)), (C.layers.mask = 2 | e.layers.mask), (k.layers.mask = 4 | e.layers.mask), (I.layers.mask = C.layers.mask | k.layers.mask)) var r = e.parent, i = I.cameras U(I, r) for (var o = 0; o < i.length; o++) U(i[o], r) ;(2 === i.length ? (function (e, t, n) { ;(F.setFromMatrixPosition(t.matrixWorld), B.setFromMatrixPosition(n.matrixWorld)) var r = F.distanceTo(B), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), u = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], c = (i[8] - 1) / i[0], h = (a[8] + 1) / a[0], d = o * c, f = o * h, p = r / (-c + h), v = p * -c if ( (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(v), e.translateZ(p), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), -1 === i[10]) ) (e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse)) else { var m = o + p, g = s + p, y = d - v, _ = f + (r - v), b = ((u * s) / g) * m, x = ((l * s) / g) * m ;(e.projectionMatrix.makePerspective(y, _, b, x, m, g), e.projectionMatrixInverse.copy(e.projectionMatrix).invert()) } })(I, C, k) : I.projectionMatrix.copy(C.projectionMatrix), (function (e, t, n) { null === n ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)) ;(e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && ((e.fov = 2 * Pc * Math.atan(1 / e.projectionMatrix.elements[5])), (e.zoom = 1))) })(e, I, r)) } }), (r.getCamera = function () { return I }), (r.getFoveation = function () { if (null !== p || null !== m) return l }), (r.setFoveation = function (e) { ;((l = e), null !== p && (p.fixedFoveation = e), null !== m && void 0 !== m.fixedFoveation && (m.fixedFoveation = e)) }), (r.hasDepthSensing = function () { return null !== _.texture }), (r.getDepthSensingMesh = function () { return _.getMesh(I) })) var z = null var V = new am() return ( V.setAnimationLoop(function (t, n) { if (((h = n.getViewerPose(c || s)), (g = n), null !== h)) { var r = h.views null !== m && (e.setRenderTargetFramebuffer(S, m.framebuffer), e.setRenderTarget(S)) var o = !1 r.length !== I.cameras.length && ((I.cameras.length = 0), (o = !0)) for (var u = 0; u < r.length; u++) { var l = r[u], d = null if (null !== m) d = m.getViewport(l) else { var v = f.getViewSubImage(p, l) ;((d = v.viewport), 0 === u && (e.setRenderTargetTextures( S, v.colorTexture, p.ignoreDepthValues ? void 0 : v.depthStencilTexture ), e.setRenderTarget(S))) } var y = R[u] ;(void 0 === y && ((y = new kf()).layers.enable(u), (y.viewport = new uh()), (R[u] = y)), y.matrix.fromArray(l.transform.matrix), y.matrix.decompose(y.position, y.quaternion, y.scale), y.projectionMatrix.fromArray(l.projectionMatrix), y.projectionMatrixInverse.copy(y.projectionMatrix).invert(), y.viewport.set(d.x, d.y, d.width, d.height), 0 === u && (I.matrix.copy(y.matrix), I.matrix.decompose(I.position, I.quaternion, I.scale)), !0 === o && I.cameras.push(y)) } var b = a.enabledFeatures if ( b && b.includes('depth-sensing') && 'gpu-optimized' == a.depthUsage && f ) { var x = f.getDepthInformation(r[0]) x && x.isValid && x.texture && _.init(e, x, a.renderState) } } for (var A = 0; A < w.length; A++) { var M = T[A], E = w[A] null !== M && void 0 !== E && E.update(M, n, c || s) } ;(z && z(t, n), n.detectedPlanes && i.dispatchEvent({ type: 'planesdetected', data: n }), (g = null)) }), (r.setAnimationLoop = function (e) { z = e }), (r.dispose = function () {}), r ) } return (x(t, e), T(t)) })(kc), Dy = new ed(), Oy = new Gh() function Fy(e, t) { function n(e, t) { ;(!0 === e.matrixAutoUpdate && e.updateMatrix(), t.value.copy(e.matrix)) } function r(e, r) { ;((e.opacity.value = r.opacity), r.color && e.diffuse.value.copy(r.color), r.emissive && e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity), r.map && ((e.map.value = r.map), n(r.map, e.mapTransform)), r.alphaMap && ((e.alphaMap.value = r.alphaMap), n(r.alphaMap, e.alphaMapTransform)), r.bumpMap && ((e.bumpMap.value = r.bumpMap), n(r.bumpMap, e.bumpMapTransform), (e.bumpScale.value = r.bumpScale), 1 === r.side && (e.bumpScale.value *= -1)), r.normalMap && ((e.normalMap.value = r.normalMap), n(r.normalMap, e.normalMapTransform), e.normalScale.value.copy(r.normalScale), 1 === r.side && e.normalScale.value.negate()), r.displacementMap && ((e.displacementMap.value = r.displacementMap), n(r.displacementMap, e.displacementMapTransform), (e.displacementScale.value = r.displacementScale), (e.displacementBias.value = r.displacementBias)), r.emissiveMap && ((e.emissiveMap.value = r.emissiveMap), n(r.emissiveMap, e.emissiveMapTransform)), r.specularMap && ((e.specularMap.value = r.specularMap), n(r.specularMap, e.specularMapTransform)), r.alphaTest > 0 && (e.alphaTest.value = r.alphaTest)) var i = t.get(r), a = i.envMap, o = i.envMapRotation ;(a && ((e.envMap.value = a), Dy.copy(o), (Dy.x *= -1), (Dy.y *= -1), (Dy.z *= -1), a.isCubeTexture && !1 === a.isRenderTargetTexture && ((Dy.y *= -1), (Dy.z *= -1)), e.envMapRotation.value.setFromMatrix4(Oy.makeRotationFromEuler(Dy)), (e.flipEnvMap.value = a.isCubeTexture && !1 === a.isRenderTargetTexture ? -1 : 1), (e.reflectivity.value = r.reflectivity), (e.ior.value = r.ior), (e.refractionRatio.value = r.refractionRatio)), r.lightMap && ((e.lightMap.value = r.lightMap), (e.lightMapIntensity.value = r.lightMapIntensity), n(r.lightMap, e.lightMapTransform)), r.aoMap && ((e.aoMap.value = r.aoMap), (e.aoMapIntensity.value = r.aoMapIntensity), n(r.aoMap, e.aoMapTransform))) } return { refreshFogUniforms: function (t, n) { ;(n.color.getRGB(t.fogColor.value, Sf(e)), n.isFog ? ((t.fogNear.value = n.near), (t.fogFar.value = n.far)) : n.isFogExp2 && (t.fogDensity.value = n.density)) }, refreshMaterialUniforms: function (e, i, a, o, s) { i.isMeshBasicMaterial || i.isMeshLambertMaterial ? r(e, i) : i.isMeshToonMaterial ? (r(e, i), (function (e, t) { t.gradientMap && (e.gradientMap.value = t.gradientMap) })(e, i)) : i.isMeshPhongMaterial ? (r(e, i), (function (e, t) { ;(e.specular.value.copy(t.specular), (e.shininess.value = Math.max(t.shininess, 1e-4))) })(e, i)) : i.isMeshStandardMaterial ? (r(e, i), (function (e, t) { ;((e.metalness.value = t.metalness), t.metalnessMap && ((e.metalnessMap.value = t.metalnessMap), n(t.metalnessMap, e.metalnessMapTransform))) ;((e.roughness.value = t.roughness), t.roughnessMap && ((e.roughnessMap.value = t.roughnessMap), n(t.roughnessMap, e.roughnessMapTransform))) t.envMap && (e.envMapIntensity.value = t.envMapIntensity) })(e, i), i.isMeshPhysicalMaterial && (function (e, t, r) { ;((e.ior.value = t.ior), t.sheen > 0 && (e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen), (e.sheenRoughness.value = t.sheenRoughness), t.sheenColorMap && ((e.sheenColorMap.value = t.sheenColorMap), n(t.sheenColorMap, e.sheenColorMapTransform)), t.sheenRoughnessMap && ((e.sheenRoughnessMap.value = t.sheenRoughnessMap), n(t.sheenRoughnessMap, e.sheenRoughnessMapTransform)))) t.clearcoat > 0 && ((e.clearcoat.value = t.clearcoat), (e.clearcoatRoughness.value = t.clearcoatRoughness), t.clearcoatMap && ((e.clearcoatMap.value = t.clearcoatMap), n(t.clearcoatMap, e.clearcoatMapTransform)), t.clearcoatRoughnessMap && ((e.clearcoatRoughnessMap.value = t.clearcoatRoughnessMap), n(t.clearcoatRoughnessMap, e.clearcoatRoughnessMapTransform)), t.clearcoatNormalMap && ((e.clearcoatNormalMap.value = t.clearcoatNormalMap), n(t.clearcoatNormalMap, e.clearcoatNormalMapTransform), e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale), 1 === t.side && e.clearcoatNormalScale.value.negate())) t.dispersion > 0 && (e.dispersion.value = t.dispersion) t.iridescence > 0 && ((e.iridescence.value = t.iridescence), (e.iridescenceIOR.value = t.iridescenceIOR), (e.iridescenceThicknessMinimum.value = t.iridescenceThicknessRange[0]), (e.iridescenceThicknessMaximum.value = t.iridescenceThicknessRange[1]), t.iridescenceMap && ((e.iridescenceMap.value = t.iridescenceMap), n(t.iridescenceMap, e.iridescenceMapTransform)), t.iridescenceThicknessMap && ((e.iridescenceThicknessMap.value = t.iridescenceThicknessMap), n(t.iridescenceThicknessMap, e.iridescenceThicknessMapTransform))) t.transmission > 0 && ((e.transmission.value = t.transmission), (e.transmissionSamplerMap.value = r.texture), e.transmissionSamplerSize.value.set(r.width, r.height), t.transmissionMap && ((e.transmissionMap.value = t.transmissionMap), n(t.transmissionMap, e.transmissionMapTransform)), (e.thickness.value = t.thickness), t.thicknessMap && ((e.thicknessMap.value = t.thicknessMap), n(t.thicknessMap, e.thicknessMapTransform)), (e.attenuationDistance.value = t.attenuationDistance), e.attenuationColor.value.copy(t.attenuationColor)) t.anisotropy > 0 && (e.anisotropyVector.value.set( t.anisotropy * Math.cos(t.anisotropyRotation), t.anisotropy * Math.sin(t.anisotropyRotation) ), t.anisotropyMap && ((e.anisotropyMap.value = t.anisotropyMap), n(t.anisotropyMap, e.anisotropyMapTransform))) ;((e.specularIntensity.value = t.specularIntensity), e.specularColor.value.copy(t.specularColor), t.specularColorMap && ((e.specularColorMap.value = t.specularColorMap), n(t.specularColorMap, e.specularColorMapTransform))) t.specularIntensityMap && ((e.specularIntensityMap.value = t.specularIntensityMap), n(t.specularIntensityMap, e.specularIntensityMapTransform)) })(e, i, s)) : i.isMeshMatcapMaterial ? (r(e, i), (function (e, t) { t.matcap && (e.matcap.value = t.matcap) })(e, i)) : i.isMeshDepthMaterial ? r(e, i) : i.isMeshDistanceMaterial ? (r(e, i), (function (e, n) { var r = t.get(n).light ;(e.referencePosition.value.setFromMatrixPosition(r.matrixWorld), (e.nearDistance.value = r.shadow.camera.near), (e.farDistance.value = r.shadow.camera.far)) })(e, i)) : i.isMeshNormalMaterial ? r(e, i) : i.isLineBasicMaterial ? ((function (e, t) { ;(e.diffuse.value.copy(t.color), (e.opacity.value = t.opacity), t.map && ((e.map.value = t.map), n(t.map, e.mapTransform))) })(e, i), i.isLineDashedMaterial && (function (e, t) { ;((e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale)) })(e, i)) : i.isPointsMaterial ? (function (e, t, r, i) { ;(e.diffuse.value.copy(t.color), (e.opacity.value = t.opacity), (e.size.value = t.size * r), (e.scale.value = 0.5 * i), t.map && ((e.map.value = t.map), n(t.map, e.uvTransform))) t.alphaMap && ((e.alphaMap.value = t.alphaMap), n(t.alphaMap, e.alphaMapTransform)) t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest) })(e, i, a, o) : i.isSpriteMaterial ? (function (e, t) { ;(e.diffuse.value.copy(t.color), (e.opacity.value = t.opacity), (e.rotation.value = t.rotation), t.map && ((e.map.value = t.map), n(t.map, e.mapTransform))) t.alphaMap && ((e.alphaMap.value = t.alphaMap), n(t.alphaMap, e.alphaMapTransform)) t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest) })(e, i) : i.isShadowMaterial ? (e.color.value.copy(i.color), (e.opacity.value = i.opacity)) : i.isShaderMaterial && (i.uniformsNeedUpdate = !1) }, } } function By(e, t, n, r) { var i = {}, a = {}, o = [], s = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS) function u(e, t, n, r) { var i = e.value, a = t + '_' + n if (void 0 === r[a]) return ((r[a] = 'number' == typeof i || 'boolean' == typeof i ? i : i.clone()), !0) var o = r[a] if ('number' == typeof i || 'boolean' == typeof i) { if (o !== i) return ((r[a] = i), !0) } else if (!1 === o.equals(i)) return (o.copy(i), !0) return !1 } function l(e) { var t = { boundary: 0, storage: 0 } return ( 'number' == typeof e || 'boolean' == typeof e ? ((t.boundary = 4), (t.storage = 4)) : e.isVector2 ? ((t.boundary = 8), (t.storage = 8)) : e.isVector3 || e.isColor ? ((t.boundary = 16), (t.storage = 12)) : e.isVector4 ? ((t.boundary = 16), (t.storage = 16)) : e.isMatrix3 ? ((t.boundary = 48), (t.storage = 48)) : e.isMatrix4 ? ((t.boundary = 64), (t.storage = 64)) : e.isTexture ? console.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' ) : console.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', e ), t ) } function c(t) { var n = t.target n.removeEventListener('dispose', c) var r = o.indexOf(n.__bindingPointIndex) ;(o.splice(r, 1), e.deleteBuffer(i[n.id]), delete i[n.id], delete a[n.id]) } return { bind: function (e, t) { var n = t.program r.uniformBlockBinding(e, n) }, update: function (n, h) { var d = i[n.id] void 0 === d && (!(function (e) { for (var t = e.uniforms, n = 0, r = 16, i = 0, a = t.length; i < a; i++) for ( var o = Array.isArray(t[i]) ? t[i] : [t[i]], s = 0, u = o.length; s < u; s++ ) for ( var c = o[s], h = Array.isArray(c.value) ? c.value : [c.value], d = 0, f = h.length; d < f; d++ ) { var p = l(h[d]), v = n % r, m = v % p.boundary, g = v + m ;((n += m), 0 !== g && r - g < p.storage && (n += r - g), (c.__data = new Float32Array( p.storage / Float32Array.BYTES_PER_ELEMENT )), (c.__offset = n), (n += p.storage)) } var y = n % r y > 0 && (n += r - y) ;((e.__size = n), (e.__cache = {})) })(n), (d = (function (t) { var n = (function () { for (var e = 0; e < s; e++) if (-1 === o.indexOf(e)) return (o.push(e), e) return ( console.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' ), 0 ) })() t.__bindingPointIndex = n var r = e.createBuffer(), i = t.__size, a = t.usage return ( e.bindBuffer(e.UNIFORM_BUFFER, r), e.bufferData(e.UNIFORM_BUFFER, i, a), e.bindBuffer(e.UNIFORM_BUFFER, null), e.bindBufferBase(e.UNIFORM_BUFFER, n, r), r ) })(n)), (i[n.id] = d), n.addEventListener('dispose', c)) var f = h.program r.updateUBOMapping(n, f) var p = t.render.frame a[n.id] !== p && (!(function (t) { var n = i[t.id], r = t.uniforms, a = t.__cache e.bindBuffer(e.UNIFORM_BUFFER, n) for (var o = 0, s = r.length; o < s; o++) for ( var c = Array.isArray(r[o]) ? r[o] : [r[o]], h = 0, d = c.length; h < d; h++ ) { var f = c[h] if (!0 === u(f, o, h, a)) { for ( var p = f.__offset, v = Array.isArray(f.value) ? f.value : [f.value], m = 0, g = 0; g < v.length; g++ ) { var y = v[g], _ = l(y) 'number' == typeof y || 'boolean' == typeof y ? ((f.__data[0] = y), e.bufferSubData(e.UNIFORM_BUFFER, p + m, f.__data)) : y.isMatrix3 ? ((f.__data[0] = y.elements[0]), (f.__data[1] = y.elements[1]), (f.__data[2] = y.elements[2]), (f.__data[3] = 0), (f.__data[4] = y.elements[3]), (f.__data[5] = y.elements[4]), (f.__data[6] = y.elements[5]), (f.__data[7] = 0), (f.__data[8] = y.elements[6]), (f.__data[9] = y.elements[7]), (f.__data[10] = y.elements[8]), (f.__data[11] = 0)) : (y.toArray(f.__data, m), (m += _.storage / Float32Array.BYTES_PER_ELEMENT)) } e.bufferSubData(e.UNIFORM_BUFFER, p, f.__data) } } e.bindBuffer(e.UNIFORM_BUFFER, null) })(n), (a[n.id] = p)) }, dispose: function () { for (var t in i) e.deleteBuffer(i[t]) ;((o = []), (i = {}), (a = {})) }, } } var Uy = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} A(this, e) var n, r = t.canvas, i = void 0 === r ? (function () { var e = jc('canvas') return ((e.style.display = 'block'), e) })() : r, a = t.context, o = void 0 === a ? null : a, s = t.depth, u = void 0 === s || s, l = t.stencil, c = void 0 !== l && l, h = t.alpha, f = void 0 !== h && h, p = t.antialias, m = void 0 !== p && p, g = t.premultipliedAlpha, y = void 0 === g || g, _ = t.preserveDrawingBuffer, b = void 0 !== _ && _, x = t.powerPreference, S = void 0 === x ? 'default' : x, w = t.failIfMajorPerformanceCaveat, T = void 0 !== w && w, M = t.reverseDepthBuffer, E = void 0 !== M && M if (((this.isWebGLRenderer = !0), null !== o)) { if ( 'undefined' != typeof WebGLRenderingContext && o instanceof WebGLRenderingContext ) throw new Error('THREE.WebGLRenderer: WebGL 1 is not supported since r163.') n = o.getContextAttributes().alpha } else n = f var C = new Uint32Array(4), k = new Int32Array(4), R = null, I = null, N = [], P = [] ;((this.domElement = i), (this.debug = { checkShaderErrors: !0, onShaderError: null }), (this.autoClear = !0), (this.autoClearColor = !0), (this.autoClearDepth = !0), (this.autoClearStencil = !0), (this.sortObjects = !0), (this.clippingPlanes = []), (this.localClippingEnabled = !1), (this._outputColorSpace = _c), (this.toneMapping = 0), (this.toneMappingExposure = 1)) var L = this, D = !1, O = 0, F = 0, B = null, U = -1, z = null, V = new uh(), H = new uh(), W = null, G = new Od(0), j = 0, Q = i.width, q = i.height, X = 1, Y = null, K = null, Z = new uh(0, 0, Q, q), J = new uh(0, 0, Q, q), $ = !1, ee = new gp(), te = !1, ne = !1 this.transmissionResolutionScale = 1 var re = new Gh(), ie = new Gh(), ae = new ph(), oe = new uh(), se = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0, }, ue = !1 function le() { return null === B ? X : 1 } var ce, he, de, fe, pe, ve, me, ge, ye, _e, be, xe, Se, Ae, we, Te, Me, Ee, Ce, ke, Re, Ie, Ne, Pe, Le = o function De(e, t) { return i.getContext(e, t) } try { var Oe = { alpha: !0, depth: u, stencil: c, antialias: m, premultipliedAlpha: y, preserveDrawingBuffer: b, powerPreference: S, failIfMajorPerformanceCaveat: T, } if ( ('setAttribute' in i && i.setAttribute('data-engine', 'three.js r'.concat(Wu)), i.addEventListener('webglcontextlost', ze, !1), i.addEventListener('webglcontextrestored', Ve, !1), i.addEventListener('webglcontextcreationerror', He, !1), null === Le) ) { var Fe = 'webgl2' if (null === (Le = De(Fe, Oe))) throw De(Fe) ? new Error('Error creating WebGL context with your selected attributes.') : new Error('Error creating WebGL context.') } } catch (ot) { throw (console.error('THREE.WebGLRenderer: ' + ot.message), ot) } function Be() { ;((ce = new Om(Le)).init(), (Ie = new Ny(Le, ce)), (he = new mm(Le, ce, t, Ie)), (de = new Ry(Le, ce)), he.reverseDepthBuffer && E && de.buffers.depth.setReversed(!0), (fe = new Um(Le)), (pe = new gy()), (ve = new Iy(Le, ce, de, pe, he, Ie, fe)), (me = new ym(L)), (ge = new Dm(L)), (ye = new om(Le)), (Ne = new pm(Le, ye)), (_e = new Fm(Le, ye, fe, Ne)), (be = new Vm(Le, _e, ye, fe)), (Ce = new zm(Le, he, ve)), (Te = new gm(pe)), (xe = new my(L, me, ge, ce, he, Ne, Te)), (Se = new Fy(L, pe)), (Ae = new xy()), (we = new Ey(ce)), (Ee = new fm(L, me, ge, de, be, n, y)), (Me = new Cy(L, be, he)), (Pe = new By(Le, fe, he, de)), (ke = new vm(Le, ce, fe)), (Re = new Bm(Le, ce, fe)), (fe.programs = xe.programs), (L.capabilities = he), (L.extensions = ce), (L.properties = pe), (L.renderLists = Ae), (L.shadowMap = Me), (L.state = de), (L.info = fe)) } Be() var Ue = new Ly(L, Le) function ze(e) { ;(e.preventDefault(), console.log('THREE.WebGLRenderer: Context Lost.'), (D = !0)) } function Ve() { ;(console.log('THREE.WebGLRenderer: Context Restored.'), (D = !1)) var e = fe.autoReset, t = Me.enabled, n = Me.autoUpdate, r = Me.needsUpdate, i = Me.type ;(Be(), (fe.autoReset = e), (Me.enabled = t), (Me.autoUpdate = n), (Me.needsUpdate = r), (Me.type = i)) } function He(e) { console.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', e.statusMessage ) } function We(e) { var t = e.target ;(t.removeEventListener('dispose', We), (function (e) { ;((function (e) { var t = pe.get(e).programs void 0 !== t && (t.forEach(function (e) { xe.releaseProgram(e) }), e.isShaderMaterial && xe.releaseShaderCache(e)) })(e), pe.remove(e)) })(t)) } function Ge(e, t, n) { !0 === e.transparent && 2 === e.side && !1 === e.forceSinglePass ? ((e.side = 1), (e.needsUpdate = !0), et(e, t, n), (e.side = 0), (e.needsUpdate = !0), et(e, t, n), (e.side = 2)) : et(e, t, n) } ;((this.xr = Ue), (this.getContext = function () { return Le }), (this.getContextAttributes = function () { return Le.getContextAttributes() }), (this.forceContextLoss = function () { var e = ce.get('WEBGL_lose_context') e && e.loseContext() }), (this.forceContextRestore = function () { var e = ce.get('WEBGL_lose_context') e && e.restoreContext() }), (this.getPixelRatio = function () { return X }), (this.setPixelRatio = function (e) { void 0 !== e && ((X = e), this.setSize(Q, q, !1)) }), (this.getSize = function (e) { return e.set(Q, q) }), (this.setSize = function (e, t) { var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2] Ue.isPresenting ? console.warn( "THREE.WebGLRenderer: Can't change size while VR device is presenting." ) : ((Q = e), (q = t), (i.width = Math.floor(e * X)), (i.height = Math.floor(t * X)), !0 === n && ((i.style.width = e + 'px'), (i.style.height = t + 'px')), this.setViewport(0, 0, e, t)) }), (this.getDrawingBufferSize = function (e) { return e.set(Q * X, q * X).floor() }), (this.setDrawingBufferSize = function (e, t, n) { ;((Q = e), (q = t), (X = n), (i.width = Math.floor(e * n)), (i.height = Math.floor(t * n)), this.setViewport(0, 0, e, t)) }), (this.getCurrentViewport = function (e) { return e.copy(V) }), (this.getViewport = function (e) { return e.copy(Z) }), (this.setViewport = function (e, t, n, r) { ;(e.isVector4 ? Z.set(e.x, e.y, e.z, e.w) : Z.set(e, t, n, r), de.viewport(V.copy(Z).multiplyScalar(X).round())) }), (this.getScissor = function (e) { return e.copy(J) }), (this.setScissor = function (e, t, n, r) { ;(e.isVector4 ? J.set(e.x, e.y, e.z, e.w) : J.set(e, t, n, r), de.scissor(H.copy(J).multiplyScalar(X).round())) }), (this.getScissorTest = function () { return $ }), (this.setScissorTest = function (e) { de.setScissorTest(($ = e)) }), (this.setOpaqueSort = function (e) { Y = e }), (this.setTransparentSort = function (e) { K = e }), (this.getClearColor = function (e) { return e.copy(Ee.getClearColor()) }), (this.setClearColor = function () { Ee.setClearColor.apply(Ee, arguments) }), (this.getClearAlpha = function () { return Ee.getClearAlpha() }), (this.setClearAlpha = function () { Ee.setClearAlpha.apply(Ee, arguments) }), (this.clear = function () { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], t = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], n = 0 if (!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) { var r = !1 if (null !== B) { var i = B.texture.format r = i === Il || i === Rl || i === Cl } if (r) { var a = B.texture.type, o = a === dl || a === gl || a === vl || a === Sl || a === bl || a === xl, s = Ee.getClearColor(), u = Ee.getClearAlpha(), l = s.r, c = s.g, h = s.b o ? ((C[0] = l), (C[1] = c), (C[2] = h), (C[3] = u), Le.clearBufferuiv(Le.COLOR, 0, C)) : ((k[0] = l), (k[1] = c), (k[2] = h), (k[3] = u), Le.clearBufferiv(Le.COLOR, 0, k)) } else n |= Le.COLOR_BUFFER_BIT } ;(e && (n |= Le.DEPTH_BUFFER_BIT), t && ((n |= Le.STENCIL_BUFFER_BIT), this.state.buffers.stencil.setMask(4294967295)), Le.clear(n)) }), (this.clearColor = function () { this.clear(!0, !1, !1) }), (this.clearDepth = function () { this.clear(!1, !0, !1) }), (this.clearStencil = function () { this.clear(!1, !1, !0) }), (this.dispose = function () { ;(i.removeEventListener('webglcontextlost', ze, !1), i.removeEventListener('webglcontextrestored', Ve, !1), i.removeEventListener('webglcontextcreationerror', He, !1), Ee.dispose(), Ae.dispose(), we.dispose(), pe.dispose(), me.dispose(), ge.dispose(), be.dispose(), Ne.dispose(), Pe.dispose(), xe.dispose(), Ue.dispose(), Ue.removeEventListener('sessionstart', Qe), Ue.removeEventListener('sessionend', qe), Xe.stop()) }), (this.renderBufferDirect = function (e, t, n, r, i, a) { null === t && (t = se) var o = i.isMesh && i.matrixWorld.determinant() < 0, s = (function (e, t, n, r, i) { !0 !== t.isScene && (t = se) ve.resetTextureUnits() var a = t.fog, o = r.isMeshStandardMaterial ? t.environment : null, s = null === B ? L.outputColorSpace : !0 === B.isXRRenderTarget ? B.texture.colorSpace : bc, u = (r.isMeshStandardMaterial ? ge : me).get(r.envMap || o), l = !0 === r.vertexColors && !!n.attributes.color && 4 === n.attributes.color.itemSize, c = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), h = !!n.morphAttributes.position, d = !!n.morphAttributes.normal, f = !!n.morphAttributes.color, p = 0 r.toneMapped && ((null !== B && !0 !== B.isXRRenderTarget) || (p = L.toneMapping)) var v = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, m = void 0 !== v ? v.length : 0, g = pe.get(r), y = I.state.lights if (!0 === te && (!0 === ne || e !== z)) { var _ = e === z && r.id === U Te.setState(r, e, _) } var b = !1 r.version === g.__version ? (g.needsLights && g.lightsStateVersion !== y.state.version) || g.outputColorSpace !== s || (i.isBatchedMesh && !1 === g.batching) ? (b = !0) : i.isBatchedMesh || !0 !== g.batching ? (i.isBatchedMesh && !0 === g.batchingColor && null === i.colorTexture) || (i.isBatchedMesh && !1 === g.batchingColor && null !== i.colorTexture) || (i.isInstancedMesh && !1 === g.instancing) ? (b = !0) : i.isInstancedMesh || !0 !== g.instancing ? i.isSkinnedMesh && !1 === g.skinning ? (b = !0) : i.isSkinnedMesh || !0 !== g.skinning ? (i.isInstancedMesh && !0 === g.instancingColor && null === i.instanceColor) || (i.isInstancedMesh && !1 === g.instancingColor && null !== i.instanceColor) || (i.isInstancedMesh && !0 === g.instancingMorph && null === i.morphTexture) || (i.isInstancedMesh && !1 === g.instancingMorph && null !== i.morphTexture) || g.envMap !== u || (!0 === r.fog && g.fog !== a) ? (b = !0) : void 0 === g.numClippingPlanes || (g.numClippingPlanes === Te.numPlanes && g.numIntersection === Te.numIntersection) ? (g.vertexAlphas !== l || g.vertexTangents !== c || g.morphTargets !== h || g.morphNormals !== d || g.morphColors !== f || g.toneMapping !== p || g.morphTargetsCount !== m) && (b = !0) : (b = !0) : (b = !0) : (b = !0) : (b = !0) : ((b = !0), (g.__version = r.version)) var x = g.currentProgram !0 === b && (x = et(r, t, i)) var S = !1, A = !1, w = !1, T = x.getUniforms(), M = g.uniforms de.useProgram(x.program) && ((S = !0), (A = !0), (w = !0)) r.id !== U && ((U = r.id), (A = !0)) if (S || z !== e) { ;(de.buffers.depth.getReversed() ? (re.copy(e.projectionMatrix), (function (e) { var t = e.elements ;((t[2] = 0.5 * t[2] + 0.5 * t[3]), (t[6] = 0.5 * t[6] + 0.5 * t[7]), (t[10] = 0.5 * t[10] + 0.5 * t[11]), (t[14] = 0.5 * t[14] + 0.5 * t[15])) })(re), (function (e) { var t = e.elements ;-1 === t[11] ? ((t[10] = -t[10] - 1), (t[14] = -t[14])) : ((t[10] = -t[10]), (t[14] = 1 - t[14])) })(re), T.setValue(Le, 'projectionMatrix', re)) : T.setValue(Le, 'projectionMatrix', e.projectionMatrix), T.setValue(Le, 'viewMatrix', e.matrixWorldInverse)) var E = T.map.cameraPosition ;(void 0 !== E && E.setValue(Le, ae.setFromMatrixPosition(e.matrixWorld)), he.logarithmicDepthBuffer && T.setValue( Le, 'logDepthBufFC', 2 / (Math.log(e.far + 1) / Math.LN2) ), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && T.setValue(Le, 'isOrthographic', !0 === e.isOrthographicCamera), z !== e && ((z = e), (A = !0), (w = !0))) } if (i.isSkinnedMesh) { ;(T.setOptional(Le, i, 'bindMatrix'), T.setOptional(Le, i, 'bindMatrixInverse')) var C = i.skeleton C && (null === C.boneTexture && C.computeBoneTexture(), T.setValue(Le, 'boneTexture', C.boneTexture, ve)) } i.isBatchedMesh && (T.setOptional(Le, i, 'batchingTexture'), T.setValue(Le, 'batchingTexture', i._matricesTexture, ve), T.setOptional(Le, i, 'batchingIdTexture'), T.setValue(Le, 'batchingIdTexture', i._indirectTexture, ve), T.setOptional(Le, i, 'batchingColorTexture'), null !== i._colorsTexture && T.setValue(Le, 'batchingColorTexture', i._colorsTexture, ve)) var k = n.morphAttributes ;(void 0 === k.position && void 0 === k.normal && void 0 === k.color) || Ce.update(i, n, x) ;(A || g.receiveShadow !== i.receiveShadow) && ((g.receiveShadow = i.receiveShadow), T.setValue(Le, 'receiveShadow', i.receiveShadow)) r.isMeshGouraudMaterial && null !== r.envMap && ((M.envMap.value = u), (M.flipEnvMap.value = u.isCubeTexture && !1 === u.isRenderTargetTexture ? -1 : 1)) r.isMeshStandardMaterial && null === r.envMap && null !== t.environment && (M.envMapIntensity.value = t.environmentIntensity) A && (T.setValue(Le, 'toneMappingExposure', L.toneMappingExposure), g.needsLights && (function (e, t) { ;((e.ambientLightColor.needsUpdate = t), (e.lightProbe.needsUpdate = t), (e.directionalLights.needsUpdate = t), (e.directionalLightShadows.needsUpdate = t), (e.pointLights.needsUpdate = t), (e.pointLightShadows.needsUpdate = t), (e.spotLights.needsUpdate = t), (e.spotLightShadows.needsUpdate = t), (e.rectAreaLights.needsUpdate = t), (e.hemisphereLights.needsUpdate = t)) })(M, w), a && !0 === r.fog && Se.refreshFogUniforms(M, a), Se.refreshMaterialUniforms( M, r, X, q, I.state.transmissionRenderTarget[e.id] ), Qg.upload(Le, tt(g), M, ve)) r.isShaderMaterial && !0 === r.uniformsNeedUpdate && (Qg.upload(Le, tt(g), M, ve), (r.uniformsNeedUpdate = !1)) r.isSpriteMaterial && T.setValue(Le, 'center', i.center) if ( (T.setValue(Le, 'modelViewMatrix', i.modelViewMatrix), T.setValue(Le, 'normalMatrix', i.normalMatrix), T.setValue(Le, 'modelMatrix', i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) ) for (var R = r.uniformsGroups, N = 0, P = R.length; N < P; N++) { var D = R[N] ;(Pe.update(D, x), Pe.bind(D, x)) } return x })(e, t, n, r, i) de.setMaterial(r, o) var u = n.index, l = 1 if (!0 === r.wireframe) { if (void 0 === (u = _e.getWireframeAttribute(n))) return l = 2 } var c = n.drawRange, h = n.attributes.position, d = c.start * l, f = (c.start + c.count) * l ;(null !== a && ((d = Math.max(d, a.start * l)), (f = Math.min(f, (a.start + a.count) * l))), null !== u ? ((d = Math.max(d, 0)), (f = Math.min(f, u.count))) : null != h && ((d = Math.max(d, 0)), (f = Math.min(f, h.count)))) var p = f - d if (!(p < 0 || p === 1 / 0)) { var v Ne.setup(i, r, s, n, u) var m = ke if ((null !== u && ((v = ye.get(u)), (m = Re).setIndex(v)), i.isMesh)) !0 === r.wireframe ? (de.setLineWidth(r.wireframeLinewidth * le()), m.setMode(Le.LINES)) : m.setMode(Le.TRIANGLES) else if (i.isLine) { var g = r.linewidth ;(void 0 === g && (g = 1), de.setLineWidth(g * le()), i.isLineSegments ? m.setMode(Le.LINES) : i.isLineLoop ? m.setMode(Le.LINE_LOOP) : m.setMode(Le.LINE_STRIP)) } else i.isPoints ? m.setMode(Le.POINTS) : i.isSprite && m.setMode(Le.TRIANGLES) if (i.isBatchedMesh) if (null !== i._multiDrawInstances) m.renderMultiDrawInstances( i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount, i._multiDrawInstances ) else if (ce.get('WEBGL_multi_draw')) m.renderMultiDraw( i._multiDrawStarts, i._multiDrawCounts, i._multiDrawCount ) else for ( var y = i._multiDrawStarts, _ = i._multiDrawCounts, b = i._multiDrawCount, x = u ? ye.get(u).bytesPerElement : 1, S = pe.get(r).currentProgram.getUniforms(), A = 0; A < b; A++ ) (S.setValue(Le, '_gl_DrawID', A), m.render(y[A] / x, _[A])) else if (i.isInstancedMesh) m.renderInstances(d, p, i.count) else if (n.isInstancedBufferGeometry) { var w = void 0 !== n._maxInstanceCount ? n._maxInstanceCount : 1 / 0, T = Math.min(n.instanceCount, w) m.renderInstances(d, p, T) } else m.render(d, p) } }), (this.compile = function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null ;(null === n && (n = e), (I = we.get(n)).init(t), P.push(I), n.traverseVisible(function (e) { e.isLight && e.layers.test(t.layers) && (I.pushLight(e), e.castShadow && I.pushShadow(e)) }), e !== n && e.traverseVisible(function (e) { e.isLight && e.layers.test(t.layers) && (I.pushLight(e), e.castShadow && I.pushShadow(e)) }), I.setupLights()) var r = new Set() return ( e.traverse(function (e) { if (e.isMesh || e.isPoints || e.isLine || e.isSprite) { var t = e.material if (t) if (Array.isArray(t)) for (var i = 0; i < t.length; i++) { var a = t[i] ;(Ge(a, n, e), r.add(a)) } else (Ge(t, n, e), r.add(t)) } }), P.pop(), (I = null), r ) }), (this.compileAsync = function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r = this.compile(e, t, n) return new Promise(function (t) { function n() { ;(r.forEach(function (e) { pe.get(e).currentProgram.isReady() && r.delete(e) }), 0 !== r.size ? setTimeout(n, 10) : t(e)) } null !== ce.get('KHR_parallel_shader_compile') ? n() : setTimeout(n, 10) }) })) var je = null function Qe() { Xe.stop() } function qe() { Xe.start() } var Xe = new am() function Ye(e, t, n, r) { if (!1 !== e.visible) { if (e.layers.test(t.layers)) if (e.isGroup) n = e.renderOrder else if (e.isLOD) !0 === e.autoUpdate && e.update(t) else if (e.isLight) (I.pushLight(e), e.castShadow && I.pushShadow(e)) else if (e.isSprite) { if (!e.frustumCulled || ee.intersectsSprite(e)) { r && oe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ie) var i = be.update(e), a = e.material a.visible && R.push(e, i, a, n, oe.z, null) } } else if ( (e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ee.intersectsObject(e)) ) { var o = be.update(e), s = e.material if ( (r && (void 0 !== e.boundingSphere ? (null === e.boundingSphere && e.computeBoundingSphere(), oe.copy(e.boundingSphere.center)) : (null === o.boundingSphere && o.computeBoundingSphere(), oe.copy(o.boundingSphere.center)), oe.applyMatrix4(e.matrixWorld).applyMatrix4(ie)), Array.isArray(s)) ) for (var u = o.groups, l = 0, c = u.length; l < c; l++) { var h = u[l], d = s[h.materialIndex] d && d.visible && R.push(e, o, d, n, oe.z, h) } else s.visible && R.push(e, o, s, n, oe.z, null) } for (var f = e.children, p = 0, v = f.length; p < v; p++) Ye(f[p], t, n, r) } } function Ke(e, t, n, r) { var i = e.opaque, a = e.transmissive, o = e.transparent ;(I.setupLightsView(n), !0 === te && Te.setGlobalState(L.clippingPlanes, n), r && de.viewport(V.copy(r)), i.length > 0 && Je(i, t, n), a.length > 0 && Je(a, t, n), o.length > 0 && Je(o, t, n), de.buffers.depth.setTest(!0), de.buffers.depth.setMask(!0), de.buffers.color.setMask(!0), de.setPolygonOffset(!1)) } function Ze(e, t, n, r) { if (null === (!0 === n.isScene ? n.overrideMaterial : null)) { void 0 === I.state.transmissionRenderTarget[r.id] && (I.state.transmissionRenderTarget[r.id] = new ch(1, 1, { generateMipmaps: !0, type: ce.has('EXT_color_buffer_half_float') || ce.has('EXT_color_buffer_float') ? _l : dl, minFilter: hl, samples: 4, stencilBuffer: c, resolveDepthBuffer: !1, resolveStencilBuffer: !1, colorSpace: $c.workingColorSpace, })) var i = I.state.transmissionRenderTarget[r.id], a = r.viewport || V i.setSize( a.z * L.transmissionResolutionScale, a.w * L.transmissionResolutionScale ) var o = L.getRenderTarget() ;(L.setRenderTarget(i), L.getClearColor(G), (j = L.getClearAlpha()) < 1 && L.setClearColor(16777215, 0.5), L.clear(), ue && Ee.render(n)) var s = L.toneMapping L.toneMapping = 0 var u = r.viewport if ( (void 0 !== r.viewport && (r.viewport = void 0), I.setupLightsView(r), !0 === te && Te.setGlobalState(L.clippingPlanes, r), Je(e, n, r), ve.updateMultisampleRenderTarget(i), ve.updateRenderTargetMipmap(i), !1 === ce.has('WEBGL_multisampled_render_to_texture')) ) { for (var l = !1, h = 0, d = t.length; h < d; h++) { var f = t[h], p = f.object, v = f.geometry, m = f.material, g = f.group if (2 === m.side && p.layers.test(r.layers)) { var y = m.side ;((m.side = 1), (m.needsUpdate = !0), $e(p, n, r, v, m, g), (m.side = y), (m.needsUpdate = !0), (l = !0)) } } !0 === l && (ve.updateMultisampleRenderTarget(i), ve.updateRenderTargetMipmap(i)) } ;(L.setRenderTarget(o), L.setClearColor(G, j), void 0 !== u && (r.viewport = u), (L.toneMapping = s)) } } function Je(e, t, n) { for ( var r = !0 === t.isScene ? t.overrideMaterial : null, i = 0, a = e.length; i < a; i++ ) { var o = e[i], s = o.object, u = o.geometry, l = null === r ? o.material : r, c = o.group s.layers.test(n.layers) && $e(s, t, n, u, l, c) } } function $e(e, t, n, r, i, a) { ;(e.onBeforeRender(L, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(L, t, n, r, e, a), !0 === i.transparent && 2 === i.side && !1 === i.forceSinglePass ? ((i.side = 1), (i.needsUpdate = !0), L.renderBufferDirect(n, t, r, i, e, a), (i.side = 0), (i.needsUpdate = !0), L.renderBufferDirect(n, t, r, i, e, a), (i.side = 2)) : L.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(L, t, n, r, i, a)) } function et(e, t, n) { !0 !== t.isScene && (t = se) var r = pe.get(e), i = I.state.lights, a = I.state.shadowsArray, o = i.state.version, s = xe.getParameters(e, i.state, a, t, n), u = xe.getProgramCacheKey(s), l = r.programs ;((r.environment = e.isMeshStandardMaterial ? t.environment : null), (r.fog = t.fog), (r.envMap = (e.isMeshStandardMaterial ? ge : me).get( e.envMap || r.environment )), (r.envMapRotation = null !== r.environment && null === e.envMap ? t.environmentRotation : e.envMapRotation), void 0 === l && (e.addEventListener('dispose', We), (l = new Map()), (r.programs = l))) var c = l.get(u) if (void 0 !== c) { if (r.currentProgram === c && r.lightsStateVersion === o) return (nt(e, s), c) } else ((s.uniforms = xe.getUniforms(e)), e.onBeforeCompile(s, L), (c = xe.acquireProgram(s, u)), l.set(u, c), (r.uniforms = s.uniforms)) var h = r.uniforms return ( ((e.isShaderMaterial || e.isRawShaderMaterial) && !0 !== e.clipping) || (h.clippingPlanes = Te.uniform), nt(e, s), (r.needsLights = (function (e) { return ( e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || (e.isShaderMaterial && !0 === e.lights) ) })(e)), (r.lightsStateVersion = o), r.needsLights && ((h.ambientLightColor.value = i.state.ambient), (h.lightProbe.value = i.state.probe), (h.directionalLights.value = i.state.directional), (h.directionalLightShadows.value = i.state.directionalShadow), (h.spotLights.value = i.state.spot), (h.spotLightShadows.value = i.state.spotShadow), (h.rectAreaLights.value = i.state.rectArea), (h.ltc_1.value = i.state.rectAreaLTC1), (h.ltc_2.value = i.state.rectAreaLTC2), (h.pointLights.value = i.state.point), (h.pointLightShadows.value = i.state.pointShadow), (h.hemisphereLights.value = i.state.hemi), (h.directionalShadowMap.value = i.state.directionalShadowMap), (h.directionalShadowMatrix.value = i.state.directionalShadowMatrix), (h.spotShadowMap.value = i.state.spotShadowMap), (h.spotLightMatrix.value = i.state.spotLightMatrix), (h.spotLightMap.value = i.state.spotLightMap), (h.pointShadowMap.value = i.state.pointShadowMap), (h.pointShadowMatrix.value = i.state.pointShadowMatrix)), (r.currentProgram = c), (r.uniformsList = null), c ) } function tt(e) { if (null === e.uniformsList) { var t = e.currentProgram.getUniforms() e.uniformsList = Qg.seqWithValue(t.seq, e.uniforms) } return e.uniformsList } function nt(e, t) { var n = pe.get(e) ;((n.outputColorSpace = t.outputColorSpace), (n.batching = t.batching), (n.batchingColor = t.batchingColor), (n.instancing = t.instancing), (n.instancingColor = t.instancingColor), (n.instancingMorph = t.instancingMorph), (n.skinning = t.skinning), (n.morphTargets = t.morphTargets), (n.morphNormals = t.morphNormals), (n.morphColors = t.morphColors), (n.morphTargetsCount = t.morphTargetsCount), (n.numClippingPlanes = t.numClippingPlanes), (n.numIntersection = t.numClipIntersection), (n.vertexAlphas = t.vertexAlphas), (n.vertexTangents = t.vertexTangents), (n.toneMapping = t.toneMapping)) } ;(Xe.setAnimationLoop(function (e) { je && je(e) }), 'undefined' != typeof self && Xe.setContext(self), (this.setAnimationLoop = function (e) { ;((je = e), Ue.setAnimationLoop(e), null === e ? Xe.stop() : Xe.start()) }), Ue.addEventListener('sessionstart', Qe), Ue.addEventListener('sessionend', qe), (this.render = function (e, t) { if (void 0 === t || !0 === t.isCamera) { if (!0 !== D) { if ( (!0 === e.matrixWorldAutoUpdate && e.updateMatrixWorld(), null === t.parent && !0 === t.matrixWorldAutoUpdate && t.updateMatrixWorld(), !0 === Ue.enabled && !0 === Ue.isPresenting && (!0 === Ue.cameraAutoUpdate && Ue.updateCamera(t), (t = Ue.getCamera())), !0 === e.isScene && e.onBeforeRender(L, e, t, B), (I = we.get(e, P.length)).init(t), P.push(I), ie.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ee.setFromProjectionMatrix(ie), (ne = this.localClippingEnabled), (te = Te.init(this.clippingPlanes, ne)), (R = Ae.get(e, N.length)).init(), N.push(R), !0 === Ue.enabled && !0 === Ue.isPresenting) ) { var n = L.xr.getDepthSensingMesh() null !== n && Ye(n, t, -1 / 0, L.sortObjects) } ;(Ye(e, t, 0, L.sortObjects), R.finish(), !0 === L.sortObjects && R.sort(Y, K), (ue = !1 === Ue.enabled || !1 === Ue.isPresenting || !1 === Ue.hasDepthSensing()) && Ee.addToRenderList(R, e), this.info.render.frame++, !0 === te && Te.beginShadows()) var r = I.state.shadowsArray ;(Me.render(r, e, t), !0 === te && Te.endShadows(), !0 === this.info.autoReset && this.info.reset()) var i = R.opaque, a = R.transmissive if ((I.setupLights(), t.isArrayCamera)) { var o = t.cameras if (a.length > 0) for (var s = 0, u = o.length; s < u; s++) { Ze(i, a, e, o[s]) } ue && Ee.render(e) for (var l = 0, c = o.length; l < c; l++) { var h = o[l] Ke(R, e, h, h.viewport) } } else (a.length > 0 && Ze(i, a, e, t), ue && Ee.render(e), Ke(R, e, t)) ;(null !== B && 0 === F && (ve.updateMultisampleRenderTarget(B), ve.updateRenderTargetMipmap(B)), !0 === e.isScene && e.onAfterRender(L, e, t), Ne.resetDefaultState(), (U = -1), (z = null), P.pop(), P.length > 0 ? ((I = P[P.length - 1]), !0 === te && Te.setGlobalState(L.clippingPlanes, I.state.camera)) : (I = null), N.pop(), (R = N.length > 0 ? N[N.length - 1] : null)) } } else console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ) }), (this.getActiveCubeFace = function () { return O }), (this.getActiveMipmapLevel = function () { return F }), (this.getRenderTarget = function () { return B }), (this.setRenderTargetTextures = function (e, t, n) { ;((pe.get(e.texture).__webglTexture = t), (pe.get(e.depthTexture).__webglTexture = n)) var r = pe.get(e) ;((r.__hasExternalTextures = !0), (r.__autoAllocateDepthBuffer = void 0 === n), r.__autoAllocateDepthBuffer || (!0 === ce.has('WEBGL_multisampled_render_to_texture') && (console.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' ), (r.__useRenderToTexture = !1)))) }), (this.setRenderTargetFramebuffer = function (e, t) { var n = pe.get(e) ;((n.__webglFramebuffer = t), (n.__useDefaultFramebuffer = void 0 === t)) })) var rt = Le.createFramebuffer() ;((this.setRenderTarget = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 ;((B = e), (O = t), (F = n)) var r = !0, i = null, a = !1, o = !1 if (e) { var s = pe.get(e) if (void 0 !== s.__useDefaultFramebuffer) (de.bindFramebuffer(Le.FRAMEBUFFER, null), (r = !1)) else if (void 0 === s.__webglFramebuffer) ve.setupRenderTarget(e) else if (s.__hasExternalTextures) ve.rebindTextures( e, pe.get(e.texture).__webglTexture, pe.get(e.depthTexture).__webglTexture ) else if (e.depthBuffer) { var u = e.depthTexture if (s.__boundDepthTexture !== u) { if ( null !== u && pe.has(u) && (e.width !== u.image.width || e.height !== u.image.height) ) throw new Error( 'WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.' ) ve.setupDepthRenderbuffer(e) } } var l = e.texture ;(l.isData3DTexture || l.isDataArrayTexture || l.isCompressedArrayTexture) && (o = !0) var c = pe.get(e).__webglFramebuffer ;(e.isWebGLCubeRenderTarget ? ((i = Array.isArray(c[t]) ? c[t][n] : c[t]), (a = !0)) : (i = e.samples > 0 && !1 === ve.useMultisampledRTT(e) ? pe.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c), V.copy(e.viewport), H.copy(e.scissor), (W = e.scissorTest)) } else (V.copy(Z).multiplyScalar(X).floor(), H.copy(J).multiplyScalar(X).floor(), (W = $)) if ( (0 !== n && (i = rt), de.bindFramebuffer(Le.FRAMEBUFFER, i) && r && de.drawBuffers(e, i), de.viewport(V), de.scissor(H), de.setScissorTest(W), a) ) { var h = pe.get(e.texture) Le.framebufferTexture2D( Le.FRAMEBUFFER, Le.COLOR_ATTACHMENT0, Le.TEXTURE_CUBE_MAP_POSITIVE_X + t, h.__webglTexture, n ) } else if (o) { var d = pe.get(e.texture), f = t Le.framebufferTextureLayer( Le.FRAMEBUFFER, Le.COLOR_ATTACHMENT0, d.__webglTexture, n, f ) } else if (null !== e && 0 !== n) { var p = pe.get(e.texture) Le.framebufferTexture2D( Le.FRAMEBUFFER, Le.COLOR_ATTACHMENT0, Le.TEXTURE_2D, p.__webglTexture, n ) } U = -1 }), (this.readRenderTargetPixels = function (e, t, n, r, i, a, o) { if (e && e.isWebGLRenderTarget) { var s = pe.get(e).__webglFramebuffer if ((e.isWebGLCubeRenderTarget && void 0 !== o && (s = s[o]), s)) { de.bindFramebuffer(Le.FRAMEBUFFER, s) try { var u = e.texture, l = u.format, c = u.type if (!he.textureFormatReadable(l)) return void console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ) if (!he.textureTypeReadable(c)) return void console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ) t >= 0 && t <= e.width - r && n >= 0 && n <= e.height - i && Le.readPixels(t, n, r, i, Ie.convert(l), Ie.convert(c), a) } finally { var h = null !== B ? pe.get(B).__webglFramebuffer : null de.bindFramebuffer(Le.FRAMEBUFFER, h) } } } else console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ) }), (this.readRenderTargetPixelsAsync = (function () { var e = v( d().m(function e(t, n, r, i, a, o, s) { var u, l, c, h, f, p, v return d().w(function (e) { for (;;) switch (e.n) { case 0: if (t && t.isWebGLRenderTarget) { e.n = 1 break } throw new Error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ) case 1: if ( ((u = pe.get(t).__webglFramebuffer), t.isWebGLCubeRenderTarget && void 0 !== s && (u = u[s]), !u) ) { e.n = 6 break } if ( ((l = t.texture), (c = l.format), (h = l.type), he.textureFormatReadable(c)) ) { e.n = 2 break } throw new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.' ) case 2: if (he.textureTypeReadable(h)) { e.n = 3 break } throw new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.' ) case 3: if ( !(n >= 0 && n <= t.width - i && r >= 0 && r <= t.height - a) ) { e.n = 5 break } return ( de.bindFramebuffer(Le.FRAMEBUFFER, u), (f = Le.createBuffer()), Le.bindBuffer(Le.PIXEL_PACK_BUFFER, f), Le.bufferData( Le.PIXEL_PACK_BUFFER, o.byteLength, Le.STREAM_READ ), Le.readPixels(n, r, i, a, Ie.convert(c), Ie.convert(h), 0), (p = null !== B ? pe.get(B).__webglFramebuffer : null), de.bindFramebuffer(Le.FRAMEBUFFER, p), (v = Le.fenceSync(Le.SYNC_GPU_COMMANDS_COMPLETE, 0)), Le.flush(), (e.n = 4), Xc(Le, v, 4) ) case 4: return ( Le.bindBuffer(Le.PIXEL_PACK_BUFFER, f), Le.getBufferSubData(Le.PIXEL_PACK_BUFFER, 0, o), Le.deleteBuffer(f), Le.deleteSync(v), e.a(2, o) ) case 5: throw new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.' ) case 6: return e.a(2) } }, e) }) ) return function (t, n, r, i, a, o, s) { return e.apply(this, arguments) } })()), (this.copyFramebufferToTexture = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 !0 !== e.isTexture && (qc( 'WebGLRenderer: copyFramebufferToTexture function signature has changed.' ), (t = arguments[0] || null), (e = arguments[1])) var r = Math.pow(2, -n), i = Math.floor(e.image.width * r), a = Math.floor(e.image.height * r), o = null !== t ? t.x : 0, s = null !== t ? t.y : 0 ;(ve.setTexture2D(e, 0), Le.copyTexSubImage2D(Le.TEXTURE_2D, n, 0, 0, o, s, i, a), de.unbindTexture()) })) var it = Le.createFramebuffer(), at = Le.createFramebuffer() ;((this.copyTextureToTexture = function (e, t) { var n, r, i, a, o, s, u, l, c, h = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, d = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, f = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, p = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : null ;(!0 !== e.isTexture && (qc('WebGLRenderer: copyTextureToTexture function signature has changed.'), (d = arguments[0] || null), (e = arguments[1]), (t = arguments[2]), (p = arguments[3] || 0), (h = null)), null === p && (0 !== f ? (qc( 'WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.' ), (p = f), (f = 0)) : (p = 0))) var v = e.isCompressedTexture ? e.mipmaps[p] : e.image if (null !== h) ((n = h.max.x - h.min.x), (r = h.max.y - h.min.y), (i = h.isBox3 ? h.max.z - h.min.z : 1), (a = h.min.x), (o = h.min.y), (s = h.isBox3 ? h.min.z : 0)) else { var m = Math.pow(2, -f) ;((n = Math.floor(v.width * m)), (r = Math.floor(v.height * m)), (i = e.isDataArrayTexture ? v.depth : e.isData3DTexture ? Math.floor(v.depth * m) : 1), (a = 0), (o = 0), (s = 0)) } null !== d ? ((u = d.x), (l = d.y), (c = d.z)) : ((u = 0), (l = 0), (c = 0)) var g, y = Ie.convert(t.format), _ = Ie.convert(t.type) ;(t.isData3DTexture ? (ve.setTexture3D(t, 0), (g = Le.TEXTURE_3D)) : t.isDataArrayTexture || t.isCompressedArrayTexture ? (ve.setTexture2DArray(t, 0), (g = Le.TEXTURE_2D_ARRAY)) : (ve.setTexture2D(t, 0), (g = Le.TEXTURE_2D)), Le.pixelStorei(Le.UNPACK_FLIP_Y_WEBGL, t.flipY), Le.pixelStorei(Le.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), Le.pixelStorei(Le.UNPACK_ALIGNMENT, t.unpackAlignment)) var b = Le.getParameter(Le.UNPACK_ROW_LENGTH), x = Le.getParameter(Le.UNPACK_IMAGE_HEIGHT), S = Le.getParameter(Le.UNPACK_SKIP_PIXELS), A = Le.getParameter(Le.UNPACK_SKIP_ROWS), w = Le.getParameter(Le.UNPACK_SKIP_IMAGES) ;(Le.pixelStorei(Le.UNPACK_ROW_LENGTH, v.width), Le.pixelStorei(Le.UNPACK_IMAGE_HEIGHT, v.height), Le.pixelStorei(Le.UNPACK_SKIP_PIXELS, a), Le.pixelStorei(Le.UNPACK_SKIP_ROWS, o), Le.pixelStorei(Le.UNPACK_SKIP_IMAGES, s)) var T = e.isDataArrayTexture || e.isData3DTexture, M = t.isDataArrayTexture || t.isData3DTexture if (e.isDepthTexture) { var E = pe.get(e), C = pe.get(t), k = pe.get(E.__renderTarget), R = pe.get(C.__renderTarget) ;(de.bindFramebuffer(Le.READ_FRAMEBUFFER, k.__webglFramebuffer), de.bindFramebuffer(Le.DRAW_FRAMEBUFFER, R.__webglFramebuffer)) for (var I = 0; I < i; I++) (T && (Le.framebufferTextureLayer( Le.READ_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, pe.get(e).__webglTexture, f, s + I ), Le.framebufferTextureLayer( Le.DRAW_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, pe.get(t).__webglTexture, p, c + I )), Le.blitFramebuffer( a, o, n, r, u, l, n, r, Le.DEPTH_BUFFER_BIT, Le.NEAREST )) ;(de.bindFramebuffer(Le.READ_FRAMEBUFFER, null), de.bindFramebuffer(Le.DRAW_FRAMEBUFFER, null)) } else if (0 !== f || e.isRenderTargetTexture || pe.has(e)) { var N = pe.get(e), P = pe.get(t) ;(de.bindFramebuffer(Le.READ_FRAMEBUFFER, it), de.bindFramebuffer(Le.DRAW_FRAMEBUFFER, at)) for (var L = 0; L < i; L++) (T ? Le.framebufferTextureLayer( Le.READ_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, N.__webglTexture, f, s + L ) : Le.framebufferTexture2D( Le.READ_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, Le.TEXTURE_2D, N.__webglTexture, f ), M ? Le.framebufferTextureLayer( Le.DRAW_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, P.__webglTexture, p, c + L ) : Le.framebufferTexture2D( Le.DRAW_FRAMEBUFFER, Le.COLOR_ATTACHMENT0, Le.TEXTURE_2D, P.__webglTexture, p ), 0 !== f ? Le.blitFramebuffer( a, o, n, r, u, l, n, r, Le.COLOR_BUFFER_BIT, Le.NEAREST ) : M ? Le.copyTexSubImage3D(g, p, u, l, c + L, a, o, n, r) : Le.copyTexSubImage2D(g, p, u, l, a, o, n, r)) ;(de.bindFramebuffer(Le.READ_FRAMEBUFFER, null), de.bindFramebuffer(Le.DRAW_FRAMEBUFFER, null)) } else M ? e.isDataTexture || e.isData3DTexture ? Le.texSubImage3D(g, p, u, l, c, n, r, i, y, _, v.data) : t.isCompressedArrayTexture ? Le.compressedTexSubImage3D(g, p, u, l, c, n, r, i, y, v.data) : Le.texSubImage3D(g, p, u, l, c, n, r, i, y, _, v) : e.isDataTexture ? Le.texSubImage2D(Le.TEXTURE_2D, p, u, l, n, r, y, _, v.data) : e.isCompressedTexture ? Le.compressedTexSubImage2D( Le.TEXTURE_2D, p, u, l, v.width, v.height, y, v.data ) : Le.texSubImage2D(Le.TEXTURE_2D, p, u, l, n, r, y, _, v) ;(Le.pixelStorei(Le.UNPACK_ROW_LENGTH, b), Le.pixelStorei(Le.UNPACK_IMAGE_HEIGHT, x), Le.pixelStorei(Le.UNPACK_SKIP_PIXELS, S), Le.pixelStorei(Le.UNPACK_SKIP_ROWS, A), Le.pixelStorei(Le.UNPACK_SKIP_IMAGES, w), 0 === p && t.generateMipmaps && Le.generateMipmap(g), de.unbindTexture()) }), (this.copyTextureToTexture3D = function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0 return ( !0 !== e.isTexture && (qc( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' ), (n = arguments[0] || null), (r = arguments[1] || null), (e = arguments[2]), (t = arguments[3]), (i = arguments[4] || 0)), qc( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' ), this.copyTextureToTexture(e, t, n, r, i) ) }), (this.initRenderTarget = function (e) { void 0 === pe.get(e).__webglFramebuffer && ve.setupRenderTarget(e) }), (this.initTexture = function (e) { ;(e.isCubeTexture ? ve.setTextureCube(e, 0) : e.isData3DTexture ? ve.setTexture3D(e, 0) : e.isDataArrayTexture || e.isCompressedArrayTexture ? ve.setTexture2DArray(e, 0) : ve.setTexture2D(e, 0), de.unbindTexture()) }), (this.resetState = function () { ;((O = 0), (F = 0), (B = null), de.reset(), Ne.reset()) }), 'undefined' != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent('observe', { detail: this }) )) }, [ { key: 'coordinateSystem', get: function () { return Ec }, }, { key: 'outputColorSpace', get: function () { return this._outputColorSpace }, set: function (e) { this._outputColorSpace = e var t = this.getContext() ;((t.drawingBufferColorspace = $c._getDrawingBufferColorSpace(e)), (t.unpackColorSpace = $c._getUnpackColorSpace())) }, }, ] ) })(), zy = T(function e() { A(this, e) }) ;(M(zy, 'DefaultSplatSortDistanceMapPrecision', 16), M(zy, 'MemoryPageSize', 65536), M(zy, 'BytesPerFloat', 4), M(zy, 'BytesPerInt', 4), M(zy, 'MaxScenes', 32), M(zy, 'ProgressiveLoadSectionSize', 262144), M(zy, 'ProgressiveLoadSectionDelayDuration', 15), M(zy, 'SphericalHarmonics8BitCompressionRange', 3)) var Vy, Hy, Wy, Gy, jy, Qy, qy, Xy, Yy, Ky, Zy, Jy, $y, e_, t_, n_, r_, i_, a_, o_, s_, u_, l_, c_, h_, d_, f_, p_, v_, m_, g_, y_, __, b_ = zy.SphericalHarmonics8BitCompressionRange / 2, x_ = Wd.toHalfFloat.bind(Wd), S_ = Wd.fromHalfFloat.bind(Wd), A_ = function (e, t) { var n = arguments.length > 3 ? arguments[3] : void 0, r = arguments.length > 4 ? arguments[4] : void 0 return 0 === t ? e : 1 === t || (2 === t && !(arguments.length > 2 && void 0 !== arguments[2] && arguments[2])) ? Wd.fromHalfFloat(e) : 2 === t ? T_(e, n, r) : void 0 }, w_ = function (e, t, n) { e = Nu(e, t, n) var r = n - t return Nu(Math.floor(((e - t) / r) * 255), 0, 255) }, T_ = function (e, t, n) { return (e / 255) * (n - t) + t }, M_ = function (e, t, n) { return w_(S_(e, t, n)) }, E_ = function (e, t, n) { return x_(T_(e, t, n)) }, C_ = function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] return 0 === n ? e.getFloat32(4 * t, !0) : 1 === n || (2 === n && !r) ? e.getUint16(2 * t, !0) : e.getUint8(t, !0) }, k_ = (function () { var e = function (e) { return e } return function (t, n, r) { var i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] if (n === r) return t var a = e return ( 2 === n && i ? 1 === r ? (a = E_) : 0 == r && (a = T_) : 2 === n || 1 === n ? 0 === r ? (a = S_) : 2 == r && (a = i ? M_ : e) : 0 === n && (1 === r ? (a = x_) : 2 == r && (a = i ? w_ : x_)), a(t) ) } })(), R_ = function (e, t, n, r) { for ( var i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, a = new Uint8Array(e, t), o = new Uint8Array(n, r), s = 0; s < i; s++ ) o[s] = a[s] }, I_ = (function () { function e(t) { var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] ;(A(this, e), M( this, 'getSplatScaleAndRotation', (function () { var t = new Gh(), n = new Gh(), r = new Gh(), i = new ph(), a = new ph(), o = new fh() return function (s, u, l, c, h) { var d = this.globalSplatIndexToSectionMap[s], f = this.sections[d], p = s - f.splatCountOffset, v = f.bytesPerSplat * p + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, m = new DataView(this.bufferData, f.dataBase + v) ;(a.set( A_(C_(m, 0, this.compressionLevel), this.compressionLevel), A_(C_(m, 1, this.compressionLevel), this.compressionLevel), A_(C_(m, 2, this.compressionLevel), this.compressionLevel) ), h && (void 0 !== h.x && (a.x = h.x), void 0 !== h.y && (a.y = h.y), void 0 !== h.z && (a.z = h.z)), o.set( A_(C_(m, 4, this.compressionLevel), this.compressionLevel), A_(C_(m, 5, this.compressionLevel), this.compressionLevel), A_(C_(m, 6, this.compressionLevel), this.compressionLevel), A_(C_(m, 3, this.compressionLevel), this.compressionLevel) ), c ? (t.makeScale(a.x, a.y, a.z), n.makeRotationFromQuaternion(o), r.copy(t).multiply(n).multiply(c), r.decompose(i, l, u)) : (u.copy(a), l.copy(o))) } })() ), M( this, 'fillSplatScaleRotationArray', (function () { var t = new Gh(), n = new Gh(), r = new Gh(), i = new ph(), a = new fh(), o = new ph(), s = function (e) { var t = e.w < 0 ? -1 : 1 ;((e.x *= t), (e.y *= t), (e.z *= t), (e.w *= t)) } return function (u, l, c, h, d, f, p, v) { var m = this.splatCount ;((h = h || 0), (d = d || m - 1), void 0 === f && (f = h)) for ( var g = function (e, t) { return k_(e, t, p) }, y = h; y <= d; y++ ) { var _ = this.globalSplatIndexToSectionMap[y], b = this.sections[_], x = y - b.splatCountOffset, S = b.bytesPerSplat * x + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, A = (y - h + f) * e.ScaleComponentCount, w = (y - h + f) * e.RotationComponentCount, T = new DataView(this.bufferData, b.dataBase + S), M = v && void 0 !== v.x ? v.x : C_(T, 0, this.compressionLevel), E = v && void 0 !== v.y ? v.y : C_(T, 1, this.compressionLevel), C = v && void 0 !== v.z ? v.z : C_(T, 2, this.compressionLevel), k = C_(T, 3, this.compressionLevel), R = C_(T, 4, this.compressionLevel), I = C_(T, 5, this.compressionLevel), N = C_(T, 6, this.compressionLevel) ;(i.set( A_(M, this.compressionLevel), A_(E, this.compressionLevel), A_(C, this.compressionLevel) ), a .set( A_(R, this.compressionLevel), A_(I, this.compressionLevel), A_(N, this.compressionLevel), A_(k, this.compressionLevel) ) .normalize(), c && (o.set(0, 0, 0), t.makeScale(i.x, i.y, i.z), n.makeRotationFromQuaternion(a), r.identity().premultiply(t).premultiply(n), r.premultiply(c), r.decompose(o, a, i), a.normalize()), s(a), u && ((u[A] = g(i.x, 0)), (u[A + 1] = g(i.y, 0)), (u[A + 2] = g(i.z, 0))), l && ((l[w] = g(a.x, 0)), (l[w + 1] = g(a.y, 0)), (l[w + 2] = g(a.z, 0)), (l[w + 3] = g(a.w, 0)))) } } })() ), M( this, 'fillSphericalHarmonicsArray', (function () { for (var t = 0; t < 15; t++) new ph() var n = new Hc(), r = new Gh(), i = new ph(), a = new ph(), o = new fh(), s = [], u = [], l = [], c = [], h = [], d = [], f = [], p = [], v = [], m = [], g = [], y = [], _ = [], b = [], x = [], S = [], A = [], w = [], T = function (e) { return e }, M = function (e, t, n, r) { ;((e[0] = t), (e[1] = n), (e[2] = r)) }, E = function (e, t, n, r, i) { ;((e[0] = C_(t, r, i, !0)), (e[1] = C_(t, r + n, i, !0)), (e[2] = C_(t, r + n + n, i, !0))) }, C = function (e, t) { ;((t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2])) }, k = function (e, t, n, r) { ;((t[n] = r(e[0])), (t[n + 1] = r(e[1])), (t[n + 2] = r(e[2]))) }, R = function (e, t, n, r, i) { return ( (t[0] = A_(e[0], n, !0, r, i)), (t[1] = A_(e[1], n, !0, r, i)), (t[2] = A_(e[2], n, !0, r, i)), t ) } return function (t, I, N, P, L, D, O) { var F = this, B = this.splatCount ;((P = P || 0), (L = L || B - 1), void 0 === D && (D = P), N && I >= 1 && (r.copy(N), r.decompose(i, o, a), o.normalize(), r.makeRotationFromQuaternion(o), n.setFromMatrix4(r), M(s, n.elements[4], -n.elements[7], n.elements[1]), M(u, -n.elements[5], n.elements[8], -n.elements[2]), M(l, n.elements[3], -n.elements[6], n.elements[0]))) for ( var U = function (e) { return M_( e, F.minSphericalHarmonicsCoeff, F.maxSphericalHarmonicsCoeff ) }, z = function (e) { return w_( e, F.minSphericalHarmonicsCoeff, F.maxSphericalHarmonicsCoeff ) }, V = P; V <= L; V++ ) { var H = this.globalSplatIndexToSectionMap[V], W = this.sections[H] I = Math.min(I, W.sphericalHarmonicsDegree) var G = Ou(I), j = V - W.splatCountOffset, Q = W.bytesPerSplat * j + e.CompressionLevels[this.compressionLevel] .SphericalHarmonicsOffsetBytes, q = new DataView(this.bufferData, W.dataBase + Q), X = (V - P + D) * G, Y = N ? 0 : this.compressionLevel, K = T Y !== O && (1 === Y ? 0 === O ? (K = S_) : 2 == O && (K = U) : 0 === Y && (1 === O ? (K = x_) : 2 == O && (K = z))) var Z = this.minSphericalHarmonicsCoeff, J = this.maxSphericalHarmonicsCoeff I >= 1 && (E(v, q, 3, 0, this.compressionLevel), E(m, q, 3, 1, this.compressionLevel), E(g, q, 3, 2, this.compressionLevel), N ? (R(v, v, this.compressionLevel, Z, J), R(m, m, this.compressionLevel, Z, J), R(g, g, this.compressionLevel, Z, J), e.rotateSphericalHarmonics3(v, m, g, s, u, l, b, x, S)) : (C(v, b), C(m, x), C(g, S)), k(b, t, X, K), k(x, t, X + 3, K), k(S, t, X + 6, K), I >= 2 && (E(v, q, 5, 9, this.compressionLevel), E(m, q, 5, 10, this.compressionLevel), E(g, q, 5, 11, this.compressionLevel), E(y, q, 5, 12, this.compressionLevel), E(_, q, 5, 13, this.compressionLevel), N ? (R(v, v, this.compressionLevel, Z, J), R(m, m, this.compressionLevel, Z, J), R(g, g, this.compressionLevel, Z, J), R(y, y, this.compressionLevel, Z, J), R(_, _, this.compressionLevel, Z, J), e.rotateSphericalHarmonics5( v, m, g, y, _, s, u, l, c, h, d, f, p, b, x, S, A, w )) : (C(v, b), C(m, x), C(g, S), C(y, A), C(_, w)), k(b, t, X + 9, K), k(x, t, X + 12, K), k(S, t, X + 15, K), k(A, t, X + 18, K), k(w, t, X + 21, K))) } } })() ), this.constructFromBuffer(t, n)) } return T( e, [ { key: 'getSplatCount', value: function () { return this.splatCount }, }, { key: 'getMaxSplatCount', value: function () { return this.maxSplatCount }, }, { key: 'getMinSphericalHarmonicsDegree', value: function () { for (var e = 0, t = 0; t < this.sections.length; t++) { var n = this.sections[t] ;(0 === t || n.sphericalHarmonicsDegree < e) && (e = n.sphericalHarmonicsDegree) } return e }, }, { key: 'getBucketIndex', value: function (e, t) { var n, r = e.fullBucketCount * e.bucketSize if (t < r) n = Math.floor(t / e.bucketSize) else { var i = r n = e.fullBucketCount for (var a = 0; i < e.splatCount; ) { var o = e.partiallyFilledBucketLengths[a] if (t >= i && t < i + o) break ;((i += o), n++, a++) } } return n }, }, { key: 'getSplatCenter', value: function (t, n, r, i) { var a = this.globalSplatIndexToSectionMap[n], o = this.sections[a], s = n - o.splatCountOffset, u = o.bytesPerSplat * s, l = new DataView(this.bufferData, o.dataBase + u), c = C_(l, 0, this.compressionLevel), h = C_(l, 1, this.compressionLevel), d = C_(l, 2, this.compressionLevel) if (this.compressionLevel >= 1) { var f = this.getBucketIndex(o, s) * e.BucketStorageSizeFloats, p = o.compressionScaleFactor, v = o.compressionScaleRange ;((r.x = (c - v) * p + o.bucketArray[f]), (r.y = (h - v) * p + o.bucketArray[f + 1]), (r.z = (d - v) * p + o.bucketArray[f + 2])) } else ((r.x = c), (r.y = h), (r.z = d)) ;((r.x += t[3 * n + 0]), (r.y += t[3 * n + 1]), (r.z += t[3 * n + 2]), i && r.applyMatrix4(i)) }, }, { key: 'getSplatColor', value: function (t, n) { var r = this.globalSplatIndexToSectionMap[t], i = this.sections[r], a = t - i.splatCountOffset, o = i.bytesPerSplat * a + e.CompressionLevels[this.compressionLevel].ColorOffsetBytes, s = new Uint8Array(this.bufferData, i.dataBase + o, 4) n.set(s[0], s[1], s[2], s[3]) }, }, { key: 'fillSplatCenterArray', value: function (t, n, r, i, a, o) { var s = this.splatCount ;((i = i || 0), (a = a || s - 1), void 0 === o && (o = i)) for (var u = new ph(), l = i; l <= a; l++) { var c = this.globalSplatIndexToSectionMap[l], h = this.sections[c], d = l - h.splatCountOffset, f = (l - i + o) * e.CenterComponentCount, p = h.bytesPerSplat * d, v = new DataView(this.bufferData, h.dataBase + p), m = C_(v, 0, this.compressionLevel), g = C_(v, 1, this.compressionLevel), y = C_(v, 2, this.compressionLevel) if (this.compressionLevel >= 1) { var _ = this.getBucketIndex(h, d) * e.BucketStorageSizeFloats, b = h.compressionScaleFactor, x = h.compressionScaleRange ;((u.x = (m - x) * b + h.bucketArray[_]), (u.y = (g - x) * b + h.bucketArray[_ + 1]), (u.z = (y - x) * b + h.bucketArray[_ + 2])) } else ((u.x = m), (u.y = g), (u.z = y)) ;(r && u.applyMatrix4(r), (n[f] = u.x + t[3 * l + 0]), (n[f + 1] = u.y + t[3 * l + 1]), (n[f + 2] = u.z + t[3 * l + 2])) } }, }, { key: 'fillSplatCovarianceArray', value: function (t, n, r, i, a, o) { var s = this.splatCount, u = new ph(), l = new fh() ;((r = r || 0), (i = i || s - 1), void 0 === a && (a = r)) for (var c = r; c <= i; c++) { var h = this.globalSplatIndexToSectionMap[c], d = this.sections[h], f = c - d.splatCountOffset, p = (c - r + a) * e.CovarianceComponentCount, v = d.bytesPerSplat * f + e.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, m = new DataView(this.bufferData, d.dataBase + v) ;(u.set( A_(C_(m, 0, this.compressionLevel), this.compressionLevel), A_(C_(m, 1, this.compressionLevel), this.compressionLevel), A_(C_(m, 2, this.compressionLevel), this.compressionLevel) ), l.set( A_(C_(m, 4, this.compressionLevel), this.compressionLevel), A_(C_(m, 5, this.compressionLevel), this.compressionLevel), A_(C_(m, 6, this.compressionLevel), this.compressionLevel), A_(C_(m, 3, this.compressionLevel), this.compressionLevel) ), e.computeCovariance(u, l, n, t, p, o)) } }, }, { key: 'fillSplatColorArray', value: function (t, n, r, i, a) { var o = this.splatCount ;((r = r || 0), (i = i || o - 1), void 0 === a && (a = r)) for (var s = r; s <= i; s++) { var u = this.globalSplatIndexToSectionMap[s], l = this.sections[u], c = s - l.splatCountOffset, h = (s - r + a) * e.ColorComponentCount, d = l.bytesPerSplat * c + e.CompressionLevels[this.compressionLevel].ColorOffsetBytes, f = new Uint8Array(this.bufferData, l.dataBase + d), p = f[3] ;((p = p >= n ? p : 0), (t[h] = f[0]), (t[h + 1] = f[1]), (t[h + 2] = f[2]), (t[h + 3] = p)) } }, }, { key: 'constructFromBuffer', value: function (t, n) { ;((this.bufferData = t), (this.globalSplatIndexToLocalSplatIndexMap = []), (this.globalSplatIndexToSectionMap = [])) var r = e.parseHeader(this.bufferData) ;((this.versionMajor = r.versionMajor), (this.versionMinor = r.versionMinor), (this.maxSectionCount = r.maxSectionCount), (this.sectionCount = n ? r.maxSectionCount : 0), (this.maxSplatCount = r.maxSplatCount), (this.splatCount = n ? r.maxSplatCount : 0), (this.compressionLevel = r.compressionLevel), (this.sceneCenter = new ph().copy(r.sceneCenter)), (this.minSphericalHarmonicsCoeff = r.minSphericalHarmonicsCoeff), (this.maxSphericalHarmonicsCoeff = r.maxSphericalHarmonicsCoeff), (this.sections = e.parseSectionHeaders( r, this.bufferData, e.HeaderSizeBytes, n )), this.linkBufferArrays(), this.buildMaps()) }, }, { key: 'linkBufferArrays', value: function () { for (var t = 0; t < this.maxSectionCount; t++) { var n = this.sections[t] ;((n.bucketArray = new Float32Array( this.bufferData, n.bucketsBase, n.bucketCount * e.BucketStorageSizeFloats )), n.partiallyFilledBucketCount > 0 && (n.partiallyFilledBucketLengths = new Uint32Array( this.bufferData, n.base, n.partiallyFilledBucketCount ))) } }, }, { key: 'buildMaps', value: function () { for (var e = 0, t = 0; t < this.maxSectionCount; t++) { for (var n = this.sections[t], r = 0; r < n.maxSplatCount; r++) { var i = e + r ;((this.globalSplatIndexToLocalSplatIndexMap[i] = r), (this.globalSplatIndexToSectionMap[i] = t)) } e += n.maxSplatCount } }, }, { key: 'updateLoadedCounts', value: function (t, n) { ;(e.writeHeaderCountsToBuffer(t, n, this.bufferData), (this.sectionCount = t), (this.splatCount = n)) }, }, { key: 'updateSectionLoadedCounts', value: function (t, n) { var r = e.HeaderSizeBytes + e.SectionHeaderSizeBytes * t ;(e.writeSectionHeaderSplatCountToBuffer(n, this.bufferData, r), (this.sections[t].splatCount = n)) }, }, ], [ { key: 'parseHeader', value: function (t) { var n = new Uint8Array(t, 0, e.HeaderSizeBytes), r = new Uint16Array(t, 0, e.HeaderSizeBytes / 2), i = new Uint32Array(t, 0, e.HeaderSizeBytes / 4), a = new Float32Array(t, 0, e.HeaderSizeBytes / 4) return { versionMajor: n[0], versionMinor: n[1], maxSectionCount: i[1], sectionCount: i[2], maxSplatCount: i[3], splatCount: i[4], compressionLevel: r[10], sceneCenter: new ph(a[6], a[7], a[8]), minSphericalHarmonicsCoeff: a[9] || -b_, maxSphericalHarmonicsCoeff: a[10] || b_, } }, }, { key: 'writeHeaderCountsToBuffer', value: function (t, n, r) { var i = new Uint32Array(r, 0, e.HeaderSizeBytes / 4) ;((i[2] = t), (i[4] = n)) }, }, { key: 'writeHeaderToBuffer', value: function (t, n) { var r = new Uint8Array(n, 0, e.HeaderSizeBytes), i = new Uint16Array(n, 0, e.HeaderSizeBytes / 2), a = new Uint32Array(n, 0, e.HeaderSizeBytes / 4), o = new Float32Array(n, 0, e.HeaderSizeBytes / 4) ;((r[0] = t.versionMajor), (r[1] = t.versionMinor), (r[2] = 0), (r[3] = 0), (a[1] = t.maxSectionCount), (a[2] = t.sectionCount), (a[3] = t.maxSplatCount), (a[4] = t.splatCount), (i[10] = t.compressionLevel), (o[6] = t.sceneCenter.x), (o[7] = t.sceneCenter.y), (o[8] = t.sceneCenter.z), (o[9] = t.minSphericalHarmonicsCoeff || -b_), (o[10] = t.maxSphericalHarmonicsCoeff || b_)) }, }, { key: 'parseSectionHeaders', value: function (t, n) { for ( var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = arguments.length > 3 ? arguments[3] : void 0, a = t.compressionLevel, o = t.maxSectionCount, s = new Uint16Array(n, r, (o * e.SectionHeaderSizeBytes) / 2), u = new Uint32Array(n, r, (o * e.SectionHeaderSizeBytes) / 4), l = new Float32Array(n, r, (o * e.SectionHeaderSizeBytes) / 4), c = [], h = 0, d = h / 2, f = h / 4, p = e.HeaderSizeBytes + t.maxSectionCount * e.SectionHeaderSizeBytes, v = 0, m = 0; m < o; m++ ) { var g = u[f + 1], y = u[f + 2], _ = u[f + 3], b = l[f + 4], x = b / 2, S = s[d + 10], A = u[f + 6] || e.CompressionLevels[a].ScaleRange, w = u[f + 8], T = u[f + 9], M = 4 * T, E = S * _ + M, C = s[d + 20], k = e.calculateComponentStorage(a, C).bytesPerSplat, R = k * g, I = R + E, N = { bytesPerSplat: k, splatCountOffset: v, splatCount: i ? g : 0, maxSplatCount: g, bucketSize: y, bucketCount: _, bucketBlockSize: b, halfBucketBlockSize: x, bucketStorageSizeBytes: S, bucketsStorageSizeBytes: E, splatDataStorageSizeBytes: R, storageSizeBytes: I, compressionScaleRange: A, compressionScaleFactor: x / A, base: p, bucketsBase: p + M, dataBase: p + E, fullBucketCount: w, partiallyFilledBucketCount: T, sphericalHarmonicsDegree: C, } ;((c[m] = N), (p += I), (d = (h += e.SectionHeaderSizeBytes) / 2), (f = h / 4), (v += g)) } return c }, }, { key: 'writeSectionHeaderToBuffer', value: function (t, n, r) { var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, a = new Uint16Array(r, i, e.SectionHeaderSizeBytes / 2), o = new Uint32Array(r, i, e.SectionHeaderSizeBytes / 4), s = new Float32Array(r, i, e.SectionHeaderSizeBytes / 4) ;((o[0] = t.splatCount), (o[1] = t.maxSplatCount), (o[2] = n >= 1 ? t.bucketSize : 0), (o[3] = n >= 1 ? t.bucketCount : 0), (s[4] = n >= 1 ? t.bucketBlockSize : 0), (a[10] = n >= 1 ? e.BucketStorageSizeBytes : 0), (o[6] = n >= 1 ? t.compressionScaleRange : 0), (o[7] = t.storageSizeBytes), (o[8] = n >= 1 ? t.fullBucketCount : 0), (o[9] = n >= 1 ? t.partiallyFilledBucketCount : 0), (a[20] = t.sphericalHarmonicsDegree)) }, }, { key: 'writeSectionHeaderSplatCountToBuffer', value: function (t, n) { new Uint32Array( n, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, e.SectionHeaderSizeBytes / 4 )[0] = t }, }, { key: 'calculateComponentStorage', value: function (t, n) { var r = e.CompressionLevels[t].BytesPerCenter, i = e.CompressionLevels[t].BytesPerScale, a = e.CompressionLevels[t].BytesPerRotation, o = e.CompressionLevels[t].BytesPerColor, s = Ou(n), u = e.CompressionLevels[t].BytesPerSphericalHarmonicsComponent * s return { bytesPerCenter: r, bytesPerScale: i, bytesPerRotation: a, bytesPerColor: o, sphericalHarmonicsComponentsPerSplat: s, sphericalHarmonicsBytesPerSplat: u, bytesPerSplat: r + i + a + o + u, } }, }, { key: 'generateFromUncompressedSplatArrays', value: function (t, n, r, i, a, o) { for ( var s, u, l = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : [], c = 0, h = 0; h < t.length; h++ ) { var d = t[h] c = Math.max(d.sphericalHarmonicsDegree, c) } for (var f = 0; f < t.length; f++) for (var p = t[f], v = 0; v < p.splats.length; v++) for ( var m = p.splats[v], g = Hu.OFFSET.FRC0; g < Hu.OFFSET.FRC23 && g < m.length; g++ ) ((!s || m[g] < s) && (s = m[g]), (!u || m[g] > u) && (u = m[g])) ;((s = s || -b_), (u = u || b_)) for ( var y = e.calculateComponentStorage(r, c).bytesPerSplat, _ = e.CompressionLevels[r].ScaleRange, b = [], x = [], S = 0, A = 0; A < t.length; A++ ) { for (var w = t[A], T = new Hu(c), M = 0; M < w.splatCount; M++) { var E = w.splats[M] ;(E[Hu.OFFSET.OPACITY] || 0) >= n && T.addSplat(E) } for ( var C = l[A] || {}, k = (C.blockSizeFactor || 1) * (a || e.BucketBlockSize), R = Math.ceil((C.bucketSizeFactor || 1) * (o || e.BucketSize)), N = e.computeBucketsForUncompressedSplatArray(T, k, R), P = N.fullBuckets.length, L = N.partiallyFullBuckets.map(function (e) { return e.splats.length }), D = L.length, O = [].concat(I(N.fullBuckets), I(N.partiallyFullBuckets)), F = T.splats.length * y, B = 4 * D, U = r >= 1 ? O.length * e.BucketStorageSizeBytes + B : 0, z = F + U, V = new ArrayBuffer(z), H = _ / (0.5 * k), W = new ph(), G = 0, j = 0; j < O.length; j++ ) { var Q = O[j] W.fromArray(Q.center) for (var q = 0; q < Q.splats.length; q++) { var X = Q.splats[q], Y = T.splats[X], K = U + G * y ;(e.writeSplatDataToSectionBuffer(Y, V, K, r, c, W, H, _, s, u), G++) } } if (((S += G), r >= 1)) { for ( var Z = new Uint32Array(V, 0, 4 * L.length), J = 0; J < L.length; J++ ) Z[J] = L[J] for ( var $ = new Float32Array(V, B, O.length * e.BucketStorageSizeFloats), ee = 0; ee < O.length; ee++ ) { var te = O[ee], ne = 3 * ee ;(($[ne] = te.center[0]), ($[ne + 1] = te.center[1]), ($[ne + 2] = te.center[2])) } } b.push(V) var re = new ArrayBuffer(e.SectionHeaderSizeBytes) ;(e.writeSectionHeaderToBuffer( { maxSplatCount: G, splatCount: G, bucketSize: R, bucketCount: O.length, bucketBlockSize: k, compressionScaleRange: _, storageSizeBytes: z, fullBucketCount: P, partiallyFilledBucketCount: D, sphericalHarmonicsDegree: c, }, r, re, 0 ), x.push(re)) } for (var ie = 0, ae = 0, oe = b; ae < oe.length; ae++) { ie += oe[ae].byteLength } var se = e.HeaderSizeBytes + e.SectionHeaderSizeBytes * b.length + ie, ue = new ArrayBuffer(se) e.writeHeaderToBuffer( { versionMajor: 0, versionMinor: 1, maxSectionCount: b.length, sectionCount: b.length, maxSplatCount: S, splatCount: S, compressionLevel: r, sceneCenter: i, minSphericalHarmonicsCoeff: s, maxSphericalHarmonicsCoeff: u, }, ue ) for (var le = e.HeaderSizeBytes, ce = 0, he = x; ce < he.length; ce++) { var de = he[ce] ;(new Uint8Array(ue, le, e.SectionHeaderSizeBytes).set(new Uint8Array(de)), (le += e.SectionHeaderSizeBytes)) } for (var fe = 0, pe = b; fe < pe.length; fe++) { var ve = pe[fe] ;(new Uint8Array(ue, le, ve.byteLength).set(new Uint8Array(ve)), (le += ve.byteLength)) } return new e(ue) }, }, { key: 'computeBucketsForUncompressedSplatArray', value: function (e, t, n) { for ( var r = e.splatCount, i = t / 2, a = new ph(), o = new ph(), s = 0; s < r; s++ ) { var u = e.splats[s], l = [u[Hu.OFFSET.X], u[Hu.OFFSET.Y], u[Hu.OFFSET.Z]] ;((0 === s || l[0] < a.x) && (a.x = l[0]), (0 === s || l[0] > o.x) && (o.x = l[0]), (0 === s || l[1] < a.y) && (a.y = l[1]), (0 === s || l[1] > o.y) && (o.y = l[1]), (0 === s || l[2] < a.z) && (a.z = l[2]), (0 === s || l[2] > o.z) && (o.z = l[2])) } for ( var c = new ph().copy(o).sub(a), h = Math.ceil(c.y / t), d = Math.ceil(c.z / t), f = new ph(), p = [], v = {}, m = 0; m < r; m++ ) { var g = e.splats[m], y = [g[Hu.OFFSET.X], g[Hu.OFFSET.Y], g[Hu.OFFSET.Z]], _ = Math.floor((y[0] - a.x) / t), b = Math.floor((y[1] - a.y) / t), x = Math.floor((y[2] - a.z) / t) ;((f.x = _ * t + a.x + i), (f.y = b * t + a.y + i), (f.z = x * t + a.z + i)) var S = _ * (h * d) + b * d + x, A = v[S] ;(A || (v[S] = A = { splats: [], center: f.toArray() }), A.splats.push(m), A.splats.length >= n && (p.push(A), (v[S] = null))) } var w = [] for (var T in v) if (v.hasOwnProperty(T)) { var M = v[T] M && w.push(M) } return { fullBuckets: p, partiallyFullBuckets: w } }, }, ] ) })() ;((f = I_), M(I_, 'CurrentMajorVersion', 0), M(I_, 'CurrentMinorVersion', 1), M(I_, 'CenterComponentCount', 3), M(I_, 'ScaleComponentCount', 3), M(I_, 'RotationComponentCount', 4), M(I_, 'ColorComponentCount', 4), M(I_, 'CovarianceComponentCount', 6), M(I_, 'SplatScaleOffsetFloat', 3), M(I_, 'SplatRotationOffsetFloat', 6), M(I_, 'CompressionLevels', { 0: { BytesPerCenter: 12, BytesPerScale: 12, BytesPerRotation: 16, BytesPerColor: 4, ScaleOffsetBytes: 12, RotationffsetBytes: 24, ColorOffsetBytes: 40, SphericalHarmonicsOffsetBytes: 44, ScaleRange: 1, BytesPerSphericalHarmonicsComponent: 4, SphericalHarmonicsOffsetFloat: 11, SphericalHarmonicsDegrees: { 0: { BytesPerSplat: 44 }, 1: { BytesPerSplat: 80 }, 2: { BytesPerSplat: 140 }, }, }, 1: { BytesPerCenter: 6, BytesPerScale: 6, BytesPerRotation: 8, BytesPerColor: 4, ScaleOffsetBytes: 6, RotationffsetBytes: 12, ColorOffsetBytes: 20, SphericalHarmonicsOffsetBytes: 24, ScaleRange: 32767, BytesPerSphericalHarmonicsComponent: 2, SphericalHarmonicsOffsetFloat: 12, SphericalHarmonicsDegrees: { 0: { BytesPerSplat: 24 }, 1: { BytesPerSplat: 42 }, 2: { BytesPerSplat: 72 }, }, }, 2: { BytesPerCenter: 6, BytesPerScale: 6, BytesPerRotation: 8, BytesPerColor: 4, ScaleOffsetBytes: 6, RotationffsetBytes: 12, ColorOffsetBytes: 20, SphericalHarmonicsOffsetBytes: 24, ScaleRange: 32767, BytesPerSphericalHarmonicsComponent: 1, SphericalHarmonicsOffsetFloat: 12, SphericalHarmonicsDegrees: { 0: { BytesPerSplat: 24 }, 1: { BytesPerSplat: 33 }, 2: { BytesPerSplat: 48 }, }, }, }), M(I_, 'CovarianceSizeFloats', 6), M(I_, 'HeaderSizeBytes', 4096), M(I_, 'SectionHeaderSizeBytes', 1024), M(I_, 'BucketStorageSizeBytes', 12), M(I_, 'BucketStorageSizeFloats', 3), M(I_, 'BucketBlockSize', 5), M(I_, 'BucketSize', 256), M( I_, 'computeCovariance', ((Vy = new Gh()), (Hy = new Hc()), (Wy = new Hc()), (Gy = new Hc()), (jy = new Hc()), (Qy = new Hc()), (qy = new Hc()), function (e, t, n, r) { var i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, a = arguments.length > 5 ? arguments[5] : void 0 ;(Vy.makeScale(e.x, e.y, e.z), Hy.setFromMatrix4(Vy), Vy.makeRotationFromQuaternion(t), Wy.setFromMatrix4(Vy), Gy.copy(Wy).multiply(Hy), jy.copy(Gy).transpose().premultiply(Gy), n && (Qy.setFromMatrix4(n), qy.copy(Qy).transpose(), jy.multiply(qy), jy.premultiply(Qy)), a >= 1 ? ((r[i] = x_(jy.elements[0])), (r[i + 1] = x_(jy.elements[3])), (r[i + 2] = x_(jy.elements[6])), (r[i + 3] = x_(jy.elements[4])), (r[i + 4] = x_(jy.elements[7])), (r[i + 5] = x_(jy.elements[8]))) : ((r[i] = jy.elements[0]), (r[i + 1] = jy.elements[3]), (r[i + 2] = jy.elements[6]), (r[i + 3] = jy.elements[4]), (r[i + 4] = jy.elements[7]), (r[i + 5] = jy.elements[8]))) }) ), M(I_, 'dot3', function (e, t, n, r, i) { i[0] = i[1] = i[2] = 0 var a = r[0], o = r[1], s = r[2] ;(f.addInto3(e[0] * a, e[1] * a, e[2] * a, i), f.addInto3(t[0] * o, t[1] * o, t[2] * o, i), f.addInto3(n[0] * s, n[1] * s, n[2] * s, i)) }), M(I_, 'addInto3', function (e, t, n, r) { ;((r[0] = r[0] + e), (r[1] = r[1] + t), (r[2] = r[2] + n)) }), M(I_, 'dot5', function (e, t, n, r, i, a, o) { o[0] = o[1] = o[2] = 0 var s = a[0], u = a[1], l = a[2], c = a[3], h = a[4] ;(f.addInto3(e[0] * s, e[1] * s, e[2] * s, o), f.addInto3(t[0] * u, t[1] * u, t[2] * u, o), f.addInto3(n[0] * l, n[1] * l, n[2] * l, o), f.addInto3(r[0] * c, r[1] * c, r[2] * c, o), f.addInto3(i[0] * h, i[1] * h, i[2] * h, o)) }), M(I_, 'rotateSphericalHarmonics3', function (e, t, n, r, i, a, o, s, u) { ;(f.dot3(e, t, n, r, o), f.dot3(e, t, n, i, s), f.dot3(e, t, n, a, u)) }), M( I_, 'rotateSphericalHarmonics5', function (e, t, n, r, i, a, o, s, u, l, c, h, d, p, v, m, g, y) { var _ = Math.sqrt(1 / 4), b = Math.sqrt(3 / 4), x = Math.sqrt(1 / 3), S = Math.sqrt(4 / 3), A = Math.sqrt(1 / 12) ;((u[0] = _ * (s[2] * a[0] + s[0] * a[2] + (a[2] * s[0] + a[0] * s[2]))), (u[1] = s[1] * a[0] + a[1] * s[0]), (u[2] = b * (s[1] * a[1] + a[1] * s[1])), (u[3] = s[1] * a[2] + a[1] * s[2]), (u[4] = _ * (s[2] * a[2] - s[0] * a[0] + (a[2] * s[2] - a[0] * s[0]))), f.dot5(e, t, n, r, i, u, p), (l[0] = _ * (o[2] * a[0] + o[0] * a[2] + (a[2] * o[0] + a[0] * o[2]))), (l[1] = o[1] * a[0] + a[1] * o[0]), (l[2] = b * (o[1] * a[1] + a[1] * o[1])), (l[3] = o[1] * a[2] + a[1] * o[2]), (l[4] = _ * (o[2] * a[2] - o[0] * a[0] + (a[2] * o[2] - a[0] * o[0]))), f.dot5(e, t, n, r, i, l, v), (c[0] = x * (o[2] * o[0] + o[0] * o[2]) + -A * (s[2] * s[0] + s[0] * s[2] + (a[2] * a[0] + a[0] * a[2]))), (c[1] = S * o[1] * o[0] + -x * (s[1] * s[0] + a[1] * a[0])), (c[2] = o[1] * o[1] + -_ * (s[1] * s[1] + a[1] * a[1])), (c[3] = S * o[1] * o[2] + -x * (s[1] * s[2] + a[1] * a[2])), (c[4] = x * (o[2] * o[2] - o[0] * o[0]) + -A * (s[2] * s[2] - s[0] * s[0] + (a[2] * a[2] - a[0] * a[0]))), f.dot5(e, t, n, r, i, c, m), (h[0] = _ * (o[2] * s[0] + o[0] * s[2] + (s[2] * o[0] + s[0] * o[2]))), (h[1] = o[1] * s[0] + s[1] * o[0]), (h[2] = b * (o[1] * s[1] + s[1] * o[1])), (h[3] = o[1] * s[2] + s[1] * o[2]), (h[4] = _ * (o[2] * s[2] - o[0] * s[0] + (s[2] * o[2] - s[0] * o[0]))), f.dot5(e, t, n, r, i, h, g), (d[0] = _ * (s[2] * s[0] + s[0] * s[2] - (a[2] * a[0] + a[0] * a[2]))), (d[1] = s[1] * s[0] - a[1] * a[0]), (d[2] = b * (s[1] * s[1] - a[1] * a[1])), (d[3] = s[1] * s[2] - a[1] * a[2]), (d[4] = _ * (s[2] * s[2] - s[0] * s[0] - (a[2] * a[2] - a[0] * a[0]))), f.dot5(e, t, n, r, i, d, y)) } ), M( I_, 'writeSplatDataToSectionBuffer', ((Xy = new ArrayBuffer(12)), (Yy = new ArrayBuffer(12)), (Ky = new ArrayBuffer(16)), (Zy = new ArrayBuffer(4)), (Jy = new ArrayBuffer(256)), ($y = new fh()), (e_ = new ph()), (t_ = new ph()), (n_ = Hu.OFFSET), (r_ = n_.X), (i_ = n_.Y), (a_ = n_.Z), (o_ = n_.SCALE0), (s_ = n_.SCALE1), (u_ = n_.SCALE2), (l_ = n_.ROTATION0), (c_ = n_.ROTATION1), (h_ = n_.ROTATION2), (d_ = n_.ROTATION3), (f_ = n_.FDC0), (p_ = n_.FDC1), (v_ = n_.FDC2), (m_ = n_.OPACITY), (g_ = n_.FRC0), (y_ = n_.FRC9), (__ = function (e, t, n) { var r = 2 * n + 1 return ((e = Math.round(e * t) + n), Nu(e, 0, r)) }), function (e, t, n, r, i, a, o, s) { var u = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : -b_, l = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : b_, c = Ou(i), h = n, d = h + f.CompressionLevels[r].BytesPerCenter, p = d + f.CompressionLevels[r].BytesPerScale, v = p + f.CompressionLevels[r].BytesPerRotation, m = v + f.CompressionLevels[r].BytesPerColor if ( (void 0 !== e[l_] ? ($y.set(e[l_], e[c_], e[h_], e[d_]), $y.normalize()) : $y.set(1, 0, 0, 0), void 0 !== e[o_] ? e_.set(e[o_] || 0, e[s_] || 0, e[u_] || 0) : e_.set(0, 0, 0), 0 === r) ) { var g = new Float32Array(t, h, f.CenterComponentCount), y = new Float32Array(t, p, f.RotationComponentCount), _ = new Float32Array(t, d, f.ScaleComponentCount) if ( (y.set([$y.x, $y.y, $y.z, $y.w]), _.set([e_.x, e_.y, e_.z]), g.set([e[r_], e[i_], e[a_]]), i > 0) ) { var b = new Float32Array(t, m, c) if (i >= 1) { for (var x = 0; x < 9; x++) b[x] = e[g_ + x] || 0 if (i >= 2) for (var S = 0; S < 15; S++) b[S + 9] = e[y_ + S] || 0 } } } else { var A = new Uint16Array(Xy, 0, f.CenterComponentCount), w = new Uint16Array(Ky, 0, f.RotationComponentCount), T = new Uint16Array(Yy, 0, f.ScaleComponentCount) if ( (w.set([x_($y.x), x_($y.y), x_($y.z), x_($y.w)]), T.set([x_(e_.x), x_(e_.y), x_(e_.z)]), t_.set(e[r_], e[i_], e[a_]).sub(a), (t_.x = __(t_.x, o, s)), (t_.y = __(t_.y, o, s)), (t_.z = __(t_.z, o, s)), A.set([t_.x, t_.y, t_.z]), i > 0) ) { var M = 1 === r ? 2 : 1, E = new (1 === r ? Uint16Array : Uint8Array)(Jy, 0, c) if (i >= 1) { for (var C = 0; C < 9; C++) { var k = e[g_ + C] || 0 E[C] = 1 === r ? x_(k) : w_(k, u, l) } var R = 9 * M if ((R_(E.buffer, 0, t, m, R), i >= 2)) { for (var I = 0; I < 15; I++) { var N = e[y_ + I] || 0 E[I + 9] = 1 === r ? x_(N) : w_(N, u, l) } R_(E.buffer, R, t, m + R, 15 * M) } } } ;(R_(A.buffer, 0, t, h, 6), R_(T.buffer, 0, t, d, 6), R_(w.buffer, 0, t, p, 8)) } var P = new Uint8ClampedArray(Zy, 0, 4) ;(P.set([e[f_] || 0, e[p_] || 0, e[v_] || 0]), (P[3] = e[m_] || 0), R_(P.buffer, 0, t, v, 4)) }) )) var N_ = new Uint8Array([112, 108, 121, 10]), P_ = new Uint8Array([10, 101, 110, 100, 95, 104, 101, 97, 100, 101, 114, 10]), L_ = 'end_header', D_ = new Map([ ['char', Int8Array], ['uchar', Uint8Array], ['short', Int16Array], ['ushort', Uint16Array], ['int', Int32Array], ['uint', Uint32Array], ['float', Float32Array], ['double', Float64Array], ]), O_ = function (e, t) { var n = (1 << t) - 1 return (e & n) / n }, F_ = function (e, t) { ;((e.x = O_(t >>> 21, 11)), (e.y = O_(t >>> 11, 10)), (e.z = O_(t, 11))) }, B_ = function (e, t, n) { return e * (1 - n) + t * n }, U_ = function (e, t) { var n return null === (n = e.properties.find(function (e) { return e.name === t && e.storage })) || void 0 === n ? void 0 : n.storage }, z_ = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'decodeHeaderText', value: function (e) { for ( var t, n, r, i = e.split('\n').filter(function (e) { return !e.startsWith('comment ') }), a = 0, o = !1, s = 1; s < i.length; ++s ) { var u = i[s].split(' ') switch (u[0]) { case 'format': if ('binary_little_endian' !== u[1]) throw new Error('Unsupported ply format') break case 'element': 'chunk' === (t = { name: u[1], count: parseInt(u[2], 10), properties: [], storageSizeBytes: 0, }).name ? (n = t) : 'vertex' === t.name && (r = t) break case 'property': if (!D_.has(u[1])) throw new Error( "Unrecognized property data type '".concat(u[1], "' in ply header") ) var l = D_.get(u[1]), c = l.BYTES_PER_ELEMENT * t.count ;('vertex' === t.name && (a += l.BYTES_PER_ELEMENT), t.properties.push({ type: u[1], name: u[2], storage: null, byteSize: l.BYTES_PER_ELEMENT, storageSizeByes: c, }), (t.storageSizeBytes += c)) break case L_: o = !0 break default: throw new Error( "Unrecognized header value '".concat(u[0], "' in ply header") ) } if (o) break } return { chunkElement: n, vertexElement: r, bytesPerSplat: a, headerSizeBytes: e.indexOf(L_) + 10 + 1, sphericalHarmonicsDegree: 0, } }, }, { key: 'decodeHeader', value: function (t) { var n, r = new Uint8Array(t) if ( r.length >= N_.length && !(function (e, t) { if (e.length < t.length) return !1 for (var n = 0; n < t.length; ++n) if (e[n] !== t[n]) return !1 return !0 })(r, N_) ) throw new Error('Invalid PLY header') if ( ((n = (function (e, t) { var n, r, i = e.length - t.length for (n = 0; n <= i; ++n) { for (r = 0; r < t.length && e[n + r] === t[r]; ++r); if (r === t.length) return n } return -1 })(r, P_)), -1 === n) ) throw new Error('End of PLY header not found') var i = new TextDecoder('ascii').decode(r.slice(0, n)), a = e.decodeHeaderText(i), o = a.chunkElement, s = a.vertexElement, u = a.bytesPerSplat return { headerSizeBytes: n + P_.length, bytesPerSplat: u, chunkElement: o, vertexElement: s, } }, }, { key: 'readElementData', value: function (e, t, n, r, i) { var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : null, o = t instanceof DataView ? t : new DataView(t) ;((r = r || 0), (i = i || e.count - 1)) for (var s = r; s <= i; ++s) for (var u = 0; u < e.properties.length; ++u) { var l = e.properties[u], c = D_.get(l.type), h = c.BYTES_PER_ELEMENT * e.count if ( ((l.storage && !(l.storage.byteLength < h)) || (a && !a(l.name)) || (l.storage = new c(e.count)), l.storage) ) switch (l.type) { case 'char': l.storage[s] = o.getInt8(n) break case 'uchar': l.storage[s] = o.getUint8(n) break case 'short': l.storage[s] = o.getInt16(n, !0) break case 'ushort': l.storage[s] = o.getUint16(n, !0) break case 'int': l.storage[s] = o.getInt32(n, !0) break case 'uint': l.storage[s] = o.getUint32(n, !0) break case 'float': l.storage[s] = o.getFloat32(n, !0) break case 'double': l.storage[s] = o.getFloat64(n, !0) } n += l.byteSize } return n }, }, { key: 'readPly', value: function (t) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, r = e.decodeHeader(t), i = e.readElementData(r.chunkElement, t, r.headerSizeBytes, null, null, n) return ( e.readElementData(r.vertexElement, t, i, null, null, n), { chunkElement: r.chunkElement, vertexElement: r.vertexElement } ) }, }, { key: 'getElementStorageArrays', value: function (e, t) { var n = U_(e, 'min_x'), r = U_(e, 'min_y'), i = U_(e, 'min_z'), a = U_(e, 'max_x'), o = U_(e, 'max_y'), s = U_(e, 'max_z'), u = U_(e, 'min_scale_x'), l = U_(e, 'min_scale_y'), c = U_(e, 'min_scale_z') return { positionExtremes: { minX: n, maxX: a, minY: r, maxY: o, minZ: i, maxZ: s }, scaleExtremes: { minScaleX: u, maxScaleX: U_(e, 'max_scale_x'), minScaleY: l, maxScaleY: U_(e, 'max_scale_y'), minScaleZ: c, maxScaleZ: U_(e, 'max_scale_z'), }, position: U_(t, 'packed_position'), rotation: U_(t, 'packed_rotation'), scale: U_(t, 'packed_scale'), color: U_(t, 'packed_color'), } }, }, { key: 'parseToUncompressedSplatBufferSection', value: function (t, n, r, i, a, o, s, u, l) { var c = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : null e.readElementData(n, o, s, r, i, c) for ( var h = I_.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, d = e.getElementStorageArrays(t, n), f = d.positionExtremes, p = d.scaleExtremes, v = d.position, m = d.rotation, g = d.scale, y = d.color, _ = Hu.createSplat(), b = r; b <= i; ++b ) { e.decompressSplat(b, a, v, f, g, p, m, y, _) var x = b * h + l I_.writeSplatDataToSectionBuffer(_, u, x, 0, 0) } }, }, { key: 'parseToUncompressedSplatArraySection', value: function (t, n, r, i, a, o, s, u) { var l = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : null e.readElementData(n, o, s, r, i, l) for ( var c = e.getElementStorageArrays(t, n), h = c.positionExtremes, d = c.scaleExtremes, f = c.position, p = c.rotation, v = c.scale, m = c.color, g = r; g <= i; ++g ) { var y = Hu.createSplat() ;(e.decompressSplat(g, a, f, h, v, d, p, m, y), u.addSplat(y)) } }, }, { key: 'parseToUncompressedSplatArray', value: function (t) { for ( var n = e.readPly(t), r = n.chunkElement, i = n.vertexElement, a = new Hu(), o = e.getElementStorageArrays(r, i), s = o.positionExtremes, u = o.scaleExtremes, l = o.position, c = o.rotation, h = o.scale, d = o.color, f = 0; f < i.count; ++f ) { a.addDefaultSplat() var p = a.getSplat(a.splatCount - 1) e.decompressSplat(f, 0, l, s, h, u, c, d, p) } return (new Gh().identity(), a) }, }, ]) })() M( z_, 'decompressSplat', (function () { var e = new ph(), t = new fh(), n = new ph(), r = new uh(), i = Hu.OFFSET return function (a, o, s, u, l, c, h, d, f) { f = f || Hu.createSplat() var p, v, m = Math.floor((o + a) / 256) return ( F_(e, s[a]), (function (e, t) { var n = 1 / (0.5 * Math.sqrt(2)), r = (O_(t >>> 20, 10) - 0.5) * n, i = (O_(t >>> 10, 10) - 0.5) * n, a = (O_(t, 10) - 0.5) * n, o = Math.sqrt(1 - (r * r + i * i + a * a)) switch (t >>> 30) { case 0: e.set(o, r, i, a) break case 1: e.set(r, o, i, a) break case 2: e.set(r, i, o, a) break case 3: e.set(r, i, a, o) } })(t, h[a]), F_(n, l[a]), (p = r), (v = d[a]), (p.x = O_(v >>> 24, 8)), (p.y = O_(v >>> 16, 8)), (p.z = O_(v >>> 8, 8)), (p.w = O_(v, 8)), (f[i.X] = B_(u.minX[m], u.maxX[m], e.x)), (f[i.Y] = B_(u.minY[m], u.maxY[m], e.y)), (f[i.Z] = B_(u.minZ[m], u.maxZ[m], e.z)), (f[i.ROTATION0] = t.x), (f[i.ROTATION1] = t.y), (f[i.ROTATION2] = t.z), (f[i.ROTATION3] = t.w), (f[i.SCALE0] = Math.exp(B_(c.minScaleX[m], c.maxScaleX[m], n.x))), (f[i.SCALE1] = Math.exp(B_(c.minScaleY[m], c.maxScaleY[m], n.y))), (f[i.SCALE2] = Math.exp(B_(c.minScaleZ[m], c.maxScaleZ[m], n.z))), (f[i.FDC0] = Nu(Math.floor(255 * r.x), 0, 255)), (f[i.FDC1] = Nu(Math.floor(255 * r.y), 0, 255)), (f[i.FDC2] = Nu(Math.floor(255 * r.z), 0, 255)), (f[i.OPACITY] = Nu(Math.floor(255 * r.w), 0, 255)), f ) } })() ) var V_ = 0, H_ = 1, W_ = 2, G_ = { double: 0, int: 1, uint: 2, float: 3, short: 4, ushort: 5, uchar: 6 }, j_ = M(M(M(M(M(M(M({}, 0, 8), 1, 4), 2, 4), 3, 4), 4, 2), 5, 2), 6, 1), Q_ = (function () { function e() { A(this, e) } return T( e, [ { key: 'decodeSectionHeader', value: function (t, n) { for ( var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = [], a = !1, o = -1, s = 0, u = !1, l = null, c = [], h = [], d = [], f = {}, p = r; p < t.length; p++ ) { var v = t[p].trim() if (v.startsWith('element')) { if (a) { o-- break } ;((a = !0), (r = p), (o = p)) var m, g = 0, y = L(v.split(' ')) try { for (y.s(); !(m = y.n()).done; ) { var _ = m.value.trim() _.length > 0 && (2 === ++g ? (l = _) : 3 === g && (s = parseInt(_))) } } catch (P) { y.e(P) } finally { y.f() } } else if (v.startsWith('property')) { var b = v.match(/(\w+)\s+(\w+)\s+(\w+)/) if (b) { var x = b[2], S = b[3] d.push(S) var A = n[S] f[S] = x var w = G_[x] void 0 !== A && (c.push(A), (h[A] = w)) } } if (v === e.HeaderEndToken) { u = !0 break } a && (i.push(v), o++) } for (var T = [], M = 0, E = 0, C = d; E < C.length; E++) { var k = C[E], R = f[k] if (f.hasOwnProperty(k)) { var I = n[k] void 0 !== I && (T[I] = M) } M += j_[G_[R]] } var N = this.decodeSphericalHarmonicsFromSectionHeader(d, n) return { headerLines: i, headerStartLine: r, headerEndLine: o, fieldTypes: h, fieldIds: c, fieldOffsets: T, bytesPerVertex: M, vertexCount: s, dataSizeBytes: M * s, endOfHeader: u, sectionName: l, sphericalHarmonicsDegree: N.degree, sphericalHarmonicsCoefficientsPerChannel: N.coefficientsPerChannel, sphericalHarmonicsDegree1Fields: N.degree1Fields, sphericalHarmonicsDegree2Fields: N.degree2Fields, } }, }, { key: 'decodeSphericalHarmonicsFromSectionHeader', value: function (e, t) { var n, r, i = 0, a = L(e) try { for (a.s(); !(r = a.n()).done; ) { r.value.startsWith('f_rest') && i++ } } catch (d) { a.e(d) } finally { a.f() } var o = 0 ;((n = i / 3) >= 3 && (o = 1), n >= 8 && (o = 2)) for (var s = [], u = [], l = 0; l < 3; l++) { if (o >= 1) for (var c = 0; c < 3; c++) s.push(t['f_rest_' + (c + n * l)]) if (o >= 2) for (var h = 0; h < 5; h++) u.push(t['f_rest_' + (h + n * l + 3)]) } return { degree: o, coefficientsPerChannel: n, degree1Fields: s, degree2Fields: u, } }, }, { key: 'readHeaderFromBuffer', value: function (t) { for (var n = new TextDecoder(), r = 0, i = '', a = 100; ; ) { if (r + a >= t.byteLength) throw new Error('End of file reached while searching for end of header') var o = new Uint8Array(t, r, a) if (((i += n.decode(o)), (r += a), e.checkBufferForEndHeader(t, r, 200, n))) break } return i }, }, ], [ { key: 'getHeaderSectionNames', value: function (e) { var t, n = [], r = L(e) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value if (i.startsWith('element')) { var a, o = i.split(' '), s = 0, u = L(o) try { for (u.s(); !(a = u.n()).done; ) { var l = a.value.trim() l.length > 0 && 2 === ++s && n.push(l) } } catch (c) { u.e(c) } finally { u.f() } } } } catch (c) { r.e(c) } finally { r.f() } return n }, }, { key: 'checkTextForEndHeader', value: function (t) { return !!t.includes(e.HeaderEndToken) }, }, { key: 'checkBufferForEndHeader', value: function (t, n, r, i) { var a = new Uint8Array(t, Math.max(0, n - r), r), o = i.decode(a) return e.checkTextForEndHeader(o) }, }, { key: 'extractHeaderFromBufferToText', value: function (t) { for (var n = new TextDecoder(), r = 0, i = '', a = 100; ; ) { if (r + a >= t.byteLength) throw new Error('End of file reached while searching for end of header') var o = new Uint8Array(t, r, a) if (((i += n.decode(o)), (r += a), e.checkBufferForEndHeader(t, r, 200, n))) break } return i }, }, { key: 'convertHeaderTextToLines', value: function (t) { for (var n = t.split('\n'), r = [], i = 0; i < n.length; i++) { var a = n[i].trim() if ((r.push(a), a === e.HeaderEndToken)) break } return r }, }, { key: 'determineHeaderFormatFromHeaderText', value: function (t) { for ( var n = e.convertHeaderTextToLines(t), r = V_, i = 0; i < n.length; i++ ) { var a = n[i].trim() if (a.startsWith('element chunk') || a.match(/[A-Za-z]*packed_[A-Za-z]*/)) r = W_ else if (a.startsWith('element codebook_centers')) r = H_ else if (a === e.HeaderEndToken) break } return r }, }, { key: 'determineHeaderFormatFromPlyBuffer', value: function (t) { var n = e.extractHeaderFromBufferToText(t) return e.determineHeaderFormatFromHeaderText(n) }, }, { key: 'readVertex', value: function (e, t, n, r, i, a) { var o, s = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6], u = n * t.bytesPerVertex + r, l = t.fieldOffsets, c = t.fieldTypes, h = L(i) try { for (h.s(); !(o = h.n()).done; ) { var d = o.value, f = c[d] 3 === f ? (a[d] = e.getFloat32(u + l[d], !0)) : 4 === f ? (a[d] = e.getInt16(u + l[d], !0)) : 5 === f ? (a[d] = e.getUint16(u + l[d], !0)) : 1 === f ? (a[d] = e.getInt32(u + l[d], !0)) : 2 === f ? (a[d] = e.getUint32(u + l[d], !0)) : 6 === f && (a[d] = s ? e.getUint8(u + l[d]) / 255 : e.getUint8(u + l[d])) } } catch (p) { h.e(p) } finally { h.f() } }, }, ] ) })() M(Q_, 'HeaderEndToken', 'end_header') var q_ = [ 'scale_0', 'scale_1', 'scale_2', 'rot_0', 'rot_1', 'rot_2', 'rot_3', 'x', 'y', 'z', 'f_dc_0', 'f_dc_1', 'f_dc_2', 'opacity', 'red', 'green', 'blue', 'f_rest_0', ], X_ = q_.map(function (e, t) { return t }), Y_ = C(X_, 18), K_ = Y_[0], Z_ = Y_[1], J_ = Y_[2], $_ = Y_[3], eb = Y_[4], tb = Y_[5], nb = Y_[6], rb = Y_[7], ib = Y_[8], ab = Y_[9], ob = Y_[10], sb = Y_[11], ub = Y_[12], lb = Y_[13], cb = Y_[14], hb = Y_[15], db = Y_[16], fb = Y_[17], pb = (function () { function e() { ;(A(this, e), (this.plyParserutils = new Q_())) } return T( e, [ { key: 'decodeHeaderLines', value: function (e) { var t = 0 e.forEach(function (e) { e.includes('f_rest_') && t++ }) var n = 0 t >= 45 ? (n = 45) : t >= 24 ? (n = 24) : t >= 9 && (n = 9) var r = Array.from(Array(Math.max(n - 1, 0))).map(function (e, t) { return 'f_rest_'.concat(t + 1) }), i = [].concat(q_, I(r)), a = i.map(function (e, t) { return t }), o = a.reduce(function (e, t) { return ((e[i[t]] = t), e) }, {}), s = this.plyParserutils.decodeSectionHeader(e, o, 0) return ( (s.splatCount = s.vertexCount), (s.bytesPerSplat = s.bytesPerVertex), (s.fieldsToReadIndexes = a), s ) }, }, { key: 'decodeHeaderText', value: function (e) { var t = Q_.convertHeaderTextToLines(e), n = this.decodeHeaderLines(t) return ( (n.headerText = e), (n.headerSizeBytes = e.indexOf(Q_.HeaderEndToken) + Q_.HeaderEndToken.length + 1), n ) }, }, { key: 'decodeHeaderFromBuffer', value: function (e) { var t = this.plyParserutils.readHeaderFromBuffer(e) return this.decodeHeaderText(t) }, }, { key: 'findSplatData', value: function (e, t) { return new DataView(e, t.headerSizeBytes) }, }, { key: 'parseToUncompressedSplatBufferSection', value: function (t, n, r, i, a, o, s) { var u = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0 u = Math.min(u, t.sphericalHarmonicsDegree) for ( var l = I_.CompressionLevels[0].SphericalHarmonicsDegrees[u].BytesPerSplat, c = n; c <= r; c++ ) { var h = e.parseToUncompressedSplat(i, c, t, a, u), d = c * l + s I_.writeSplatDataToSectionBuffer(h, o, d, 0, u) } }, }, { key: 'parseToUncompressedSplatArraySection', value: function (t, n, r, i, a, o) { var s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0 s = Math.min(s, t.sphericalHarmonicsDegree) for (var u = n; u <= r; u++) { var l = e.parseToUncompressedSplat(i, u, t, a, s) o.addSplat(l) } }, }, { key: 'decodeSectionSplatData', value: function (t, n, r, i) { i = Math.min(i, r.sphericalHarmonicsDegree) for (var a = new Hu(i), o = 0; o < n; o++) { var s = e.parseToUncompressedSplat(t, o, r, 0, i) a.addSplat(s) } return a }, }, { key: 'parseToUncompressedSplatArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = this.decodeHeaderFromBuffer(e), r = n.splatCount, i = this.findSplatData(e, n) return this.decodeSectionSplatData(i, r, n, t) }, }, ], [ { key: 'readSplat', value: function (e, t, n, r, i) { return Q_.readVertex(e, t, n, r, t.fieldsToReadIndexes, i, !0) }, }, ] ) })() ;((p = pb), M( pb, 'parseToUncompressedSplat', (function () { for ( var e = [], t = new fh(), n = Hu.OFFSET.X, r = Hu.OFFSET.Y, i = Hu.OFFSET.Z, a = Hu.OFFSET.SCALE0, o = Hu.OFFSET.SCALE1, s = Hu.OFFSET.SCALE2, u = Hu.OFFSET.ROTATION0, l = Hu.OFFSET.ROTATION1, c = Hu.OFFSET.ROTATION2, h = Hu.OFFSET.ROTATION3, d = Hu.OFFSET.FDC0, f = Hu.OFFSET.FDC1, v = Hu.OFFSET.FDC2, m = Hu.OFFSET.OPACITY, g = [], y = 0; y < 45; y++ ) g[y] = Hu.OFFSET.FRC0 + y return function (y, _, b) { var x = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, S = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0 ;((S = Math.min(S, b.sphericalHarmonicsDegree)), p.readSplat(y, b, _, x, e)) var A = Hu.createSplat(S) if ( (void 0 !== e[K_] ? ((A[a] = Math.exp(e[K_])), (A[o] = Math.exp(e[Z_])), (A[s] = Math.exp(e[J_]))) : ((A[a] = 0.01), (A[o] = 0.01), (A[s] = 0.01)), void 0 !== e[ob] ? ((A[d] = 255 * e[ob]), (A[f] = 255 * e[sb]), (A[v] = 255 * e[ub])) : void 0 !== e[cb] ? ((A[d] = 255 * e[cb]), (A[f] = 255 * e[hb]), (A[v] = 255 * e[db])) : ((A[d] = 0), (A[f] = 0), (A[v] = 0)), void 0 !== e[lb] && (A[m] = (1 / (1 + Math.exp(-e[lb]))) * 255), (A[d] = Nu(Math.floor(A[d]), 0, 255)), (A[f] = Nu(Math.floor(A[f]), 0, 255)), (A[v] = Nu(Math.floor(A[v]), 0, 255)), (A[m] = Nu(Math.floor(A[m]), 0, 255)), S >= 1 && void 0 !== e[fb]) ) { for (var w = 0; w < 9; w++) A[g[w]] = e[b.sphericalHarmonicsDegree1Fields[w]] if (S >= 2) for (var T = 0; T < 15; T++) A[g[9 + T]] = e[b.sphericalHarmonicsDegree2Fields[T]] } return ( t.set(e[$_], e[eb], e[tb], e[nb]), t.normalize(), (A[u] = t.x), (A[l] = t.y), (A[c] = t.z), (A[h] = t.w), (A[n] = e[rb]), (A[r] = e[ib]), (A[i] = e[ab]), A ) } })() )) var vb = [ 'features_dc', 'features_rest_0', 'features_rest_1', 'features_rest_2', 'features_rest_3', 'features_rest_4', 'features_rest_5', 'features_rest_6', 'features_rest_7', 'features_rest_8', 'features_rest_9', 'features_rest_10', 'features_rest_11', 'features_rest_12', 'features_rest_13', 'features_rest_14', 'opacity', 'scaling', 'rotation_re', 'rotation_im', ], mb = vb.map(function (e, t) { return t }), gb = [ 'scale_0', 'scale_1', 'scale_2', 'rot_0', 'rot_1', 'rot_2', 'rot_3', 'x', 'y', 'z', 'f_dc_0', 'f_dc_1', 'f_dc_2', 'opacity', 'red', 'green', 'blue', 'f_rest_0', 'f_rest_1', 'f_rest_2', 'f_rest_3', 'f_rest_4', 'f_rest_5', 'f_rest_6', 'f_rest_7', 'f_rest_8', 'f_rest_9', 'f_rest_10', 'f_rest_11', 'f_rest_12', 'f_rest_13', 'f_rest_14', 'f_rest_15', 'f_rest_16', 'f_rest_17', 'f_rest_18', 'f_rest_19', 'f_rest_20', 'f_rest_21', 'f_rest_22', 'f_rest_23', 'f_rest_24', 'f_rest_25', 'f_rest_26', 'f_rest_27', 'f_rest_28', 'f_rest_29', 'f_rest_30', 'f_rest_31', 'f_rest_32', 'f_rest_33', 'f_rest_34', 'f_rest_35', 'f_rest_36', 'f_rest_37', 'f_rest_38', 'f_rest_39', 'f_rest_40', 'f_rest_41', 'f_rest_42', 'f_rest_43', 'f_rest_44', 'f_rest_45', ], yb = gb.map(function (e, t) { return t }), _b = C(yb, 14), bb = _b[0], xb = _b[1], Sb = _b[2], Ab = _b[3], wb = _b[4], Tb = _b[5], Mb = _b[6], Eb = _b[7], Cb = _b[8], kb = _b[9], Rb = _b[10], Ib = _b[11], Nb = _b[12], Pb = _b[13], Lb = Rb, Db = Ib, Ob = Nb, Fb = function (e) { var t = (31744 & e) >> 10, n = 1023 & e return ( (e >> 15 ? -1 : 1) * (t ? 31 === t ? n ? NaN : 1 / 0 : Math.pow(2, t - 15) * (1 + n / 1024) : (n / 1024) * 6103515625e-14) ) }, Bb = (function () { function e() { ;(A(this, e), (this.plyParserutils = new Q_())) } return T( e, [ { key: 'decodeSectionHeadersFromHeaderLines', value: function (e) { for ( var t, n = yb.reduce(function (e, t) { return ((e[gb[t]] = t), e) }, {}), r = mb.reduce(function (e, t) { return ((e[vb[t]] = t), e) }, {}), i = Q_.getHeaderSectionNames(e), a = 0; a < i.length; a++ ) { 'codebook_centers' === i[a] && (t = a) } for (var o = 0, s = !1, u = [], l = 0; !s; ) { var c = void 0 ;((s = (c = l === t ? this.plyParserutils.decodeSectionHeader(e, r, o) : this.plyParserutils.decodeSectionHeader(e, n, o)).endOfHeader), (o = c.headerEndLine + 1), s || ((c.splatCount = c.vertexCount), (c.bytesPerSplat = c.bytesPerVertex)), u.push(c), l++) } return u }, }, { key: 'decodeSectionHeadersFromHeaderText', value: function (e) { var t = Q_.convertHeaderTextToLines(e) return this.decodeSectionHeadersFromHeaderLines(t) }, }, { key: 'getSplatCountFromSectionHeaders', value: function (e) { var t, n = 0, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value 'codebook_centers' !== i.sectionName && (n += i.vertexCount) } } catch (a) { r.e(a) } finally { r.f() } return n }, }, { key: 'decodeHeaderFromHeaderText', value: function (e) { var t = e.indexOf(Q_.HeaderEndToken) + Q_.HeaderEndToken.length + 1, n = this.decodeSectionHeadersFromHeaderText(e) return { headerSizeBytes: t, sectionHeaders: n, splatCount: this.getSplatCountFromSectionHeaders(n), } }, }, { key: 'decodeHeaderFromBuffer', value: function (e) { var t = this.plyParserutils.readHeaderFromBuffer(e) return this.decodeHeaderFromHeaderText(t) }, }, { key: 'findVertexData', value: function (e, t, n) { for ( var r = t.headerSizeBytes, i = 0; i < n && i < t.sectionHeaders.length; i++ ) { r += t.sectionHeaders[i].dataSizeBytes } return new DataView(e, r, t.sectionHeaders[n].dataSizeBytes) }, }, { key: 'decodeCodeBook', value: function (e, t) { for (var n = [], r = [], i = 0; i < t.vertexCount; i++) { Q_.readVertex(e, t, i, 0, mb, n) var a, o = L(mb) try { for (o.s(); !(a = o.n()).done; ) { var s = a.value, u = mb[s], l = r[u] ;(l || (r[u] = l = []), l.push(n[s])) } } catch (p) { o.e(p) } finally { o.f() } } for (var c = 0; c < r.length; c++) for (var h = r[c], d = 0; d < h.length; d++) { var f = Fb(h[d]) h[d] = 16 === c ? Math.round((1 / (1 + Math.exp(-f))) * 255) : 0 === c ? Math.round(255 * (0.5 + 0.28209479177387814 * f)) : 17 === c ? Math.exp(f) : f } return r }, }, { key: 'decodeSectionSplatData', value: function (t, n, r, i, a) { a = Math.min(a, r.sphericalHarmonicsDegree) for (var o = new Hu(a), s = 0; s < n; s++) { var u = e.parseToUncompressedSplat(t, s, r, i, 0, a) o.addSplat(u) } return o }, }, { key: 'parseToUncompressedSplatArray', value: function (e) { for ( var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = [], i = this.decodeHeaderFromBuffer(e, n), a = 0; a < i.sectionHeaders.length; a++ ) { var o = i.sectionHeaders[a] if ('codebook_centers' === o.sectionName) { var s = this.findVertexData(e, i, a) t = this.decodeCodeBook(s, o) } } for (var u = 0; u < i.sectionHeaders.length; u++) { var l = i.sectionHeaders[u] if ('codebook_centers' !== l.sectionName) { var c = l.vertexCount, h = this.findVertexData(e, i, u), d = this.decodeSectionSplatData(h, c, l, t, n) r.push(d) } } for (var f = new Hu(n), p = 0, v = r; p < v.length; p++) { var m, g = L(v[p].splats) try { for (g.s(); !(m = g.n()).done; ) { var y = m.value f.addSplat(y) } } catch (_) { g.e(_) } finally { g.f() } } return f }, }, ], [ { key: 'readSplat', value: function (e, t, n, r, i) { return Q_.readVertex(e, t, n, r, yb, i, !1) }, }, ] ) })() ;((_ = Bb), M( Bb, 'parseToUncompressedSplat', (function () { for ( var e = [], t = new fh(), n = Hu.OFFSET.X, r = Hu.OFFSET.Y, i = Hu.OFFSET.Z, a = Hu.OFFSET.SCALE0, o = Hu.OFFSET.SCALE1, s = Hu.OFFSET.SCALE2, u = Hu.OFFSET.ROTATION0, l = Hu.OFFSET.ROTATION1, c = Hu.OFFSET.ROTATION2, h = Hu.OFFSET.ROTATION3, d = Hu.OFFSET.FDC0, f = Hu.OFFSET.FDC1, p = Hu.OFFSET.FDC2, v = Hu.OFFSET.OPACITY, m = [], g = 0; g < 45; g++ ) m[g] = Hu.OFFSET.FRC0 + g return function (g, y, b, x) { var S = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, A = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0 ;((A = Math.min(A, b.sphericalHarmonicsDegree)), _.readSplat(g, b, y, S, e)) var w = Hu.createSplat(A) if ( (void 0 !== e[bb] ? ((w[a] = x[17][e[bb]]), (w[o] = x[17][e[xb]]), (w[s] = x[17][e[Sb]])) : ((w[a] = 0.01), (w[o] = 0.01), (w[s] = 0.01)), void 0 !== e[Rb] ? ((w[d] = x[0][e[Rb]]), (w[f] = x[0][e[Ib]]), (w[p] = x[0][e[Nb]])) : void 0 !== e[Lb] ? ((w[d] = 255 * e[Lb]), (w[f] = 255 * e[Db]), (w[p] = 255 * e[Ob])) : ((w[d] = 0), (w[f] = 0), (w[p] = 0)), void 0 !== e[Pb] && (w[v] = x[16][e[Pb]]), (w[d] = Nu(Math.floor(w[d]), 0, 255)), (w[f] = Nu(Math.floor(w[f]), 0, 255)), (w[p] = Nu(Math.floor(w[p]), 0, 255)), (w[v] = Nu(Math.floor(w[v]), 0, 255)), A >= 1 && b.sphericalHarmonicsDegree >= 1) ) { for (var T = 0; T < 9; T++) { var M = x[1 + (T % 3)] w[m[T]] = M[e[b.sphericalHarmonicsDegree1Fields[T]]] } if (A >= 2 && b.sphericalHarmonicsDegree >= 2) for (var E = 0; E < 15; E++) { var C = x[4 + (E % 5)] w[m[9 + E]] = C[e[b.sphericalHarmonicsDegree2Fields[E]]] } } var k = x[18][e[Ab]], R = x[19][e[wb]], I = x[19][e[Tb]], N = x[19][e[Mb]] return ( t.set(k, R, I, N), t.normalize(), (w[u] = t.x), (w[l] = t.y), (w[c] = t.z), (w[h] = t.w), (w[n] = Fb(e[Eb])), (w[r] = Fb(e[Cb])), (w[i] = Fb(e[kb])), w ) } })() )) var Ub = (function () { return T( function e() { A(this, e) }, null, [ { key: 'parseToUncompressedSplatArray', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = Q_.determineHeaderFormatFromPlyBuffer(e) return n === W_ ? z_.parseToUncompressedSplatArray(e) : n === V_ ? new pb().parseToUncompressedSplatArray(e, t) : n === H_ ? new Bb().parseToUncompressedSplatArray(e, t) : void 0 }, }, ] ) })(), zb = (function () { function e(t, n, r, i) { ;(A(this, e), (this.sectionCount = t), (this.sectionFilters = n), (this.groupingParameters = r), (this.partitionGenerator = i)) } return T( e, [ { key: 'partitionUncompressedSplatArray', value: function (e) { var t, n, r if (this.partitionGenerator) { var i = this.partitionGenerator(e) ;((t = i.groupingParameters), (n = i.sectionCount), (r = i.sectionFilters)) } else ((t = this.groupingParameters), (n = this.sectionCount), (r = this.sectionFilters)) for (var a = [], o = 0; o < n; o++) { for ( var s = new Hu(e.sphericalHarmonicsDegree), u = r[o], l = 0; l < e.splatCount; l++ ) u(l) && s.addSplat(e.splats[l]) a.push(s) } return { splatArrays: a, parameters: t } }, }, ], [ { key: 'getStandardPartitioner', value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(), r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : I_.BucketBlockSize, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : I_.BucketSize return new e(void 0, void 0, void 0, function (e) { var a = Hu.OFFSET.X, o = Hu.OFFSET.Y, s = Hu.OFFSET.Z t <= 0 && (t = e.splatCount) var u = new ph(), l = 0.5 ;(e.splats.forEach(function (e) { var t ;(u.set(e[a], e[o], e[s]).sub(n), ((t = u).x = Math.floor(t.x / l) * l), (t.y = Math.floor(t.y / l) * l), (t.z = Math.floor(t.z / l) * l), (e.centerDist = u.lengthSq())) }), e.splats.sort(function (e, t) { return e.centerDist > t.centerDist ? 1 : -1 })) var c = [], h = [] t = Math.min(e.splatCount, t) for ( var d = Math.ceil(e.splatCount / t), f = 0, p = function () { var e = f ;(c.push(function (n) { return n >= e && n < e + t }), h.push({ blocksSize: r, bucketSize: i }), (f += t)) }, v = 0; v < d; v++ ) p() return { sectionCount: c.length, sectionFilters: c, groupingParameters: h } }) }, }, ] ) })(), Vb = (function () { function e(t, n, r, i, a, o, s) { ;(A(this, e), (this.splatPartitioner = t), (this.alphaRemovalThreshold = n), (this.compressionLevel = r), (this.sectionSize = i), (this.sceneCenter = a ? new ph().copy(a) : void 0), (this.blockSize = o), (this.bucketSize = s)) } return T( e, [ { key: 'generateFromUncompressedSplatArray', value: function (e) { var t = this.splatPartitioner.partitionUncompressedSplatArray(e) return I_.generateFromUncompressedSplatArrays( t.splatArrays, this.alphaRemovalThreshold, this.compressionLevel, this.sceneCenter, this.blockSize, this.bucketSize, t.parameters ) }, }, ], [ { key: 'getStandardGenerator', value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : new ph(), a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : I_.BucketBlockSize, o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : I_.BucketSize return new e(zb.getStandardPartitioner(r, i, a, o), t, n, r, i, a, o) }, }, ] ) })(), Hb = 0, Wb = 1, Gb = 2, jb = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return (x(t, e), T(t)) })(m(Error)), Qb = 0, qb = 1, Xb = 2 function Yb(e, t) { var n, r = 0, i = L(e) try { for (i.s(); !(n = i.n()).done; ) { r += n.value.sizeBytes } } catch (l) { i.e(l) } finally { i.f() } ;(!t || t.byteLength < r) && (t = new ArrayBuffer(r)) var a, o = 0, s = L(e) try { for (s.s(); !(a = s.n()).done; ) { var u = a.value ;(new Uint8Array(t, o, u.sizeBytes).set(u.data), (o += u.sizeBytes)) } } catch (l) { s.e(l) } finally { s.f() } return t } function Kb(e, t, n, r, i, a, o, s) { return t ? Vb.getStandardGenerator(n, r, i, a, o, s).generateFromUncompressedSplatArray(e) : I_.generateFromUncompressedSplatArrays([e], n, 0, new ph()) } var Zb = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'loadFromURL', value: function (t, n, r, i, a, o) { var s = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6], u = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0, l = arguments.length > 8 ? arguments[8] : void 0, c = arguments.length > 9 ? arguments[9] : void 0, h = arguments.length > 10 ? arguments[10] : void 0, d = arguments.length > 11 ? arguments[11] : void 0, f = arguments.length > 12 ? arguments[12] : void 0, p = r ? Qb : qb s && (p = qb) var v, m, g, y, _, b = zy.ProgressiveLoadSectionSize, x = I_.HeaderSizeBytes + I_.SectionHeaderSizeBytes, S = 0, A = 0, w = !1, T = !1, M = !1, E = Fu(), C = 0, k = 0, R = 0, I = '', N = null, P = [], L = new TextDecoder(), D = new pb() return ( n && n(0, '0%', Hb), Iu( t, function (e, t, a) { var o = e >= 100 if ( (a && (P.push({ data: a, sizeBytes: a.byteLength, startBytes: R, endBytes: R + a.byteLength, }), (R += a.byteLength)), p === Xb) ) o && E.resolve(P) else { if (w) { if (M && !T) { var s = N.headerSizeBytes + N.chunkElement.storageSizeBytes ;(y = Yb(P, y)).byteLength >= s && (z_.readElementData(N.chunkElement, y, N.headerSizeBytes), (C = s), (k = s), (T = !0)) } } else if (((I += L.decode(a)), Q_.checkTextForEndHeader(I))) { var l = Q_.determineHeaderFormatFromHeaderText(I) if (l === V_) ((N = D.decodeHeaderText(I)), (S = N.splatCount), (T = !0), (M = !1)) else { if (l !== W_) { if (r) throw new jb( 'PlyLoader.loadFromURL() -> Selected Ply format cannot be directly loaded.' ) return void (p = Xb) } ;((N = z_.decodeHeaderText(I)), (S = N.vertexElement.count), (M = !0)) } u = Math.min(u, N.sphericalHarmonicsDegree) var c = I_.CompressionLevels[0].SphericalHarmonicsDegrees[u], h = x + c.BytesPerSplat * S ;(p === Qb ? ((m = new ArrayBuffer(h)), I_.writeHeaderToBuffer( { versionMajor: I_.CurrentMajorVersion, versionMinor: I_.CurrentMinorVersion, maxSectionCount: 1, sectionCount: 1, maxSplatCount: S, splatCount: A, compressionLevel: 0, sceneCenter: new ph(), }, m )) : (_ = new Hu(u)), (C = N.headerSizeBytes), (k = N.headerSizeBytes), (w = !0)) } if (w && T) { if (P.length > 0) if (((v = Yb(P, v)), R - C > b || o)) { var d = R - k, f = Math.floor(d / N.bytesPerSplat), O = f * N.bytesPerSplat, F = d - O, B = A + f, U = k - P[0].startBytes, z = new DataView(v, U, O), V = I_.CompressionLevels[0].SphericalHarmonicsDegrees[u], H = A * V.BytesPerSplat + x if ( (p === Qb ? M ? z_.parseToUncompressedSplatBufferSection( N.chunkElement, N.vertexElement, 0, f - 1, A, z, 0, m, H ) : D.parseToUncompressedSplatBufferSection( N, 0, f - 1, z, 0, m, H, u ) : M ? z_.parseToUncompressedSplatArraySection( N.chunkElement, N.vertexElement, 0, f - 1, A, z, 0, _ ) : D.parseToUncompressedSplatArraySection( N, 0, f - 1, z, 0, _, u ), (A = B), p === Qb && (g || (I_.writeSectionHeaderToBuffer( { maxSplatCount: S, splatCount: A, bucketSize: 0, bucketCount: 0, bucketBlockSize: 0, compressionScaleRange: 0, storageSizeBytes: 0, fullBucketCount: 0, partiallyFilledBucketCount: 0, sphericalHarmonicsDegree: u, }, 0, m, I_.HeaderSizeBytes ), (g = new I_(m, !1))), g.updateLoadedCounts(1, A), i && i(g, o)), (C += b), (k += O), 0 === F) ) P = [] else { for (var W = [], G = 0, j = P.length - 1; j >= 0; j--) { var Q = P[j] if (((G += Q.sizeBytes), W.unshift(Q), G >= F)) break } P = W } } o && (p === Qb ? E.resolve(g) : E.resolve(_)) } } n && n(e, t, Hb) }, !1, l ).then(function () { return ( n && n(0, '0%', Wb), E.promise.then(function (t) { if ((n && n(100, '100%', Gb), p === Xb)) { var r = P.map(function (e) { return e.data }) return new Blob(r).arrayBuffer().then(function (t) { return e.loadFromFileData(t, a, o, s, u, c, h, d, f) }) } return p === Qb ? t : Du(function () { return Kb(t, s, a, o, c, h, d, f) }) }) ) }) ) }, }, { key: 'loadFromFileData', value: function (e, t, n, r) { var i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, a = arguments.length > 5 ? arguments[5] : void 0, o = arguments.length > 6 ? arguments[6] : void 0, s = arguments.length > 7 ? arguments[7] : void 0, u = arguments.length > 8 ? arguments[8] : void 0 return Du(function () { return Ub.parseToUncompressedSplatArray(e, i) }).then(function (e) { return Kb(e, r, t, n, a, o, s, u) }) }, }, ]) })(), Jb = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'parseToUncompressedSplatBufferSection', value: function (t, n, r, i, a, o) { for ( var s = I_.CompressionLevels[0].BytesPerCenter, u = I_.CompressionLevels[0].BytesPerScale, l = I_.CompressionLevels[0].BytesPerRotation, c = I_.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat, h = t; h <= n; h++ ) { var d = h * e.RowSizeBytes + i, f = new Float32Array(r, d, 3), p = new Float32Array(r, d + e.CenterSizeBytes, 3), v = new Uint8Array(r, d + e.CenterSizeBytes + e.ScaleSizeBytes, 4), m = new Uint8Array( r, d + e.CenterSizeBytes + e.ScaleSizeBytes + e.RotationSizeBytes, 4 ), g = new fh( (m[1] - 128) / 128, (m[2] - 128) / 128, (m[3] - 128) / 128, (m[0] - 128) / 128 ) g.normalize() var y = h * c + o, _ = new Float32Array(a, y, 3), b = new Float32Array(a, y + s, 3), x = new Float32Array(a, y + s + u, 4), S = new Uint8Array(a, y + s + u + l, 4) ;((_[0] = f[0]), (_[1] = f[1]), (_[2] = f[2]), (b[0] = p[0]), (b[1] = p[1]), (b[2] = p[2]), (x[0] = g.w), (x[1] = g.x), (x[2] = g.y), (x[3] = g.z), (S[0] = v[0]), (S[1] = v[1]), (S[2] = v[2]), (S[3] = v[3])) } }, }, { key: 'parseToUncompressedSplatArraySection', value: function (t, n, r, i, a) { for (var o = t; o <= n; o++) { var s = o * e.RowSizeBytes + i, u = new Float32Array(r, s, 3), l = new Float32Array(r, s + e.CenterSizeBytes, 3), c = new Uint8Array(r, s + e.CenterSizeBytes + e.ScaleSizeBytes, 4), h = new Uint8Array( r, s + e.CenterSizeBytes + e.ScaleSizeBytes + e.RotationSizeBytes, 4 ), d = new fh( (h[1] - 128) / 128, (h[2] - 128) / 128, (h[3] - 128) / 128, (h[0] - 128) / 128 ) ;(d.normalize(), a.addSplatFromComonents( u[0], u[1], u[2], l[0], l[1], l[2], d.w, d.x, d.y, d.z, c[0], c[1], c[2], c[3] )) } }, }, { key: 'parseStandardSplatToUncompressedSplatArray', value: function (t) { for (var n = t.byteLength / e.RowSizeBytes, r = new Hu(), i = 0; i < n; i++) { var a = i * e.RowSizeBytes, o = new Float32Array(t, a, 3), s = new Float32Array(t, a + e.CenterSizeBytes, 3), u = new Uint8Array(t, a + e.CenterSizeBytes + e.ScaleSizeBytes, 4), l = new Uint8Array( t, a + e.CenterSizeBytes + e.ScaleSizeBytes + e.ColorSizeBytes, 4 ), c = new fh( (l[1] - 128) / 128, (l[2] - 128) / 128, (l[3] - 128) / 128, (l[0] - 128) / 128 ) ;(c.normalize(), r.addSplatFromComonents( o[0], o[1], o[2], s[0], s[1], s[2], c.w, c.x, c.y, c.z, u[0], u[1], u[2], u[3] )) } return r }, }, ]) })() function $b(e, t, n, r, i, a, o, s) { return t ? Vb.getStandardGenerator(n, r, i, a, o, s).generateFromUncompressedSplatArray(e) : I_.generateFromUncompressedSplatArrays([e], n, 0, new ph()) } ;(M(Jb, 'RowSizeBytes', 32), M(Jb, 'CenterSizeBytes', 12), M(Jb, 'ScaleSizeBytes', 12), M(Jb, 'RotationSizeBytes', 4), M(Jb, 'ColorSizeBytes', 4)) var ex, tx = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'loadFromURL', value: function (t, n, r, i, a, o) { var s = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6], u = arguments.length > 7 ? arguments[7] : void 0, l = arguments.length > 8 ? arguments[8] : void 0, c = arguments.length > 9 ? arguments[9] : void 0, h = arguments.length > 10 ? arguments[10] : void 0, d = arguments.length > 11 ? arguments[11] : void 0, f = r ? Qb : qb s && (f = qb) var p, v, m, g, y = I_.HeaderSizeBytes + I_.SectionHeaderSizeBytes, _ = zy.ProgressiveLoadSectionSize, b = 0, x = 0, S = Fu(), A = 0, w = 0, T = [] return ( n && n(0, '0%', Hb), Iu( t, function (e, t, a, o) { var s = e >= 100 if ((a && T.push(a), f !== Xb)) if (o) { if (!p) { ;((b = o / Jb.RowSizeBytes), (p = new ArrayBuffer(o))) var u = I_.CompressionLevels[0].SphericalHarmonicsDegrees[0].BytesPerSplat f === Qb ? ((v = new ArrayBuffer(y + u * b)), I_.writeHeaderToBuffer( { versionMajor: I_.CurrentMajorVersion, versionMinor: I_.CurrentMinorVersion, maxSectionCount: 1, sectionCount: 1, maxSplatCount: b, splatCount: x, compressionLevel: 0, sceneCenter: new ph(), }, v )) : (g = new Hu(0)) } if (a) { new Uint8Array(p, w, a.byteLength).set(new Uint8Array(a)) var l = (w += a.byteLength) - A if (l > _ || s) { var c = (s ? l : _) / Jb.RowSizeBytes, h = x + c ;(f === Qb ? Jb.parseToUncompressedSplatBufferSection(x, h - 1, p, 0, v, y) : Jb.parseToUncompressedSplatArraySection(x, h - 1, p, 0, g), (x = h), f === Qb && (m || (I_.writeSectionHeaderToBuffer( { maxSplatCount: b, splatCount: x, bucketSize: 0, bucketCount: 0, bucketBlockSize: 0, compressionScaleRange: 0, storageSizeBytes: 0, fullBucketCount: 0, partiallyFilledBucketCount: 0, }, 0, v, I_.HeaderSizeBytes ), (m = new I_(v, !1))), m.updateLoadedCounts(1, x), i && i(m, s)), (A += _)) } } ;(s && (f === Qb ? S.resolve(m) : S.resolve(g)), n && n(e, t, Hb)) } else { if (r) throw new jb( 'Cannon directly load .splat because no file size info is available.' ) f = Xb } else s && S.resolve(T) }, !1, u ).then(function () { return ( n && n(0, '0%', Wb), S.promise.then(function (t) { return ( n && n(100, '100%', Gb), f === Xb ? new Blob(T).arrayBuffer().then(function (t) { return e.loadFromFileData(t, a, o, s, l, c, h, d) }) : f === Qb ? t : Du(function () { return $b(t, s, a, o, l, c, h, d) }) ) }) ) }) ) }, }, { key: 'loadFromFileData', value: function (e, t, n, r, i, a, o, s) { return Du(function () { return $b( Jb.parseStandardSplatToUncompressedSplatArray(e), r, t, n, i, a, o, s ) }) }, }, ]) })(), nx = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'checkVersion', value: function (e) { var t = I_.CurrentMajorVersion, n = I_.CurrentMinorVersion, r = I_.parseHeader(e) if ((r.versionMajor === t && r.versionMinor >= n) || r.versionMajor > t) return !0 throw new Error( 'KSplat version not supported: v' .concat(r.versionMajor, '.') .concat(r.versionMinor, '. ') + 'Minimum required: v'.concat(t, '.').concat(n) ) }, }, { key: 'loadFromURL', value: function (t, n, r, i, a) { var o, s, u, l, c, h = !1, d = !1, f = [], p = !1, v = !1, m = 0, g = 0, y = 0, _ = !1, b = !1, x = !1, S = [], A = Fu(), w = 0, T = function () { !v && !p && h && m >= I_.HeaderSizeBytes + I_.SectionHeaderSizeBytes * l.maxSectionCount && ((v = !0), new Blob(S).arrayBuffer().then(function (e) { ;((v = !1), (p = !0), (c = new ArrayBuffer(l.maxSectionCount * I_.SectionHeaderSizeBytes)), new Uint8Array(c).set( new Uint8Array( e, I_.HeaderSizeBytes, l.maxSectionCount * I_.SectionHeaderSizeBytes ) ), (f = I_.parseSectionHeaders(l, c, 0, !1))) for (var t = 0, n = 0; n < l.maxSectionCount; n++) t += f[n].storageSizeBytes var r = I_.HeaderSizeBytes + l.maxSectionCount * I_.SectionHeaderSizeBytes + t if (!o) { o = new ArrayBuffer(r) for (var i = 0, a = 0; a < S.length; a++) { var s = S[a] ;(new Uint8Array(o, i, s.byteLength).set(new Uint8Array(s)), (i += s.byteLength)) } } y = I_.HeaderSizeBytes + I_.SectionHeaderSizeBytes * l.maxSectionCount for (var u = 0; u <= f.length && u < l.maxSectionCount; u++) y += f[u].storageSizeBytes 0 === w && (w++, window.setTimeout(function () { ;(w--, M()) }, 1)) })) }, M = function () { if (!x) { x = !0 window.setTimeout(function () { if (((x = !1), p)) { if (b) return if (((_ = m >= y), m - g > zy.ProgressiveLoadSectionSize || _)) { ;((g += zy.ProgressiveLoadSectionSize), (b = g >= y), s || (s = new I_(o, !1))) for ( var e = I_.HeaderSizeBytes + I_.SectionHeaderSizeBytes * l.maxSectionCount, t = 0, r = 0, a = 0, u = 0; u < l.maxSectionCount; u++ ) { var c = f[u], h = e + (t + 4 * c.partiallyFilledBucketCount + c.bucketStorageSizeBytes * c.bucketCount) if (!(g >= h)) break r++ var d = g - h, v = I_.CompressionLevels[l.compressionLevel] .SphericalHarmonicsDegrees[c.sphericalHarmonicsDegree] .BytesPerSplat, S = Math.floor(d / v) ;((a += S = Math.min(S, c.maxSplatCount)), s.updateLoadedCounts(r, a), s.updateSectionLoadedCounts(u, S), (t += c.storageSizeBytes)) } i(s, b) var w = (g / y) * 100, T = w.toFixed(2) + '%' ;(n && n(w, T, Hb), b ? A.resolve(s) : M()) } } }, zy.ProgressiveLoadSectionDelayDuration) } } return Iu( t, function (t, i, a) { ;(a && (S.push(a), o && new Uint8Array(o, m, a.byteLength).set(new Uint8Array(a)), (m += a.byteLength)), r ? (!h && !d && m >= I_.HeaderSizeBytes && ((d = !0), new Blob(S).arrayBuffer().then(function (t) { ;((u = new ArrayBuffer(I_.HeaderSizeBytes)), new Uint8Array(u).set(new Uint8Array(t, 0, I_.HeaderSizeBytes)), e.checkVersion(u), (d = !1), (h = !0), (l = I_.parseHeader(u)), window.setTimeout(function () { T() }, 1)) })), T(), M()) : n && n(t, i, Hb)) }, !r, a ).then(function (t) { return ( n && n(0, '0%', Wb), (r ? A.promise : e.loadFromFileData(t)).then(function (e) { return (n && n(100, '100%', Gb), e) }) ) }) }, }, { key: 'loadFromFileData', value: function (t) { return Du(function () { return (e.checkVersion(t), new I_(t)) }) }, }, ]) })() M(nx, 'downloadFile', function (e, t) { var n = new Blob([e.bufferData], { type: 'application/octet-stream' }) ;(ex || ((ex = document.createElement('a')), document.body.appendChild(ex)), (ex.download = t), (ex.href = URL.createObjectURL(n)), ex.click()) }) var rx = 0, ix = 1, ax = 2, ox = function (e) { return e.endsWith('.ply') ? ax : e.endsWith('.splat') ? rx : e.endsWith('.ksplat') ? ix : null }, sx = { type: 'change' }, ux = { type: 'start' }, lx = { type: 'end' }, cx = new Wh(), hx = new pp(), dx = Math.cos(70 * zc.DEG2RAD), fx = (function (e) { function t(e, n) { var r ;(A(this, t), ((r = y(this, t)).object = e), (r.domElement = n), (r.domElement.style.touchAction = 'none'), (r.enabled = !0), (r.target = new ph()), (r.minDistance = 0), (r.maxDistance = 1 / 0), (r.minZoom = 0), (r.maxZoom = 1 / 0), (r.minPolarAngle = 0), (r.maxPolarAngle = Math.PI), (r.minAzimuthAngle = -Math.PI / 72), (r.maxAzimuthAngle = Math.PI / 72), (r.enableDamping = !1), (r.dampingFactor = 0.05), (r.enableZoom = !0), (r.zoomSpeed = 1), (r.enableRotate = !0), (r.rotateSpeed = 1), (r.enablePan = !1), (r.panSpeed = 1), (r.screenSpacePanning = !0), (r.keyPanSpeed = 7), (r.zoomToCursor = !1), (r.autoRotate = !1), (r.autoRotateSpeed = 2), (r.keys = { LEFT: 'KeyA', UP: 'KeyW', RIGHT: 'KeyD', BOTTOM: 'KeyS' }), (r.mouseButtons = { LEFT: Gu, MIDDLE: ju, RIGHT: Qu }), (r.touches = { ONE: qu, TWO: Yu }), (r.target0 = r.target.clone()), (r.position0 = r.object.position.clone()), (r.zoom0 = r.object.zoom), (r._domElementKeyEvents = null), (r.getPolarAngle = function () { return u.phi }), (r.getAzimuthalAngle = function () { return u.theta }), (r.getDistance = function () { return this.object.position.distanceTo(this.target) }), (r.listenToKeyEvents = function (e) { ;(e.addEventListener('keydown', K), (r._domElementKeyEvents = e)) }), (r.stopListenToKeyEvents = function () { ;(r._domElementKeyEvents.removeEventListener('keydown', K), (r._domElementKeyEvents = null)) }), (r.saveState = function () { ;(i.target0.copy(i.target), i.position0.copy(i.object.position), (i.zoom0 = i.object.zoom)) }), (r.reset = function () { ;(i.target.copy(i.target0), i.object.position.copy(i.position0), (i.object.zoom = i.zoom0), this.clearDampedRotation(), this.clearDampedPan(), i.object.updateProjectionMatrix(), i.dispatchEvent(sx), i.update(), (o = a.NONE)) }), (r.clearDampedRotation = function () { ;((l.theta = 0), (l.phi = 0)) }), (r.clearDampedPan = function () { h.set(0, 0, 0) }), (r.update = (function () { var t = new ph(), n = new fh().setFromUnitVectors(e.up, new ph(0, 1, 0)), r = n.clone().invert(), d = new ph(), f = new fh(), p = new ph(), v = 2 * Math.PI return function () { ;(n.setFromUnitVectors(e.up, new ph(0, 1, 0)), r.copy(n).invert()) var m = i.object.position ;(t.copy(m).sub(i.target), t.applyQuaternion(n), u.setFromVector3(t), i.autoRotate && o === a.NONE && k(((2 * Math.PI) / 60 / 60) * i.autoRotateSpeed), i.enableDamping ? ((u.theta += l.theta * i.dampingFactor), (u.phi += l.phi * i.dampingFactor)) : ((u.theta += l.theta), (u.phi += l.phi))) var g = i.minAzimuthAngle, y = i.maxAzimuthAngle ;(isFinite(g) && isFinite(y) && (g < -Math.PI ? (g += v) : g > Math.PI && (g -= v), y < -Math.PI ? (y += v) : y > Math.PI && (y -= v), (u.theta = g <= y ? Math.max(g, Math.min(y, u.theta)) : u.theta > (g + y) / 2 ? Math.max(g, u.theta) : Math.min(y, u.theta))), (u.phi = Math.max(i.minPolarAngle, Math.min(i.maxPolarAngle, u.phi))), u.makeSafe(), !0 === i.enableDamping ? i.target.addScaledVector(h, i.dampingFactor) : i.target.add(h), (i.zoomToCursor && T) || i.object.isOrthographicCamera ? (u.radius = F(u.radius)) : (u.radius = F(u.radius * c)), t.setFromSpherical(u), t.applyQuaternion(r), m.copy(i.target).add(t), i.object.lookAt(i.target), !0 === i.enableDamping ? ((l.theta *= 1 - i.dampingFactor), (l.phi *= 1 - i.dampingFactor), h.multiplyScalar(1 - i.dampingFactor)) : (l.set(0, 0, 0), h.set(0, 0, 0))) var _ = !1 if (i.zoomToCursor && T) { var b = null if (i.object.isPerspectiveCamera) { var x = t.length(), A = x - (b = F(x * c)) ;(i.object.position.addScaledVector(S, A), i.object.updateMatrixWorld()) } else if (i.object.isOrthographicCamera) { var M = new ph(w.x, w.y, 0) ;(M.unproject(i.object), (i.object.zoom = Math.max( i.minZoom, Math.min(i.maxZoom, i.object.zoom / c) )), i.object.updateProjectionMatrix(), (_ = !0)) var E = new ph(w.x, w.y, 0) ;(E.unproject(i.object), i.object.position.sub(E).add(M), i.object.updateMatrixWorld(), (b = t.length())) } else (console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' ), (i.zoomToCursor = !1)) null !== b && (this.screenSpacePanning ? i.target .set(0, 0, -1) .transformDirection(i.object.matrix) .multiplyScalar(b) .add(i.object.position) : (cx.origin.copy(i.object.position), cx.direction.set(0, 0, -1).transformDirection(i.object.matrix), Math.abs(i.object.up.dot(cx.direction)) < dx ? e.lookAt(i.target) : (hx.setFromNormalAndCoplanarPoint(i.object.up, i.target), cx.intersectPlane(hx, i.target)))) } else i.object.isOrthographicCamera && ((i.object.zoom = Math.max( i.minZoom, Math.min(i.maxZoom, i.object.zoom / c) )), i.object.updateProjectionMatrix(), (_ = !0)) return ( (c = 1), (T = !1), !!( _ || d.distanceToSquared(i.object.position) > s || 8 * (1 - f.dot(i.object.quaternion)) > s || p.distanceToSquared(i.target) > 0 ) && (i.dispatchEvent(sx), d.copy(i.object.position), f.copy(i.object.quaternion), p.copy(i.target), (_ = !1), !0) ) } })()), (r.dispose = function () { ;(i.domElement.removeEventListener('contextmenu', Z), i.domElement.removeEventListener('pointerdown', Q), i.domElement.removeEventListener('pointercancel', X), i.domElement.removeEventListener('wheel', Y), i.domElement.removeEventListener('pointermove', q), i.domElement.removeEventListener('pointerup', X), null !== i._domElementKeyEvents && (i._domElementKeyEvents.removeEventListener('keydown', K), (i._domElementKeyEvents = null))) })) var i = r, a = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_PAN: 4, TOUCH_DOLLY_PAN: 5, TOUCH_DOLLY_ROTATE: 6, }, o = a.NONE, s = 1e-6, u = new nm(), l = new nm(), c = 1, h = new ph(), d = new Vc(), f = new Vc(), p = new Vc(), v = new Vc(), m = new Vc(), g = new Vc(), _ = new Vc(), b = new Vc(), x = new Vc(), S = new ph(), w = new Vc(), T = !1, M = [], E = {} function C() { return Math.pow(0.95, i.zoomSpeed) } function k(e) { l.theta -= e } function R(e) { l.phi -= e } var I = (function () { var e = new ph() return function (t, n) { ;(e.setFromMatrixColumn(n, 0), e.multiplyScalar(-t), h.add(e)) } })(), N = (function () { var e = new ph() return function (t, n) { ;(!0 === i.screenSpacePanning ? e.setFromMatrixColumn(n, 1) : (e.setFromMatrixColumn(n, 0), e.crossVectors(i.object.up, e)), e.multiplyScalar(t), h.add(e)) } })(), P = (function () { var e = new ph() return function (t, n) { var r = i.domElement if (i.object.isPerspectiveCamera) { var a = i.object.position e.copy(a).sub(i.target) var o = e.length() ;((o *= Math.tan(((i.object.fov / 2) * Math.PI) / 180)), I((2 * t * o) / r.clientHeight, i.object.matrix), N((2 * n * o) / r.clientHeight, i.object.matrix)) } else i.object.isOrthographicCamera ? (I( (t * (i.object.right - i.object.left)) / i.object.zoom / r.clientWidth, i.object.matrix ), N( (n * (i.object.top - i.object.bottom)) / i.object.zoom / r.clientHeight, i.object.matrix )) : (console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' ), (i.enablePan = !1)) } })() function L(e) { i.object.isPerspectiveCamera || i.object.isOrthographicCamera ? (c /= e) : (console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ), (i.enableZoom = !1)) } function D(e) { i.object.isPerspectiveCamera || i.object.isOrthographicCamera ? (c *= e) : (console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ), (i.enableZoom = !1)) } function O(t) { if (i.zoomToCursor) { T = !0 var n = i.domElement.getBoundingClientRect(), r = t.clientX - n.left, a = t.clientY - n.top, o = n.width, s = n.height ;((w.x = (r / o) * 2 - 1), (w.y = (-a / s) * 2 + 1), S.set(w.x, w.y, 1).unproject(e).sub(e.position).normalize()) } } function F(e) { return Math.max(i.minDistance, Math.min(i.maxDistance, e)) } function B(e) { d.set(e.clientX, e.clientY) } function U(e) { v.set(e.clientX, e.clientY) } function z() { if (1 === M.length) d.set(M[0].pageX, M[0].pageY) else { var e = 0.5 * (M[0].pageX + M[1].pageX), t = 0.5 * (M[0].pageY + M[1].pageY) d.set(e, t) } } function V() { if (1 === M.length) v.set(M[0].pageX, M[0].pageY) else { var e = 0.5 * (M[0].pageX + M[1].pageX), t = 0.5 * (M[0].pageY + M[1].pageY) v.set(e, t) } } function H() { var e = M[0].pageX - M[1].pageX, t = M[0].pageY - M[1].pageY, n = Math.sqrt(e * e + t * t) _.set(0, n) } function W(e) { if (1 == M.length) f.set(e.pageX, e.pageY) else { var t = $(e), n = 0.5 * (e.pageX + t.x), r = 0.5 * (e.pageY + t.y) f.set(n, r) } p.subVectors(f, d).multiplyScalar(i.rotateSpeed) var a = i.domElement ;(k((2 * Math.PI * p.x) / a.clientHeight), R((2 * Math.PI * p.y) / a.clientHeight), d.copy(f)) } function G(e) { if (1 === M.length) m.set(e.pageX, e.pageY) else { var t = $(e), n = 0.5 * (e.pageX + t.x), r = 0.5 * (e.pageY + t.y) m.set(n, r) } ;(g.subVectors(m, v).multiplyScalar(i.panSpeed), P(g.x, g.y), v.copy(m)) } function j(e) { var t = $(e), n = e.pageX - t.x, r = e.pageY - t.y, a = Math.sqrt(n * n + r * r) ;(b.set(0, a), x.set(0, Math.pow(b.y / _.y, i.zoomSpeed)), L(x.y), _.copy(b)) } function Q(e) { !1 !== i.enabled && (0 === M.length && (i.domElement.setPointerCapture(e.pointerId), i.domElement.addEventListener('pointermove', q), i.domElement.addEventListener('pointerup', X)), (function (e) { M.push(e) })(e), 'touch' === e.pointerType ? (function (e) { switch ((J(e), M.length)) { case 1: switch (i.touches.ONE) { case qu: if (!1 === i.enableRotate) return ;(z(), (o = a.TOUCH_ROTATE)) break case Xu: if (!1 === i.enablePan) return ;(V(), (o = a.TOUCH_PAN)) break default: o = a.NONE } break case 2: switch (i.touches.TWO) { case Yu: if (!1 === i.enableZoom && !1 === i.enablePan) return ;(i.enableZoom && H(), i.enablePan && V(), (o = a.TOUCH_DOLLY_PAN)) break case Ku: if (!1 === i.enableZoom && !1 === i.enableRotate) return ;(i.enableZoom && H(), i.enableRotate && z(), (o = a.TOUCH_DOLLY_ROTATE)) break default: o = a.NONE } break default: o = a.NONE } o !== a.NONE && i.dispatchEvent(ux) })(e) : (function (e) { var t switch (e.button) { case 0: t = i.mouseButtons.LEFT break case 1: t = i.mouseButtons.MIDDLE break case 2: t = i.mouseButtons.RIGHT break default: t = -1 } switch (t) { case ju: if (!1 === i.enableZoom) return ;(!(function (e) { ;(O(e), _.set(e.clientX, e.clientY)) })(e), (o = a.DOLLY)) break case Gu: if (e.ctrlKey || e.metaKey || e.shiftKey) { if (!1 === i.enablePan) return ;(U(e), (o = a.PAN)) } else { if (!1 === i.enableRotate) return ;(B(e), (o = a.ROTATE)) } break case Qu: if (e.ctrlKey || e.metaKey || e.shiftKey) { if (!1 === i.enableRotate) return ;(B(e), (o = a.ROTATE)) } else { if (!1 === i.enablePan) return ;(U(e), (o = a.PAN)) } break default: o = a.NONE } o !== a.NONE && i.dispatchEvent(ux) })(e)) } function q(e) { !1 !== i.enabled && ('touch' === e.pointerType ? (function (e) { switch ((J(e), o)) { case a.TOUCH_ROTATE: if (!1 === i.enableRotate) return ;(W(e), i.update()) break case a.TOUCH_PAN: if (!1 === i.enablePan) return ;(G(e), i.update()) break case a.TOUCH_DOLLY_PAN: if (!1 === i.enableZoom && !1 === i.enablePan) return ;(!(function (e) { ;(i.enableZoom && j(e), i.enablePan && G(e)) })(e), i.update()) break case a.TOUCH_DOLLY_ROTATE: if (!1 === i.enableZoom && !1 === i.enableRotate) return ;(!(function (e) { ;(i.enableZoom && j(e), i.enableRotate && W(e)) })(e), i.update()) break default: o = a.NONE } })(e) : (function (e) { switch (o) { case a.ROTATE: if (!1 === i.enableRotate) return !(function (e) { ;(f.set(e.clientX, e.clientY), p.subVectors(f, d).multiplyScalar(i.rotateSpeed)) var t = i.domElement ;(k((2 * Math.PI * p.x) / t.clientHeight), R((2 * Math.PI * p.y) / t.clientHeight), d.copy(f), i.update()) })(e) break case a.DOLLY: if (!1 === i.enableZoom) return !(function (e) { ;(b.set(e.clientX, e.clientY), x.subVectors(b, _), x.y > 0 ? L(C()) : x.y < 0 && D(C()), _.copy(b), i.update()) })(e) break case a.PAN: if (!1 === i.enablePan) return !(function (e) { ;(m.set(e.clientX, e.clientY), g.subVectors(m, v).multiplyScalar(i.panSpeed), P(g.x, g.y), v.copy(m), i.update()) })(e) } })(e)) } function X(e) { ;(!(function (e) { delete E[e.pointerId] for (var t = 0; t < M.length; t++) if (M[t].pointerId == e.pointerId) return void M.splice(t, 1) })(e), 0 === M.length && (i.domElement.releasePointerCapture(e.pointerId), i.domElement.removeEventListener('pointermove', q), i.domElement.removeEventListener('pointerup', X)), i.dispatchEvent(lx), (o = a.NONE)) } function Y(e) { !1 !== i.enabled && !1 !== i.enableZoom && o === a.NONE && (e.preventDefault(), i.dispatchEvent(ux), (function (e) { ;(O(e), e.deltaY < 0 ? D(C()) : e.deltaY > 0 && L(C()), i.update()) })(e), i.dispatchEvent(lx)) } function K(e) { !1 !== i.enabled && !1 !== i.enablePan && (function (e) { var t = !1 switch (e.code) { case i.keys.UP: ;(e.ctrlKey || e.metaKey || e.shiftKey ? R((2 * Math.PI * i.rotateSpeed) / i.domElement.clientHeight) : P(0, i.keyPanSpeed), (t = !0)) break case i.keys.BOTTOM: ;(e.ctrlKey || e.metaKey || e.shiftKey ? R((-2 * Math.PI * i.rotateSpeed) / i.domElement.clientHeight) : P(0, -i.keyPanSpeed), (t = !0)) break case i.keys.LEFT: ;(e.ctrlKey || e.metaKey || e.shiftKey ? k((2 * Math.PI * i.rotateSpeed) / i.domElement.clientHeight) : P(i.keyPanSpeed, 0), (t = !0)) break case i.keys.RIGHT: ;(e.ctrlKey || e.metaKey || e.shiftKey ? k((-2 * Math.PI * i.rotateSpeed) / i.domElement.clientHeight) : P(-i.keyPanSpeed, 0), (t = !0)) } t && (e.preventDefault(), i.update()) })(e) } function Z(e) { !1 !== i.enabled && e.preventDefault() } function J(e) { var t = E[e.pointerId] ;(void 0 === t && ((t = new Vc()), (E[e.pointerId] = t)), t.set(e.pageX, e.pageY)) } function $(e) { var t = e.pointerId === M[0].pointerId ? M[1] : M[0] return E[t.pointerId] } return ( i.domElement.addEventListener('contextmenu', Z), i.domElement.addEventListener('pointerdown', Q), i.domElement.addEventListener('pointercancel', X), i.domElement.addEventListener('wheel', Y, { passive: !1 }), r.update(), r ) } return (x(t, e), T(t)) })(kc), px = (function () { return T( function e(t, n) { ;(A(this, e), (this.taskIDGen = 0), (this.elementID = e.elementIDGen++), (this.tasks = []), (this.message = t || 'Loading...'), (this.container = n || document.body), (this.spinnerContainerOuter = document.createElement('div')), (this.spinnerContainerOuter.className = 'spinnerOuterContainer'.concat( this.elementID )), (this.spinnerContainerOuter.style.display = 'none'), (this.spinnerContainerPrimary = document.createElement('div')), (this.spinnerContainerPrimary.className = 'spinnerContainerPrimary'.concat( this.elementID )), (this.spinnerPrimary = document.createElement('div')), this.spinnerPrimary.classList.add( 'spinner'.concat(this.elementID), 'spinnerPrimary'.concat(this.elementID) ), (this.messageContainerPrimary = document.createElement('div')), this.messageContainerPrimary.classList.add( 'messageContainer'.concat(this.elementID), 'messageContainerPrimary'.concat(this.elementID) ), (this.messageContainerPrimary.innerHTML = this.message), (this.spinnerContainerMin = document.createElement('div')), (this.spinnerContainerMin.className = 'spinnerContainerMin'.concat( this.elementID )), (this.spinnerMin = document.createElement('div')), this.spinnerMin.classList.add( 'spinner'.concat(this.elementID), 'spinnerMin'.concat(this.elementID) ), (this.messageContainerMin = document.createElement('div')), this.messageContainerMin.classList.add( 'messageContainer'.concat(this.elementID), 'messageContainerMin'.concat(this.elementID) ), (this.messageContainerMin.innerHTML = this.message), this.spinnerContainerPrimary.appendChild(this.spinnerPrimary), this.spinnerContainerPrimary.appendChild(this.messageContainerPrimary), this.spinnerContainerOuter.appendChild(this.spinnerContainerPrimary), this.spinnerContainerMin.appendChild(this.spinnerMin), this.spinnerContainerMin.appendChild(this.messageContainerMin), this.spinnerContainerOuter.appendChild(this.spinnerContainerMin)) var r = document.createElement('style') ;((r.innerHTML = '\n\n .spinnerOuterContainer' .concat( this.elementID, ' {\n width: 100%;\n height: 100%;\n margin: 0;\n top: 0;\n left: 0;\n position: absolute;\n pointer-events: none;\n }\n\n .messageContainer' ) .concat( this.elementID, ' {\n height: 20px;\n font-family: arial;\n font-size: 12pt;\n color: #ffffff;\n text-align: center;\n vertical-align: middle;\n }\n\n .spinner' ) .concat( this.elementID, ' {\n padding: 15px;\n background: #07e8d6;\n z-index:99999;\n \n aspect-ratio: 1;\n border-radius: 50%;\n --_m: \n conic-gradient(#0000,#000),\n linear-gradient(#000 0 0) content-box;\n -webkit-mask: var(--_m);\n mask: var(--_m);\n -webkit-mask-composite: source-out;\n mask-composite: subtract;\n box-sizing: border-box;\n animation: load 1s linear infinite;\n }\n\n .spinnerContainerPrimary' ) .concat( this.elementID, ' {\n z-index:99999;\n background-color: rgba(128, 128, 128, 0.75);\n border: #666666 1px solid;\n border-radius: 5px;\n padding-top: 20px;\n padding-bottom: 10px;\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-80px, -80px);\n width: 180px;\n pointer-events: auto;\n }\n\n .spinnerPrimary' ) .concat( this.elementID, ' {\n width: 120px;\n margin-left: 30px;\n }\n\n .messageContainerPrimary' ) .concat( this.elementID, ' {\n padding-top: 15px;\n }\n\n .spinnerContainerMin' ) .concat( this.elementID, ' {\n z-index:99999;\n background-color: rgba(128, 128, 128, 0.75);\n border: #666666 1px solid;\n border-radius: 5px;\n padding-top: 20px;\n padding-bottom: 15px;\n margin: 0;\n position: absolute;\n bottom: 50px;\n left: 50%;\n transform: translate(-50%, 0);\n display: flex;\n flex-direction: left;\n pointer-events: auto;\n min-width: 250px;\n }\n\n .messageContainerMin' ) .concat( this.elementID, ' {\n margin-right: 15px;\n }\n\n .spinnerMin' ) .concat( this.elementID, ' {\n width: 50px;\n height: 50px;\n margin-left: 15px;\n margin-right: 25px;\n }\n\n .messageContainerMin' ) .concat( this.elementID, ' {\n padding-top: 15px;\n }\n \n @keyframes load {\n to{transform: rotate(1turn)}\n }\n\n ' )), this.spinnerContainerOuter.appendChild(r), this.container.appendChild(this.spinnerContainerOuter), this.setMinimized(!1, !0), (this.fadeTransitions = [])) }, [ { key: 'addTask', value: function (e) { var t = { message: e, id: this.taskIDGen++ } return (this.tasks.push(t), this.update(), t.id) }, }, { key: 'removeTask', value: function (e) { var t, n = 0, r = L(this.tasks) try { for (r.s(); !(t = r.n()).done; ) { if (t.value.id === e) { this.tasks.splice(n, 1) break } n++ } } catch (i) { r.e(i) } finally { r.f() } this.update() }, }, { key: 'removeAllTasks', value: function () { ;((this.tasks = []), this.update()) }, }, { key: 'setMessageForTask', value: function (e, t) { var n, r = L(this.tasks) try { for (r.s(); !(n = r.n()).done; ) { var i = n.value if (i.id === e) { i.message = t break } } } catch (a) { r.e(a) } finally { r.f() } this.update() }, }, { key: 'update', value: function () { this.tasks.length > 0 ? (this.show(), this.setMessage(this.tasks[this.tasks.length - 1].message)) : this.hide() }, }, { key: 'show', value: function () { ;((this.spinnerContainerOuter.style.display = 'block'), (this.visible = !0)) }, }, { key: 'hide', value: function () { ;((this.spinnerContainerOuter.style.display = 'none'), (this.visible = !1)) }, }, { key: 'setContainer', value: function (e) { ;(this.container && this.spinnerContainerOuter.parentElement === this.container && this.container.removeChild(this.spinnerContainerOuter), e && ((this.container = e), this.container.appendChild(this.spinnerContainerOuter), (this.spinnerContainerOuter.style.zIndex = this.container.style.zIndex + 1))) }, }, { key: 'setMinimized', value: function (e, t) { var n = this, r = function (e, t, r, i, a) { r ? (e.style.display = t ? i : 'none') : (n.fadeTransitions[a] = (function (e, t, n, r, i) { var a = performance.now(), o = 'none' === e.style.display ? 0 : parseFloat(e.style.opacity) isNaN(o) && (o = 1) var s = window.setInterval(function () { var u, l = performance.now() - a, c = Math.min(l / r, 1) ;(c > 0.999 && (c = 1), t ? (u = (1 - c) * o) < 1e-4 && (u = 0) : (u = (1 - o) * c + o), u > 0 ? ((e.style.display = n), (e.style.opacity = u)) : (e.style.display = 'none'), c >= 1 && (i && i(), window.clearInterval(s))) }, 16) return s })(e, !t, i, 500, function () { n.fadeTransitions[a] = null })) } ;(r(this.spinnerContainerPrimary, !e, t, 'block', 0), r(this.spinnerContainerMin, e, t, 'flex', 1), (this.minimized = e)) }, }, { key: 'setMessage', value: function (e) { ;((this.messageContainerPrimary.innerHTML = e), (this.messageContainerMin.innerHTML = e)) }, }, ] ) })() M(px, 'elementIDGen', 0) var vx = (function () { return T( function e(t) { ;(A(this, e), (this.idGen = 0), (this.tasks = []), (this.container = t || document.body), (this.progressBarContainerOuter = document.createElement('div')), (this.progressBarContainerOuter.className = 'progressBarOuterContainer'), (this.progressBarContainerOuter.style.display = 'none'), (this.progressBarBox = document.createElement('div')), (this.progressBarBox.className = 'progressBarBox'), (this.progressBarBackground = document.createElement('div')), (this.progressBarBackground.className = 'progressBarBackground'), (this.progressBar = document.createElement('div')), (this.progressBar.className = 'progressBar'), this.progressBarBackground.appendChild(this.progressBar), this.progressBarBox.appendChild(this.progressBarBackground), this.progressBarContainerOuter.appendChild(this.progressBarBox)) var n = document.createElement('style') ;((n.innerHTML = '\n\n .progressBarOuterContainer {\n width: 100%;\n height: 100%;\n margin: 0;\n top: 0;\n left: 0;\n position: absolute;\n pointer-events: none;\n }\n\n .progressBarBox {\n z-index:99999;\n padding: 7px 9px 5px 7px;\n background-color: rgba(190, 190, 190, 0.75);\n border: #555555 1px solid;\n border-radius: 15px;\n margin: 0;\n position: absolute;\n bottom: 50px;\n left: 50%;\n transform: translate(-50%, 0);\n width: 180px;\n height: 30px;\n pointer-events: auto;\n }\n\n .progressBarBackground {\n width: 100%;\n height: 25px;\n border-radius:10px;\n background-color: rgba(128, 128, 128, 0.75);\n border: #444444 1px solid;\n box-shadow: inset 0 0 10px #333333;\n }\n\n .progressBar {\n height: 25px;\n width: 0px;\n border-radius:10px;\n background-color: rgba(0, 200, 0, 0.75);\n box-shadow: inset 0 0 10px #003300;\n }\n\n '), this.progressBarContainerOuter.appendChild(n), this.container.appendChild(this.progressBarContainerOuter)) }, [ { key: 'show', value: function () { this.progressBarContainerOuter.style.display = 'block' }, }, { key: 'hide', value: function () { this.progressBarContainerOuter.style.display = 'none' }, }, { key: 'setProgress', value: function (e) { this.progressBar.style.width = e + '%' }, }, { key: 'setContainer', value: function (e) { ;(this.container && this.progressBarContainerOuter.parentElement === this.container && this.container.removeChild(this.progressBarContainerOuter), e && ((this.container = e), this.container.appendChild(this.progressBarContainerOuter), (this.progressBarContainerOuter.style.zIndex = this.container.style.zIndex + 1))) }, }, ] ) })(), mx = new ph(), gx = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(0, 0, 1), r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(0, 0, 0), i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.1, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 16776960, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0.2 * i, u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0.2 * s ;(A(this, t), ((e = y(this, t)).type = 'ArrowHelper')) var l = new Vp(a, a, i, 32) l.translate(0, i / 2, 0) var c = new Vp(0, u, s, 32) return ( c.translate(0, i, 0), e.position.copy(r), (e.line = new gf(l, new zd({ color: o, toneMapped: !1 }))), (e.line.matrixAutoUpdate = !1), e.add(e.line), (e.cone = new gf(c, new zd({ color: o, toneMapped: !1 }))), (e.cone.matrixAutoUpdate = !1), e.add(e.cone), e.setDirection(n), e ) } return ( x(t, e), T(t, [ { key: 'setDirection', value: function (e) { if (e.y > 0.99999) this.quaternion.set(0, 0, 0, 1) else if (e.y < -0.99999) this.quaternion.set(1, 0, 0, 0) else { mx.set(e.z, 0, -e.x).normalize() var t = Math.acos(e.y) this.quaternion.setFromAxisAngle(mx, t) } }, }, { key: 'setColor', value: function (e) { ;(this.line.material.color.set(e), this.cone.material.color.set(e)) }, }, { key: 'copy', value: function (e) { return ( n(t, 'copy', this, 3)([e, !1]), this.line.copy(e.line), this.cone.copy(e.cone), this ) }, }, { key: 'dispose', value: function () { ;(this.line.geometry.dispose(), this.line.material.dispose(), this.cone.geometry.dispose(), this.cone.material.dispose()) }, }, ]) ) })(gd), yx = (function () { function e(t) { var n, r, i, a, o ;(A(this, e), M( this, 'updateFocusMarker', ((n = new ph()), (r = new Gh()), (i = new ph()), function (e, t, a) { ;(r.copy(t.matrixWorld).invert(), n.copy(e).applyMatrix4(r), n.normalize().multiplyScalar(10), n.applyMatrix4(t.matrixWorld), i.copy(t.position).sub(e)) var o = i.length() ;(this.focusMarker.position.copy(e), this.focusMarker.scale.set(o, o, o), this.focusMarker.material.uniforms.realFocusPosition.value.copy(e), this.focusMarker.material.uniforms.viewport.value.copy(a), (this.focusMarker.material.uniformsNeedUpdate = !0)) }) ), M( this, 'positionAndOrientControlPlane', ((a = new fh()), (o = new ph(0, 1, 0)), function (e, t) { ;(a.setFromUnitVectors(o, t), this.controlPlane.position.copy(e), this.controlPlane.quaternion.copy(a)) }) ), (this.threeScene = t), (this.splatRenderTarget = null), (this.renderTargetCopyQuad = null), (this.renderTargetCopyCamera = null), (this.meshCursor = null), (this.focusMarker = null), (this.controlPlane = null), (this.debugRoot = null), (this.secondaryDebugRoot = null)) } return T( e, [ { key: 'updateSplatRenderTargetForRenderDimensions', value: function (e, t) { ;(this.destroySplatRendertarget(), (this.splatRenderTarget = new ch(e, t, { format: wl, stencilBuffer: !1, depthBuffer: !0, })), (this.splatRenderTarget.depthTexture = new zp(e, t)), (this.splatRenderTarget.depthTexture.format = Tl), (this.splatRenderTarget.depthTexture.type = gl)) }, }, { key: 'destroySplatRendertarget', value: function () { this.splatRenderTarget && (this.splatRenderTarget = null) }, }, { key: 'setupRenderTargetCopyObjects', value: function () { var e = new wf({ vertexShader: '\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4( position.xy, 0.0, 1.0 ); \n }\n ', fragmentShader: '\n #include \n #include \n varying vec2 vUv;\n uniform sampler2D sourceColorTexture;\n uniform sampler2D sourceDepthTexture;\n void main() {\n vec4 color = texture2D(sourceColorTexture, vUv);\n float fragDepth = texture2D(sourceDepthTexture, vUv).x;\n gl_FragDepth = fragDepth;\n gl_FragColor = vec4(color.rgb, color.a * 2.0);\n }\n ', uniforms: { sourceColorTexture: { type: 't', value: null }, sourceDepthTexture: { type: 't', value: null }, }, depthWrite: !1, depthTest: !1, transparent: !0, blending: 5, blendSrc: Ju, blendSrcAlpha: Ju, blendDst: $u, blendDstAlpha: $u, }) ;((e.extensions.fragDepth = !0), (this.renderTargetCopyQuad = new gf(new Wp(2, 2), e)), (this.renderTargetCopyCamera = new Lv(-1, 1, 1, -1, 0, 1))) }, }, { key: 'destroyRenderTargetCopyObjects', value: function () { this.renderTargetCopyQuad && (Lu(this.renderTargetCopyQuad), (this.renderTargetCopyQuad = null)) }, }, { key: 'setupMeshCursor', value: function () { if (!this.meshCursor) { var e = new Hp(0.5, 1.5, 32), t = new zd({ color: 16777215 }), n = new gf(e, t) ;(n.rotation.set(0, 0, Math.PI), n.position.set(0, 1, 0)) var r = new gf(e, t) r.position.set(0, -1, 0) var i = new gf(e, t) ;(i.rotation.set(0, 0, Math.PI / 2), i.position.set(1, 0, 0)) var a = new gf(e, t) ;(a.rotation.set(0, 0, -Math.PI / 2), a.position.set(-1, 0, 0), (this.meshCursor = new gd()), this.meshCursor.add(n), this.meshCursor.add(r), this.meshCursor.add(i), this.meshCursor.add(a), this.meshCursor.scale.set(0.1, 0.1, 0.1), this.threeScene.add(this.meshCursor), (this.meshCursor.visible = !1)) } }, }, { key: 'destroyMeshCursor', value: function () { this.meshCursor && (Lu(this.meshCursor), this.threeScene.remove(this.meshCursor), (this.meshCursor = null)) }, }, { key: 'setMeshCursorVisibility', value: function (e) { this.meshCursor.visible = e }, }, { key: 'getMeschCursorVisibility', value: function () { return this.meshCursor.visible }, }, { key: 'setMeshCursorPosition', value: function (e) { this.meshCursor.position.copy(e) }, }, { key: 'positionAndOrientMeshCursor', value: function (e, t) { ;(this.meshCursor.position.copy(e), this.meshCursor.up.copy(t.up), this.meshCursor.lookAt(t.position)) }, }, { key: 'setupFocusMarker', value: function () { if (!this.focusMarker) { var t = new Gp(0.5, 32, 32), n = e.buildFocusMarkerMaterial() ;((n.depthTest = !1), (n.depthWrite = !1), (n.transparent = !0), (this.focusMarker = new gf(t, n))) } }, }, { key: 'destroyFocusMarker', value: function () { this.focusMarker && (Lu(this.focusMarker), (this.focusMarker = null)) }, }, { key: 'setFocusMarkerVisibility', value: function (e) { this.focusMarker.visible = e }, }, { key: 'setFocusMarkerOpacity', value: function (e) { ;((this.focusMarker.material.uniforms.opacity.value = e), (this.focusMarker.material.uniformsNeedUpdate = !0)) }, }, { key: 'getFocusMarkerOpacity', value: function () { return this.focusMarker.material.uniforms.opacity.value }, }, { key: 'setupControlPlane', value: function () { if (!this.controlPlane) { var e = new Wp(1, 1) e.rotateX(-Math.PI / 2) var t = new zd({ color: 16777215 }) ;((t.transparent = !0), (t.opacity = 0.6), (t.depthTest = !1), (t.depthWrite = !1), (t.side = 2)) var n = new gf(e, t), r = new ph(0, 1, 0) r.normalize() var i = new ph(0, 0, 0), a = new gx(r, i, 0.5, 0.01, 56576, 0.1, 0.03) ;((this.controlPlane = new gd()), this.controlPlane.add(n), this.controlPlane.add(a)) } }, }, { key: 'destroyControlPlane', value: function () { this.controlPlane && (Lu(this.controlPlane), (this.controlPlane = null)) }, }, { key: 'setControlPlaneVisibility', value: function (e) { this.controlPlane.visible = e }, }, { key: 'addDebugMeshes', value: function () { ;((this.debugRoot = this.createDebugMeshes()), (this.secondaryDebugRoot = this.createSecondaryDebugMeshes()), this.threeScene.add(this.debugRoot), this.threeScene.add(this.secondaryDebugRoot)) }, }, { key: 'destroyDebugMeshes', value: function () { for ( var e = 0, t = [this.debugRoot, this.secondaryDebugRoot]; e < t.length; e++ ) { var n = t[e] n && (Lu(n), this.threeScene.remove(n)) } ;((this.debugRoot = null), (this.secondaryDebugRoot = null)) }, }, { key: 'createDebugMeshes', value: function (t) { var n = new Gp(1, 32, 32), r = new gd(), i = function (i, a) { var o = new gf(n, e.buildDebugMaterial(i)) ;((o.renderOrder = t), r.add(o), o.position.fromArray(a)) } return ( i(16711680, [-50, 0, 0]), i(16711680, [50, 0, 0]), i(65280, [0, 0, -50]), i(65280, [0, 0, 50]), i(16755200, [5, 0, 5]), r ) }, }, { key: 'createSecondaryDebugMeshes', value: function (t) { var n = new _f(3, 3, 3), r = new gd(), i = function (i) { var a = new gf(n, e.buildDebugMaterial(12303291)) ;((a.renderOrder = t), r.add(a), a.position.fromArray(i)) }, a = 10 return (i([-10, 0, -10]), i([-10, 0, a]), i([a, 0, -10]), i([a, 0, a]), r) }, }, { key: 'dispose', value: function () { ;(this.destroyMeshCursor(), this.destroyFocusMarker(), this.destroyDebugMeshes(), this.destroyControlPlane(), this.destroyRenderTargetCopyObjects(), this.destroySplatRendertarget()) }, }, ], [ { key: 'buildDebugMaterial', value: function (e) { var t = { color: { type: 'v3', value: new Od(e) } }, n = new wf({ uniforms: t, vertexShader: '\n #include \n varying float ndcDepth;\n\n void main() {\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position.xyz, 1.0);\n ndcDepth = gl_Position.z / gl_Position.w;\n gl_Position.x = gl_Position.x / gl_Position.w;\n gl_Position.y = gl_Position.y / gl_Position.w;\n gl_Position.z = 0.0;\n gl_Position.w = 1.0;\n \n }\n ', fragmentShader: '\n #include \n uniform vec3 color;\n varying float ndcDepth;\n void main() {\n gl_FragDepth = (ndcDepth + 1.0) / 2.0;\n gl_FragColor = vec4(color.rgb, 0.0);\n }\n ', transparent: !1, depthTest: !0, depthWrite: !0, side: 0, }) return ((n.extensions.fragDepth = !0), n) }, }, { key: 'buildFocusMarkerMaterial', value: function (e) { var t = { color: { type: 'v3', value: new Od(e) }, realFocusPosition: { type: 'v3', value: new ph() }, viewport: { type: 'v2', value: new Vc() }, opacity: { value: 0 }, } return new wf({ uniforms: t, vertexShader: '\n #include \n\n uniform vec2 viewport;\n uniform vec3 realFocusPosition;\n\n varying vec4 ndcPosition;\n varying vec4 ndcCenter;\n varying vec4 ndcFocusPosition;\n\n void main() {\n float radius = 0.01;\n\n vec4 viewPosition = modelViewMatrix * vec4(position.xyz, 1.0);\n vec4 viewCenter = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n\n vec4 viewFocusPosition = modelViewMatrix * vec4(realFocusPosition, 1.0);\n\n ndcPosition = projectionMatrix * viewPosition;\n ndcPosition = ndcPosition * vec4(1.0 / ndcPosition.w);\n ndcCenter = projectionMatrix * viewCenter;\n ndcCenter = ndcCenter * vec4(1.0 / ndcCenter.w);\n\n ndcFocusPosition = projectionMatrix * viewFocusPosition;\n ndcFocusPosition = ndcFocusPosition * vec4(1.0 / ndcFocusPosition.w);\n\n gl_Position = projectionMatrix * viewPosition;\n\n }\n ', fragmentShader: '\n #include \n uniform vec3 color;\n uniform vec2 viewport;\n uniform float opacity;\n\n varying vec4 ndcPosition;\n varying vec4 ndcCenter;\n varying vec4 ndcFocusPosition;\n\n void main() {\n vec2 screenPosition = vec2(ndcPosition) * viewport;\n vec2 screenCenter = vec2(ndcCenter) * viewport;\n\n vec2 screenVec = screenPosition - screenCenter;\n\n float projectedRadius = length(screenVec);\n\n float lineWidth = 0.0005 * viewport.y;\n float aaRange = 0.0025 * viewport.y;\n float radius = 0.06 * viewport.y;\n float radDiff = abs(projectedRadius - radius) - lineWidth;\n float alpha = 1.0 - clamp(radDiff / 5.0, 0.0, 1.0); \n\n gl_FragColor = vec4(color.rgb, alpha * opacity);\n }\n ', transparent: !0, depthTest: !1, depthWrite: !1, side: 0, }) }, }, ] ) })(), _x = new ph(1, 0, 0), bx = new ph(0, 1, 0), xx = new ph(0, 0, 1), Sx = (function () { return T( function e() { var t, n, r, i, a, o = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new ph(), s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph() ;(A(this, e), M( this, 'intersectBox', ((t = new ph()), (n = []), (r = []), (i = []), function (e, a) { if ( ((r[0] = this.origin.x), (r[1] = this.origin.y), (r[2] = this.origin.z), (i[0] = this.direction.x), (i[1] = this.direction.y), (i[2] = this.direction.z), this.boxContainsPoint(e, this.origin, 1e-4)) ) return ( a && (a.origin.copy(this.origin), a.normal.set(0, 0, 0), (a.distance = -1)), !0 ) for (var o = 0; o < 3; o++) if (0 != i[o]) { var s = 0 == o ? _x : 1 == o ? bx : xx, u = i[o] < 0 ? e.max : e.min, l = -Math.sign(i[o]) n[0] = 0 == o ? u.x : 1 == o ? u.y : u.z var c = n[0] - r[o] if (c * l < 0) { var h = (o + 1) % 3, d = (o + 2) % 3 if ( ((n[2] = (i[h] / i[o]) * c + r[h]), (n[1] = (i[d] / i[o]) * c + r[d]), t.set(n[o], n[d], n[h]), this.boxContainsPoint(e, t, 1e-4)) ) return ( a && (a.origin.copy(t), a.normal.copy(s).multiplyScalar(l), (a.distance = t.sub(this.origin).length())), !0 ) } } return !1 }) ), M( this, 'intersectSphere', ((a = new ph()), function (e, t, n) { a.copy(e).sub(this.origin) var r = a.dot(this.direction), i = r * r, o = a.dot(a) - i, s = t * t if (o > s) return !1 var u = Math.sqrt(s - o), l = r - u, c = r + u if (c < 0) return !1 var h = l < 0 ? c : l return ( n && (n.origin.copy(this.origin).addScaledVector(this.direction, h), n.normal.copy(n.origin).sub(e).normalize(), (n.distance = h)), !0 ) }) ), (this.origin = new ph()), (this.direction = new ph()), this.setParameters(o, s)) }, [ { key: 'setParameters', value: function (e, t) { ;(this.origin.copy(e), this.direction.copy(t).normalize()) }, }, { key: 'boxContainsPoint', value: function (e, t, n) { return !( t.x < e.min.x - n || t.x > e.max.x + n || t.y < e.min.y - n || t.y > e.max.y + n || t.z < e.min.z - n || t.z > e.max.z + n ) }, }, ] ) })(), Ax = (function () { function e() { ;(A(this, e), (this.origin = new ph()), (this.normal = new ph()), (this.distance = 0), (this.splatIndex = 0)) } return T(e, [ { key: 'set', value: function (e, t, n, r) { ;(this.origin.copy(e), this.normal.copy(t), (this.distance = n), (this.splatIndex = r)) }, }, { key: 'clone', value: function () { var t = new e() return ( t.origin.copy(this.origin), t.normal.copy(this.normal), (t.distance = this.distance), (t.splatIndex = this.splatIndex), t ) }, }, ]) })(), wx = 0, Tx = 1, Mx = T(function e(t, n) { var r, i, a, o, s, u = this, l = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ;(A(this, e), M(this, 'ndcCoords', new Vc()), M(this, 'setFromCameraAndScreenPosition', function (e, t, n) { if ( ((u.ndcCoords.x = (t.x / n.x) * 2 - 1), (u.ndcCoords.y = ((n.y - t.y) / n.y) * 2 - 1), e.isPerspectiveCamera) ) (u.ray.origin.setFromMatrixPosition(e.matrixWorld), u.ray.direction .set(u.ndcCoords.x, u.ndcCoords.y, 0.5) .unproject(e) .sub(u.ray.origin) .normalize(), (u.camera = e)) else { if (!e.isOrthographicCamera) throw new Error( 'Raycaster::setFromCameraAndScreenPosition() -> Unsupported camera type' ) ;(u.ray.origin .set(u.ndcCoords.x, u.ndcCoords.y, (e.near + e.far) / (e.near - e.far)) .unproject(e), u.ray.direction.set(0, 0, -1).transformDirection(e.matrixWorld), (u.camera = e)) } }), M( this, 'intersectSplatMesh', ((r = new Gh()), (i = new Gh()), (a = new Gh()), (o = new Sx()), (s = new ph()), function (e) { var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], u = e.getSplatTree() if (u) { for (var l = 0; l < u.subTrees.length; l++) { var c = u.subTrees[l] ;(i.copy(e.matrixWorld), e.dynamicMode && (e.getSceneTransform(l, a), i.multiply(a)), r.copy(i).invert(), o.origin.copy(this.ray.origin).applyMatrix4(r), o.direction.copy(this.ray.origin).add(this.ray.direction), o.direction.applyMatrix4(r).sub(o.origin).normalize()) var h = [] ;(c.rootNode && this.castRayAtSplatTreeNode(o, u, c.rootNode, h), h.forEach(function (e) { ;(e.origin.applyMatrix4(i), e.normal.applyMatrix4(i).normalize(), (e.distance = s.copy(e.origin).sub(t.ray.origin).length())) }), n.push.apply(n, h)) } return ( n.sort(function (e, t) { return e.distance > t.distance ? 1 : -1 }), n ) } }) ), M( this, 'castRayAtSplatTreeNode', (function () { var e = new uh(), t = new ph(), n = new ph(), r = new fh(), i = new Ax(), a = 1e-7, o = new ph(0, 0, 0), s = new Gh(), u = new Gh(), l = new Gh(), c = new Gh(), h = new Gh(), d = new Sx() return function (f, p, v) { var m = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [] if (f.intersectBox(v.boundingBox)) { if (v.data && v.data.indexes && v.data.indexes.length > 0) for (var g = 0; g < v.data.indexes.length; g++) { var y = v.data.indexes[g], _ = p.splatMesh.getSceneIndexForSplat(y) if ( p.splatMesh.getScene(_).visible && (p.splatMesh.getSplatColor(y, e), p.splatMesh.getSplatCenter(y, t), p.splatMesh.getSplatScaleAndRotation(y, n, r), !( n.x <= a || n.y <= a || (p.splatMesh.splatRenderMode === wx && n.z <= a) )) ) if (this.raycastAgainstTrueSplatEllipsoid) { ;(u.makeScale(n.x, n.y, n.z), l.makeRotationFromQuaternion(r)) var b = 2 * Math.log10(e.w) if ( (s.makeScale(b, b, b), h.copy(s).multiply(l).multiply(u), c.copy(h).invert(), d.origin.copy(f.origin).sub(t).applyMatrix4(c), d.direction.copy(f.origin).add(f.direction).sub(t), d.direction.applyMatrix4(c).sub(d.origin).normalize(), d.intersectSphere(o, 1, i)) ) { var x = i.clone() ;((x.splatIndex = y), x.origin.applyMatrix4(h).add(t), m.push(x)) } } else { var S = n.x + n.y, A = 2 if ( (p.splatMesh.splatRenderMode === wx && ((S += n.z), (A = 3)), (S /= A), f.intersectSphere(t, S, i)) ) { var w = i.clone() ;((w.splatIndex = y), m.push(w)) } } } if (v.children && v.children.length > 0) { var T, M = L(v.children) try { for (M.s(); !(T = M.n()).done; ) { var E = T.value this.castRayAtSplatTreeNode(f, p, E, m) } } catch (C) { M.e(C) } finally { M.f() } } return m } } })() ), (this.ray = new Sx(t, n)), (this.raycastAgainstTrueSplatEllipsoid = l)) }), Ex = (function () { return T( function e() { A(this, e) }, null, [ { key: 'buildVertexShaderBase', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : '', i = '' return ( (i += 1 == (!(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4]) ? '#define USE_FLAME' : '#define USE_SKINNING'), (i += '\n precision highp float;\n #include \n\n attribute uint splatIndex;\n uniform highp usampler2D flameModelTexture;\n uniform highp usampler2D boneTexture;\n uniform highp usampler2D boneWeightTexture;\n\n\n uniform highp usampler2D centersColorsTexture;\n uniform highp sampler2D sphericalHarmonicsTexture;\n uniform highp sampler2D sphericalHarmonicsTextureR;\n uniform highp sampler2D sphericalHarmonicsTextureG;\n uniform highp sampler2D sphericalHarmonicsTextureB;\n\n uniform highp usampler2D sceneIndexesTexture;\n uniform vec2 sceneIndexesTextureSize;\n uniform int sceneCount;\n uniform int gaussianSplatCount;\n uniform int bsCount;\n uniform float headBoneIndex;\n #ifdef USE_SKINNING\n attribute vec4 skinIndex;\n attribute vec4 skinWeight;\n #endif\n '), t && (i += '\n uniform float sceneOpacity[' .concat(zy.MaxScenes, '];\n uniform int sceneVisibility[') .concat(zy.MaxScenes, '];\n ')), e && (i += '\n uniform highp mat4 transforms['.concat( zy.MaxScenes, '];\n ' )), (i += '\n ' .concat( r, '\n uniform vec2 focal;\n uniform float orthoZoom;\n uniform int orthographicMode;\n uniform int pointCloudModeEnabled;\n uniform float inverseFocalAdjustment;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 centersColorsTextureSize;\n uniform vec2 flameModelTextureSize;\n uniform vec2 boneWeightTextureSize;\n uniform vec2 boneTextureSize;\n\n uniform int sphericalHarmonicsDegree;\n uniform vec2 sphericalHarmonicsTextureSize;\n uniform int sphericalHarmonics8BitMode;\n uniform int sphericalHarmonicsMultiTextureMode;\n uniform float visibleRegionRadius;\n uniform float visibleRegionFadeStartRadius;\n uniform float firstRenderTime;\n uniform float currentTime;\n uniform int fadeInComplete;\n uniform vec3 sceneCenter;\n uniform float splatScale;\n uniform float sphericalHarmonics8BitCompressionRangeMin[' ) .concat( zy.MaxScenes, '];\n uniform float sphericalHarmonics8BitCompressionRangeMax[' ) .concat( zy.MaxScenes, '];\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying vec2 vSplatIndex;\n #ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture0;\n mat4 getBoneMatrix0( const in float i ) {\n int size = textureSize( boneTexture0, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture0, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture0, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture0, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture0, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n #endif\n\n mat3 quaternionToRotationMatrix(float x, float y, float z, float w) {\n float s = 1.0 / sqrt(w * w + x * x + y * y + z * z);\n \n return mat3(\n 1. - 2. * (y * y + z * z),\n 2. * (x * y + w * z),\n 2. * (x * z - w * y),\n 2. * (x * y - w * z),\n 1. - 2. * (x * x + z * z),\n 2. * (y * z + w * x),\n 2. * (x * z + w * y),\n 2. * (y * z - w * x),\n 1. - 2. * (x * x + y * y)\n );\n }\n\n const float sqrt8 = sqrt(8.0);\n const float minAlpha = 1.0 / 255.0;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n int internal = 1;//show a gaussian splatting point every internal points.\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n float getRealIndex(int sIndex, int reducedFactor) {\n int remainder = sIndex % reducedFactor;\n\n if(remainder == int(0)) {\n return float(sIndex);\n }\n else\n {\n return float(sIndex - remainder);\n }\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(getRealIndex(int(splatIndex), internal)) * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getFlameDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset) + uint(gaussianSplatCount * bsCount)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getBoneWeightUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getBSFlameDataUV(in int bsInedex, in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(int(splatIndex) / internal) * uint(stride) + uint(offset) + uint(gaussianSplatCount * bsInedex)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n vec2 getDataUVF(in uint sIndex, in float stride, in uint offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(uint(float(getRealIndex(int(sIndex), internal)) * stride) + offset) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n const float SH_C1 = 0.4886025119029199f;\n const float[5] SH_C2 = float[](1.0925484, -1.0925484, 0.3153916, -1.0925484, 0.5462742);\n\n mat4 getBoneMatrix( float i ) {\n float y = i;\n float x = 0.0;\n\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(i * 4.0) / boneTextureSize.x;//4\n samplerUV.y = float(floor(d)) / boneTextureSize.y;//5\n samplerUV.x = fract(d);\n\n vec4 v1 = uintBitsToFloat(texture( boneTexture, samplerUV ));\n vec4 v2 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 1.0 / boneTextureSize.x, samplerUV.y)));\n vec4 v3 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 2.0 / boneTextureSize.x, samplerUV.y) ));\n vec4 v4 = uintBitsToFloat(texture( boneTexture, vec2(samplerUV.x + 3.0 / boneTextureSize.x, samplerUV.y)));\n\n return mat4( v1, v2, v3, v4 );\n }\n\n void main () {\n\n uint oddOffset = splatIndex & uint(0x00000001);\n uint doubleOddOffset = oddOffset * uint(2);\n bool isEven = oddOffset == uint(0);\n uint nearestEvenIndex = splatIndex - oddOffset;\n float fOddOffset = float(oddOffset);\n\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n // vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n\n uvec3 sampledCenter = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize)).gba;\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenter));\n\n vec2 flameTextureUV = getBSFlameDataUV(bsCount, 1, 0, flameModelTextureSize);\n uvec3 sampledflamePos = texture(flameModelTexture, flameTextureUV).rgb;\n // splatCenter += uintBitsToFloat(uvec3(sampledflamePos.rgb));\n\n for(int i = 0; i < bsCount; ++i) {\n vec2 flameBSTextureUV = getBSFlameDataUV(i, 1, 0, flameModelTextureSize);\n uvec3 sampledBSPos = texture(flameModelTexture, flameBSTextureUV).rgb;\n\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(i / 4 + 5 * 4) / boneTextureSize.x;//4\n samplerUV.y = float(floor(d)) / boneTextureSize.y;//32\n samplerUV.x = fract(d);\n\n vec4 bsWeight = uintBitsToFloat(texture(boneTexture, samplerUV));\n float weight = bsWeight.r;\n if(i % 4 == 1) {\n weight = bsWeight.g;\n }\n if(i % 4 == 2) {\n weight = bsWeight.b;\n }\n if(i % 4 == 3) {\n weight = bsWeight.a;\n }\n\n splatCenter = splatCenter + weight * uintBitsToFloat(sampledBSPos);\n }\n\n\n #ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix0( skinIndex.x );\n mat4 boneMatY = getBoneMatrix0( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix0( skinIndex.z );\n mat4 boneMatW = getBoneMatrix0( skinIndex.w );\n #endif\n #ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n // skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n #endif\n vec3 transformed = vec3(splatCenter.xyz);\n #ifdef USE_SKINNING\n // vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinVertex = vec4( transformed, 1.0 );\n\n vec4 skinned = vec4( 0.0 );\n // There is an offset between the Gaussian point and the mesh vertex,\n // which will cause defects in the skeletal animation driving the Gaussian point. \n //In order to circumvent this problem, only the head bone(index is 110 currently) is used to drive\n\n if (headBoneIndex >= 0.0)\n {\n mat4 boneMat = getBoneMatrix0( headBoneIndex );\n skinned += boneMat * skinVertex * 1.0;\n }\n\n // skinned += boneMatX * skinVertex * skinWeight.x;\n // skinned += boneMatY * skinVertex * skinWeight.y;\n // skinned += boneMatZ * skinVertex * skinWeight.z;\n // skinned += boneMatW * skinVertex * skinWeight.w;\n\n // transformed = ( bindMatrixInverse * skinned ).xyz;\n transformed = skinned.xyz;\n\n #endif\n splatCenter = transformed.xyz;\n\n #ifdef USE_FLAME\n mat4 boneMatX = getBoneMatrix( 0.0 );\n mat4 boneMatY = getBoneMatrix( 1.0 );\n mat4 boneMatZ = getBoneMatrix( 2.0 );\n mat4 boneMatW = getBoneMatrix( 3.0 ); \n mat4 boneMat0 = getBoneMatrix( 4.0 ); \n \n vec2 boneWeightUV0 = getBoneWeightUV(2, 0, boneWeightTextureSize);\n vec2 boneWeightUV1 = getBoneWeightUV(2, 1, boneWeightTextureSize);\n\n uvec4 sampledBoneMatrixValue = texture(boneWeightTexture, boneWeightUV0);\n uvec4 sampledBoneMatrixValue0 = texture(boneWeightTexture, boneWeightUV1);\n\n vec4 boneMatrixValue = uintBitsToFloat(sampledBoneMatrixValue);\n vec4 boneMatrixValue0 = uintBitsToFloat(sampledBoneMatrixValue0);\n\n vec4 skinVertex = vec4( splatCenter, 1.0 );\n vec4 skinned = vec4( 0.0 );\n float minWeight = min(boneMatrixValue.x,min(boneMatrixValue.y, min(boneMatrixValue.z, min(boneMatrixValue.w, boneMatrixValue0.x))));\n \n if(boneMatrixValue.x > 0.0 && boneMatrixValue.x > minWeight)\n skinned += boneMatX * skinVertex * boneMatrixValue.x;\n \n if(boneMatrixValue.y > 0.0 && boneMatrixValue.y > minWeight)\n skinned += boneMatY * skinVertex * boneMatrixValue.y;\n \n if(boneMatrixValue.z > 0.0 && boneMatrixValue.z > minWeight)\n skinned += boneMatZ * skinVertex * boneMatrixValue.z;\n \n if(boneMatrixValue.w > 0.0 && boneMatrixValue.w > minWeight)\n skinned += boneMatW * skinVertex * boneMatrixValue.w;\n \n if(boneMatrixValue0.x > 0.0 && boneMatrixValue0.x > minWeight)\n skinned += boneMat0 * skinVertex * boneMatrixValue0.x;\n \n splatCenter = skinned.xyz;\n #endif\n\n uint sceneIndex = uint(0);\n if (sceneCount > 1) {\n sceneIndex = texture(sceneIndexesTexture, getDataUV(1, 0, sceneIndexesTextureSize)).r;\n }\n ' )), t && (i += '\n float splatOpacityFromScene = sceneOpacity[sceneIndex];\n int sceneVisible = sceneVisibility[sceneIndex];\n if (splatOpacityFromScene <= 0.01 || sceneVisible == 0) {\n gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n return;\n }\n '), (i += e ? '\n mat4 transform = transforms[sceneIndex];\n mat4 transformModelViewMatrix = viewMatrix * transform;\n #ifdef USE_SKINNING\n transformModelViewMatrix = transformModelViewMatrix * skinMatrix;\n #endif\n ' : 'mat4 transformModelViewMatrix = modelViewMatrix;'), (i += '\n float sh8BitCompressionRangeMinForScene = sphericalHarmonics8BitCompressionRangeMin[sceneIndex];\n float sh8BitCompressionRangeMaxForScene = sphericalHarmonics8BitCompressionRangeMax[sceneIndex];\n float sh8BitCompressionRangeForScene = sh8BitCompressionRangeMaxForScene - sh8BitCompressionRangeMinForScene;\n float sh8BitCompressionHalfRangeForScene = sh8BitCompressionRangeForScene / 2.0;\n vec3 vec8BitSHShift = vec3(sh8BitCompressionRangeMinForScene);\n\n vec4 viewCenter = transformModelViewMatrix * vec4(splatCenter, 1.0);\n\n vec4 clipCenter = projectionMatrix * viewCenter;\n\n float clip = 1.2 * clipCenter.w;\n if (clipCenter.z < -clip || clipCenter.x < -clip || clipCenter.x > clip || clipCenter.y < -clip || clipCenter.y > clip) {\n gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n return;\n }\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n vPosition = position.xy;\n vSplatIndex = vec2(splatIndex, splatIndex);\n\n vColor = uintToRGBAVec(sampledCenterColor.r);\n '), n >= 1 && ((i += ' \n if (sphericalHarmonicsDegree >= 1) {\n '), (i += e ? '\n vec3 worldViewDir = normalize(splatCenter - vec3(inverse(transform) * vec4(cameraPosition, 1.0)));\n ' : '\n vec3 worldViewDir = normalize(splatCenter - cameraPosition);\n '), (i += '\n vec3 sh1;\n vec3 sh2;\n vec3 sh3;\n '), n >= 2 && (i += '\n vec3 sh4;\n vec3 sh5;\n vec3 sh6;\n vec3 sh7;\n vec3 sh8;\n '), 1 === n ? (i += '\n if (sphericalHarmonicsMultiTextureMode == 0) {\n vec2 shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset, sphericalHarmonicsTextureSize);\n vec4 sampledSH0123 = texture(sphericalHarmonicsTexture, shUV);\n shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(1), sphericalHarmonicsTextureSize);\n vec4 sampledSH4567 = texture(sphericalHarmonicsTexture, shUV);\n shUV = getDataUVF(nearestEvenIndex, 2.5, doubleOddOffset + uint(2), sphericalHarmonicsTextureSize);\n vec4 sampledSH891011 = texture(sphericalHarmonicsTexture, shUV);\n sh1 = vec3(sampledSH0123.rgb) * (1.0 - fOddOffset) + vec3(sampledSH0123.ba, sampledSH4567.r) * fOddOffset;\n sh2 = vec3(sampledSH0123.a, sampledSH4567.rg) * (1.0 - fOddOffset) + vec3(sampledSH4567.gba) * fOddOffset;\n sh3 = vec3(sampledSH4567.ba, sampledSH891011.r) * (1.0 - fOddOffset) + vec3(sampledSH891011.rgb) * fOddOffset;\n } else {\n vec2 sampledSH01R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH01G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH01B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize)).rg;\n vec2 sampledSH23B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize)).rg;\n sh1 = vec3(sampledSH01R.rg, sampledSH23R.r);\n sh2 = vec3(sampledSH01G.rg, sampledSH23G.r);\n sh3 = vec3(sampledSH01B.rg, sampledSH23B.r);\n }\n ') : 2 === n && (i += '\n vec4 sampledSH0123;\n vec4 sampledSH4567;\n vec4 sampledSH891011;\n\n vec4 sampledSH0123R;\n vec4 sampledSH0123G;\n vec4 sampledSH0123B;\n\n if (sphericalHarmonicsMultiTextureMode == 0) {\n sampledSH0123 = texture(sphericalHarmonicsTexture, getDataUV(6, 0, sphericalHarmonicsTextureSize));\n sampledSH4567 = texture(sphericalHarmonicsTexture, getDataUV(6, 1, sphericalHarmonicsTextureSize));\n sampledSH891011 = texture(sphericalHarmonicsTexture, getDataUV(6, 2, sphericalHarmonicsTextureSize));\n sh1 = sampledSH0123.rgb;\n sh2 = vec3(sampledSH0123.a, sampledSH4567.rg);\n sh3 = vec3(sampledSH4567.ba, sampledSH891011.r);\n } else {\n sampledSH0123R = texture(sphericalHarmonicsTextureR, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sampledSH0123G = texture(sphericalHarmonicsTextureG, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sampledSH0123B = texture(sphericalHarmonicsTextureB, getDataUV(2, 0, sphericalHarmonicsTextureSize));\n sh1 = vec3(sampledSH0123R.rgb);\n sh2 = vec3(sampledSH0123G.rgb);\n sh3 = vec3(sampledSH0123B.rgb);\n }\n '), (i += '\n if (sphericalHarmonics8BitMode == 1) {\n sh1 = sh1 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh2 = sh2 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh3 = sh3 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n }\n float x = worldViewDir.x;\n float y = worldViewDir.y;\n float z = worldViewDir.z;\n vColor.rgb += SH_C1 * (-sh1 * y + sh2 * z - sh3 * x);\n '), n >= 2 && ((i += '\n if (sphericalHarmonicsDegree >= 2) {\n float xx = x * x;\n float yy = y * y;\n float zz = z * z;\n float xy = x * y;\n float yz = y * z;\n float xz = x * z;\n '), 2 === n && (i += '\n if (sphericalHarmonicsMultiTextureMode == 0) {\n vec4 sampledSH12131415 = texture(sphericalHarmonicsTexture, getDataUV(6, 3, sphericalHarmonicsTextureSize));\n vec4 sampledSH16171819 = texture(sphericalHarmonicsTexture, getDataUV(6, 4, sphericalHarmonicsTextureSize));\n vec4 sampledSH20212223 = texture(sphericalHarmonicsTexture, getDataUV(6, 5, sphericalHarmonicsTextureSize));\n sh4 = sampledSH891011.gba;\n sh5 = sampledSH12131415.rgb;\n sh6 = vec3(sampledSH12131415.a, sampledSH16171819.rg);\n sh7 = vec3(sampledSH16171819.ba, sampledSH20212223.r);\n sh8 = sampledSH20212223.gba;\n } else {\n vec4 sampledSH4567R = texture(sphericalHarmonicsTextureR, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n vec4 sampledSH4567G = texture(sphericalHarmonicsTextureG, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n vec4 sampledSH4567B = texture(sphericalHarmonicsTextureB, getDataUV(2, 1, sphericalHarmonicsTextureSize));\n sh4 = vec3(sampledSH0123R.a, sampledSH4567R.rg);\n sh5 = vec3(sampledSH4567R.ba, sampledSH0123G.a);\n sh6 = vec3(sampledSH4567G.rgb);\n sh7 = vec3(sampledSH4567G.a, sampledSH0123B.a, sampledSH4567B.r);\n sh8 = vec3(sampledSH4567B.gba);\n }\n '), (i += '\n if (sphericalHarmonics8BitMode == 1) {\n sh4 = sh4 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh5 = sh5 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh6 = sh6 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh7 = sh7 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n sh8 = sh8 * sh8BitCompressionRangeForScene + vec8BitSHShift;\n }\n\n vColor.rgb +=\n (SH_C2[0] * xy) * sh4 +\n (SH_C2[1] * yz) * sh5 +\n (SH_C2[2] * (2.0 * zz - xx - yy)) * sh6 +\n (SH_C2[3] * xz) * sh7 +\n (SH_C2[4] * (xx - yy)) * sh8;\n }\n ')), (i += '\n\n vColor.rgb = clamp(vColor.rgb, vec3(0.), vec3(1.));\n\n }\n\n ')), i ) }, }, { key: 'getVertexShaderFadeIn', value: function () { return '\n if (fadeInComplete == 0) {\n float opacityAdjust = 1.0;\n float centerDist = length(splatCenter - sceneCenter);\n float renderTime = max(currentTime - firstRenderTime, 0.0);\n\n float fadeDistance = 0.75;\n float distanceLoadFadeInFactor = step(visibleRegionFadeStartRadius, centerDist);\n distanceLoadFadeInFactor = (1.0 - distanceLoadFadeInFactor) +\n (1.0 - clamp((centerDist - visibleRegionFadeStartRadius) / fadeDistance, 0.0, 1.0)) *\n distanceLoadFadeInFactor;\n opacityAdjust *= distanceLoadFadeInFactor;\n vColor.a *= opacityAdjust;\n }\n ' }, }, { key: 'getUniforms', value: function () { for ( var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1, i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a = { sceneCenter: { type: 'v3', value: new ph() }, fadeInComplete: { type: 'i', value: 0 }, orthographicMode: { type: 'i', value: 0 }, visibleRegionFadeStartRadius: { type: 'f', value: 0 }, visibleRegionRadius: { type: 'f', value: 0 }, bindMatrix: { type: 'm4', value: new Gh() }, bindMatrixInverse: { type: 'm4', value: new Gh() }, currentTime: { type: 'f', value: 0 }, firstRenderTime: { type: 'f', value: 0 }, centersColorsTexture: { type: 't', value: null }, flameModelTexture: { type: 't', value: null }, boneTexture: { type: 't', value: null }, boneTexture0: { type: 't', value: null }, boneWeightTexture: { type: 't', value: null }, sphericalHarmonicsTexture: { type: 't', value: null }, sphericalHarmonicsTextureR: { type: 't', value: null }, sphericalHarmonicsTextureG: { type: 't', value: null }, sphericalHarmonicsTextureB: { type: 't', value: null }, sphericalHarmonics8BitCompressionRangeMin: { type: 'f', value: [] }, sphericalHarmonics8BitCompressionRangeMax: { type: 'f', value: [] }, focal: { type: 'v2', value: new Vc() }, orthoZoom: { type: 'f', value: 1 }, inverseFocalAdjustment: { type: 'f', value: 1 }, viewport: { type: 'v2', value: new Vc() }, basisViewport: { type: 'v2', value: new Vc() }, debugColor: { type: 'v3', value: new Od() }, centersColorsTextureSize: { type: 'v2', value: new Vc(1024, 1024) }, flameModelTextureSize: { type: 'v2', value: new Vc(4096, 2048) }, boneTextureSize: { type: 'v2', value: new Vc(4, 32) }, boneWeightTextureSize: { type: 'v2', value: new Vc(512, 512) }, sphericalHarmonicsDegree: { type: 'i', value: n }, sphericalHarmonicsTextureSize: { type: 'v2', value: new Vc(1024, 1024), }, sphericalHarmonics8BitMode: { type: 'i', value: 0 }, sphericalHarmonicsMultiTextureMode: { type: 'i', value: 0 }, splatScale: { type: 'f', value: r }, pointCloudModeEnabled: { type: 'i', value: i ? 1 : 0 }, sceneIndexesTexture: { type: 't', value: null }, sceneIndexesTextureSize: { type: 'v2', value: new Vc(1024, 1024) }, sceneCount: { type: 'i', value: 1 }, gaussianSplatCount: { type: 'i', value: 1 }, bsCount: { type: 'i', value: 1 }, headBoneIndex: { type: 'f', value: -1 }, }, o = 0; o < zy.MaxScenes; o++ ) (a.sphericalHarmonics8BitCompressionRangeMin.value.push(-1.5), a.sphericalHarmonics8BitCompressionRangeMax.value.push( zy.SphericalHarmonics8BitCompressionRange / 2 )) if (t) { for (var s = [], u = 0; u < zy.MaxScenes; u++) s.push(1) a.sceneOpacity = { type: 'f', value: s } for (var l = [], c = 0; c < zy.MaxScenes; c++) l.push(1) a.sceneVisibility = { type: 'i', value: l } } if (e) { for (var h = [], d = 0; d < zy.MaxScenes; d++) h.push(new Gh()) a.transforms = { type: 'mat4', value: h } } return a }, }, ] ) })(), Cx = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'build', value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 2048, a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1, o = arguments.length > 5 && void 0 !== arguments[5] && arguments[5], s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0, u = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0.3, l = !(arguments.length > 8 && void 0 !== arguments[8]) || arguments[8], c = Ex.buildVertexShaderBase( t, n, s, '\n uniform vec2 covariancesTextureSize;\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D covariancesTextureHalfFloat;\n uniform int covariancesAreHalfFloat;\n\n void fromCovarianceHalfFloatV4(uvec4 val, out vec4 first, out vec4 second) {\n vec2 r = unpackHalf2x16(val.r);\n vec2 g = unpackHalf2x16(val.g);\n vec2 b = unpackHalf2x16(val.b);\n\n first = vec4(r.x, r.y, g.x, g.y);\n second = vec4(b.x, b.y, 0.0, 0.0);\n }\n ', l ) c += e.buildVertexShaderProjection(r, n, i, u) var h = e.buildFragmentShader(), d = Ex.getUniforms(t, n, s, a, o) return ( (d.covariancesTextureSize = { type: 'v2', value: new Vc(1024, 1024) }), (d.covariancesTexture = { type: 't', value: null }), (d.covariancesTextureHalfFloat = { type: 't', value: null }), (d.covariancesAreHalfFloat = { type: 'i', value: 0 }), new wf({ uniforms: d, vertexShader: c, fragmentShader: h, transparent: !0, alphaTest: 1, blending: 1, depthTest: !0, depthWrite: !1, side: 2, }) ) }, }, { key: 'buildVertexShaderProjection', value: function (e, t, n, r) { var i = "\n\n vec4 sampledCovarianceA;\n vec4 sampledCovarianceB;\n vec3 cov3D_M11_M12_M13;\n vec3 cov3D_M22_M23_M33;\n if (covariancesAreHalfFloat == 0) {\n sampledCovarianceA = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset,\n covariancesTextureSize));\n sampledCovarianceB = texture(covariancesTexture, getDataUVF(nearestEvenIndex, 1.5, oddOffset + uint(1),\n covariancesTextureSize));\n\n cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rgb) * (1.0 - fOddOffset) +\n vec3(sampledCovarianceA.ba, sampledCovarianceB.r) * fOddOffset;\n cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg) * (1.0 - fOddOffset) +\n vec3(sampledCovarianceB.gba) * fOddOffset;\n } else {\n uvec4 sampledCovarianceU = texture(covariancesTextureHalfFloat, getDataUV(1, 0, covariancesTextureSize));\n fromCovarianceHalfFloatV4(sampledCovarianceU, sampledCovarianceA, sampledCovarianceB);\n cov3D_M11_M12_M13 = sampledCovarianceA.rgb;\n cov3D_M22_M23_M33 = vec3(sampledCovarianceA.a, sampledCovarianceB.rg);\n }\n \n // Construct the 3D covariance matrix\n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n\n mat3 J;\n if (orthographicMode == 1) {\n // Since the projection is linear, we don't need an approximation\n J = transpose(mat3(orthoZoom, 0.0, 0.0,\n 0.0, orthoZoom, 0.0,\n 0.0, 0.0, 0.0));\n } else {\n // Construct the Jacobian of the affine approximation of the projection matrix. It will be used to transform the\n // 3D covariance matrix instead of using the actual projection matrix because that transformation would\n // require a non-linear component (perspective division) which would yield a non-gaussian result.\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n J = mat3(\n focal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n 0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n 0., 0., 0.\n );\n }\n\n // Concatenate the projection approximation with the model-view transformation\n mat3 W = transpose(mat3(transformModelViewMatrix));\n mat3 T = W * J;\n\n // Transform the 3D covariance matrix (Vrk) to compute the 2D covariance matrix\n mat3 cov2Dm = transpose(T) * Vrk * T;\n " return ( (i += e ? '\n float detOrig = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n cov2Dm[0][0] += ' .concat(r, ';\n cov2Dm[1][1] += ') .concat( r, ';\n float detBlur = cov2Dm[0][0] * cov2Dm[1][1] - cov2Dm[0][1] * cov2Dm[0][1];\n vColor.a *= sqrt(max(detOrig / detBlur, 0.0));\n if (vColor.a < minAlpha) return;\n ' ) : '\n cov2Dm[0][0] += ' .concat(r, ';\n cov2Dm[1][1] += ') .concat(r, ';\n ')), (i += "\n\n // We are interested in the upper-left 2x2 portion of the projected 3D covariance matrix because\n // we only care about the X and Y values. We want the X-diagonal, cov2Dm[0][0],\n // the Y-diagonal, cov2Dm[1][1], and the correlation between the two cov2Dm[0][1]. We don't\n // need cov2Dm[1][0] because it is a symetric matrix.\n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n // We now need to solve for the eigen-values and eigen vectors of the 2D covariance matrix\n // so that we can determine the 2D basis for the splat. This is done using the method described\n // here: https://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n // After calculating the eigen-values and eigen-vectors, we calculate the basis for rendering the splat\n // by normalizing the eigen-vectors and then multiplying them by (sqrt(8) * sqrt(eigen-value)), which is\n // equal to scaling them by sqrt(8) standard deviations.\n //\n // This is a different approach than in the original work at INRIA. In that work they compute the\n // max extents of the projected splat in screen space to form a screen-space aligned bounding rectangle\n // which forms the geometry that is actually rasterized. The dimensions of that bounding box are 3.0\n // times the square root of the maximum eigen-value, or 3 standard deviations. They then use the inverse\n // 2D covariance matrix (called 'conic') in the CUDA rendering thread to determine fragment opacity by\n // calculating the full gaussian: exp(-0.5 * (X - mean) * conic * (X - mean)) * splat opacity\n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(max(0.1f, traceOver2 * traceOver2 - D));\n float eigenValue1 = traceOver2 + term2;\n float eigenValue2 = traceOver2 - term2;\n\n if (pointCloudModeEnabled == 1) {\n eigenValue1 = eigenValue2 = 0.2;\n }\n\n if (eigenValue2 <= 0.0) return;\n\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n // since the eigen vectors are orthogonal, we derive the second one from the first\n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n\n // We use sqrt(8) standard deviations instead of 3 to eliminate more of the splat with a very low opacity.\n vec2 basisVector1 = eigenVector1 * splatScale * min(sqrt8 * sqrt(eigenValue1), " .concat( parseInt(n), '.0);\n vec2 basisVector2 = eigenVector2 * splatScale * min(sqrt8 * sqrt(eigenValue2), ' ) .concat(parseInt(n), '.0);\n ')), t && (i += '\n vColor.a *= splatOpacityFromScene;\n '), (i += '\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) *\n basisViewport * 2.0 * inverseFocalAdjustment;\n\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n // Scale the position data we send to the fragment shader\n vPosition *= sqrt8;\n '), (i += Ex.getVertexShaderFadeIn()), (i += '}') ) }, }, { key: 'buildFragmentShader', value: function () { return "\n precision highp float;\n #include \n \n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying vec2 vSplatIndex;\n\n \n void main () {\n // Compute the positional squared distance from the center of the splat to the current fragment.\n float A = dot(vPosition, vPosition);\n // Since the positional data in vPosition has been scaled by sqrt(8), the squared result will be\n // scaled by a factor of 8. If the squared result is larger than 8, it means it is outside the ellipse\n // defined by the rectangle formed by vPosition. It also means it's farther\n // away than sqrt(8) standard deviations from the mean.\n\n // if(vSplatIndex.x > 20000.0) discard;\n // if (A > 8.0) discard;\n vec3 color = vColor.rgb;\n\n // Since the rendered splat is scaled by sqrt(8), the inverse covariance matrix that is part of\n // the gaussian formula becomes the identity matrix. We're then left with (X - mean) * (X - mean),\n // and since 'mean' is zero, we have X * X, which is the same as A:\n float opacity = exp( -0.5*A) * vColor.a;\n if(opacity < 1.0 / 255.0)\n discard;\n\n // uint a = uint(255);\n // vec3 c = vec3(vSplatIndex.x / 256.0 / 256.0, float(uint(vSplatIndex.x / 256.0 )% a) / 256.0, float(uint(vSplatIndex.x)% a) / 256.0);\n // gl_FragColor = vec4(c, 1.0);\n gl_FragColor = vec4(color, opacity);\n\n\n }\n " }, }, ]) })(), kx = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'build', value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, o = Ex.buildVertexShaderBase( t, n, a, '\n uniform vec2 scaleRotationsTextureSize;\n uniform highp sampler2D scaleRotationsTexture;\n varying mat3 vT;\n varying vec2 vQuadCenter;\n varying vec2 vFragCoord;\n ' ) o += e.buildVertexShaderProjection() var s = e.buildFragmentShader(), u = Ex.getUniforms(t, n, a, r, i) return ( (u.scaleRotationsTexture = { type: 't', value: null }), (u.scaleRotationsTextureSize = { type: 'v2', value: new Vc(1024, 1024) }), new wf({ uniforms: u, vertexShader: o, fragmentShader: s, transparent: !0, alphaTest: 1, blending: 1, depthTest: !0, depthWrite: !1, side: 2, }) ) }, }, { key: 'buildVertexShaderProjection', value: function () { var e = '\n\n vec4 scaleRotationA = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\n oddOffset, scaleRotationsTextureSize));\n vec4 scaleRotationB = texture(scaleRotationsTexture, getDataUVF(nearestEvenIndex, 1.5,\n oddOffset + uint(1), scaleRotationsTextureSize));\n\n vec3 scaleRotation123 = vec3(scaleRotationA.rgb) * (1.0 - fOddOffset) +\n vec3(scaleRotationA.ba, scaleRotationB.r) * fOddOffset;\n vec3 scaleRotation456 = vec3(scaleRotationA.a, scaleRotationB.rg) * (1.0 - fOddOffset) +\n vec3(scaleRotationB.gba) * fOddOffset;\n\n float missingW = sqrt(1.0 - scaleRotation456.x * scaleRotation456.x - scaleRotation456.y *\n scaleRotation456.y - scaleRotation456.z * scaleRotation456.z);\n mat3 R = quaternionToRotationMatrix(scaleRotation456.r, scaleRotation456.g, scaleRotation456.b, missingW);\n mat3 S = mat3(scaleRotation123.r, 0.0, 0.0,\n 0.0, scaleRotation123.g, 0.0,\n 0.0, 0.0, scaleRotation123.b);\n \n mat3 L = R * S;\n\n mat3x4 splat2World = mat3x4(vec4(L[0], 0.0),\n vec4(L[1], 0.0),\n vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\n\n mat4 world2ndc = transpose(projectionMatrix * transformModelViewMatrix);\n\n mat3x4 ndc2pix = mat3x4(vec4(viewport.x / 2.0, 0.0, 0.0, (viewport.x - 1.0) / 2.0),\n vec4(0.0, viewport.y / 2.0, 0.0, (viewport.y - 1.0) / 2.0),\n vec4(0.0, 0.0, 0.0, 1.0));\n\n mat3 T = transpose(splat2World) * world2ndc * ndc2pix;\n vec3 normal = vec3(viewMatrix * vec4(L[0][2], L[1][2], L[2][2], 0.0));\n ' return ( (e += '\n\n mat4 splat2World4 = mat4(vec4(L[0], 0.0),\n vec4(L[1], 0.0),\n vec4(L[2], 0.0),\n vec4(splatCenter.x, splatCenter.y, splatCenter.z, 1.0));\n\n mat4 Tt = transpose(transpose(splat2World4) * world2ndc);\n\n vec4 tempPoint1 = Tt * vec4(1.0, 0.0, 0.0, 1.0);\n tempPoint1 /= tempPoint1.w;\n\n vec4 tempPoint2 = Tt * vec4(0.0, 1.0, 0.0, 1.0);\n tempPoint2 /= tempPoint2.w;\n\n vec4 center = Tt * vec4(0.0, 0.0, 0.0, 1.0);\n center /= center.w;\n\n vec2 basisVector1 = tempPoint1.xy - center.xy;\n vec2 basisVector2 = tempPoint2.xy - center.xy;\n\n vec2 basisVector1Screen = basisVector1 * 0.5 * viewport;\n vec2 basisVector2Screen = basisVector2 * 0.5 * viewport;\n\n const float minPix = 1.;\n if (length(basisVector1Screen) < minPix || length(basisVector2Screen) < minPix) {\n '.concat( '\n vec3 T0 = vec3(T[0][0], T[0][1], T[0][2]);\n vec3 T1 = vec3(T[1][0], T[1][1], T[1][2]);\n vec3 T3 = vec3(T[2][0], T[2][1], T[2][2]);\n\n vec3 tempPoint = vec3(1.0, 1.0, -1.0);\n float distance = (T3.x * T3.x * tempPoint.x) + (T3.y * T3.y * tempPoint.y) + (T3.z * T3.z * tempPoint.z);\n vec3 f = (1.0 / distance) * tempPoint;\n if (abs(distance) < 0.00001) return;\n\n float pointImageX = (T0.x * T3.x * f.x) + (T0.y * T3.y * f.y) + (T0.z * T3.z * f.z);\n float pointImageY = (T1.x * T3.x * f.x) + (T1.y * T3.y * f.y) + (T1.z * T3.z * f.z);\n vec2 pointImage = vec2(pointImageX, pointImageY);\n\n float tempX = (T0.x * T0.x * f.x) + (T0.y * T0.y * f.y) + (T0.z * T0.z * f.z);\n float tempY = (T1.x * T1.x * f.x) + (T1.y * T1.y * f.y) + (T1.z * T1.z * f.z);\n vec2 temp = vec2(tempX, tempY);\n\n vec2 halfExtend = pointImage * pointImage - temp;\n vec2 extent = sqrt(max(vec2(0.0001), halfExtend));\n float radius = max(extent.x, extent.y);\n\n vec2 ndcOffset = ((position.xy * radius * 3.0) * basisViewport * 2.0);\n\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n vT = T;\n vQuadCenter = pointImage;\n vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\n ', '\n } else {\n vec2 ndcOffset = vec2(position.x * basisVector1 + position.y * basisVector2) * 3.0 * inverseFocalAdjustment;\n vec4 quadPos = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n gl_Position = quadPos;\n\n vT = T;\n vQuadCenter = center.xy;\n vFragCoord = (quadPos.xy * 0.5 + 0.5) * viewport;\n }\n ' )), (e += Ex.getVertexShaderFadeIn()), (e += '}') ) }, }, { key: 'buildFragmentShader', value: function () { return '\n precision highp float;\n #include \n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n varying vec2 vPosition;\n varying mat3 vT;\n varying vec2 vQuadCenter;\n varying vec2 vFragCoord;\n\n void main () {\n\n const float FilterInvSquare = 2.0;\n const float near_n = 0.2;\n const float T = 1.0;\n\n vec2 xy = vQuadCenter;\n vec3 Tu = vT[0];\n vec3 Tv = vT[1];\n vec3 Tw = vT[2];\n vec3 k = vFragCoord.x * Tw - Tu;\n vec3 l = vFragCoord.y * Tw - Tv;\n vec3 p = cross(k, l);\n if (p.z == 0.0) discard;\n vec2 s = vec2(p.x / p.z, p.y / p.z);\n float rho3d = (s.x * s.x + s.y * s.y); \n vec2 d = vec2(xy.x - vFragCoord.x, xy.y - vFragCoord.y);\n float rho2d = FilterInvSquare * (d.x * d.x + d.y * d.y); \n\n // compute intersection and depth\n float rho = min(rho3d, rho2d);\n float depth = (rho3d <= rho2d) ? (s.x * Tw.x + s.y * Tw.y) + Tw.z : Tw.z; \n if (depth < near_n) discard;\n // vec4 nor_o = collected_normal_opacity[j];\n // float normal[3] = {nor_o.x, nor_o.y, nor_o.z};\n float opa = vColor.a;\n\n float power = -0.5f * rho;\n if (power > 0.0f) discard;\n\n // Eq. (2) from 3D Gaussian splatting paper.\n // Obtain alpha by multiplying with Gaussian opacity\n // and its exponential falloff from mean.\n // Avoid numerical instabilities (see paper appendix). \n float alpha = min(0.99f, opa * exp(power));\n if (alpha < 1.0f / 255.0f) discard;\n float test_T = T * (1.0 - alpha);\n if (test_T < 0.0001)discard;\n\n float w = alpha * T;\n gl_FragColor = vec4(vColor.rgb, w);\n }\n ' }, }, ]) })(), Rx = (function () { return T( function e() { A(this, e) }, null, [ { key: 'build', value: function (e) { var t = new af() t.setIndex([0, 1, 2, 0, 2, 3]) var n = new Float32Array(12), r = new qd(n, 3) ;(t.setAttribute('position', r), r.setXYZ(0, -1, -1, 0), r.setXYZ(1, -1, 1, 0), r.setXYZ(2, 1, 1, 0), r.setXYZ(3, 1, -1, 0), (r.needsUpdate = !0)) var i = new Bv().copy(t), a = new Uint32Array(e), o = new np(a, 1, !1) return ( o.setUsage(Tc), i.setAttribute('splatIndex', o), (i.instanceCount = 0), i ) }, }, ] ) })(), Ix = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new ph(), i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new fh(), a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : new ph(1, 1, 1), o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 1, u = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6] return ( A(this, t), ((n = y(this, t)).splatBuffer = e), n.position.copy(r), n.quaternion.copy(i), n.scale.copy(a), (n.transform = new Gh()), (n.minimumAlpha = o), (n.opacity = s), (n.visible = u), n ) } return ( x(t, e), T(t, [ { key: 'copyTransformData', value: function (e) { ;(this.position.copy(e.position), this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.transform.copy(e.transform)) }, }, { key: 'updateTransform', value: function (e) { e ? (this.matrixWorldAutoUpdate && this.updateWorldMatrix(!0, !1), this.transform.copy(this.matrixWorld)) : (this.matrixAutoUpdate && this.updateMatrix(), this.transform.copy(this.matrix)) }, }, ]) ) })(gd), Nx = T(function e(t, n, r, i) { ;(A(this, e), (this.min = new ph().copy(t)), (this.max = new ph().copy(n)), (this.boundingBox = new gh(this.min, this.max)), (this.center = new ph() .copy(this.max) .sub(this.min) .multiplyScalar(0.5) .add(this.min)), (this.depth = r), (this.children = []), (this.data = null), (this.id = i || e.idGen++)) }) M(Nx, 'idGen', 0) var Px = (function () { function e(t, n) { ;(A(this, e), (this.maxDepth = t), (this.maxCentersPerNode = n), (this.sceneDimensions = new ph()), (this.sceneMin = new ph()), (this.sceneMax = new ph()), (this.rootNode = null), (this.nodesWithIndexes = []), (this.splatMesh = null)) } return T(e, null, [ { key: 'convertWorkerSubTreeNode', value: function (t) { var n = new ph().fromArray(t.min), r = new ph().fromArray(t.max), i = new Nx(n, r, t.depth, t.id) if (t.data.indexes) { i.data = { indexes: [] } var a, o = L(t.data.indexes) try { for (o.s(); !(a = o.n()).done; ) { var s = a.value i.data.indexes.push(s) } } catch (h) { o.e(h) } finally { o.f() } } if (t.children) { var u, l = L(t.children) try { for (l.s(); !(u = l.n()).done; ) { var c = u.value i.children.push(e.convertWorkerSubTreeNode(c)) } } catch (h) { l.e(h) } finally { l.f() } } return i }, }, { key: 'convertWorkerSubTree', value: function (t, n) { var r = new e(t.maxDepth, t.maxCentersPerNode) ;((r.sceneMin = new ph().fromArray(t.sceneMin)), (r.sceneMax = new ph().fromArray(t.sceneMax)), (r.splatMesh = n), (r.rootNode = e.convertWorkerSubTreeNode(t.rootNode))) var i = function (e, t) { 0 === e.children.length && t(e) var n, r = L(e.children) try { for (r.s(); !(n = r.n()).done; ) { var a = n.value i(a, t) } } catch (o) { r.e(o) } finally { r.f() } } return ( (r.nodesWithIndexes = []), i(r.rootNode, function (e) { e.data && e.data.indexes && e.data.indexes.length > 0 && r.nodesWithIndexes.push(e) }), r ) }, }, ]) })() function Lx(e) { var t = 0, n = (function () { return T( function e(t, n) { ;(A(this, e), (this.min = [t[0], t[1], t[2]]), (this.max = [n[0], n[1], n[2]])) }, [ { key: 'containsPoint', value: function (e) { return ( e[0] >= this.min[0] && e[0] <= this.max[0] && e[1] >= this.min[1] && e[1] <= this.max[1] && e[2] >= this.min[2] && e[2] <= this.max[2] ) }, }, ] ) })(), r = T(function e(t, n) { ;(A(this, e), (this.maxDepth = t), (this.maxCentersPerNode = n), (this.sceneDimensions = []), (this.sceneMin = []), (this.sceneMax = []), (this.rootNode = null), (this.addedIndexes = {}), (this.nodesWithIndexes = []), (this.splatMesh = null), (this.disposed = !1)) }), i = T(function e(n, r, i, a) { ;(A(this, e), (this.min = [n[0], n[1], n[2]]), (this.max = [r[0], r[1], r[2]]), (this.center = [ 0.5 * (r[0] - n[0]) + n[0], 0.5 * (r[1] - n[1]) + n[1], 0.5 * (r[2] - n[2]) + n[2], ]), (this.depth = i), (this.children = []), (this.data = null), (this.id = a || t++)) }) processSplatTreeNode = (function (e) { function t(t, n, r, i) { return e.apply(this, arguments) } return ( (t.toString = function () { return e.toString() }), t ) })(function (e, t, r, a) { var o = t.data.indexes.length if (o < e.maxCentersPerNode || t.depth > e.maxDepth) { for (var s = [], u = 0; u < t.data.indexes.length; u++) e.addedIndexes[t.data.indexes[u]] || (s.push(t.data.indexes[u]), (e.addedIndexes[t.data.indexes[u]] = !0)) return ( (t.data.indexes = s), t.data.indexes.sort(function (e, t) { return e > t ? 1 : -1 }), void e.nodesWithIndexes.push(t) ) } for ( var l = [t.max[0] - t.min[0], t.max[1] - t.min[1], t.max[2] - t.min[2]], c = [0.5 * l[0], 0.5 * l[1], 0.5 * l[2]], h = [t.min[0] + c[0], t.min[1] + c[1], t.min[2] + c[2]], d = [ new n([h[0] - c[0], h[1], h[2] - c[2]], [h[0], h[1] + c[1], h[2]]), new n([h[0], h[1], h[2] - c[2]], [h[0] + c[0], h[1] + c[1], h[2]]), new n([h[0], h[1], h[2]], [h[0] + c[0], h[1] + c[1], h[2] + c[2]]), new n([h[0] - c[0], h[1], h[2]], [h[0], h[1] + c[1], h[2] + c[2]]), new n([h[0] - c[0], h[1] - c[1], h[2] - c[2]], [h[0], h[1], h[2]]), new n([h[0], h[1] - c[1], h[2] - c[2]], [h[0] + c[0], h[1], h[2]]), new n([h[0], h[1] - c[1], h[2]], [h[0] + c[0], h[1], h[2] + c[2]]), new n([h[0] - c[0], h[1] - c[1], h[2]], [h[0], h[1], h[2] + c[2]]), ], f = [], p = 0; p < d.length; p++ ) f[p] = [] for (var v = [0, 0, 0], m = 0; m < o; m++) { var g = t.data.indexes[m], y = r[g] ;((v[0] = a[y]), (v[1] = a[y + 1]), (v[2] = a[y + 2])) for (var _ = 0; _ < d.length; _++) d[_].containsPoint(v) && f[_].push(g) } for (var b = 0; b < d.length; b++) { var x = new i(d[b].min, d[b].max, t.depth + 1) ;((x.data = { indexes: f[b] }), t.children.push(x)) } t.data = {} var S, A = L(t.children) try { for (A.s(); !(S = A.n()).done; ) { var w = S.value processSplatTreeNode(e, w, r, a) } } catch (T) { A.e(T) } finally { A.f() } }) var a = function (e, t, n) { for ( var a = [0, 0, 0], o = [0, 0, 0], s = [], u = Math.floor(e.length / 4), l = 0; l < u; l++ ) { var c = 4 * l, h = e[c], d = e[c + 1], f = e[c + 2], p = Math.round(e[c + 3]) ;((0 === l || h < a[0]) && (a[0] = h), (0 === l || h > o[0]) && (o[0] = h), (0 === l || d < a[1]) && (a[1] = d), (0 === l || d > o[1]) && (o[1] = d), (0 === l || f < a[2]) && (a[2] = f), (0 === l || f > o[2]) && (o[2] = f), s.push(p)) } var v = new r(t, n) return ( (v.sceneMin = a), (v.sceneMax = o), (v.rootNode = new i(v.sceneMin, v.sceneMax, 0)), (v.rootNode.data = { indexes: s }), v ) } e.onmessage = function (t) { t.data.process && (function (t, n, r) { var i, o = [], s = L(t) try { for (s.s(); !(i = s.n()).done; ) for (var u = i.value, l = Math.floor(u.length / 4), c = 0; c < l; c++) { var h = 4 * c o[Math.round(u[h + 3])] = h } } catch (g) { s.e(g) } finally { s.f() } var d, f = [], p = L(t) try { for (p.s(); !(d = p.n()).done; ) { var v = d.value, m = a(v, n, r) ;(f.push(m), processSplatTreeNode(m, m.rootNode, o, v)) } } catch (g) { p.e(g) } finally { p.f() } e.postMessage({ subTrees: f }) })( t.data.process.centers, t.data.process.maxDepth, t.data.process.maxCentersPerNode ) } } var Dx = (function () { return T( function e(t, n) { var r = this ;(A(this, e), M(this, 'processSplatMesh', function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function () { return !0 }, n = arguments.length > 2 ? arguments[2] : void 0, i = arguments.length > 3 ? arguments[3] : void 0 ;(r.splatTreeWorker || (r.splatTreeWorker = new Worker( URL.createObjectURL( new Blob(['(', Lx.toString(), ')(self)'], { type: 'application/javascript', }) ) )), (r.splatMesh = e), (r.subTrees = [])) var a = new ph(), o = function (n, r) { for (var i = new Float32Array(4 * r), o = 0, s = 0; s < r; s++) { var u = s + n if (t(u)) { e.getSplatCenter(u, a) var l = 4 * o ;((i[l] = a.x), (i[l + 1] = a.y), (i[l + 2] = a.z), (i[l + 3] = u), o++) } } return i } return new Promise(function (t) { var a = function () { return !!r.disposed && (r.diposeSplatTreeWorker(), t(), !0) } ;(n && n(!1), Du(function () { if (!a()) { var s = [] if (e.dynamicMode) for (var u = 0, l = 0; l < e.scenes.length; l++) { var c = e.getScene(l).splatBuffer.getSplatCount(), h = o(u, c) ;(s.push(h), (u += c)) } else { var d = o(0, e.getSplatCount()) s.push(d) } ;((r.splatTreeWorker.onmessage = function (n) { a() || (n.data.subTrees && (i && i(!1), Du(function () { if (!a()) { var o, s = L(n.data.subTrees) try { for (s.s(); !(o = s.n()).done; ) { var u = o.value, l = Px.convertWorkerSubTree(u, e) r.subTrees.push(l) } } catch (c) { s.e(c) } finally { s.f() } ;(r.diposeSplatTreeWorker(), i && i(!0), Du(function () { t() })) } }))) }), Du(function () { if (!a()) { n && n(!0) var e = s.map(function (e) { return e.buffer }) !(function (e, t, n, r, i) { e.postMessage( { process: { centers: t, maxDepth: r, maxCentersPerNode: i }, }, n ) })(r.splatTreeWorker, s, e, r.maxDepth, r.maxCentersPerNode) } })) } })) }) }), (this.maxDepth = t), (this.maxCentersPerNode = n), (this.subTrees = []), (this.splatMesh = null)) }, [ { key: 'dispose', value: function () { ;(this.diposeSplatTreeWorker(), (this.disposed = !0)) }, }, { key: 'diposeSplatTreeWorker', value: function () { ;(this.splatTreeWorker && this.splatTreeWorker.terminate(), (this.splatTreeWorker = null)) }, }, { key: 'countLeaves', value: function () { var e = 0 return ( this.visitLeaves(function () { e++ }), e ) }, }, { key: 'visitLeaves', value: function (e) { var t, n = function (e, t) { 0 === e.children.length && t(e) var r, i = L(e.children) try { for (i.s(); !(r = i.n()).done; ) { var a = r.value n(a, t) } } catch (o) { i.e(o) } finally { i.f() } }, r = L(this.subTrees) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value n(i.rootNode, e) } } catch (a) { r.e(a) } finally { r.f() } }, }, ] ) })() function Ox(e) { var t = {} function n(n) { if (void 0 !== t[n]) return t[n] var r switch (n) { case 'WEBGL_depth_texture': r = e.getExtension('WEBGL_depth_texture') || e.getExtension('MOZ_WEBGL_depth_texture') || e.getExtension('WEBKIT_WEBGL_depth_texture') break case 'EXT_texture_filter_anisotropic': r = e.getExtension('EXT_texture_filter_anisotropic') || e.getExtension('MOZ_EXT_texture_filter_anisotropic') || e.getExtension('WEBKIT_EXT_texture_filter_anisotropic') break case 'WEBGL_compressed_texture_s3tc': r = e.getExtension('WEBGL_compressed_texture_s3tc') || e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc') break case 'WEBGL_compressed_texture_pvrtc': r = e.getExtension('WEBGL_compressed_texture_pvrtc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc') break default: r = e.getExtension(n) } return ((t[n] = r), r) } return { has: function (e) { return null !== n(e) }, init: function (e) { ;(e.isWebGL2 ? (n('EXT_color_buffer_float'), n('WEBGL_clip_cull_distance')) : (n('WEBGL_depth_texture'), n('OES_texture_float'), n('OES_texture_half_float'), n('OES_texture_half_float_linear'), n('OES_standard_derivatives'), n('OES_element_index_uint'), n('OES_vertex_array_object'), n('ANGLE_instanced_arrays')), n('OES_texture_float_linear'), n('EXT_color_buffer_half_float'), n('WEBGL_multisampled_render_to_texture')) }, get: function (e) { var t = n(e) return ( null === t && console.warn('THREE.WebGLRenderer: ' + e + ' extension not supported.'), t ) }, } } function Fx(e, t, n) { var r function i(t) { if ('highp' === t) { if ( e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0 ) return 'highp' t = 'mediump' } return 'mediump' === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? 'mediump' : 'lowp' } var a = 'undefined' != typeof WebGL2RenderingContext && 'WebGL2RenderingContext' === e.constructor.name, o = void 0 !== n.precision ? n.precision : 'highp', s = i(o) s !== o && (console.warn('THREE.WebGLRenderer:', o, 'not supported, using', s, 'instead.'), (o = s)) var u = a || t.has('WEBGL_draw_buffers'), l = !0 === n.logarithmicDepthBuffer, c = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), h = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS), d = e.getParameter(e.MAX_TEXTURE_SIZE), f = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE), p = e.getParameter(e.MAX_VERTEX_ATTRIBS), v = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS), m = e.getParameter(e.MAX_VARYING_VECTORS), g = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS), y = h > 0, _ = a || t.has('OES_texture_float') return { isWebGL2: a, drawBuffers: u, getMaxAnisotropy: function () { if (void 0 !== r) return r if (!0 === t.has('EXT_texture_filter_anisotropic')) { var n = t.get('EXT_texture_filter_anisotropic') r = e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT) } else r = 0 return r }, getMaxPrecision: i, precision: o, logarithmicDepthBuffer: l, maxTextures: c, maxVertexTextures: h, maxTextureSize: d, maxCubemapSize: f, maxAttributes: p, maxVertexUniforms: v, maxVaryings: m, maxFragmentUniforms: g, vertexTextures: y, floatFragmentTextures: _, floatVertexTextures: y && _, maxSamples: a ? e.getParameter(e.MAX_SAMPLES) : 0, } } var Bx = 0, Ux = 2, zx = 0, Vx = 3, Hx = new af(), Wx = new zd(), Gx = 16777216, jx = (function (e) { function t() { var e, n, r, i, a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : wx, o = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], s = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], u = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], l = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1, c = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5], h = arguments.length > 6 && void 0 !== arguments[6] && arguments[6], d = arguments.length > 7 && void 0 !== arguments[7] && arguments[7], f = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 1024, p = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : zx, v = arguments.length > 10 && void 0 !== arguments[10] ? arguments[10] : 0, m = arguments.length > 11 && void 0 !== arguments[11] ? arguments[11] : 1, g = arguments.length > 12 && void 0 !== arguments[12] ? arguments[12] : 0.3 return ( A(this, t), M((e = y(this, t, [Hx, Wx])), 'buildSplatTree', function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], n = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0 return new Promise(function (i) { ;(e.disposeSplatTree(), (e.baseSplatTree = new Dx(8, 1e3))) var a = performance.now(), o = new uh() e.baseSplatTree .processSplatMesh( e, function (n) { e.getSplatColor(n, o) var r = e.getSceneIndexForSplat(n), i = t[r] || 1 return o.w >= i }, n, r ) .then(function () { var t = performance.now() - a if ( (e.logLevel >= Vx && console.log('SplatTree build: ' + t + ' ms'), e.disposed) ) i() else { ;((e.splatTree = e.baseSplatTree), (e.baseSplatTree = null)) var n = 0, r = 0, o = 0 ;(e.splatTree.visitLeaves(function (e) { var t = e.data.indexes.length t > 0 && ((r += t), o++, n++) }), e.logLevel >= Vx && (console.log( 'SplatTree leaves: '.concat(e.splatTree.countLeaves()) ), console.log('SplatTree leaves with splats:'.concat(n)), (r /= o), console.log('Avg splat count per node: '.concat(r)), console.log('Total splat count: '.concat(e.getSplatCount()))), i()) } }) }) }), M( e, 'updateUniforms', ((n = new Vc()), function (e, t, r, i, a, o) { if (this.getSplatCount() > 0) { if ( (n.set(e.x * this.devicePixelRatio, e.y * this.devicePixelRatio), this.material.uniforms.viewport.value.copy(n), this.material.uniforms.basisViewport.value.set(1 / n.x, 1 / n.y), this.material.uniforms.focal.value.set(t, r), (this.material.uniforms.orthographicMode.value = i ? 1 : 0), (this.material.uniforms.orthoZoom.value = a), (this.material.uniforms.inverseFocalAdjustment.value = o), this.dynamicMode) ) for (var s = 0; s < this.scenes.length; s++) this.material.uniforms.transforms.value[s].copy( this.getScene(s).transform ) if (this.enableOptionalEffects) for (var u = 0; u < this.scenes.length; u++) ((this.material.uniforms.sceneOpacity.value[u] = Nu( this.getScene(u).opacity, 0, 1 )), (this.material.uniforms.sceneVisibility.value[u] = this.getScene(u) .visible ? 1 : 0), (this.material.uniformsNeedUpdate = !0)) this.material.uniformsNeedUpdate = !0 } }) ), M( e, 'setupDistancesComputationTransformFeedback', (function () { var e, t = this return function () { var n = t.getMaxSplatCount() if (t.renderer) { var r = t.lastRenderer !== t.renderer, i = e !== n if (r || i) { r ? t.disposeDistancesComputationGPUResources() : i && t.disposeDistancesComputationGPUBufferResources() var a, o = t.renderer.getContext(), s = function (e, t, n) { var r = e.createShader(t) if (!r) return ( console.error( 'Fatal error: gl could not create a shader object.' ), null ) if ( (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) ) { var i = 'unknown' t === e.VERTEX_SHADER ? (i = 'vertex shader') : t === e.FRAGMENT_SHADER && (i = 'fragement shader') var a = e.getShaderInfoLog(r) return ( console.error( 'Failed to compile ' + i + ' with these errors:' + a ), e.deleteShader(r), null ) } return r } t.integerBasedDistancesComputation ? ((a = '#version 300 es\n in ivec4 center;\n flat out int distance;'), t.dynamicMode ? (a += '\n in uint sceneIndex;\n uniform ivec4 transforms['.concat( zy.MaxScenes, '];\n void main(void) {\n ivec4 transform = transforms[sceneIndex];\n distance = center.x * transform.x + center.y * transform.y + center.z * transform.z + transform.w * center.w;\n }\n ' )) : (a += '\n uniform ivec3 modelViewProj;\n void main(void) {\n distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\n }\n ')) : ((a = '#version 300 es\n in vec4 center;\n flat out float distance;'), t.dynamicMode ? (a += '\n in uint sceneIndex;\n uniform mat4 transforms['.concat( zy.MaxScenes, '];\n void main(void) {\n vec4 transformedCenter = transforms[sceneIndex] * vec4(center.xyz, 1.0);\n distance = transformedCenter.z;\n }\n ' )) : (a += '\n uniform vec3 modelViewProj;\n void main(void) {\n distance = center.x * modelViewProj.x + center.y * modelViewProj.y + center.z * modelViewProj.z;\n }\n ')) var u = o.getParameter(o.VERTEX_ARRAY_BINDING), l = o.getParameter(o.CURRENT_PROGRAM), c = !!l && o.getProgramParameter(l, o.DELETE_STATUS) if ( (r && (t.distancesTransformFeedback.vao = o.createVertexArray()), o.bindVertexArray(t.distancesTransformFeedback.vao), r) ) { var h = o.createProgram(), d = s(o, o.VERTEX_SHADER, a), f = s( o, o.FRAGMENT_SHADER, '#version 300 es\n precision lowp float;\n out vec4 fragColor;\n void main(){}\n ' ) if (!d || !f) throw new Error( 'Could not compile shaders for distances computation on GPU.' ) if ( (o.attachShader(h, d), o.attachShader(h, f), o.transformFeedbackVaryings(h, ['distance'], o.SEPARATE_ATTRIBS), o.linkProgram(h), !o.getProgramParameter(h, o.LINK_STATUS)) ) { var p = o.getProgramInfoLog(h) throw ( console.error('Fatal error: Failed to link program: ' + p), o.deleteProgram(h), o.deleteShader(f), o.deleteShader(d), new Error( 'Could not link shaders for distances computation on GPU.' ) ) } ;((t.distancesTransformFeedback.program = h), (t.distancesTransformFeedback.vertexShader = d), (t.distancesTransformFeedback.vertexShader = f)) } if ( (o.useProgram(t.distancesTransformFeedback.program), (t.distancesTransformFeedback.centersLoc = o.getAttribLocation( t.distancesTransformFeedback.program, 'center' )), t.dynamicMode) ) { t.distancesTransformFeedback.sceneIndexesLoc = o.getAttribLocation( t.distancesTransformFeedback.program, 'sceneIndex' ) for (var v = 0; v < t.scenes.length; v++) t.distancesTransformFeedback.transformsLocs[v] = o.getUniformLocation( t.distancesTransformFeedback.program, 'transforms['.concat(v, ']') ) } else t.distancesTransformFeedback.modelViewProjLoc = o.getUniformLocation( t.distancesTransformFeedback.program, 'modelViewProj' ) ;((r || i) && ((t.distancesTransformFeedback.centersBuffer = o.createBuffer()), o.bindBuffer( o.ARRAY_BUFFER, t.distancesTransformFeedback.centersBuffer ), o.enableVertexAttribArray(t.distancesTransformFeedback.centersLoc), t.integerBasedDistancesComputation ? o.vertexAttribIPointer( t.distancesTransformFeedback.centersLoc, 4, o.INT, 0, 0 ) : o.vertexAttribPointer( t.distancesTransformFeedback.centersLoc, 4, o.FLOAT, !1, 0, 0 ), t.dynamicMode && ((t.distancesTransformFeedback.sceneIndexesBuffer = o.createBuffer()), o.bindBuffer( o.ARRAY_BUFFER, t.distancesTransformFeedback.sceneIndexesBuffer ), o.enableVertexAttribArray( t.distancesTransformFeedback.sceneIndexesLoc ), o.vertexAttribIPointer( t.distancesTransformFeedback.sceneIndexesLoc, 1, o.UNSIGNED_INT, 0, 0 ))), (r || i) && (t.distancesTransformFeedback.outDistancesBuffer = o.createBuffer()), o.bindBuffer( o.ARRAY_BUFFER, t.distancesTransformFeedback.outDistancesBuffer ), o.bufferData(o.ARRAY_BUFFER, 4 * n, o.STATIC_READ), r && (t.distancesTransformFeedback.id = o.createTransformFeedback()), o.bindTransformFeedback( o.TRANSFORM_FEEDBACK, t.distancesTransformFeedback.id ), o.bindBufferBase( o.TRANSFORM_FEEDBACK_BUFFER, 0, t.distancesTransformFeedback.outDistancesBuffer ), l && !0 !== c && o.useProgram(l), u && o.bindVertexArray(u), (t.lastRenderer = t.renderer), (e = n)) } } } })() ), M( e, 'fillTransformsArray', ((r = []), function (e) { r.length !== e.length && (r.length = e.length) for (var t = 0; t < this.scenes.length; t++) for (var n = this.getScene(t).transform.elements, i = 0; i < 16; i++) r[16 * t + i] = n[i] e.set(r) }) ), M( e, 'computeDistancesOnGPU', (function () { var e = this, n = new Gh() return function (r, i) { if (e.renderer) { var a = e.renderer.getContext(), o = a.getParameter(a.VERTEX_ARRAY_BINDING), s = a.getParameter(a.CURRENT_PROGRAM), u = !!s && a.getProgramParameter(s, a.DELETE_STATUS) if ( (a.bindVertexArray(e.distancesTransformFeedback.vao), a.useProgram(e.distancesTransformFeedback.program), a.enable(a.RASTERIZER_DISCARD), e.dynamicMode) ) for (var l = 0; l < e.scenes.length; l++) if ( (n.copy(e.getScene(l).transform), n.premultiply(r), e.integerBasedDistancesComputation) ) { var c = t.getIntegerMatrixArray(n), h = [c[2], c[6], c[10], c[14]] a.uniform4i( e.distancesTransformFeedback.transformsLocs[l], h[0], h[1], h[2], h[3] ) } else a.uniformMatrix4fv( e.distancesTransformFeedback.transformsLocs[l], !1, n.elements ) else if (e.integerBasedDistancesComputation) { var d = t.getIntegerMatrixArray(r), f = [d[2], d[6], d[10]] a.uniform3i( e.distancesTransformFeedback.modelViewProjLoc, f[0], f[1], f[2] ) } else { var p = [r.elements[2], r.elements[6], r.elements[10]] a.uniform3f( e.distancesTransformFeedback.modelViewProjLoc, p[0], p[1], p[2] ) } ;(a.bindBuffer( a.ARRAY_BUFFER, e.distancesTransformFeedback.centersBuffer ), a.enableVertexAttribArray(e.distancesTransformFeedback.centersLoc), e.integerBasedDistancesComputation ? a.vertexAttribIPointer( e.distancesTransformFeedback.centersLoc, 4, a.INT, 0, 0 ) : a.vertexAttribPointer( e.distancesTransformFeedback.centersLoc, 4, a.FLOAT, !1, 0, 0 ), e.dynamicMode && (a.bindBuffer( a.ARRAY_BUFFER, e.distancesTransformFeedback.sceneIndexesBuffer ), a.enableVertexAttribArray( e.distancesTransformFeedback.sceneIndexesLoc ), a.vertexAttribIPointer( e.distancesTransformFeedback.sceneIndexesLoc, 1, a.UNSIGNED_INT, 0, 0 )), a.bindTransformFeedback( a.TRANSFORM_FEEDBACK, e.distancesTransformFeedback.id ), a.bindBufferBase( a.TRANSFORM_FEEDBACK_BUFFER, 0, e.distancesTransformFeedback.outDistancesBuffer ), a.beginTransformFeedback(a.POINTS), a.drawArrays(a.POINTS, 0, e.getSplatCount()), a.endTransformFeedback(), a.bindBufferBase(a.TRANSFORM_FEEDBACK_BUFFER, 0, null), a.bindTransformFeedback(a.TRANSFORM_FEEDBACK, null), a.disable(a.RASTERIZER_DISCARD)) var v = a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE, 0) a.flush() var m = new Promise(function (t) { var n = function () { if (e.disposed) t() else { switch (a.clientWaitSync(v, 0, 0)) { case a.TIMEOUT_EXPIRED: return ( (e.computeDistancesOnGPUSyncTimeout = setTimeout(n)), e.computeDistancesOnGPUSyncTimeout ) case a.WAIT_FAILED: throw new Error('should never get here') default: ;((e.computeDistancesOnGPUSyncTimeout = null), a.deleteSync(v)) var r = a.getParameter(a.VERTEX_ARRAY_BINDING) ;(a.bindVertexArray(e.distancesTransformFeedback.vao), a.bindBuffer( a.ARRAY_BUFFER, e.distancesTransformFeedback.outDistancesBuffer ), a.getBufferSubData(a.ARRAY_BUFFER, 0, i), a.bindBuffer(a.ARRAY_BUFFER, null), r && a.bindVertexArray(r), t()) } } } e.computeDistancesOnGPUSyncTimeout = setTimeout(n) }) return (s && !0 !== u && a.useProgram(s), o && a.bindVertexArray(o), m) } } })() ), M(e, 'morphedMesh', void 0), M( e, 'getSplatCenter', ((i = {}), function (e, t, n, r) { ;(this.getLocalSplatParameters(t, i, r), i.splatBuffer.getSplatCenter(e, i.localIndex, n, i.sceneTransform)) }) ), M( e, 'getSplatScaleAndRotation', (function () { var e = {}, t = new ph() return function (n, r, i, a) { ;(this.getLocalSplatParameters(n, e, a), (t.x = void 0), (t.y = void 0), (t.z = void 0), this.splatRenderMode === Tx && (t.z = 0), e.splatBuffer.getSplatScaleAndRotation( e.localIndex, r, i, e.sceneTransform, t )) } })() ), M( e, 'getSplatColor', (function () { var e = {} return function (t, n) { ;(this.getLocalSplatParameters(t, e), e.splatBuffer.getSplatColor(e.localIndex, n)) } })() ), (e.renderer = void 0), (e.splatRenderMode = a), (e.dynamicMode = o), (e.enableOptionalEffects = s), (e.halfPrecisionCovariancesOnGPU = u), (e.devicePixelRatio = l), (e.enableDistancesComputationOnGPU = c), (e.integerBasedDistancesComputation = h), (e.antialiased = d), (e.kernel2DSize = g), (e.maxScreenSpaceSplatSize = f), (e.logLevel = p), (e.sphericalHarmonicsDegree = v), (e.minSphericalHarmonicsDegree = 0), (e.sceneFadeInRateMultiplier = m), (e.scenes = []), (e.splatTree = null), (e.baseSplatTree = null), (e.splatDataTextures = {}), (e.flameModel = null), (e.expressionBSNum = 0), (e.bsWeight = []), (e.bonesMatrix = null), (e.bonesNum = null), (e.bonesWeight = null), (e.gaussianSplatCount = null), (e.useFlameModel = !0), (e.morphTargetDictionary = null), (e.distancesTransformFeedback = { id: null, vertexShader: null, fragmentShader: null, program: null, centersBuffer: null, sceneIndexesBuffer: null, outDistancesBuffer: null, centersLoc: -1, modelViewProjLoc: -1, sceneIndexesLoc: -1, transformsLocs: [], }), (e.globalSplatIndexToLocalSplatIndexMap = []), (e.globalSplatIndexToSceneIndexMap = []), (e.lastBuildSplatCount = 0), (e.lastBuildScenes = []), (e.lastBuildMaxSplatCount = 0), (e.lastBuildSceneCount = 0), (e.firstRenderTime = -1), (e.finalBuild = !1), (e.webGLUtils = null), (e.boundingBox = new gh()), (e.calculatedSceneCenter = new ph()), (e.maxSplatDistanceFromSceneCenter = 0), (e.visibleRegionBufferRadius = 0), (e.visibleRegionRadius = 0), (e.visibleRegionFadeStartRadius = 0), (e.visibleRegionChanging = !1), (e.splatScale = 1), (e.pointCloudModeEnabled = !1), (e.disposed = !1), (e.lastRenderer = null), (e.visible = !1), e ) } return ( x(t, e), T( t, [ { key: 'build', value: function (e, n) { var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], a = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6] ;((this.sceneOptions = n), (this.finalBuild = i)) var o = t.getTotalMaxSplatCountForSplatBuffers(e), s = t.buildScenes(this, e, n) if (r) for (var u = 0; u < this.scenes.length && u < s.length; u++) { var l = s[u], c = this.getScene(u) l.copyTransformData(c) } this.scenes = s var h, d = 3, f = L(e) try { for (f.s(); !(h = f.n()).done; ) { var p = h.value.getMinSphericalHarmonicsDegree() p < d && (d = p) } } catch (S) { f.e(S) } finally { f.f() } this.minSphericalHarmonicsDegree = Math.min( d, this.sphericalHarmonicsDegree ) var v = !1 if (e.length !== this.lastBuildScenes.length) v = !0 else for (var m = 0; m < e.length; m++) { if (e[m] !== this.lastBuildScenes[m].splatBuffer) { v = !0 break } } var g = !0 if ( ((1 !== this.scenes.length || this.lastBuildSceneCount !== this.scenes.length || this.lastBuildMaxSplatCount !== o || v) && (g = !1), !g) ) { ;((this.boundingBox = new gh()), a || ((this.maxSplatDistanceFromSceneCenter = 0), (this.visibleRegionBufferRadius = 0), (this.visibleRegionRadius = 0), (this.visibleRegionFadeStartRadius = 0), (this.firstRenderTime = -1)), (this.lastBuildScenes = []), (this.lastBuildSplatCount = 0), (this.lastBuildMaxSplatCount = 0), this.disposeMeshData(), (this.geometry = Rx.build(o)), this.splatRenderMode === wx ? (this.material = Cx.build( this.dynamicMode, this.enableOptionalEffects, this.antialiased, this.maxScreenSpaceSplatSize, this.splatScale, this.pointCloudModeEnabled, this.minSphericalHarmonicsDegree, this.kernel2DSize, this.useFlameModel )) : (this.material = kx.build( this.dynamicMode, this.enableOptionalEffects, this.splatScale, this.pointCloudModeEnabled, this.minSphericalHarmonicsDegree ))) var y = t.buildSplatIndexMaps(e) ;((this.globalSplatIndexToLocalSplatIndexMap = y.localSplatIndexMap), (this.globalSplatIndexToSceneIndexMap = y.sceneIndexMap)) } var _ = this.getSplatCount(!0) this.enableDistancesComputationOnGPU && this.setupDistancesComputationTransformFeedback() for ( var b = this.refreshGPUDataFromSplatBuffers(g), x = 0; x < this.scenes.length; x++ ) this.lastBuildScenes[x] = this.scenes[x] return ( (this.lastBuildSplatCount = _), (this.lastBuildMaxSplatCount = this.getMaxSplatCount()), (this.lastBuildSceneCount = this.scenes.length), (this.visible = this.scenes.length > 0), b ) }, }, { key: 'freeIntermediateSplatData', value: function () { var e = this, t = function (e) { ;(delete e.source.data, delete e.image, (e.onUpdate = null)) } ;(delete this.splatDataTextures.baseData.covariances, delete this.splatDataTextures.baseData.centers, delete this.splatDataTextures.baseData.colors, delete this.splatDataTextures.baseData.sphericalHarmonics, delete this.splatDataTextures.centerColors.data, delete this.splatDataTextures.covariances.data, this.splatDataTextures.sphericalHarmonics && delete this.splatDataTextures.sphericalHarmonics.data, this.splatDataTextures.sceneIndexes && delete this.splatDataTextures.sceneIndexes.data, (this.splatDataTextures.centerColors.texture.needsUpdate = !0), (this.splatDataTextures.centerColors.texture.onUpdate = function () { t(e.splatDataTextures.centerColors.texture) }), (this.splatDataTextures.flameModelPosTexture.texture.needsUpdate = !0), (this.splatDataTextures.flameModelPosTexture.texture.onUpdate = function () { t(e.splatDataTextures.flameModelPosTexture.texture) }), (this.splatDataTextures.covariances.texture.needsUpdate = !0), (this.splatDataTextures.covariances.texture.onUpdate = function () { t(e.splatDataTextures.covariances.texture) }), this.splatDataTextures.sphericalHarmonics && (this.splatDataTextures.sphericalHarmonics.texture ? ((this.splatDataTextures.sphericalHarmonics.texture.needsUpdate = !0), (this.splatDataTextures.sphericalHarmonics.texture.onUpdate = function () { t(e.splatDataTextures.sphericalHarmonics.texture) })) : this.splatDataTextures.sphericalHarmonics.textures.forEach( function (e) { ;((e.needsUpdate = !0), (e.onUpdate = function () { t(e) })) } )), this.splatDataTextures.sceneIndexes && ((this.splatDataTextures.sceneIndexes.texture.needsUpdate = !0), (this.splatDataTextures.sceneIndexes.texture.onUpdate = function () { t(e.splatDataTextures.sceneIndexes.texture) }))) }, }, { key: 'dispose', value: function () { ;(this.disposeMeshData(), this.disposeTextures(), this.disposeSplatTree(), this.enableDistancesComputationOnGPU && (this.computeDistancesOnGPUSyncTimeout && (clearTimeout(this.computeDistancesOnGPUSyncTimeout), (this.computeDistancesOnGPUSyncTimeout = null)), this.disposeDistancesComputationGPUResources()), (this.scenes = []), (this.distancesTransformFeedback = { id: null, vertexShader: null, fragmentShader: null, program: null, centersBuffer: null, sceneIndexesBuffer: null, outDistancesBuffer: null, centersLoc: -1, modelViewProjLoc: -1, sceneIndexesLoc: -1, transformsLocs: [], }), (this.renderer = null), (this.globalSplatIndexToLocalSplatIndexMap = []), (this.globalSplatIndexToSceneIndexMap = []), (this.lastBuildSplatCount = 0), (this.lastBuildScenes = []), (this.lastBuildMaxSplatCount = 0), (this.lastBuildSceneCount = 0), (this.firstRenderTime = -1), (this.finalBuild = !1), (this.webGLUtils = null), (this.boundingBox = new gh()), (this.calculatedSceneCenter = new ph()), (this.maxSplatDistanceFromSceneCenter = 0), (this.visibleRegionBufferRadius = 0), (this.visibleRegionRadius = 0), (this.visibleRegionFadeStartRadius = 0), (this.visibleRegionChanging = !1), (this.splatScale = 1), (this.pointCloudModeEnabled = !1), (this.disposed = !0), (this.lastRenderer = null), (this.visible = !1)) }, }, { key: 'disposeMeshData', value: function () { ;(this.geometry && this.geometry !== Hx && (this.geometry.dispose(), (this.geometry = null)), this.material && (this.material.dispose(), (this.material = null))) }, }, { key: 'disposeTextures', value: function () { for (var e in this.splatDataTextures) if (this.splatDataTextures.hasOwnProperty(e)) { var t = this.splatDataTextures[e] t.texture && (t.texture.dispose(), (t.texture = null)) } this.splatDataTextures = null }, }, { key: 'disposeSplatTree', value: function () { ;(this.splatTree && (this.splatTree.dispose(), (this.splatTree = null)), this.baseSplatTree && (this.baseSplatTree.dispose(), (this.baseSplatTree = null))) }, }, { key: 'getSplatTree', value: function () { return this.splatTree }, }, { key: 'onSplatTreeReady', value: function (e) { this.onSplatTreeReadyCallback = e }, }, { key: 'getDataForDistancesComputation', value: function (e, t) { return { centers: this.integerBasedDistancesComputation ? this.getIntegerCenters(e, t, !0) : this.getFloatCenters(e, t, !0), sceneIndexes: this.getSceneIndexes(e, t), } }, }, { key: 'refreshGPUDataFromSplatBuffers', value: function (e) { var t = this.getSplatCount(!0) this.refreshDataTexturesFromSplatBuffers(e) var n = e ? this.lastBuildSplatCount : 0, r = this.getDataForDistancesComputation(n, t - 1), i = r.centers, a = r.sceneIndexes return ( this.enableDistancesComputationOnGPU && this.refreshGPUBuffersForDistancesComputation(i, a, e), { from: n, to: t - 1, count: t - n, centers: i, sceneIndexes: a } ) }, }, { key: 'refreshGPUBuffersForDistancesComputation', value: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = n ? this.lastBuildSplatCount : 0 ;(this.updateGPUCentersBufferForDistancesComputation(n, e, r), this.updateGPUTransformIndexesBufferForDistancesComputation(n, t, r)) }, }, { key: 'refreshDataTexturesFromSplatBuffers', value: function (e) { var t = this.getSplatCount(!0), n = this.lastBuildSplatCount, r = t - 1 ;(e ? this.updateBaseDataFromSplatBuffers(n, r) : (this.setupDataTextures(), this.updateBaseDataFromSplatBuffers()), this.updateDataTexturesFromBaseData(n, r), this.updateVisibleRegion(e)) }, }, { key: 'setupDataTextures', value: function () { var e = this, n = this.getMaxSplatCount(), r = this.getSplatCount(!0) this.disposeTextures() var i, a, o, s = function (e, t) { for (var r = new Vc(4096, 1024); r.x * r.y * e < n * t; ) r.y *= 2 return r }, u = function (e) { var t = (function (e) { return e >= 1 ? 6 : 4 })(e) return { elementsPerTexelStored: t, texSize: s(t, 6) } }, l = this.getTargetCovarianceCompressionLevel(), c = this.getTargetSphericalHarmonicsCompressionLevel() if (this.splatRenderMode === wx) { var h = u(l) ;(h.texSize.x * h.texSize.y > Gx && 0 === l && (l = 1), (i = new Float32Array(6 * n))) } else ((a = new Float32Array(3 * n)), (o = new Float32Array(4 * n))) var d = new Float32Array(3 * n), f = new Uint8Array(4 * n), p = Float32Array 1 === c ? (p = Uint16Array) : 2 === c && (p = Uint8Array) var v = Ou(this.minSphericalHarmonicsDegree), m = this.minSphericalHarmonicsDegree ? new p(n * v) : void 0, g = s(4, 4), y = new Uint32Array(g.x * g.y * 4) t.updateCenterColorsPaddedData(0, r - 1, d, f, y) var _ = new Jf(y, g.x, g.y, Il, gl) if ( ((_.internalFormat = 'RGBA32UI'), (_.needsUpdate = !0), (this.material.uniforms.centersColorsTexture.value = _), this.material.uniforms.centersColorsTextureSize.value.copy(g), (this.material.uniformsNeedUpdate = !0), (this.splatDataTextures = { baseData: { covariances: i, scales: a, rotations: o, centers: d, colors: f, sphericalHarmonics: m, }, centerColors: { data: y, texture: _, size: g }, }), this.splatRenderMode === wx) ) { var b, x = u(l), S = x.elementsPerTexelStored, A = x.texSize, w = l >= 1 ? 8 : 4, T = new (l >= 1 ? Uint32Array : Float32Array)(A.x * A.y * w) if ( (0 === l ? T.set(i) : t.updatePaddedCompressedCovariancesTextureData( i, T, 0, 0, i.length ), l >= 1) ) (((b = new Jf(T, A.x, A.y, Il, gl)).internalFormat = 'RGBA32UI'), (this.material.uniforms.covariancesTextureHalfFloat.value = b)) else { ;((b = new Jf(T, A.x, A.y, wl, yl)), (this.material.uniforms.covariancesTexture.value = b)) var M = new Jf(new Uint32Array(32), 2, 2, Il, gl) ;((M.internalFormat = 'RGBA32UI'), (this.material.uniforms.covariancesTextureHalfFloat.value = M), (M.needsUpdate = !0)) } ;((b.needsUpdate = !0), (this.material.uniforms.covariancesAreHalfFloat.value = l >= 1 ? 1 : 0), this.material.uniforms.covariancesTextureSize.value.copy(A), (this.splatDataTextures.covariances = { data: T, texture: b, size: A, compressionLevel: l, elementsPerTexelStored: S, elementsPerTexelAllocated: w, })) } else { var E = s(4, 6), C = Float32Array, k = new C(E.x * E.y * 4) t.updateScaleRotationsPaddedData(0, r - 1, a, o, k) var R = new Jf(k, E.x, E.y, wl, 1015) ;((R.needsUpdate = !0), (this.material.uniforms.scaleRotationsTexture.value = R), this.material.uniforms.scaleRotationsTextureSize.value.copy(E), (this.splatDataTextures.scaleRotations = { data: k, texture: R, size: E, compressionLevel: 0, })) } if (m) { var I = 2 === c ? dl : _l, N = v N % 2 != 0 && N++ var P = 2 === this.minSphericalHarmonicsDegree ? 4 : 2, L = 4 === P ? wl : kl, D = s(P, N) if (D.x * D.y <= Gx) { for (var O = new p(D.x * D.y * P), F = 0; F < r; F++) for (var B = v * F, U = N * F, z = 0; z < v; z++) O[U + z] = m[B + z] var V = new Jf(O, D.x, D.y, L, I) ;((V.needsUpdate = !0), (this.material.uniforms.sphericalHarmonicsTexture.value = V), (this.splatDataTextures.sphericalHarmonics = { componentCount: v, paddedComponentCount: N, data: O, textureCount: 1, texture: V, size: D, compressionLevel: c, elementsPerTexel: P, })) } else { var H = v / 3 ;(N = H) % 2 != 0 && N++ for ( var W = (D = s(P, N)).x * D.y * P, G = [ this.material.uniforms.sphericalHarmonicsTextureR, this.material.uniforms.sphericalHarmonicsTextureG, this.material.uniforms.sphericalHarmonicsTextureB, ], j = [], Q = [], q = 0; q < 3; q++ ) { var X = new p(W) j.push(X) for (var Y = 0; Y < r; Y++) { var K = v * Y, Z = N * Y if (H >= 3) { for (var J = 0; J < 3; J++) X[Z + J] = m[K + 3 * q + J] if (H >= 8) for (var $ = 0; $ < 5; $++) X[Z + 3 + $] = m[K + 9 + 5 * q + $] } } var ee = new Jf(X, D.x, D.y, L, I) ;(Q.push(ee), (ee.needsUpdate = !0), (G[q].value = ee)) } ;((this.material.uniforms.sphericalHarmonicsMultiTextureMode.value = 1), (this.splatDataTextures.sphericalHarmonics = { componentCount: v, componentCountPerChannel: H, paddedComponentCount: N, data: j, textureCount: 3, textures: Q, size: D, compressionLevel: c, elementsPerTexel: P, })) } ;(this.material.uniforms.sphericalHarmonicsTextureSize.value.copy(D), (this.material.uniforms.sphericalHarmonics8BitMode.value = 2 === c ? 1 : 0)) for (var te = 0; te < this.scenes.length; te++) { var ne = this.scenes[te].splatBuffer ;((this.material.uniforms.sphericalHarmonics8BitCompressionRangeMin.value[ te ] = ne.minSphericalHarmonicsCoeff), (this.material.uniforms.sphericalHarmonics8BitCompressionRangeMax.value[ te ] = ne.maxSphericalHarmonicsCoeff)) } this.material.uniformsNeedUpdate = !0 } for ( var re = s(1, 4), ie = new Uint32Array(re.x * re.y * 1), ae = 0; ae < r; ae++ ) ie[ae] = this.globalSplatIndexToSceneIndexMap[ae] var oe = new Jf(ie, re.x, re.y, Cl, gl) ;((oe.internalFormat = 'R32UI'), (oe.needsUpdate = !0), (this.material.uniforms.sceneIndexesTexture.value = oe), this.material.uniforms.sceneIndexesTextureSize.value.copy(re), (this.material.uniformsNeedUpdate = !0), (this.splatDataTextures.sceneIndexes = { data: ie, texture: oe, size: re, }), (this.material.uniforms.sceneCount.value = this.scenes.length), (this.expressionBSNum = this.flameModel.geometry.morphAttributes.position.length), (this.material.uniforms.bsCount.value = this.expressionBSNum), this.flameModel.skeleton.bones.forEach(function (t, n) { 'head' == t.name && (e.material.uniforms.headBoneIndex.value = n) }), this.buildModelTexture(this.flameModel), this.buildBoneMatrixTexture(), this.useFlameModel && this.buildBoneWeightTexture(this.flameModel)) }, }, { key: 'buildBoneMatrixTexture', value: function () { if (this.bsWeight) { var e = new Vc(4, 32), t = new Float32Array(this.bonesMatrix), n = new Uint32Array(e.x * e.y * 4) if ( ((this.morphTargetDictionary = this.flameModel.morphTargetDictionary), this.useFlameModel) ) { for (var r = 0; r < 16 * this.bonesNum; r++) n[r] = ku(t[r]) this.flameModel && this.flameModel.skeleton && ((this.material.uniforms.boneTexture0.value = this.flameModel.skeleton.boneTexture), (this.material.uniforms.bindMatrix.value = this.flameModel.bindMatrix), (this.material.uniforms.bindMatrixInverse.value = this.flameModel.bindMatrixInverse)) } for (var i in this.bsWeight) if (this.bsWeight.hasOwnProperty(i)) { var a = this.bsWeight[i] n[this.morphTargetDictionary[i] + 16 * this.bonesNum] = ku(a) } var o = new Jf(n, e.x, e.y, Il, gl) ;((o.internalFormat = 'RGBA32UI'), (o.needsUpdate = !0), (this.material.uniforms.boneTexture.value = o), this.material.uniforms.boneTextureSize.value.copy(e), (this.material.uniformsNeedUpdate = !0), (this.splatDataTextures.boneMatrix = { data: n, texture: o, size: e }), (this.splatDataTextures.baseData.boneMatrix = n)) } }, }, { key: 'updateBoneMatrixTexture', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] if (this.bsWeight && this.morphTargetDictionary) { if (1 == e) for ( var t = new Float32Array(this.bonesMatrix), n = 0; n < 16 * this.bonesNum; n++ ) this.splatDataTextures.baseData.boneMatrix[n] = ku(t[n]) for (var r in this.bsWeight) if (this.bsWeight.hasOwnProperty(r)) { var i = this.bsWeight[r], a = this.morphTargetDictionary[r] this.splatDataTextures.baseData.boneMatrix[a + 16 * this.bonesNum] = ku(i) } ;((this.splatDataTextures.boneMatrix.texture.data = this.splatDataTextures.baseData.boneMatrix), (this.splatDataTextures.boneMatrix.texture.needsUpdate = !0), (this.material.uniforms.boneTexture.value = this.splatDataTextures.boneMatrix.texture), this.flameModel.skeleton && ((this.material.uniforms.boneTexture0.value = this.flameModel.skeleton.boneTexture), (this.material.uniforms.bindMatrix.value = this.flameModel.bindMatrix), (this.material.uniforms.bindMatrixInverse.value = this.flameModel.bindMatrixInverse)), (this.material.uniformsNeedUpdate = !0)) } }, }, { key: 'buildBoneWeightTexture', value: function (e) { for ( var t = e.geometry.attributes.position.array.length / 3, n = new Vc(512, 512), r = new Float32Array(n.x * n.y * 4), i = new Uint32Array(n.x * n.y * 4), a = 0; a < t; a++ ) ((r[8 * a + 0] = this.bonesWeight[a][0]), (r[8 * a + 1] = this.bonesWeight[a][1]), (r[8 * a + 2] = this.bonesWeight[a][2]), (r[8 * a + 3] = this.bonesWeight[a][3]), (r[8 * a + 4] = this.bonesWeight[a][4]), (i[8 * a + 0] = ku(this.bonesWeight[a][0])), (i[8 * a + 1] = ku(this.bonesWeight[a][1])), (i[8 * a + 2] = ku(this.bonesWeight[a][2])), (i[8 * a + 3] = ku(this.bonesWeight[a][3])), (i[8 * a + 4] = ku(this.bonesWeight[a][4]))) var o = new Jf(i, n.x, n.y, Il, gl) ;((o.internalFormat = 'RGBA32UI'), (o.needsUpdate = !0), (this.material.uniforms.boneWeightTexture.value = o), this.material.uniforms.boneWeightTextureSize.value.copy(n), (this.material.uniformsNeedUpdate = !0), (this.splatDataTextures.boneWeight = { data: i, texture: o, size: n }), (this.splatDataTextures.baseData.boneWeight = i)) }, }, { key: 'buildModelTexture', value: function (e) { var t = new Vc(4096, 2048), n = e.geometry.attributes.position.array, r = [], i = n.length / 3, a = e.geometry.morphAttributes.position.length ;(Object.keys(e.morphTargetDictionary).forEach(function (t, n) { var i = e.morphTargetDictionary[t], a = e.geometry.morphAttributes.position[i] r = r.concat(Array.from(a.array)) }), (r = r.concat(Array.from(n)))) for ( var o = new Float32Array(t.x * t.y * 4), s = new Uint32Array(t.x * t.y * 4), u = 0; u < i * (a + 1); u++ ) ((o[4 * u + 0] = r[3 * u + 0]), (o[4 * u + 1] = r[3 * u + 1]), (o[4 * u + 2] = r[3 * u + 2]), (s[4 * u + 0] = ku(o[4 * u + 0])), (s[4 * u + 1] = ku(o[4 * u + 1])), (s[4 * u + 2] = ku(o[4 * u + 2]))) var l = new Jf(s, t.x, t.y, Il, gl) ;((l.internalFormat = 'RGBA32UI'), (l.needsUpdate = !0), (this.material.uniforms.flameModelTexture.value = l), this.material.uniforms.flameModelTextureSize.value.copy(t), (this.material.uniformsNeedUpdate = !0), (this.material.uniforms.gaussianSplatCount.value = this.gaussianSplatCount), (this.splatDataTextures.flameModel = { data: s, texture: l, size: t }), (this.splatDataTextures.baseData.flameModelPos = o)) }, }, { key: 'updateTetureAfterBSAndSkeleton', value: function (e, n) { var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], i = new Gh() ;(this.getSceneTransform(0, i), this.getScene(0).splatBuffer.fillSplatCenterArray( this.morphedMesh, this.splatDataTextures.baseData.centers, i, e, n, 0 )) var a = this.splatDataTextures.centerColors, o = a.data, s = a.texture t.updateCenterColorsPaddedData( e, n, this.splatDataTextures.baseData.centers, this.splatDataTextures.baseData.colors, o ) var u = this.renderer ? this.renderer.properties.get(s) : null ;(u && u.__webglTexture ? this.updateDataTexture(o, a.texture, a.size, u, 4, 4, 4, e, n) : (s.needsUpdate = !0), this.updateBoneMatrixTexture(r)) }, }, { key: 'updateBaseDataFromSplatBuffers', value: function (e, t) { var n = this.splatDataTextures.covariances, r = n ? n.compressionLevel : void 0, i = this.splatDataTextures.scaleRotations, a = i ? i.compressionLevel : void 0, o = this.splatDataTextures.sphericalHarmonics, s = o ? o.compressionLevel : 0 this.fillSplatDataArrays( this.splatDataTextures.baseData.covariances, this.splatDataTextures.baseData.scales, this.splatDataTextures.baseData.rotations, this.splatDataTextures.baseData.centers, this.splatDataTextures.baseData.colors, this.splatDataTextures.baseData.sphericalHarmonics, this.splatDataTextures.baseData.flameModelPos, void 0, r, a, s, e, t, e ) }, }, { key: 'updateDataTexturesFromBaseData', value: function (e, n) { var r = this, i = this.splatDataTextures.covariances, a = i ? i.compressionLevel : void 0, o = this.splatDataTextures.scaleRotations, s = o ? o.compressionLevel : void 0, u = this.splatDataTextures.sphericalHarmonics, l = u ? u.compressionLevel : 0, c = this.splatDataTextures.flameModel, h = c.data, d = c.texture, f = this.renderer ? this.renderer.properties.get(d) : null f && f.__webglTexture ? this.updateDataTexture(h, c.texture, c.size, f, 4, 4, 3, e, n) : (d.needsUpdate = !0) var p = this.splatDataTextures.centerColors, v = p.data, m = p.texture t.updateCenterColorsPaddedData( e, n, this.splatDataTextures.baseData.centers, this.splatDataTextures.baseData.colors, v ) var g = this.renderer ? this.renderer.properties.get(m) : null if ( (g && g.__webglTexture ? this.updateDataTexture(v, p.texture, p.size, g, 4, 4, 4, e, n) : (m.needsUpdate = !0), i) ) { var y = i.texture, _ = 6 * e, b = 6 * n if (0 === a) for (var x = _; x <= b; x++) { var S = this.splatDataTextures.baseData.covariances[x] i.data[x] = S } else t.updatePaddedCompressedCovariancesTextureData( this.splatDataTextures.baseData.covariances, i.data, e * i.elementsPerTexelAllocated, _, b ) var A = this.renderer ? this.renderer.properties.get(y) : null A && A.__webglTexture ? 0 === a ? this.updateDataTexture( i.data, i.texture, i.size, A, i.elementsPerTexelStored, 6, 4, e, n ) : this.updateDataTexture( i.data, i.texture, i.size, A, i.elementsPerTexelAllocated, i.elementsPerTexelAllocated, 2, e, n ) : (y.needsUpdate = !0) } if (o) { var w = o.data, T = o.texture, M = 0 === s ? 4 : 2 t.updateScaleRotationsPaddedData( e, n, this.splatDataTextures.baseData.scales, this.splatDataTextures.baseData.rotations, w ) var E = this.renderer ? this.renderer.properties.get(T) : null E && E.__webglTexture ? this.updateDataTexture(w, o.texture, o.size, E, 4, 6, M, e, n) : (T.needsUpdate = !0) } var C = this.splatDataTextures.baseData.sphericalHarmonics if (C) { var k = 4 1 === l ? (k = 2) : 2 === l && (k = 1) var R = function (t, i, a, o, s) { var u = r.renderer ? r.renderer.properties.get(t) : null u && u.__webglTexture ? r.updateDataTexture(o, t, i, u, a, s, k, e, n) : (t.needsUpdate = !0) }, I = u.componentCount, N = u.paddedComponentCount if (1 === u.textureCount) { for (var P = u.data, L = e; L <= n; L++) for (var D = I * L, O = N * L, F = 0; F < I; F++) P[O + F] = C[D + F] R(u.texture, u.size, u.elementsPerTexel, P, N) } else for (var B = u.componentCountPerChannel, U = 0; U < 3; U++) { for (var z = u.data[U], V = e; V <= n; V++) { var H = I * V, W = N * V if (B >= 3) { for (var G = 0; G < 3; G++) z[W + G] = C[H + 3 * U + G] if (B >= 8) for (var j = 0; j < 5; j++) z[W + 3 + j] = C[H + 9 + 5 * U + j] } } R(u.textures[U], u.size, u.elementsPerTexel, z, N) } } for ( var Q = this.splatDataTextures.sceneIndexes, q = Q.data, X = this.lastBuildSplatCount; X <= n; X++ ) q[X] = this.globalSplatIndexToSceneIndexMap[X] var Y = Q.texture, K = this.renderer ? this.renderer.properties.get(Y) : null K && K.__webglTexture ? this.updateDataTexture( q, Q.texture, Q.size, K, 1, 1, 1, this.lastBuildSplatCount, n ) : (Y.needsUpdate = !0) }, }, { key: 'getTargetCovarianceCompressionLevel', value: function () { return this.halfPrecisionCovariancesOnGPU ? 1 : 0 }, }, { key: 'getTargetSphericalHarmonicsCompressionLevel', value: function () { return Math.max(1, this.getMaximumSplatBufferCompressionLevel()) }, }, { key: 'getMaximumSplatBufferCompressionLevel', value: function () { for (var e, t = 0; t < this.scenes.length; t++) { var n = this.getScene(t).splatBuffer ;(0 === t || n.compressionLevel > e) && (e = n.compressionLevel) } return e }, }, { key: 'getMinimumSplatBufferCompressionLevel', value: function () { for (var e, t = 0; t < this.scenes.length; t++) { var n = this.getScene(t).splatBuffer ;(0 === t || n.compressionLevel < e) && (e = n.compressionLevel) } return e }, }, { key: 'updateDataTexture', value: function (e, n, r, i, a, o, s, u, l) { var c = this.renderer.getContext(), h = t.computeTextureUpdateRegion(u, l, r.x, a, o), d = h.dataEnd - h.dataStart, f = new e.constructor(e.buffer, h.dataStart * s, d), p = h.endRow - h.startRow + 1, v = this.webGLUtils.convert(n.type), m = this.webGLUtils.convert(n.format, n.colorSpace), g = c.getParameter(c.TEXTURE_BINDING_2D) ;(c.bindTexture(c.TEXTURE_2D, i.__webglTexture), c.texSubImage2D(c.TEXTURE_2D, 0, 0, h.startRow, r.x, p, m, v, f), c.bindTexture(c.TEXTURE_2D, g)) }, }, { key: 'updateVisibleRegion', value: function (e) { var t = this.getSplatCount(!0), n = new ph() if (!e) { var r = new ph() ;(this.scenes.forEach(function (e) { r.add(e.splatBuffer.sceneCenter) }), r.multiplyScalar(1 / this.scenes.length), this.calculatedSceneCenter.copy(r), this.material.uniforms.sceneCenter.value.copy( this.calculatedSceneCenter ), (this.material.uniformsNeedUpdate = !0)) } for (var i = e ? this.lastBuildSplatCount : 0; i < t; i++) { this.getSplatCenter(this.morphedMesh, i, n, !0) var a = n.sub(this.calculatedSceneCenter).length() a > this.maxSplatDistanceFromSceneCenter && (this.maxSplatDistanceFromSceneCenter = a) } ;(this.maxSplatDistanceFromSceneCenter - this.visibleRegionBufferRadius > 1 && ((this.visibleRegionBufferRadius = this.maxSplatDistanceFromSceneCenter), (this.visibleRegionRadius = Math.max( this.visibleRegionBufferRadius - 1, 0 ))), this.finalBuild && (this.visibleRegionRadius = this.visibleRegionBufferRadius = this.maxSplatDistanceFromSceneCenter), this.updateVisibleRegionFadeDistance()) }, }, { key: 'updateVisibleRegionFadeDistance', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Bx, t = 0.012 * this.sceneFadeInRateMultiplier, n = 0.003 * this.sceneFadeInRateMultiplier, r = this.finalBuild ? t : n, i = e === Bx ? r : n this.visibleRegionFadeStartRadius = (this.visibleRegionRadius - this.visibleRegionFadeStartRadius) * i + this.visibleRegionFadeStartRadius var a = (this.visibleRegionBufferRadius > 0 ? this.visibleRegionFadeStartRadius / this.visibleRegionBufferRadius : 0) > 0.99, o = a || e === Ux ? 1 : 0 ;((this.material.uniforms.visibleRegionFadeStartRadius.value = this.visibleRegionFadeStartRadius), (this.material.uniforms.visibleRegionRadius.value = this.visibleRegionRadius), (this.material.uniforms.firstRenderTime.value = this.firstRenderTime), (this.material.uniforms.currentTime.value = performance.now()), (this.material.uniforms.fadeInComplete.value = o), (this.material.uniformsNeedUpdate = !0), (this.visibleRegionChanging = !a)) }, }, { key: 'updateRenderIndexes', value: function (e, t) { var n = this.geometry ;(n.attributes.splatIndex.set(e), (n.attributes.splatIndex.needsUpdate = !0), t > 0 && -1 === this.firstRenderTime && (this.firstRenderTime = performance.now()), (n.instanceCount = t), n.setDrawRange(0, t)) }, }, { key: 'updateTransforms', value: function () { for (var e = 0; e < this.scenes.length; e++) { this.getScene(e).updateTransform(this.dynamicMode) } }, }, { key: 'setSplatScale', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1 ;((this.splatScale = e), (this.material.uniforms.splatScale.value = e), (this.material.uniformsNeedUpdate = !0)) }, }, { key: 'getSplatScale', value: function () { return this.splatScale }, }, { key: 'setPointCloudModeEnabled', value: function (e) { ;((this.pointCloudModeEnabled = e), (this.material.uniforms.pointCloudModeEnabled.value = e ? 1 : 0), (this.material.uniformsNeedUpdate = !0)) }, }, { key: 'getPointCloudModeEnabled', value: function () { return this.pointCloudModeEnabled }, }, { key: 'getSplatDataTextures', value: function () { return this.splatDataTextures }, }, { key: 'getSplatCount', value: function () { return arguments.length > 0 && void 0 !== arguments[0] && arguments[0] ? t.getTotalSplatCountForScenes(this.scenes) : this.lastBuildSplatCount }, }, { key: 'getMaxSplatCount', value: function () { return t.getTotalMaxSplatCountForScenes(this.scenes) }, }, { key: 'disposeDistancesComputationGPUResources', value: function () { if (this.renderer) { var e = this.renderer.getContext() ;(this.distancesTransformFeedback.vao && (e.deleteVertexArray(this.distancesTransformFeedback.vao), (this.distancesTransformFeedback.vao = null)), this.distancesTransformFeedback.program && (e.deleteProgram(this.distancesTransformFeedback.program), e.deleteShader(this.distancesTransformFeedback.vertexShader), e.deleteShader(this.distancesTransformFeedback.fragmentShader), (this.distancesTransformFeedback.program = null), (this.distancesTransformFeedback.vertexShader = null), (this.distancesTransformFeedback.fragmentShader = null)), this.disposeDistancesComputationGPUBufferResources(), this.distancesTransformFeedback.id && (e.deleteTransformFeedback(this.distancesTransformFeedback.id), (this.distancesTransformFeedback.id = null))) } }, }, { key: 'disposeDistancesComputationGPUBufferResources', value: function () { if (this.renderer) { var e = this.renderer.getContext() ;(this.distancesTransformFeedback.centersBuffer && ((this.distancesTransformFeedback.centersBuffer = null), e.deleteBuffer(this.distancesTransformFeedback.centersBuffer)), this.distancesTransformFeedback.outDistancesBuffer && (e.deleteBuffer(this.distancesTransformFeedback.outDistancesBuffer), (this.distancesTransformFeedback.outDistancesBuffer = null))) } }, }, { key: 'setRenderer', value: function (e) { if (e !== this.renderer) { this.renderer = e var t = this.renderer.getContext(), n = new Ox(t), r = new Fx(t, n, {}) if ( (n.init(r), (this.webGLUtils = new Ny(t, n)), this.enableDistancesComputationOnGPU && this.getSplatCount() > 0) ) { this.setupDistancesComputationTransformFeedback() var i = this.getDataForDistancesComputation( 0, this.getSplatCount() - 1 ), a = i.centers, o = i.sceneIndexes this.refreshGPUBuffersForDistancesComputation(a, o) } } }, }, { key: 'updateGPUCentersBufferForDistancesComputation', value: function (e, t, n) { if (this.renderer) { var r = this.renderer.getContext(), i = r.getParameter(r.VERTEX_ARRAY_BINDING) r.bindVertexArray(this.distancesTransformFeedback.vao) var a = this.integerBasedDistancesComputation ? Uint32Array : Float32Array, o = 16 * n if ( (r.bindBuffer( r.ARRAY_BUFFER, this.distancesTransformFeedback.centersBuffer ), e) ) r.bufferSubData(r.ARRAY_BUFFER, o, t) else { var s = new a(16 * this.getMaxSplatCount()) ;(s.set(t), r.bufferData(r.ARRAY_BUFFER, s, r.STATIC_DRAW)) } ;(r.bindBuffer(r.ARRAY_BUFFER, null), i && r.bindVertexArray(i)) } }, }, { key: 'updateGPUTransformIndexesBufferForDistancesComputation', value: function (e, t, n) { if (this.renderer && this.dynamicMode) { var r = this.renderer.getContext(), i = r.getParameter(r.VERTEX_ARRAY_BINDING) r.bindVertexArray(this.distancesTransformFeedback.vao) var a = 4 * n if ( (r.bindBuffer( r.ARRAY_BUFFER, this.distancesTransformFeedback.sceneIndexesBuffer ), e) ) r.bufferSubData(r.ARRAY_BUFFER, a, t) else { var o = new Uint32Array(4 * this.getMaxSplatCount()) ;(o.set(t), r.bufferData(r.ARRAY_BUFFER, o, r.STATIC_DRAW)) } ;(r.bindBuffer(r.ARRAY_BUFFER, null), i && r.bindVertexArray(i)) } }, }, { key: 'getSceneIndexes', value: function (e, t) { var n n = new Uint32Array(t - e + 1) for (var r = e; r <= t; r++) n[r] = this.globalSplatIndexToSceneIndexMap[r] return n }, }, { key: 'getLocalSplatParameters', value: function (e, t, n) { ;(null == n && (n = !this.dynamicMode), (t.splatBuffer = this.getSplatBufferForSplat(e)), (t.localIndex = this.getSplatLocalIndex(e)), (t.sceneTransform = n ? this.getSceneTransformForSplat(e) : null)) }, }, { key: 'fillSplatDataArrays', value: function (e, t, n, r, i, a, o, s) { var u = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 0, l = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : 0, c = arguments.length > 10 && void 0 !== arguments[10] ? arguments[10] : 1, h = arguments.length > 11 ? arguments[11] : void 0, d = arguments.length > 12 ? arguments[12] : void 0, f = arguments.length > 13 && void 0 !== arguments[13] ? arguments[13] : 0, p = arguments.length > 14 ? arguments[14] : void 0, v = new ph() ;((v.x = void 0), (v.y = void 0), this.splatRenderMode === wx ? (v.z = void 0) : (v.z = 1)) var m = new Gh(), g = 0, y = this.scenes.length - 1 null != p && p >= 0 && p <= this.scenes.length && ((g = p), (y = p)) for (var _ = g; _ <= y; _++) { null == s && (s = !this.dynamicMode) var b = this.getScene(_), x = b.splatBuffer, S = void 0 if ( (s && (this.getSceneTransform(_, m), (S = m)), e && x.fillSplatCovarianceArray(e, S, h, d, f, u), t || n) ) { if (!t || !n) throw new Error( 'SplatMesh::fillSplatDataArrays() -> "scales" and "rotations" must both be valid.' ) x.fillSplatScaleRotationArray(t, n, S, h, d, f, l, v) } ;(r && x.fillSplatCenterArray(this.morphedMesh, r, S, h, d, f), i && x.fillSplatColorArray(i, b.minimumAlpha, h, d, f), a && x.fillSphericalHarmonicsArray( a, this.minSphericalHarmonicsDegree, S, h, d, f, c ), (f += x.getSplatCount())) } }, }, { key: 'getIntegerCenters', value: function (e, t) { var n, r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], i = t - e + 1, a = new Float32Array(3 * i) this.fillSplatDataArrays( null, null, null, a, null, null, void 0, void 0, void 0, void 0, e ) var o = r ? 4 : 3 n = new Int32Array(i * o) for (var s = 0; s < i; s++) { for (var u = 0; u < 3; u++) n[s * o + u] = Math.round(1e3 * a[3 * s + u]) r && (n[s * o + 3] = 1e3) } return n }, }, { key: 'getFloatCenters', value: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = t - e + 1, i = new Float32Array(3 * r) if ( (this.fillSplatDataArrays( null, null, null, i, null, null, void 0, void 0, void 0, void 0, e ), !n) ) return i for (var a = new Float32Array(4 * r), o = 0; o < r; o++) { for (var s = 0; s < 3; s++) a[4 * o + s] = i[3 * o + s] a[4 * o + 3] = 1 } return a }, }, { key: 'getSceneTransform', value: function (e, t) { var n = this.getScene(e) ;(n.updateTransform(this.dynamicMode), t.copy(n.transform)) }, }, { key: 'getScene', value: function (e) { if (e < 0 || e >= this.scenes.length) throw new Error('SplatMesh::getScene() -> Invalid scene index.') return this.scenes[e] }, }, { key: 'getSceneCount', value: function () { return this.scenes.length }, }, { key: 'getSplatBufferForSplat', value: function (e) { return this.getScene(this.globalSplatIndexToSceneIndexMap[e]).splatBuffer }, }, { key: 'getSceneIndexForSplat', value: function (e) { return this.globalSplatIndexToSceneIndexMap[e] }, }, { key: 'getSceneTransformForSplat', value: function (e) { return this.getScene(this.globalSplatIndexToSceneIndexMap[e]).transform }, }, { key: 'getSplatLocalIndex', value: function (e) { return this.globalSplatIndexToLocalSplatIndexMap[e] }, }, { key: 'computeBoundingBox', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = arguments.length > 1 ? arguments[1] : void 0, n = this.getSplatCount() if (null != t) { if (t < 0 || t >= this.scenes.length) throw new Error( 'SplatMesh::computeBoundingBox() -> Invalid scene index.' ) n = this.scenes[t].splatBuffer.getSplatCount() } var r = new Float32Array(3 * n) this.fillSplatDataArrays( null, null, null, r, null, null, e, void 0, void 0, void 0, void 0, t ) for (var i = new ph(), a = new ph(), o = 0; o < n; o++) { var s = 3 * o, u = r[s], l = r[s + 1], c = r[s + 2] ;((0 === o || u < i.x) && (i.x = u), (0 === o || l < i.y) && (i.y = l), (0 === o || c < i.z) && (i.z = c), (0 === o || u > a.x) && (a.x = u), (0 === o || l > a.y) && (a.y = l), (0 === o || c > a.z) && (a.z = c)) } return new gh(i, a) }, }, ], [ { key: 'buildScenes', value: function (e, n, r) { var i = [] i.length = n.length for (var a = 0; a < n.length; a++) { var o = n[a], s = r[a] || {}, u = s.position || [0, 0, 0], l = s.rotation || [0, 0, 0, 1], c = s.scale || [1, 1, 1], h = new ph().fromArray(u), d = new fh().fromArray(l), f = new ph().fromArray(c), p = t.createScene( o, h, d, f, s.splatAlphaRemovalThreshold || 1, s.opacity, s.visible ) ;(e.add(p), (i[a] = p)) } return i }, }, { key: 'createScene', value: function (e, t, n, r, i) { return new Ix( e, t, n, r, i, arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 1, !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6] ) }, }, { key: 'buildSplatIndexMaps', value: function (e) { for (var t = [], n = [], r = 0, i = 0; i < e.length; i++) for (var a = e[i].getMaxSplatCount(), o = 0; o < a; o++) ((t[r] = o), (n[r] = i), r++) return { localSplatIndexMap: t, sceneIndexMap: n } }, }, { key: 'computeTextureUpdateRegion', value: function (e, t, n, r, i) { var a = i / r, o = e * a, s = Math.floor(o / n), u = s * n * r, l = t * a, c = Math.floor(l / n) return { dataStart: u, dataEnd: c * n * r + n * r, startRow: s, endRow: c } }, }, { key: 'updatePaddedCompressedCovariancesTextureData', value: function (e, t, n, r, i) { for (var a = new DataView(t.buffer), o = n, s = 0, u = r; u <= i; u += 2) (a.setUint16(2 * o, e[u], !0), a.setUint16(2 * o + 2, e[u + 1], !0), (o += 2), ++s >= 3 && ((o += 2), (s = 0))) }, }, { key: 'updateCenterColorsPaddedData', value: function (e, t, n, r, i) { for (var a = e; a <= t; a++) { var o = 4 * a, s = 3 * a, u = 4 * a ;((i[u] = Ru(r, o)), (i[u + 1] = ku(n[s])), (i[u + 2] = ku(n[s + 1])), (i[u + 3] = ku(n[s + 2]))) } }, }, { key: 'updateScaleRotationsPaddedData', value: function (e, t, n, r, i) { for (var a = e; a <= t; a++) { var o = 3 * a, s = 4 * a, u = 6 * a ;((i[u] = n[o]), (i[u + 1] = n[o + 1]), (i[u + 2] = n[o + 2]), (i[u + 3] = r[s]), (i[u + 4] = r[s + 1]), (i[u + 5] = r[s + 2])) } }, }, { key: 'getTotalSplatCountForScenes', value: function (e) { var t, n = 0, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value i && i.splatBuffer && (n += i.splatBuffer.getSplatCount()) } } catch (a) { r.e(a) } finally { r.f() } return n }, }, { key: 'getTotalSplatCountForSplatBuffers', value: function (e) { var t, n = 0, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { n += t.value.getSplatCount() } } catch (i) { r.e(i) } finally { r.f() } return n }, }, { key: 'getTotalMaxSplatCountForScenes', value: function (e) { var t, n = 0, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value i && i.splatBuffer && (n += i.splatBuffer.getMaxSplatCount()) } } catch (a) { r.e(a) } finally { r.f() } return n }, }, { key: 'getTotalMaxSplatCountForSplatBuffers', value: function (e) { var t, n = 0, r = L(e) try { for (r.s(); !(t = r.n()).done; ) { n += t.value.getMaxSplatCount() } } catch (i) { r.e(i) } finally { r.f() } return n }, }, { key: 'getIntegerMatrixArray', value: function (e) { for (var t = e.elements, n = [], r = 0; r < 16; r++) n[r] = Math.round(1e3 * t[r]) return n }, }, ] ) ) })(gf), Qx = 'AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACEgEDZW52Bm1lbW9yeQIDAICABAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=' function qx(e) { var t, n, r, i, a, o, s, u, l, c, h, d, f, p, v, m, g, y, _, b e.onmessage = function (x) { if (x.data.centers) ((centers = x.data.centers), (sceneIndexes = x.data.sceneIndexes), i ? new Int32Array( n, p + x.data.range.from * b.BytesPerInt * 4, 4 * x.data.range.count ).set(new Int32Array(centers)) : new Float32Array( n, p + x.data.range.from * b.BytesPerFloat * 4, 4 * x.data.range.count ).set(new Float32Array(centers)), a && new Uint32Array(n, l + 4 * x.data.range.from, x.data.range.count).set( new Uint32Array(sceneIndexes) ), (_ = x.data.range.from + x.data.range.count)) else if (x.data.sort) { var S, A, w, T = Math.min(x.data.sort.splatRenderCount || 0, _), M = Math.min(x.data.sort.splatSortCount || 0, _), E = x.data.sort.usePrecomputedDistances ;(r || ((S = x.data.sort.indexesToSort), (w = x.data.sort.transforms), E && (A = x.data.sort.precomputedDistances)), (function (_, x, S, A, w, T, M) { var E = performance.now() ;(r || (new Uint32Array(n, s, w.byteLength / b.BytesPerInt).set(w), new Float32Array(n, c, M.byteLength / b.BytesPerFloat).set(M), A && (i ? new Int32Array(n, h, T.byteLength / b.BytesPerInt) : new Float32Array(n, h, T.byteLength / b.BytesPerFloat) ).set(T)), m || (m = new Uint32Array(y)), new Float32Array(n, v, 16).set(S), new Uint32Array(n, f, y).set(m), t.exports.sortIndexes(s, p, h, d, f, v, u, l, c, y, _, x, o, A, i, a)) var C = { sortDone: !0, splatSortCount: _, splatRenderCount: x, sortTime: 0 } if (!r) { var k = new Uint32Array(n, u, x) ;((!g || g.length < x) && (g = new Uint32Array(x)), g.set(k), (C.sortedIndexes = g)) } var R = performance.now() ;((C.sortTime = R - E), e.postMessage(C)) })(M, T, x.data.sort.modelViewProj, E, S, A, w)) } else if (x.data.init) { ;((b = x.data.init.Constants), (o = x.data.init.splatCount), (r = x.data.init.useSharedMemory), (i = x.data.init.integerBasedSort), (a = x.data.init.dynamicMode), (y = x.data.init.distanceMapRange), (_ = 0)) var C = i ? 4 * b.BytesPerInt : 4 * b.BytesPerFloat, k = new Uint8Array(x.data.init.sorterWasmBytes), R = 16 * b.BytesPerFloat, I = o * b.BytesPerInt, N = o * C, P = R, L = i ? o * b.BytesPerInt : o * b.BytesPerFloat, D = o * b.BytesPerInt, O = o * b.BytesPerInt, F = i ? y * b.BytesPerInt * 2 : y * b.BytesPerFloat * 2, B = a ? o * b.BytesPerInt : 0, U = a ? b.MaxScenes * R : 0, z = 32 * b.MemoryPageSize, V = I + N + P + L + D + F + O + B + U + z, H = Math.floor(V / b.MemoryPageSize) + 1, W = { module: {}, env: { memory: new WebAssembly.Memory({ initial: H, maximum: H, shared: !0 }) }, } WebAssembly.compile(k) .then(function (e) { return WebAssembly.instantiate(e, W) }) .then(function (i) { ;((t = i), (c = (l = (u = (f = (d = (h = (v = (p = (s = 0) + I) + N) + P) + L) + D) + F) + O) + B), (n = W.env.memory.buffer), r ? e.postMessage({ sortSetupPhase1Complete: !0, indexesToSortBuffer: n, indexesToSortOffset: s, sortedIndexesBuffer: n, sortedIndexesOffset: u, precomputedDistancesBuffer: n, precomputedDistancesOffset: h, transformsBuffer: n, transformsOffset: c, }) : e.postMessage({ sortSetupPhase1Complete: !0 })) }) } } } function Xx(e, t, n, r, i) { var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : zy.DefaultSplatSortDistanceMapPrecision, o = new Worker( URL.createObjectURL( new Blob(['(', qx.toString(), ')(self)'], { type: 'application/javascript' }) ) ), s = 'AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEbA2AAAGAQf39/f39/f39/f39/f39/fwBgAAF/AhIBA2VudgZtZW1vcnkCAwCAgAQDBAMAAQIHVAQRX193YXNtX2NhbGxfY3RvcnMAABhfX3dhc21fYXBwbHlfZGF0YV9yZWxvY3MAAAtzb3J0SW5kZXhlcwABE2Vtc2NyaXB0ZW5fdGxzX2luaXQAAgqWEAMDAAELihAEAXwDewN/A30gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEBA0AgAyABQQJ0IgVqIAIgACAFaigCAEECdGooAgAiBTYCACAFIAogBSAKSBshCiAFIA0gBSANShshDSABQQFqIgEgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiFWooAgAiFkECdGooAgAiFEcEQAJ/IAX9CQI4IAggFEEGdGoiDv0JAgwgDioCHP0gASAOKgIs/SACIA4qAjz9IAP95gEgBf0JAiggDv0JAgggDioCGP0gASAOKgIo/SACIA4qAjj9IAP95gEgBf0JAgggDv0JAgAgDioCEP0gASAOKgIg/SACIA4qAjD9IAP95gEgBf0JAhggDv0JAgQgDioCFP0gASAOKgIk/SACIA4qAjT9IAP95gH95AH95AH95AEiEf1f/QwAAAAAAECPQAAAAAAAQI9AIhL98gEiE/0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBP9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/REgDv0cAQJ/IBEgEf0NCAkKCwwNDg8AAAAAAAAAAP1fIBL98gEiEf0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9HAICfyAR/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAyESIBQhDwsgAyAVaiABIBZBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmogEf0bA2oiDjYCACAOIAogCiAOShshCiAOIA0gDSAOSBshDSACQQFqIgIgC0cNAAsMAwsCfyAFKgIIu/0UIAUqAhi7/SIB/QwAAAAAAECPQAAAAAAAQI9A/fIBIhH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIQ4CfyAR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyECAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQIgAv0RIA79HAEgBf0cAiESIAwhBQNAIAMgBUECdCICaiABIAAgAmooAgBBBHRq/QAAACAS/bUBIhH9GwAgEf0bAWogEf0bAmoiAjYCACACIAogAiAKSBshCiACIA0gAiANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEBA0AgAyABQQJ0IgVqAn8gAiAAIAVqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAFBAWoiASALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIRcgBSoCGCEYIAUqAgghGUH4////ByEKQYiAgIB4IQ0gDCEFA0ACfyAXIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCAZIAIqAgCUIBggAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIUaigCAEECdCIVaigCACIORwRAIAX9CQI4IAggDkEGdGoiD/0JAgwgDyoCHP0gASAPKgIs/SACIA8qAjz9IAP95gEgBf0JAiggD/0JAgggDyoCGP0gASAPKgIo/SACIA8qAjj9IAP95gEgBf0JAgggD/0JAgAgDyoCEP0gASAPKgIg/SACIA8qAjD9IAP95gEgBf0JAhggD/0JAgQgDyoCFP0gASAPKgIk/SACIA8qAjT9IAP95gH95AH95AH95AEhESAOIQ8LIAMgFGoCfyAR/R8DIAEgFUECdCIOQQxyaioCAJQgEf0fAiABIA5BCHJqKgIAlCAR/R8AIAEgDmoqAgCUIBH9HwEgASAOQQRyaioCAJSSkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSACQQFqIgIgC0cNAAsMAQtBiICAgHghDUH4////ByEKCyALIAxLBEAgCUEBa7MgDbIgCrKTlSEXIAwhDQNAAn8gFyADIA1BAnRqIgEoAgAgCmuylCIYi0MAAABPXQRAIBioDAELQYCAgIB4CyEOIAEgDjYCACAEIA5BAnRqIgEgASgCAEEBajYCACANQQFqIg0gC0cNAAsLIAlBAk8EQCAEKAIAIQ1BASEKA0AgBCAKQQJ0aiIBIAEoAgAgDWoiDTYCACAKQQFqIgogCUcNAAsLIAxBAEoEQCAMIQoDQCAGIApBAWsiAUECdCICaiAAIAJqKAIANgIAIApBAUshAiABIQogAg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCwsEAEEACw==', u = zu() ? Vu() : null n || t ? n ? t || (u && u.major <= 16 && u.minor < 4 && (s = 'AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQrrDwICAAvlDwQBfAN7B30DfyALIAprIQwCQAJAIA4EQCANBEBB+P///wchCkGIgICAeCENIAsgDE0NAyAMIQUDQCADIAVBAnQiAWogAiAAIAFqKAIAQQJ0aigCACIBNgIAIAEgCiABIApIGyEKIAEgDSABIA1KGyENIAVBAWoiBSALRw0ACwwDCyAPBEAgCyAMTQ0CQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIcaigCACIdQQJ0aigCACIbRwRAAn8gBf0JAjggCCAbQQZ0aiIO/QkCDCAOKgIc/SABIA4qAiz9IAIgDioCPP0gA/3mASAF/QkCKCAO/QkCCCAOKgIY/SABIA4qAij9IAIgDioCOP0gA/3mASAF/QkCCCAO/QkCACAOKgIQ/SABIA4qAiD9IAIgDioCMP0gA/3mASAF/QkCGCAO/QkCBCAOKgIU/SABIA4qAiT9IAIgDioCNP0gA/3mAf3kAf3kAf3kASIR/V/9DAAAAAAAQI9AAAAAAABAj0AiEv3yASIT/SEBIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOAn8gE/0hACIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAv9ESAO/RwBAn8gESAR/Q0ICQoLDA0ODwABAgMAAQID/V8gEv3yASIR/SEAIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4C/0cAgJ/IBH9IQEiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgL/RwDIRIgGyEPCyADIBxqIAEgHUEEdGr9AAAAIBL9tQEiEf0bACAR/RsBaiAR/RsCaiAR/RsDaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAgi7/RQgBSoCGLv9IgH9DAAAAAAAQI9AAAAAAABAj0D98gEiEf0hASIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDgJ/IBH9IQAiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLAn8gBSoCKLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEFQfj///8HIQpBiICAgHghDSALIAxNDQL9ESAO/RwBIAX9HAIhEiAMIQUDQCADIAVBAnQiAmogASAAIAJqKAIAQQR0av0AAAAgEv21ASIR/RsAIBH9GwFqIBH9GwJqIgI2AgAgAiAKIAIgCkgbIQogAiANIAIgDUobIQ0gBUEBaiIFIAtHDQALDAILIA0EQEH4////ByEKQYiAgIB4IQ0gCyAMTQ0CIAwhBQNAIAMgBUECdCIBagJ/IAIgACABaigCAEECdGoqAgC7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAsiDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgD0UEQCALIAxNDQEgBSoCKCEUIAUqAhghFSAFKgIIIRZB+P///wchCkGIgICAeCENIAwhBQNAAn8gFCABIAAgBUECdCIHaigCAEEEdGoiAioCCJQgFiACKgIAlCAVIAIqAgSUkpK7RAAAAAAAALBAoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshDiADIAdqIA42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gBUEBaiIFIAtHDQALDAILIAsgDE0NAEF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiG2ooAgBBAnQiHGooAgAiDkcEQCAFKgI4IhQgCCAOQQZ0aiIPKgI8lCAFKgIoIhUgDyoCOJQgBSoCCCIWIA8qAjCUIAUqAhgiFyAPKgI0lJKSkiEYIBQgDyoCLJQgFSAPKgIolCAWIA8qAiCUIBcgDyoCJJSSkpIhGSAUIA8qAhyUIBUgDyoCGJQgFiAPKgIQlCAXIA8qAhSUkpKSIRogFCAPKgIMlCAVIA8qAgiUIBYgDyoCAJQgFyAPKgIElJKSkiEUIA4hDwsgAyAbagJ/IBggASAcQQJ0aiIOKgIMlCAZIA4qAgiUIBQgDioCAJQgGiAOKgIElJKSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAJBAWoiAiALRw0ACwwBC0GIgICAeCENQfj///8HIQoLIAsgDEsEQCAJQQFrsyANsiAKspOVIRQgDCENA0ACfyAUIAMgDUECdGoiASgCACAKa7KUIhWLQwAAAE9dBEAgFagMAQtBgICAgHgLIQ4gASAONgIAIAQgDkECdGoiASABKAIAQQFqNgIAIA1BAWoiDSALRw0ACwsgCUECTwRAIAQoAgAhDUEBIQoDQCAEIApBAnRqIgEgASgCACANaiINNgIAIApBAWoiCiAJRw0ACwsgDEEASgRAIAwhCgNAIAYgCkEBayIBQQJ0IgJqIAAgAmooAgA2AgAgCkEBSyABIQoNAAsLIAsgDEoEQCALIQoDQCAGIAsgBCADIApBAWsiCkECdCIBaigCAEECdGoiAigCACIFa0ECdGogACABaigCADYCACACIAVBAWs2AgAgCiAMSg0ACwsL')) : (s = Qx) : ((s = Qx), u && u.major <= 16 && u.minor < 4 && (s = 'AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEXAmAAAGAQf39/f39/f39/f39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMDAgABBz4DEV9fd2FzbV9jYWxsX2N0b3JzAAAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAALc29ydEluZGV4ZXMAAQqiDwICAAucDwMBfAd9Bn8gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEFA0AgAyAFQQJ0IgFqIAIgACABaigCAEECdGooAgAiATYCACABIAogASAKSBshCiABIA0gASANShshDSAFQQFqIgUgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiGmooAgBBAnQiG2ooAgAiDkcEQAJ/IAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRgCfyARIA8qAiyUIBIgDyoCKJQgEyAPKgIglCAUIA8qAiSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRkCfyARIA8qAhyUIBIgDyoCGJQgEyAPKgIQlCAUIA8qAhSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIRwCfyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSu0QAAAAAAECPQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIR0gDiEPCyADIBpqIAEgG0ECdGoiDigCBCAcbCAOKAIAIB1saiAOKAIIIBlsaiAOKAIMIBhsaiIONgIAIA4gCiAKIA5KGyEKIA4gDSANIA5IGyENIAJBAWoiAiALRw0ACwwDCwJ/IAUqAii7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshAgJ/IAUqAhi7RAAAAAAAQI9AoiIQmUQAAAAAAADgQWMEQCAQqgwBC0GAgICAeAshByALIAxNAn8gBSoCCLtEAAAAAABAj0CiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEPQfj///8HIQpBiICAgHghDQ0CIAwhBQNAIAMgBUECdCIIaiABIAAgCGooAgBBBHRqIggoAgQgB2wgCCgCACAPbGogCCgCCCACbGoiCDYCACAIIAogCCAKSBshCiAIIA0gCCANShshDSAFQQFqIgUgC0cNAAsMAgsgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQIgDCEFA0AgAyAFQQJ0IgFqAn8gAiAAIAFqKAIAQQJ0aioCALtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyIONgIAIAogDiAKIA5IGyEKIA0gDiANIA5KGyENIAVBAWoiBSALRw0ACwwCCyAPRQRAIAsgDE0NASAFKgIoIREgBSoCGCESIAUqAgghE0H4////ByEKQYiAgIB4IQ0gDCEFA0ACfyARIAEgACAFQQJ0IgdqKAIAQQR0aiICKgIIlCATIAIqAgCUIBIgAioCBJSSkrtEAAAAAAAAsECiIhCZRAAAAAAAAOBBYwRAIBCqDAELQYCAgIB4CyEOIAMgB2ogDjYCACAKIA4gCiAOSBshCiANIA4gDSAOShshDSAFQQFqIgUgC0cNAAsMAgsgCyAMTQ0AQX8hD0H4////ByEKQYiAgIB4IQ0gDCECA0AgDyAHIAAgAkECdCIYaigCAEECdCIZaigCACIORwRAIAUqAjgiESAIIA5BBnRqIg8qAjyUIAUqAigiEiAPKgI4lCAFKgIIIhMgDyoCMJQgBSoCGCIUIA8qAjSUkpKSIRUgESAPKgIslCASIA8qAiiUIBMgDyoCIJQgFCAPKgIklJKSkiEWIBEgDyoCHJQgEiAPKgIYlCATIA8qAhCUIBQgDyoCFJSSkpIhFyARIA8qAgyUIBIgDyoCCJQgEyAPKgIAlCAUIA8qAgSUkpKSIREgDiEPCyADIBhqAn8gFSABIBlBAnRqIg4qAgyUIBYgDioCCJQgESAOKgIAlCAXIA4qAgSUkpKSu0QAAAAAAACwQKIiEJlEAAAAAAAA4EFjBEAgEKoMAQtBgICAgHgLIg42AgAgCiAOIAogDkgbIQogDSAOIA0gDkobIQ0gAkEBaiICIAtHDQALDAELQYiAgIB4IQ1B+P///wchCgsgCyAMSwRAIAlBAWuzIA2yIAqyk5UhESAMIQ0DQAJ/IBEgAyANQQJ0aiIBKAIAIAprspQiEotDAAAAT10EQCASqAwBC0GAgICAeAshDiABIA42AgAgBCAOQQJ0aiIBIAEoAgBBAWo2AgAgDUEBaiINIAtHDQALCyAJQQJPBEAgBCgCACENQQEhCgNAIAQgCkECdGoiASABKAIAIA1qIg02AgAgCkEBaiIKIAlHDQALCyAMQQBKBEAgDCEKA0AgBiAKQQFrIgFBAnQiAmogACACaigCADYCACAKQQFLIAEhCg0ACwsgCyAMSgRAIAshCgNAIAYgCyAEIAMgCkEBayIKQQJ0IgFqKAIAQQJ0aiICKAIAIgVrQQJ0aiAAIAFqKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=')) for (var l = atob(s), c = new Uint8Array(l.length), h = 0; h < l.length; h++) c[h] = l.charCodeAt(h) return ( o.postMessage({ init: { sorterWasmBytes: c.buffer, splatCount: e, useSharedMemory: t, integerBasedSort: r, dynamicMode: i, distanceMapRange: 1 << a, Constants: { BytesPerFloat: zy.BytesPerFloat, BytesPerInt: zy.BytesPerInt, MemoryPageSize: zy.MemoryPageSize, MaxScenes: zy.MaxScenes, }, }, }), o ) } var Yx = 0, Kx = 1, Zx = 2, Jx = (function () { function e() { A(this, e) } return T(e, null, [ { key: 'createButton', value: function (t) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = document.createElement('button') function i() { ;((r.style.display = ''), (r.style.cursor = 'auto'), (r.style.left = 'calc(50% - 75px)'), (r.style.width = '150px'), (r.onmouseenter = null), (r.onmouseleave = null), (r.onclick = null)) } function a(e) { ;((e.style.position = 'absolute'), (e.style.bottom = '20px'), (e.style.padding = '12px 6px'), (e.style.border = '1px solid #fff'), (e.style.borderRadius = '4px'), (e.style.background = 'rgba(0,0,0,0.1)'), (e.style.color = '#fff'), (e.style.font = 'normal 13px sans-serif'), (e.style.textAlign = 'center'), (e.style.opacity = '0.5'), (e.style.outline = 'none'), (e.style.zIndex = '999')) } if ('xr' in navigator) return ( (r.id = 'VRButton'), (r.style.display = 'none'), a(r), navigator.xr .isSessionSupported('immersive-vr') .then(function (a) { ;(a ? (function () { var e = null function i(e) { return a.apply(this, arguments) } function a() { return (a = v( d().m(function n(i) { return d().w(function (n) { for (;;) switch (n.n) { case 0: return ( i.addEventListener('end', o), (n.n = 1), t.xr.setSession(i) ) case 1: ;((r.textContent = 'EXIT VR'), (e = i)) case 2: return n.a(2) } }, n) }) )).apply(this, arguments) } function o() { ;(e.removeEventListener('end', o), (r.textContent = 'ENTER VR'), (e = null)) } ;((r.style.display = ''), (r.style.cursor = 'pointer'), (r.style.left = 'calc(50% - 50px)'), (r.style.width = '100px'), (r.textContent = 'ENTER VR')) var u = s( s({}, n), {}, { optionalFeatures: [ 'local-floor', 'bounded-floor', 'layers', ].concat(I(n.optionalFeatures || [])), } ) ;((r.onmouseenter = function () { r.style.opacity = '1.0' }), (r.onmouseleave = function () { r.style.opacity = '0.5' }), (r.onclick = function () { null === e ? navigator.xr.requestSession('immersive-vr', u).then(i) : (e.end(), void 0 !== navigator.xr.offerSession && navigator.xr .offerSession('immersive-vr', u) .then(i) .catch(function (e) { console.warn(e) })) }), void 0 !== navigator.xr.offerSession && navigator.xr .offerSession('immersive-vr', u) .then(i) .catch(function (e) { console.warn(e) })) })() : (i(), (r.textContent = 'VR NOT SUPPORTED')), a && e.xrSessionIsGranted && r.click()) }) .catch(function (e) { ;(i(), console.warn( 'Exception when trying to call xr.isSessionSupported', e ), (r.textContent = 'VR NOT ALLOWED')) }), r ) var o = document.createElement('a') return ( !1 === window.isSecureContext ? ((o.href = document.location.href.replace(/^http:/, 'https:')), (o.innerHTML = 'WEBXR NEEDS HTTPS')) : ((o.href = 'https://immersiveweb.dev/'), (o.innerHTML = 'WEBXR NOT AVAILABLE')), (o.style.left = 'calc(50% - 90px)'), (o.style.width = '180px'), (o.style.textDecoration = 'none'), a(o), o ) }, }, { key: 'registerSessionGrantedListener', value: function () { if ('undefined' != typeof navigator && 'xr' in navigator) { if (/WebXRViewer\//i.test(navigator.userAgent)) return navigator.xr.addEventListener('sessiongranted', function () { e.xrSessionIsGranted = !0 }) } }, }, ]) })() ;((Jx.xrSessionIsGranted = !1), Jx.registerSessionGrantedListener()) var $x = (function () { return T( function e() { A(this, e) }, null, [ { key: 'createButton', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = document.createElement('button') function r() { ;((n.style.display = ''), (n.style.cursor = 'auto'), (n.style.left = 'calc(50% - 75px)'), (n.style.width = '150px'), (n.onmouseenter = null), (n.onmouseleave = null), (n.onclick = null)) } function i(e) { ;((e.style.position = 'absolute'), (e.style.bottom = '20px'), (e.style.padding = '12px 6px'), (e.style.border = '1px solid #fff'), (e.style.borderRadius = '4px'), (e.style.background = 'rgba(0,0,0,0.1)'), (e.style.color = '#fff'), (e.style.font = 'normal 13px sans-serif'), (e.style.textAlign = 'center'), (e.style.opacity = '0.5'), (e.style.outline = 'none'), (e.style.zIndex = '999')) } if ('xr' in navigator) return ( (n.id = 'ARButton'), (n.style.display = 'none'), i(n), navigator.xr .isSessionSupported('immersive-ar') .then(function (i) { i ? (function () { if (void 0 === t.domOverlay) { var r = document.createElement('div') ;((r.style.display = 'none'), document.body.appendChild(r)) var i = document.createElementNS( 'http://www.w3.org/2000/svg', 'svg' ) ;(i.setAttribute('width', 38), i.setAttribute('height', 38), (i.style.position = 'absolute'), (i.style.right = '20px'), (i.style.top = '20px'), i.addEventListener('click', function () { o.end() }), r.appendChild(i)) var a = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' ) ;(a.setAttribute('d', 'M 12,12 L 28,28 M 28,12 12,28'), a.setAttribute('stroke', '#fff'), a.setAttribute('stroke-width', 2), i.appendChild(a), void 0 === t.optionalFeatures && (t.optionalFeatures = []), t.optionalFeatures.push('dom-overlay'), (t.domOverlay = { root: r })) } var o = null function s(e) { return u.apply(this, arguments) } function u() { return (u = v( d().m(function r(i) { return d().w(function (r) { for (;;) switch (r.n) { case 0: return ( i.addEventListener('end', l), e.xr.setReferenceSpaceType('local'), (r.n = 1), e.xr.setSession(i) ) case 1: ;((n.textContent = 'STOP AR'), (t.domOverlay.root.style.display = ''), (o = i)) case 2: return r.a(2) } }, r) }) )).apply(this, arguments) } function l() { ;(o.removeEventListener('end', l), (n.textContent = 'START AR'), (t.domOverlay.root.style.display = 'none'), (o = null)) } ;((n.style.display = ''), (n.style.cursor = 'pointer'), (n.style.left = 'calc(50% - 50px)'), (n.style.width = '100px'), (n.textContent = 'START AR'), (n.onmouseenter = function () { n.style.opacity = '1.0' }), (n.onmouseleave = function () { n.style.opacity = '0.5' }), (n.onclick = function () { null === o ? navigator.xr.requestSession('immersive-ar', t).then(s) : (o.end(), void 0 !== navigator.xr.offerSession && navigator.xr .offerSession('immersive-ar', t) .then(s) .catch(function (e) { console.warn(e) })) }), void 0 !== navigator.xr.offerSession && navigator.xr .offerSession('immersive-ar', t) .then(s) .catch(function (e) { console.warn(e) })) })() : (r(), (n.textContent = 'AR NOT SUPPORTED')) }) .catch(function (e) { ;(r(), console.warn( 'Exception when trying to call xr.isSessionSupported', e ), (n.textContent = 'AR NOT ALLOWED')) }), n ) var a = document.createElement('a') return ( !1 === window.isSecureContext ? ((a.href = document.location.href.replace(/^http:/, 'https:')), (a.innerHTML = 'WEBXR NEEDS HTTPS')) : ((a.href = 'https://immersiveweb.dev/'), (a.innerHTML = 'WEBXR NOT AVAILABLE')), (a.style.left = 'calc(50% - 90px)'), (a.style.width = '180px'), (a.style.textDecoration = 'none'), i(a), a ) }, }, ] ) })(), eS = 0, tS = 2, nS = [ 'alphaMap', 'alphaTest', 'anisotropy', 'anisotropyMap', 'anisotropyRotation', 'aoMap', 'attenuationColor', 'attenuationDistance', 'bumpMap', 'clearcoat', 'clearcoatMap', 'clearcoatNormalMap', 'clearcoatNormalScale', 'clearcoatRoughness', 'color', 'dispersion', 'displacementMap', 'emissive', 'emissiveMap', 'envMap', 'gradientMap', 'ior', 'iridescence', 'iridescenceIOR', 'iridescenceMap', 'iridescenceThicknessMap', 'lightMap', 'map', 'matcap', 'metalness', 'metalnessMap', 'normalMap', 'normalScale', 'opacity', 'roughness', 'roughnessMap', 'sheen', 'sheenColor', 'sheenColorMap', 'sheenRoughnessMap', 'shininess', 'specular', 'specularColor', 'specularColorMap', 'specularIntensity', 'specularIntensityMap', 'specularMap', 'thickness', 'transmission', 'transmissionMap', ], rS = (function () { return T( function e(t) { ;(A(this, e), (this.renderObjects = new WeakMap()), (this.hasNode = this.containsNode(t)), (this.hasAnimation = !0 === t.object.isSkinnedMesh), (this.refreshUniforms = nS), (this.renderId = 0)) }, [ { key: 'firstInitialization', value: function (e) { return !1 === this.renderObjects.has(e) && (this.getRenderObjectData(e), !0) }, }, { key: 'getRenderObjectData', value: function (e) { var t = this.renderObjects.get(e) if (void 0 === t) { var n = e.geometry, r = e.material, i = e.object if ( ((t = { material: this.getMaterialData(r), geometry: { id: n.id, attributes: this.getAttributesData(n.attributes), indexVersion: n.index ? n.index.version : null, drawRange: { start: n.drawRange.start, count: n.drawRange.count }, }, worldMatrix: i.matrixWorld.clone(), }), i.center && (t.center = i.center.clone()), i.morphTargetInfluences && (t.morphTargetInfluences = i.morphTargetInfluences.slice()), null !== e.bundle && (t.version = e.bundle.version), t.material.transmission > 0) ) { var a = e.context, o = a.width, s = a.height ;((t.bufferWidth = o), (t.bufferHeight = s)) } this.renderObjects.set(e, t) } return t }, }, { key: 'getAttributesData', value: function (e) { var t = {} for (var n in e) { var r = e[n] t[n] = { version: r.version } } return t }, }, { key: 'containsNode', value: function (e) { var t = e.material for (var n in t) if (t[n] && t[n].isNode) return !0 return ( null !== e.renderer.nodes.modelViewMatrix || null !== e.renderer.nodes.modelNormalViewMatrix ) }, }, { key: 'getMaterialData', value: function (e) { var t, n = {}, r = L(this.refreshUniforms) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value, a = e[i] null != a && ('object' === P(a) && void 0 !== a.clone ? !0 === a.isTexture ? (n[i] = { id: a.id, version: a.version }) : (n[i] = a.clone()) : (n[i] = a)) } } catch (o) { r.e(o) } finally { r.f() } return n }, }, { key: 'equals', value: function (e) { var t = e.object, n = e.material, r = e.geometry, i = this.getRenderObjectData(e) if (!0 !== i.worldMatrix.equals(t.matrixWorld)) return (i.worldMatrix.copy(t.matrixWorld), !1) var a = i.material for (var o in a) { var s = a[o], u = n[o] if (void 0 !== s.equals) { if (!1 === s.equals(u)) return (s.copy(u), !1) } else if (!0 === u.isTexture) { if (s.id !== u.id || s.version !== u.version) return ((s.id = u.id), (s.version = u.version), !1) } else if (s !== u) return ((a[o] = u), !1) } if (a.transmission > 0) { var l = e.context, c = l.width, h = l.height if (i.bufferWidth !== c || i.bufferHeight !== h) return ((i.bufferWidth = c), (i.bufferHeight = h), !1) } var d = i.geometry, f = r.attributes, p = d.attributes, v = Object.keys(p), m = Object.keys(f) if (d.id !== r.id) return ((d.id = r.id), !1) if (v.length !== m.length) return ((i.geometry.attributes = this.getAttributesData(f)), !1) for (var g = 0, y = v; g < y.length; g++) { var _ = y[g], b = p[_], x = f[_] if (void 0 === x) return (delete p[_], !1) if (b.version !== x.version) return ((b.version = x.version), !1) } var S = r.index, A = d.indexVersion, w = S ? S.version : null if (A !== w) return ((d.indexVersion = w), !1) if ( d.drawRange.start !== r.drawRange.start || d.drawRange.count !== r.drawRange.count ) return ( (d.drawRange.start = r.drawRange.start), (d.drawRange.count = r.drawRange.count), !1 ) if (i.morphTargetInfluences) { for (var T = !1, M = 0; M < i.morphTargetInfluences.length; M++) i.morphTargetInfluences[M] !== t.morphTargetInfluences[M] && (T = !0) if (T) return !0 } return i.center && !1 === i.center.equals(t.center) ? (i.center.copy(t.center), !0) : (null !== e.bundle && (i.version = e.bundle.version), !0) }, }, { key: 'needsRefresh', value: function (e, t) { if (this.hasNode || this.hasAnimation || this.firstInitialization(e)) return !0 var n = t.renderId if (this.renderId !== n) return ((this.renderId = n), !0) var r = !0 === e.object.static, i = null !== e.bundle && !0 === e.bundle.static && this.getRenderObjectData(e).version === e.bundle.version return !r && !i && !0 !== this.equals(e) }, }, ] ) })() function iS(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = 3735928559 ^ t, r = 1103547991 ^ t if (e instanceof Array) for (var i, a = 0; a < e.length; a++) ((i = e[a]), (n = Math.imul(n ^ i, 2654435761)), (r = Math.imul(r ^ i, 1597334677))) else for (var o, s = 0; s < e.length; s++) ((o = e.charCodeAt(s)), (n = Math.imul(n ^ o, 2654435761)), (r = Math.imul(r ^ o, 1597334677))) return ( (n = Math.imul(n ^ (n >>> 16), 2246822507)), (n ^= Math.imul(r ^ (r >>> 13), 3266489909)), (r = Math.imul(r ^ (r >>> 16), 2246822507)), 4294967296 * (2097151 & (r ^= Math.imul(n ^ (n >>> 13), 3266489909))) + (n >>> 0) ) } var aS = function (e) { return iS(e) }, oS = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return iS(t) } function sS(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = [] !0 === e.isNode && (n.push(e.id), (e = e.getSelf())) var r, i = L(uS(e)) try { for (i.s(); !(r = i.n()).done; ) { var a = r.value, o = a.property, s = a.childNode n.push(iS(o.slice(0, -4)), s.getCacheKey(t)) } } catch (u) { i.e(u) } finally { i.f() } return iS(n) } function uS(e) { var n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] return d().m(function r() { var i, a, o, s, u, l, c, h, f, p return d().w(function (r) { for (;;) switch (r.n) { case 0: c = t(e) case 1: if ((h = c()).done) { r.n = 12 break } if (!0 !== (i = h.value).startsWith('_')) { r.n = 2 break } return r.a(3, 1) case 2: if (((a = e[i]), !0 !== Array.isArray(a))) { r.n = 6 break } o = 0 case 3: if (!(o < a.length)) { r.n = 5 break } if ( !(s = a[o]) || !(!0 === s.isNode || (n && 'function' == typeof s.toJSON)) ) { r.n = 4 break } return ((r.n = 4), { property: i, index: o, childNode: s }) case 4: ;(o++, (r.n = 3)) break case 5: r.n = 11 break case 6: if (!a || !0 !== a.isNode) { r.n = 8 break } return ((r.n = 7), { property: i, childNode: a }) case 7: r.n = 11 break case 8: if ('object' !== P(a)) { r.n = 11 break } f = t(a) case 9: if ((p = f()).done) { r.n = 11 break } if ( ((u = p.value), !(l = a[u]) || !(!0 === l.isNode || (n && 'function' == typeof l.toJSON))) ) { r.n = 10 break } return ((r.n = 10), { property: i, index: u, childNode: l }) case 10: r.n = 9 break case 11: r.n = 1 break case 12: return r.a(2) } }, r) })() } var lS = new Map([ [1, 'float'], [2, 'vec2'], [3, 'vec3'], [4, 'vec4'], [9, 'mat3'], [16, 'mat4'], ]), cS = new WeakMap() function hS(e) { if (/[iu]?vec\d/.test(e)) return e.startsWith('ivec') ? Int32Array : e.startsWith('uvec') ? Uint32Array : Float32Array if (/mat\d/.test(e)) return Float32Array if (/float/.test(e)) return Float32Array if (/uint/.test(e)) return Uint32Array if (/int/.test(e)) return Int32Array throw new Error('THREE.NodeUtils: Unsupported type: '.concat(e)) } function dS(e) { return /float|int|uint/.test(e) ? 1 : /vec2/.test(e) ? 2 : /vec3/.test(e) ? 3 : /vec4/.test(e) || /mat2/.test(e) ? 4 : /mat3/.test(e) ? 9 : /mat4/.test(e) ? 16 : void console.error('THREE.TSL: Unsupported type:', e) } function fS(e) { if (null == e) return null var t = P(e) return !0 === e.isNode ? 'node' : 'number' === t ? 'float' : 'boolean' === t ? 'bool' : 'string' === t ? 'string' : 'function' === t ? 'shader' : !0 === e.isVector2 ? 'vec2' : !0 === e.isVector3 ? 'vec3' : !0 === e.isVector4 ? 'vec4' : !0 === e.isMatrix2 ? 'mat2' : !0 === e.isMatrix3 ? 'mat3' : !0 === e.isMatrix4 ? 'mat4' : !0 === e.isColor ? 'color' : e instanceof ArrayBuffer ? 'ArrayBuffer' : null } function pS(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 = e ? e.slice(-4) : void 0 return ( 1 === n.length && ('vec2' === i ? (n = [n[0], n[0]]) : 'vec3' === i ? (n = [n[0], n[0], n[0]]) : 'vec4' === i && (n = [n[0], n[0], n[0], n[0]])), 'color' === e ? g(Od, I(n)) : 'vec2' === i ? g(Vc, I(n)) : 'vec3' === i ? g(ph, I(n)) : 'vec4' === i ? g(uh, I(n)) : 'mat2' === i ? g(rm, I(n)) : 'mat3' === i ? g(Hc, I(n)) : 'mat4' === i ? g(Gh, I(n)) : 'bool' === e ? n[0] || !1 : 'float' === e || 'int' === e || 'uint' === e ? n[0] || 0 : 'string' === e ? n[0] || '' : 'ArrayBuffer' === e ? gS(n[0]) : null ) } function vS(e) { var t = cS.get(e) return (void 0 === t && ((t = {}), cS.set(e, t)), t) } function mS(e) { for (var t = '', n = new Uint8Array(e), r = 0; r < n.length; r++) t += String.fromCharCode(n[r]) return btoa(t) } function gS(e) { return Uint8Array.from(atob(e), function (e) { return e.charCodeAt(0) }).buffer } var yS = { VERTEX: 'vertex', FRAGMENT: 'fragment' }, _S = { NONE: 'none', FRAME: 'frame', RENDER: 'render', OBJECT: 'object' }, bS = { READ_ONLY: 'readOnly', WRITE_ONLY: 'writeOnly', READ_WRITE: 'readWrite' }, xS = ['fragment', 'vertex'], SS = [].concat(xS, ['compute']), AS = ['x', 'y', 'z', 'w'], wS = 0, TS = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return ( A(this, t), ((e = y(this, t)).nodeType = n), (e.updateType = _S.NONE), (e.updateBeforeType = _S.NONE), (e.updateAfterType = _S.NONE), (e.uuid = zc.generateUUID()), (e.version = 0), (e.global = !1), (e.isNode = !0), (e._cacheKey = null), (e._cacheKeyVersion = 0), Object.defineProperty(e, 'id', { value: wS++ }), e ) } return ( x(t, e), T( t, [ { key: 'needsUpdate', set: function (e) { !0 === e && this.version++ }, }, { key: 'type', get: function () { return this.constructor.type }, }, { key: 'onUpdate', value: function (e, t) { return ((this.updateType = t), (this.update = e.bind(this.getSelf())), this) }, }, { key: 'onFrameUpdate', value: function (e) { return this.onUpdate(e, _S.FRAME) }, }, { key: 'onRenderUpdate', value: function (e) { return this.onUpdate(e, _S.RENDER) }, }, { key: 'onObjectUpdate', value: function (e) { return this.onUpdate(e, _S.OBJECT) }, }, { key: 'onReference', value: function (e) { return ((this.updateReference = e.bind(this.getSelf())), this) }, }, { key: 'getSelf', value: function () { return this.self || this }, }, { key: 'updateReference', value: function () { return this }, }, { key: 'isGlobal', value: function () { return this.global }, }, { key: 'getChildren', value: d().m(function e() { var t, n, r, i return d().w( function (e) { for (;;) switch (e.n) { case 0: ;((t = L(uS(this))), (e.p = 1), t.s()) case 2: if ((n = t.n()).done) { e.n = 4 break } return ((r = n.value.childNode), (e.n = 3), r) case 3: e.n = 2 break case 4: e.n = 6 break case 5: ;((e.p = 5), (i = e.v), t.e(i)) case 6: return ((e.p = 6), t.f(), e.f(6)) case 7: return e.a(2) } }, e, this, [[1, 5, 6, 7]] ) }), }, { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, { key: 'traverse', value: function (e) { e(this) var t, n = L(this.getChildren()) try { for (n.s(); !(t = n.n()).done; ) { t.value.traverse(e) } } catch (r) { n.e(r) } finally { n.f() } }, }, { key: 'getCacheKey', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] return ( (!0 !== (e = e || this.version !== this._cacheKeyVersion) && null !== this._cacheKey) || ((this._cacheKey = oS(sS(this, e), this.customCacheKey())), (this._cacheKeyVersion = this.version)), this._cacheKey ) }, }, { key: 'customCacheKey', value: function () { return 0 }, }, { key: 'getScope', value: function () { return this }, }, { key: 'getHash', value: function () { return this.uuid }, }, { key: 'getUpdateType', value: function () { return this.updateType }, }, { key: 'getUpdateBeforeType', value: function () { return this.updateBeforeType }, }, { key: 'getUpdateAfterType', value: function () { return this.updateAfterType }, }, { key: 'getElementType', value: function (e) { var t = this.getNodeType(e) return e.getElementType(t) }, }, { key: 'getMemberType', value: function () { return 'void' }, }, { key: 'getNodeType', value: function (e) { var t = e.getNodeProperties(this) return t.outputNode ? t.outputNode.getNodeType(e) : this.nodeType }, }, { key: 'getShared', value: function (e) { var t = this.getHash(e) return e.getNodeFromHash(t) || this }, }, { key: 'setup', value: function (e) { var t, n = e.getNodeProperties(this), r = 0, i = L(this.getChildren()) try { for (i.s(); !(t = i.n()).done; ) { var a = t.value n['node' + r++] = a } } catch (o) { i.e(o) } finally { i.f() } return n.outputNode || null }, }, { key: 'analyze', value: function (e) { if (1 === e.increaseUsage(this)) for ( var t = e.getNodeProperties(this), n = 0, r = Object.values(t); n < r.length; n++ ) { var i = r[n] i && !0 === i.isNode && i.build(e) } }, }, { key: 'generate', value: function (e, t) { var n = e.getNodeProperties(this).outputNode if (n && !0 === n.isNode) return n.build(e, t) }, }, { key: 'updateBefore', value: function () { console.warn('Abstract function.') }, }, { key: 'updateAfter', value: function () { console.warn('Abstract function.') }, }, { key: 'update', value: function () { console.warn('Abstract function.') }, }, { key: 'build', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = this.getShared(e) if (this !== n) return n.build(e, t) ;(e.addNode(this), e.addChain(this)) var r = null, i = e.getBuildStage() if ('setup' === i) { this.updateReference(e) var a = e.getNodeProperties(this) if (!0 !== a.initialized) { a.initialized = !0 for ( var o = this.setup(e), s = o && !0 === o.isNode, u = 0, l = Object.values(a); u < l.length; u++ ) { var c = l[u] c && !0 === c.isNode && c.build(e) } ;(s && o.build(e), (a.outputNode = o)) } } else if ('analyze' === i) this.analyze(e) else if ('generate' === i) { if (1 === this.generate.length) { var h = this.getNodeType(e), d = e.getDataFromNode(this) ;(void 0 === (r = d.snippet) ? ((r = this.generate(e) || ''), (d.snippet = r)) : void 0 !== d.flowCodes && void 0 !== e.context.nodeBlock && e.addFlowCodeHierarchy(this, e.context.nodeBlock), (r = e.format(r, h, t))) } else r = this.generate(e, t) || '' } return (e.removeChain(this), e.addSequentialNode(this), r) }, }, { key: 'getSerializeChildren', value: function () { return uS(this) }, }, { key: 'serialize', value: function (e) { var t, n = {}, r = L(this.getSerializeChildren()) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value, a = i.property, o = i.index, s = i.childNode void 0 !== o ? (void 0 === n[a] && (n[a] = Number.isInteger(o) ? [] : {}), (n[a][o] = s.toJSON(e.meta).uuid)) : (n[a] = s.toJSON(e.meta).uuid) } } catch (u) { r.e(u) } finally { r.f() } Object.keys(n).length > 0 && (e.inputNodes = n) }, }, { key: 'deserialize', value: function (e) { if (void 0 !== e.inputNodes) { var t = e.meta.nodes for (var n in e.inputNodes) if (Array.isArray(e.inputNodes[n])) { var r, i = [], a = L(e.inputNodes[n]) try { for (a.s(); !(r = a.n()).done; ) { var o = r.value i.push(t[o]) } } catch (h) { a.e(h) } finally { a.f() } this[n] = i } else if ('object' === P(e.inputNodes[n])) { var s = {} for (var u in e.inputNodes[n]) { var l = e.inputNodes[n][u] s[u] = t[l] } this[n] = s } else { var c = e.inputNodes[n] this[n] = t[c] } } }, }, { key: 'toJSON', value: function (e) { var t = this.uuid, n = this.type, r = void 0 === e || 'string' == typeof e r && (e = { textures: {}, images: {}, nodes: {} }) var i = e.nodes[t] function a(e) { var t = [] for (var n in e) { var r = e[n] ;(delete r.metadata, t.push(r)) } return t } if ( (void 0 === i && ((i = { uuid: t, type: n, meta: e, metadata: { version: 4.6, type: 'Node', generator: 'Node.toJSON' }, }), !0 !== r && (e.nodes[i.uuid] = i), this.serialize(i), delete i.meta), r) ) { var o = a(e.textures), s = a(e.images), u = a(e.nodes) ;(o.length > 0 && (i.textures = o), s.length > 0 && (i.images = s), u.length > 0 && (i.nodes = u)) } return i }, }, ], [ { key: 'type', get: function () { return 'Node' }, }, ] ) ) })(kc), MS = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t)).node = e), (r.indexNode = n), (r.isArrayElementNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.node.getElementType(e) }, }, { key: 'generate', value: function (e) { var t = this.node.build(e), n = this.indexNode.build(e, 'uint') return ''.concat(t, '[ ').concat(n, ' ]') }, }, ], [ { key: 'type', get: function () { return 'ArrayElementNode' }, }, ] ) ) })(TS), ES = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).node = e), (r.convertTo = n), r) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { var t, n = this.node.getNodeType(e), r = null, i = L(this.convertTo.split('|')) try { for (i.s(); !(t = i.n()).done; ) { var a = t.value ;(null !== r && e.getTypeLength(n) !== e.getTypeLength(a)) || (r = a) } } catch (o) { i.e(o) } finally { i.f() } return r }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.convertTo = this.convertTo)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.convertTo = e.convertTo)) }, }, { key: 'generate', value: function (e, t) { var n = this.node, r = this.getNodeType(e), i = n.build(e, r) return e.format(i, r, t) }, }, ], [ { key: 'type', get: function () { return 'ConvertNode' }, }, ] ) ) })(TS), CS = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return (A(this, t), ((e = y(this, t, [n])).isTempNode = !0), e) } return ( x(t, e), T( t, [ { key: 'hasDependencies', value: function (e) { return e.getDataFromNode(this).usageCount > 1 }, }, { key: 'build', value: function (e, r) { if ('generate' === e.getBuildStage()) { var i = e.getVectorType(this.getNodeType(e, r)), a = e.getDataFromNode(this) if (void 0 !== a.propertyName) return e.format(a.propertyName, i, r) if ('void' !== i && 'void' !== r && this.hasDependencies(e)) { var o = n(t, 'build', this, 3)([e, i]), s = e.getVarFromNode(this, null, i), u = e.getPropertyName(s) return ( e.addLineFlowCode(''.concat(u, ' = ').concat(o), this), (a.snippet = o), (a.propertyName = u), e.format(a.propertyName, i, r) ) } } return n(t, 'build', this, 3)([e, r]) }, }, ], [ { key: 'type', get: function () { return 'TempNode' }, }, ] ) ) })(TS), kS = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), ((e = y(this, t, [r])).nodes = n), e) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return null !== this.nodeType ? e.getVectorType(this.nodeType) : e.getTypeFromLength( this.nodes.reduce(function (t, n) { return t + e.getTypeLength(n.getNodeType(e)) }, 0) ) }, }, { key: 'generate', value: function (e, t) { var n, r = this.getNodeType(e), i = this.nodes, a = e.getComponentType(r), o = [], s = L(i) try { for (s.s(); !(n = s.n()).done; ) { var u = n.value, l = u.build(e), c = e.getComponentType(u.getNodeType(e)) ;(c !== a && (l = e.format(l, c, a)), o.push(l)) } } catch (d) { s.e(d) } finally { s.f() } var h = ''.concat(e.getType(r), '( ').concat(o.join(', '), ' )') return e.format(h, r, t) }, }, ], [ { key: 'type', get: function () { return 'JoinNode' }, }, ] ) ) })(CS), RS = AS.join(''), IS = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'x' return ( A(this, t), ((n = y(this, t)).node = e), (n.components = r), (n.isSplitNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'getVectorLength', value: function () { var e, t = this.components.length, n = L(this.components) try { for (n.s(); !(e = n.n()).done; ) { var r = e.value t = Math.max(AS.indexOf(r) + 1, t) } } catch (i) { n.e(i) } finally { n.f() } return t }, }, { key: 'getComponentType', value: function (e) { return e.getComponentType(this.node.getNodeType(e)) }, }, { key: 'getNodeType', value: function (e) { return e.getTypeFromLength(this.components.length, this.getComponentType(e)) }, }, { key: 'generate', value: function (e, t) { var n = this.node, r = e.getTypeLength(n.getNodeType(e)), i = null if (r > 1) { var a = null this.getVectorLength() >= r && (a = e.getTypeFromLength( this.getVectorLength(), this.getComponentType(e) )) var o = n.build(e, a) i = this.components.length === r && this.components === RS.slice(0, this.components.length) ? e.format(o, a, t) : e.format( ''.concat(o, '.').concat(this.components), this.getNodeType(e), t ) } else i = n.build(e, t) return i }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.components = this.components)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.components = e.components)) }, }, ], [ { key: 'type', get: function () { return 'SplitNode' }, }, ] ) ) })(TS), NS = (function (e) { function t(e, n, r) { var i return ( A(this, t), ((i = y(this, t)).sourceNode = e), (i.components = n), (i.targetNode = r), i ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.sourceNode.getNodeType(e) }, }, { key: 'generate', value: function (e) { for ( var t = this.sourceNode, n = this.components, r = this.targetNode, i = this.getNodeType(e), a = e.getComponentType(r.getNodeType(e)), o = e.getTypeFromLength(n.length, a), s = r.build(e, o), u = t.build(e, i), l = e.getTypeLength(i), c = [], h = 0; h < l; h++ ) { var d = AS[h] d === n[0] ? (c.push(s), (h += n.length - 1)) : c.push(u + '.' + d) } return ''.concat(e.getType(i), '( ').concat(c.join(', '), ' )') }, }, ], [ { key: 'type', get: function () { return 'SetNode' }, }, ] ) ) })(CS), PS = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).sourceNode = e), (r.components = n), r) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.sourceNode.getNodeType(e) }, }, { key: 'generate', value: function (e) { var t = this.components, n = this.sourceNode, r = this.getNodeType(e), i = n.build(e), a = e.getVarFromNode(this), o = e.getPropertyName(a) e.addLineFlowCode(o + ' = ' + i, this) for (var s = e.getTypeLength(r), u = [], l = 0, c = 0; c < s; c++) { var h = AS[c] h === t[l] ? (u.push('1.0 - ' + o + '.' + h), l++) : u.push(o + '.' + h) } return ''.concat(e.getType(r), '( ').concat(u.join(', '), ' )') }, }, ], [ { key: 'type', get: function () { return 'FlipNode' }, }, ] ) ) })(CS), LS = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, [r])).isInputNode = !0), (n.value = e), (n.precision = null), n ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return null === this.nodeType ? fS(this.value) : this.nodeType }, }, { key: 'getInputType', value: function (e) { return this.getNodeType(e) }, }, { key: 'setPrecision', value: function (e) { return ((this.precision = e), this) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.value = this.value), this.value && this.value.toArray && (e.value = this.value.toArray()), (e.valueType = fS(this.value)), (e.nodeType = this.nodeType), 'ArrayBuffer' === e.valueType && (e.value = mS(e.value)), (e.precision = this.precision)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.nodeType = e.nodeType), (this.value = Array.isArray(e.value) ? pS.apply(void 0, [e.valueType].concat(I(e.value))) : e.value), (this.precision = e.precision || null), this.value && this.value.fromArray && (this.value = this.value.fromArray(e.value))) }, }, { key: 'generate', value: function () { console.warn('Abstract function.') }, }, ], [ { key: 'type', get: function () { return 'InputNode' }, }, ] ) ) })(TS), DS = /float|u?int/, OS = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), ((n = y(this, t, [e, r])).isConstNode = !0), n) } return ( x(t, e), T( t, [ { key: 'generateConst', value: function (e) { return e.generateConst(this.getNodeType(e), this.value) }, }, { key: 'generate', value: function (e, t) { var n = this.getNodeType(e) return DS.test(n) && DS.test(t) ? e.generateConst(t, this.value) : e.format(this.generateConst(e), n, t) }, }, ], [ { key: 'type', get: function () { return 'ConstNode' }, }, ] ) ) })(LS), FS = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t)).node = e), (r.property = n), (r.isMemberNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.node.getMemberType(e, this.property) }, }, { key: 'generate', value: function (e) { return this.node.build(e) + '.' + this.property }, }, ], [ { key: 'type', get: function () { return 'MemberNode' }, }, ] ) ) })(TS), BS = null, US = new Map() function zS(e, t) { if (US.has(e)) console.warn('Redefinition of method chaining '.concat(e)) else { if ('function' != typeof t) throw new Error('Node element '.concat(e, ' is not a function')) US.set(e, t) } } for ( var VS = function (e) { return e .replace(/r|s/g, 'x') .replace(/g|t/g, 'y') .replace(/b|p/g, 'z') .replace(/a|q/g, 'w') }, HS = function (e) { return VS(e).split('').sort().join('') }, WS = { setup: function (e, t) { var n = t.shift() return e.apply(void 0, [EA(n)].concat(I(t))) }, get: function (e, t, n) { if ('string' == typeof t && void 0 === e[t]) { if (!0 !== e.isStackNode && 'assign' === t) return function () { for (var e, t = arguments.length, r = new Array(t), i = 0; i < t; i++) r[i] = arguments[i] return ((e = BS).assign.apply(e, [n].concat(r)), n) } if (US.has(t)) { var r = US.get(t) return e.isStackNode ? function () { return n.add(r.apply(void 0, arguments)) } : function () { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i] return r.apply(void 0, [n].concat(t)) } } if ('self' === t) return e if (t.endsWith('Assign') && US.has(t.slice(0, t.length - 6))) { var i = US.get(t.slice(0, t.length - 6)) return e.isStackNode ? function () { return n.assign( arguments.length <= 0 ? void 0 : arguments[0], i.apply(void 0, arguments) ) } : function () { for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r] return n.assign(i.apply(void 0, [n].concat(t))) } } if (!0 === /^[xyzwrgbastpq]{1,4}$/.test(t)) return ((t = VS(t)), MA(new IS(n, t))) if (!0 === /^set[XYZWRGBASTPQ]{1,4}$/.test(t)) return ( (t = HS(t.slice(3).toLowerCase())), function (n) { return MA(new NS(e, t, n)) } ) if (!0 === /^flip[XYZWRGBASTPQ]{1,4}$/.test(t)) return ( (t = HS(t.slice(4).toLowerCase())), function () { return MA(new PS(MA(e), t)) } ) if ('width' === t || 'height' === t || 'depth' === t) return ( 'width' === t ? (t = 'x') : 'height' === t ? (t = 'y') : 'depth' === t && (t = 'z'), MA(new IS(e, t)) ) if (!0 === /^\d+$/.test(t)) return MA(new MS(n, new OS(Number(t), 'uint'))) if (!0 === /^get$/.test(t)) return function (e) { return MA(new FS(n, e)) } } return Reflect.get(e, t, n) }, set: function (e, t, n, r) { return 'string' != typeof t || void 0 !== e[t] || (!0 !== /^[xyzwrgbastpq]{1,4}$/.test(t) && 'width' !== t && 'height' !== t && 'depth' !== t && !0 !== /^\d+$/.test(t)) ? Reflect.set(e, t, n, r) : (r[t].assign(n), !0) }, }, GS = new WeakMap(), jS = new WeakMap(), QS = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = fS(e) if ('node' === n) { var r = GS.get(e) return (void 0 === r && ((r = new Proxy(e, WS)), GS.set(e, r), GS.set(r, r)), r) } return (null === t && ('float' === n || 'boolean' === n)) || (n && 'shader' !== n && 'string' !== n) ? MA(xA(e, t)) : 'shader' === n ? IA(e) : e }, qS = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null for (var n in e) e[n] = MA(e[n], t) return e }, XS = function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = e.length, r = 0; r < n; r++ ) e[r] = MA(e[r], t) return e }, YS = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, i = function (e) { return MA(null !== r ? Object.assign(e, r) : e) } return null === t ? function () { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r] return i(g(e, I(CA(n)))) } : null !== n ? ((n = MA(n)), function () { for (var r = arguments.length, a = new Array(r), o = 0; o < r; o++) a[o] = arguments[o] return i(g(e, [t].concat(I(CA(a)), [n]))) }) : function () { for (var n = arguments.length, r = new Array(n), a = 0; a < n; a++) r[a] = arguments[a] return i(g(e, [t].concat(I(CA(r))))) } }, KS = function (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 MA(g(e, I(CA(n)))) }, ZS = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).shaderNode = e), (r.inputNodes = n), r) } return ( x(t, e), T(t, [ { key: 'getNodeType', value: function (e) { return this.shaderNode.nodeType || this.getOutputNode(e).getNodeType(e) }, }, { key: 'getMemberType', value: function (e, t) { return this.getOutputNode(e).getMemberType(e, t) }, }, { key: 'call', value: function (e) { var t = this.shaderNode, n = this.inputNodes, r = e.getNodeProperties(t) if (r.onceOutput) return r.onceOutput var i = null if (t.layout) { var a = jS.get(e.constructor) void 0 === a && ((a = new WeakMap()), jS.set(e.constructor, a)) var o = a.get(t) ;(void 0 === o && ((o = MA(e.buildFunctionNode(t))), a.set(t, o)), null !== e.currentFunctionNode && e.currentFunctionNode.includes.push(o), (i = MA(o.call(n)))) } else { var s = t.jsFunc, u = null !== n || s.length > 1 ? s(n || [], e) : s(e) i = MA(u) } return (t.once && (r.onceOutput = i), i) }, }, { key: 'getOutputNode', value: function (e) { var t = e.getNodeProperties(this) return ( null === t.outputNode && (t.outputNode = this.setupOutput(e)), t.outputNode ) }, }, { key: 'setup', value: function (e) { return this.getOutputNode(e) }, }, { key: 'setupOutput', value: function (e) { return (e.addStack(), (e.stack.outputNode = this.call(e)), e.removeStack()) }, }, { key: 'generate', value: function (e, t) { return this.getOutputNode(e).build(e, t) }, }, ]) ) })(TS), JS = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [n])).jsFunc = e), (r.layout = null), (r.global = !0), (r.once = !1), r ) } return ( x(t, e), T(t, [ { key: 'setLayout', value: function (e) { return ((this.layout = e), this) }, }, { key: 'call', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return (EA(e), MA(new ZS(this, e))) }, }, { key: 'setup', value: function () { return this.call() }, }, ]) ) })(TS), $S = [ 0.5, 1.5, 1 / 3, 1e-6, 1e6, Math.PI, 2 * Math.PI, 1 / Math.PI, 2 / Math.PI, 1 / (2 * Math.PI), Math.PI / 2, ], eA = new Map(), tA = 0, nA = [!1, !0]; tA < nA.length; tA++ ) { var rA = nA[tA] eA.set(rA, new OS(rA)) } for (var iA = new Map(), aA = 0, oA = [0, 1, 2, 3]; aA < oA.length; aA++) { var sA = oA[aA] iA.set(sA, new OS(sA, 'uint')) } for ( var uA = new Map( I(iA).map(function (e) { return new OS(e.value, 'int') }) ), lA = 0, cA = [-1, -2]; lA < cA.length; lA++ ) { var hA = cA[lA] uA.set(hA, new OS(hA, 'int')) } for ( var dA = new Map( I(uA).map(function (e) { return new OS(e.value) }) ), fA = 0, pA = $S; fA < pA.length; fA++ ) { var vA = pA[fA] dA.set(vA, new OS(vA)) } for (var mA = 0, gA = $S; mA < gA.length; mA++) { var yA = gA[mA] dA.set(-yA, new OS(-yA)) } var _A = { bool: eA, uint: iA, ints: uA, float: dA }, bA = new Map([].concat(I(eA), I(dA))), xA = function (e, t) { return bA.has(e) ? bA.get(e) : !0 === e.isNode ? e : new OS(e, t) }, SA = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return function () { for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i] if ( ((0 === r.length || (!['bool', 'float', 'int', 'uint'].includes(e) && r.every(function (e) { return 'object' !== P(e) }))) && (r = [pS.apply(void 0, [e].concat(I(r)))]), 1 === r.length && null !== t && t.has(r[0])) ) return MA(t.get(r[0])) if (1 === r.length) { var a = xA(r[0], e) return (function (e) { try { return e.getNodeType() } catch (BG) { return } })(a) === e ? MA(a) : MA(new ES(a, e)) } var o = r.map(function (e) { return xA(e) }) return MA(new kS(o, e)) } }, AA = function (e) { return 'object' === P(e) && null !== e ? e.value : e }, wA = function (e) { return null != e ? e.nodeType || e.convertTo || ('string' == typeof e ? e : null) : null } function TA(e, t) { return new Proxy(new JS(e, t), WS) } var MA = function (e) { return QS(e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null) }, EA = function (e) { return new qS( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null ) }, CA = function (e) { return new XS( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null ) }, kA = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return g(YS, t) }, RA = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return g(KS, t) }, IA = function (e, t) { var n = new TA(e, t), r = function () { for (var e, t = arguments.length, r = new Array(t), i = 0; i < t; i++) r[i] = arguments[i] return (EA(r), (e = r[0] && r[0].isNode ? [].concat(r) : r[0]), n.call(e)) } return ( (r.shaderNode = n), (r.setLayout = function (e) { return (n.setLayout(e), r) }), (r.once = function () { return ((n.once = !0), r) }), r ) } zS('toGlobal', function (e) { return ((e.global = !0), e) }) var NA = function (e) { BS = e }, PA = function () { return BS }, LA = function () { var e return (e = BS).If.apply(e, arguments) } function DA(e) { return (BS && BS.add(e), e) } zS('append', DA) var OA = new SA('color'), FA = new SA('float', _A.float), BA = new SA('int', _A.ints), UA = new SA('uint', _A.uint), zA = new SA('bool', _A.bool), VA = new SA('vec2'), HA = new SA('ivec2'), WA = new SA('uvec2'), GA = new SA('bvec2'), jA = new SA('vec3'), QA = new SA('ivec3'), qA = new SA('uvec3'), XA = new SA('bvec3'), YA = new SA('vec4'), KA = new SA('ivec4'), ZA = new SA('uvec4'), JA = new SA('bvec4'), $A = new SA('mat2'), ew = new SA('mat3'), tw = new SA('mat4') ;(zS('toColor', OA), zS('toFloat', FA), zS('toInt', BA), zS('toUint', UA), zS('toBool', zA), zS('toVec2', VA), zS('toIVec2', HA), zS('toUVec2', WA), zS('toBVec2', GA), zS('toVec3', jA), zS('toIVec3', QA), zS('toUVec3', qA), zS('toBVec3', XA), zS('toVec4', YA), zS('toIVec4', KA), zS('toUVec4', ZA), zS('toBVec4', JA), zS('toMat2', $A), zS('toMat3', ew), zS('toMat4', tw)) var nw = kA(MS), rw = function (e, t) { return MA(new ES(MA(e), t)) } ;(zS('element', nw), zS('convert', rw)) var iw = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), ((r = y(this, t, [e])).count = n), (r.values = i), (r.isArrayNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return ( null === this.nodeType && (this.nodeType = this.values[0].getNodeType(e)), this.nodeType ) }, }, { key: 'getElementType', value: function (e) { return this.getNodeType(e) }, }, { key: 'generate', value: function (e) { var t = this.getNodeType(e) return e.generateArray(t, this.count, this.values) }, }, ], [ { key: 'type', get: function () { return 'ArrayNode' }, }, ] ) ) })(CS), aw = function () { var e if (1 === arguments.length) { var t = arguments.length <= 0 ? void 0 : arguments[0] e = new iw(null, t.length, t) } else { e = new iw( arguments.length <= 0 ? void 0 : arguments[0], arguments.length <= 1 ? void 0 : arguments[1] ) } return MA(e) } zS('toArray', function (e, t) { return aw(Array(t).fill(e)) }) var ow = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 return ( A(this, t), ((n = y(this, t, ['string'])).name = e), (n.shared = r), (n.order = i), (n.isUniformGroup = !0), n ) } return ( x(t, e), T( t, [ { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.name = this.name), (e.version = this.version), (e.shared = this.shared)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.name = e.name), (this.version = e.version), (this.shared = e.shared)) }, }, ], [ { key: 'type', get: function () { return 'UniformGroupNode' }, }, ] ) ) })(TS), sw = function (e) { return new ow(e) }, uw = function (e) { return new ow( e, !0, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 ) }, lw = uw('frame'), cw = uw('render'), hw = sw('object'), dw = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, [e, r])).isUniformNode = !0), (n.name = ''), (n.groupNode = hw), n ) } return ( x(t, e), T( t, [ { key: 'label', value: function (e) { return ((this.name = e), this) }, }, { key: 'setGroup', value: function (e) { return ((this.groupNode = e), this) }, }, { key: 'getGroup', value: function () { return this.groupNode }, }, { key: 'getUniformHash', value: function (e) { return this.getHash(e) }, }, { key: 'onUpdate', value: function (e, r) { var i = this, a = this.getSelf() return ( (e = e.bind(a)), n( t, 'onUpdate', this, 3 )([ function (t) { var n = e(t, a) void 0 !== n && (i.value = n) }, r, ]) ) }, }, { key: 'generate', value: function (e, t) { var n = this.getNodeType(e), r = this.getUniformHash(e), i = e.getNodeFromHash(r) void 0 === i && (e.setHashNode(this, r), (i = this)) var a = i.getInputType(e), o = e.getUniformFromNode( i, a, e.shaderStage, this.name || e.context.label ), s = e.getPropertyName(o) return ( void 0 !== e.context.label && delete e.context.label, e.format(s, n, t) ) }, }, ], [ { key: 'type', get: function () { return 'UniformNode' }, }, ] ) ) })(LS), fw = function (e, t) { var n = wA(t || e), r = e && !0 === e.isNode ? (e.node && e.node.value) || e.value : e return MA(new dw(r, n)) }, pw = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] return ( A(this, t), ((n = y(this, t, [e])).name = r), (n.varying = i), (n.isPropertyNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { return this.name || n(t, 'getHash', this, 3)([e]) }, }, { key: 'isGlobal', value: function () { return !0 }, }, { key: 'generate', value: function (e) { var t return ( !0 === this.varying ? ((t = e.getVaryingFromNode(this, this.name)).needsInterpolation = !0) : (t = e.getVarFromNode(this, this.name)), e.getPropertyName(t) ) }, }, ], [ { key: 'type', get: function () { return 'PropertyNode' }, }, ] ) ) })(TS), vw = function (e, t) { return MA(new pw(e, t)) }, mw = function (e, t) { return MA(new pw(e, t, !0)) }, gw = RA(pw, 'vec4', 'DiffuseColor'), yw = RA(pw, 'vec3', 'EmissiveColor'), _w = RA(pw, 'float', 'Roughness'), bw = RA(pw, 'float', 'Metalness'), xw = RA(pw, 'float', 'Clearcoat'), Sw = RA(pw, 'float', 'ClearcoatRoughness'), Aw = RA(pw, 'vec3', 'Sheen'), ww = RA(pw, 'float', 'SheenRoughness'), Tw = RA(pw, 'float', 'Iridescence'), Mw = RA(pw, 'float', 'IridescenceIOR'), Ew = RA(pw, 'float', 'IridescenceThickness'), Cw = RA(pw, 'float', 'AlphaT'), kw = RA(pw, 'float', 'Anisotropy'), Rw = RA(pw, 'vec3', 'AnisotropyT'), Iw = RA(pw, 'vec3', 'AnisotropyB'), Nw = RA(pw, 'color', 'SpecularColor'), Pw = RA(pw, 'float', 'SpecularF90'), Lw = RA(pw, 'float', 'Shininess'), Dw = RA(pw, 'vec4', 'Output'), Ow = RA(pw, 'float', 'dashSize'), Fw = RA(pw, 'float', 'gapSize'), Bw = RA(pw, 'float', 'pointWidth'), Uw = RA(pw, 'float', 'IOR'), zw = RA(pw, 'float', 'Transmission'), Vw = RA(pw, 'float', 'Thickness'), Hw = RA(pw, 'float', 'AttenuationDistance'), Ww = RA(pw, 'color', 'AttenuationColor'), Gw = RA(pw, 'float', 'Dispersion'), jw = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).targetNode = e), (r.sourceNode = n), r) } return ( x(t, e), T( t, [ { key: 'hasDependencies', value: function () { return !1 }, }, { key: 'getNodeType', value: function (e, t) { return 'void' !== t ? this.targetNode.getNodeType(e) : 'void' }, }, { key: 'needsSplitAssign', value: function (e) { var t = this.targetNode if ( !1 === e.isAvailable('swizzleAssign') && t.isSplitNode && t.components.length > 1 ) { var n = e.getTypeLength(t.node.getNodeType(e)) return AS.join('').slice(0, n) !== t.components } return !1 }, }, { key: 'generate', value: function (e, t) { var n, r = this.targetNode, i = this.sourceNode, a = this.needsSplitAssign(e), o = r.getNodeType(e), s = r.context({ assign: !0 }).build(e), u = i.build(e, o), l = i.getNodeType(e), c = e.getDataFromNode(this) if (!0 === c.initialized) 'void' !== t && (n = s) else if (a) { var h = e.getVarFromNode(this, null, o), d = e.getPropertyName(h) e.addLineFlowCode(''.concat(d, ' = ').concat(u), this) for ( var f = r.node.context({ assign: !0 }).build(e), p = 0; p < r.components.length; p++ ) { var v = r.components[p] e.addLineFlowCode( ''.concat(f, '.').concat(v, ' = ').concat(d, '[ ').concat(p, ' ]'), this ) } 'void' !== t && (n = s) } else ((n = ''.concat(s, ' = ').concat(u)), ('void' !== t && 'void' !== l) || (e.addLineFlowCode(n, this), 'void' !== t && (n = s))) return ((c.initialized = !0), e.format(n, o, t)) }, }, ], [ { key: 'type', get: function () { return 'AssignNode' }, }, ] ) ) })(CS), Qw = kA(jw) zS('assign', Qw) var qw = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return (A(this, t), ((e = y(this, t)).functionNode = n), (e.parameters = r), e) } return ( x(t, e), T( t, [ { key: 'setParameters', value: function (e) { return ((this.parameters = e), this) }, }, { key: 'getParameters', value: function () { return this.parameters }, }, { key: 'getNodeType', value: function (e) { return this.functionNode.getNodeType(e) }, }, { key: 'generate', value: function (e) { var t = [], n = this.functionNode, r = n.getInputs(e), i = this.parameters, a = function (t, n) { var r = n.type return 'pointer' === r ? '&' + t.build(e) : t.build(e, r) } if (Array.isArray(i)) for (var o = 0; o < i.length; o++) t.push(a(i[o], r[o])) else { var s, u = L(r) try { for (u.s(); !(s = u.n()).done; ) { var l = s.value, c = i[l.name] if (void 0 === c) throw new Error( "FunctionCallNode: Input '".concat( l.name, "' not found in FunctionNode." ) ) t.push(a(c, l)) } } catch (d) { u.e(d) } finally { u.f() } } var h = n.build(e, 'property') return ''.concat(h, '( ').concat(t.join(', '), ' )') }, }, ], [ { key: 'type', get: function () { return 'FunctionCallNode' }, }, ] ) ) })(CS), Xw = function (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 = n.length > 1 || (n[0] && !0 === n[0].isNode) ? CA(n) : EA(n[0])), MA(new qw(MA(e), n)) ) } zS('call', Xw) var Yw = (function (e) { function t(e, n, r) { var i if ( (A(this, t), (i = y(this, t)), (arguments.length <= 3 ? 0 : arguments.length - 3) > 0) ) { for ( var a, o = new t(e, n, r), s = 0; s < (arguments.length <= 3 ? 0 : arguments.length - 3) - 1; s++ ) o = new t( e, o, s + 3 < 3 || arguments.length <= s + 3 ? void 0 : arguments[s + 3] ) ;((n = o), (r = (a = (arguments.length <= 3 ? 0 : arguments.length - 3) - 1 + 3) < 3 || arguments.length <= a ? void 0 : arguments[a])) } return ((i.op = e), (i.aNode = n), (i.bNode = r), (i.isOperatorNode = !0), i) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e, t) { var n = this.op, r = this.aNode, i = this.bNode, a = r.getNodeType(e), o = void 0 !== i ? i.getNodeType(e) : null if ('void' === a || 'void' === o) return 'void' if ('%' === n) return a if ( '~' === n || '&' === n || '|' === n || '^' === n || '>>' === n || '<<' === n ) return e.getIntegerType(a) if ('!' === n || '==' === n || '&&' === n || '||' === n || '^^' === n) return 'bool' if ('<' === n || '>' === n || '<=' === n || '>=' === n) { var s = t ? e.getTypeLength(t) : Math.max(e.getTypeLength(a), e.getTypeLength(o)) return s > 1 ? 'bvec'.concat(s) : 'bool' } if (e.isMatrix(a)) { if ('float' === o) return a if (e.isVector(o)) return e.getVectorFromMatrix(a) if (e.isMatrix(o)) return a } else if (e.isMatrix(o)) { if ('float' === a) return o if (e.isVector(a)) return e.getVectorFromMatrix(o) } return e.getTypeLength(o) > e.getTypeLength(a) ? o : a }, }, { key: 'generate', value: function (e, t) { var n = this.op, r = this.aNode, i = this.bNode, a = this.getNodeType(e, t), o = null, s = null 'void' !== a ? ((o = r.getNodeType(e)), (s = void 0 !== i ? i.getNodeType(e) : null), '<' === n || '>' === n || '<=' === n || '>=' === n || '==' === n ? e.isVector(o) ? (s = o) : o !== s && (o = s = 'float') : '>>' === n || '<<' === n ? ((o = a), (s = e.changeComponentType(s, 'uint'))) : e.isMatrix(o) ? 'float' === s ? (s = 'float') : e.isVector(s) ? (s = e.getVectorFromMatrix(o)) : e.isMatrix(s) || (o = s = a) : (o = e.isMatrix(s) ? 'float' === o ? 'float' : e.isVector(o) ? e.getVectorFromMatrix(s) : (s = a) : (s = a))) : (o = s = a) var u = r.build(e, o), l = void 0 !== i ? i.build(e, s) : null, c = e.getTypeLength(t), h = e.getFunctionOperator(n) return 'void' !== t ? '<' === n && c > 1 ? e.useComparisonMethod ? e.format( '' .concat(e.getMethod('lessThan', t), '( ') .concat(u, ', ') .concat(l, ' )'), a, t ) : e.format('( '.concat(u, ' < ').concat(l, ' )'), a, t) : '<=' === n && c > 1 ? e.useComparisonMethod ? e.format( '' .concat(e.getMethod('lessThanEqual', t), '( ') .concat(u, ', ') .concat(l, ' )'), a, t ) : e.format('( '.concat(u, ' <= ').concat(l, ' )'), a, t) : '>' === n && c > 1 ? e.useComparisonMethod ? e.format( '' .concat(e.getMethod('greaterThan', t), '( ') .concat(u, ', ') .concat(l, ' )'), a, t ) : e.format('( '.concat(u, ' > ').concat(l, ' )'), a, t) : '>=' === n && c > 1 ? e.useComparisonMethod ? e.format( '' .concat(e.getMethod('greaterThanEqual', t), '( ') .concat(u, ', ') .concat(l, ' )'), a, t ) : e.format('( '.concat(u, ' >= ').concat(l, ' )'), a, t) : '!' === n || '~' === n ? e.format('('.concat(n).concat(u, ')'), o, t) : h ? e.format( ''.concat(h, '( ').concat(u, ', ').concat(l, ' )'), a, t ) : e.isMatrix(o) && 'float' === s ? e.format( '( '.concat(l, ' ').concat(n, ' ').concat(u, ' )'), a, t ) : 'float' === o && e.isMatrix(s) ? e.format( ''.concat(u, ' ').concat(n, ' ').concat(l), a, t ) : e.format( '( '.concat(u, ' ').concat(n, ' ').concat(l, ' )'), a, t ) : 'void' !== o ? h ? e.format(''.concat(h, '( ').concat(u, ', ').concat(l, ' )'), a, t) : e.isMatrix(o) && 'float' === s ? e.format(''.concat(l, ' ').concat(n, ' ').concat(u), a, t) : e.format(''.concat(u, ' ').concat(n, ' ').concat(l), a, t) : void 0 }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.op = this.op)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.op = e.op)) }, }, ], [ { key: 'type', get: function () { return 'OperatorNode' }, }, ] ) ) })(CS), Kw = kA(Yw, '+'), Zw = kA(Yw, '-'), Jw = kA(Yw, '*'), $w = kA(Yw, '/'), eT = kA(Yw, '%'), tT = kA(Yw, '=='), nT = kA(Yw, '!='), rT = kA(Yw, '<'), iT = kA(Yw, '>'), aT = kA(Yw, '<='), oT = kA(Yw, '>='), sT = kA(Yw, '&&'), uT = kA(Yw, '||'), lT = kA(Yw, '!'), cT = kA(Yw, '^^'), hT = kA(Yw, '&'), dT = kA(Yw, '~'), fT = kA(Yw, '|'), pT = kA(Yw, '^'), vT = kA(Yw, '<<'), mT = kA(Yw, '>>') ;(zS('add', Kw), zS('sub', Zw), zS('mul', Jw), zS('div', $w), zS('modInt', eT), zS('equal', tT), zS('notEqual', nT), zS('lessThan', rT), zS('greaterThan', iT), zS('lessThanEqual', aT), zS('greaterThanEqual', oT), zS('and', sT), zS('or', uT), zS('not', lT), zS('xor', cT), zS('bitAnd', hT), zS('bitNot', dT), zS('bitOr', fT), zS('bitXor', pT), zS('shiftLeft', vT), zS('shiftRight', mT)) var gT = function () { return ( console.warn('TSL.OperatorNode: .remainder() has been renamed to .modInt().'), eT.apply(void 0, arguments) ) } zS('remainder', gT) var yT = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((r = y(this, t)).method = e), (r.aNode = n), (r.bNode = i), (r.cNode = a), (r.isMathNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getInputType', value: function (e) { var t = this.aNode.getNodeType(e), n = this.bNode ? this.bNode.getNodeType(e) : null, r = this.cNode ? this.cNode.getNodeType(e) : null, i = e.isMatrix(t) ? 0 : e.getTypeLength(t), a = e.isMatrix(n) ? 0 : e.getTypeLength(n), o = e.isMatrix(r) ? 0 : e.getTypeLength(r) return i > a && i > o ? t : a > o ? n : o > i ? r : t }, }, { key: 'getNodeType', value: function (e) { var n = this.method return n === t.LENGTH || n === t.DISTANCE || n === t.DOT ? 'float' : n === t.CROSS ? 'vec3' : n === t.ALL ? 'bool' : n === t.EQUALS ? e.changeComponentType(this.aNode.getNodeType(e), 'bool') : n === t.MOD ? this.aNode.getNodeType(e) : this.getInputType(e) }, }, { key: 'generate', value: function (e, n) { var r = this.method, i = this.getNodeType(e), a = this.getInputType(e), o = this.aNode, s = this.bNode, u = this.cNode, l = e.renderer.coordinateSystem if (r === t.TRANSFORM_DIRECTION) { var c = o, h = s e.isMatrix(c.getNodeType(e)) ? (h = YA(jA(h), 0)) : (c = YA(jA(c), 0)) var d = Jw(c, h).xyz return DT(d).build(e, n) } if (r === t.NEGATE) return e.format('( - ' + o.build(e, a) + ' )', i, n) if (r === t.ONE_MINUS) return Zw(1, o).build(e, n) if (r === t.RECIPROCAL) return $w(1, o).build(e, n) if (r === t.DIFFERENCE) return WT(Zw(o, s)).build(e, n) var f = [] return ( r === t.CROSS || r === t.MOD ? f.push(o.build(e, i), s.build(e, i)) : l === Ec && r === t.STEP ? f.push( o.build(e, 1 === e.getTypeLength(o.getNodeType(e)) ? 'float' : a), s.build(e, a) ) : (l === Ec && (r === t.MIN || r === t.MAX)) || r === t.MOD ? f.push( o.build(e, a), s.build(e, 1 === e.getTypeLength(s.getNodeType(e)) ? 'float' : a) ) : r === t.REFRACT ? f.push(o.build(e, a), s.build(e, a), u.build(e, 'float')) : r === t.MIX ? f.push( o.build(e, a), s.build(e, a), u.build( e, 1 === e.getTypeLength(u.getNodeType(e)) ? 'float' : a ) ) : (l === Cc && r === t.ATAN && null !== s && (r = 'atan2'), f.push(o.build(e, a)), null !== s && f.push(s.build(e, a)), null !== u && f.push(u.build(e, a))), e.format( ''.concat(e.getMethod(r, i), '( ').concat(f.join(', '), ' )'), i, n ) ) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.method = this.method)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.method = e.method)) }, }, ], [ { key: 'type', get: function () { return 'MathNode' }, }, ] ) ) })(CS) ;((yT.ALL = 'all'), (yT.ANY = 'any'), (yT.RADIANS = 'radians'), (yT.DEGREES = 'degrees'), (yT.EXP = 'exp'), (yT.EXP2 = 'exp2'), (yT.LOG = 'log'), (yT.LOG2 = 'log2'), (yT.SQRT = 'sqrt'), (yT.INVERSE_SQRT = 'inversesqrt'), (yT.FLOOR = 'floor'), (yT.CEIL = 'ceil'), (yT.NORMALIZE = 'normalize'), (yT.FRACT = 'fract'), (yT.SIN = 'sin'), (yT.COS = 'cos'), (yT.TAN = 'tan'), (yT.ASIN = 'asin'), (yT.ACOS = 'acos'), (yT.ATAN = 'atan'), (yT.ABS = 'abs'), (yT.SIGN = 'sign'), (yT.LENGTH = 'length'), (yT.NEGATE = 'negate'), (yT.ONE_MINUS = 'oneMinus'), (yT.DFDX = 'dFdx'), (yT.DFDY = 'dFdy'), (yT.ROUND = 'round'), (yT.RECIPROCAL = 'reciprocal'), (yT.TRUNC = 'trunc'), (yT.FWIDTH = 'fwidth'), (yT.TRANSPOSE = 'transpose'), (yT.BITCAST = 'bitcast'), (yT.EQUALS = 'equals'), (yT.MIN = 'min'), (yT.MAX = 'max'), (yT.MOD = 'mod'), (yT.STEP = 'step'), (yT.REFLECT = 'reflect'), (yT.DISTANCE = 'distance'), (yT.DIFFERENCE = 'difference'), (yT.DOT = 'dot'), (yT.CROSS = 'cross'), (yT.POW = 'pow'), (yT.TRANSFORM_DIRECTION = 'transformDirection'), (yT.MIX = 'mix'), (yT.CLAMP = 'clamp'), (yT.REFRACT = 'refract'), (yT.SMOOTHSTEP = 'smoothstep'), (yT.FACEFORWARD = 'faceforward')) var _T = FA(1e-6), bT = FA(1e6), xT = FA(Math.PI), ST = FA(2 * Math.PI), AT = kA(yT, yT.ALL), wT = kA(yT, yT.ANY), TT = kA(yT, yT.RADIANS), MT = kA(yT, yT.DEGREES), ET = kA(yT, yT.EXP), CT = kA(yT, yT.EXP2), kT = kA(yT, yT.LOG), RT = kA(yT, yT.LOG2), IT = kA(yT, yT.SQRT), NT = kA(yT, yT.INVERSE_SQRT), PT = kA(yT, yT.FLOOR), LT = kA(yT, yT.CEIL), DT = kA(yT, yT.NORMALIZE), OT = kA(yT, yT.FRACT), FT = kA(yT, yT.SIN), BT = kA(yT, yT.COS), UT = kA(yT, yT.TAN), zT = kA(yT, yT.ASIN), VT = kA(yT, yT.ACOS), HT = kA(yT, yT.ATAN), WT = kA(yT, yT.ABS), GT = kA(yT, yT.SIGN), jT = kA(yT, yT.LENGTH), QT = kA(yT, yT.NEGATE), qT = kA(yT, yT.ONE_MINUS), XT = kA(yT, yT.DFDX), YT = kA(yT, yT.DFDY), KT = kA(yT, yT.ROUND), ZT = kA(yT, yT.RECIPROCAL), JT = kA(yT, yT.TRUNC), $T = kA(yT, yT.FWIDTH), eM = kA(yT, yT.TRANSPOSE), tM = kA(yT, yT.BITCAST), nM = kA(yT, yT.EQUALS), rM = kA(yT, yT.MIN), iM = kA(yT, yT.MAX), aM = kA(yT, yT.MOD), oM = kA(yT, yT.STEP), sM = kA(yT, yT.REFLECT), uM = kA(yT, yT.DISTANCE), lM = kA(yT, yT.DIFFERENCE), cM = kA(yT, yT.DOT), hM = kA(yT, yT.CROSS), dM = kA(yT, yT.POW), fM = kA(yT, yT.POW, 2), pM = kA(yT, yT.POW, 3), vM = kA(yT, yT.POW, 4), mM = kA(yT, yT.TRANSFORM_DIRECTION), gM = function (e) { return Jw(GT(e), dM(WT(e), 1 / 3)) }, yM = function (e) { return cM(e, e) }, _M = kA(yT, yT.MIX), bM = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 return MA(new yT(yT.CLAMP, MA(e), MA(t), MA(n))) }, xM = function (e) { return bM(e) }, SM = kA(yT, yT.REFRACT), AM = kA(yT, yT.SMOOTHSTEP), wM = kA(yT, yT.FACEFORWARD), TM = IA(function (e) { var t = C(e, 1)[0], n = cM(t.xy, VA(12.9898, 78.233)), r = aM(n, xT) return OT(FT(r).mul(43758.5453)) }), MM = function (e, t, n) { return _M(t, n, e) }, EM = function (e, t, n) { return AM(t, n, e) }, CM = function (e, t) { return ( console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'), HT(e, t) ) }, kM = wM, RM = NT ;(zS('all', AT), zS('any', wT), zS('equals', nM), zS('radians', TT), zS('degrees', MT), zS('exp', ET), zS('exp2', CT), zS('log', kT), zS('log2', RT), zS('sqrt', IT), zS('inverseSqrt', NT), zS('floor', PT), zS('ceil', LT), zS('normalize', DT), zS('fract', OT), zS('sin', FT), zS('cos', BT), zS('tan', UT), zS('asin', zT), zS('acos', VT), zS('atan', HT), zS('abs', WT), zS('sign', GT), zS('length', jT), zS('lengthSq', yM), zS('negate', QT), zS('oneMinus', qT), zS('dFdx', XT), zS('dFdy', YT), zS('round', KT), zS('reciprocal', ZT), zS('trunc', JT), zS('fwidth', $T), zS('atan2', CM), zS('min', rM), zS('max', iM), zS('mod', aM), zS('step', oM), zS('reflect', sM), zS('distance', uM), zS('dot', cM), zS('cross', hM), zS('pow', dM), zS('pow2', fM), zS('pow3', pM), zS('pow4', vM), zS('transformDirection', mM), zS('mix', MM), zS('clamp', bM), zS('refract', SM), zS('smoothstep', EM), zS('faceForward', wM), zS('difference', lM), zS('saturate', xM), zS('cbrt', gM), zS('transpose', eM), zS('rand', TM)) var IM = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), ((r = y(this, t)).condNode = e), (r.ifNode = n), (r.elseNode = i), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { var t = e.getNodeProperties(this), n = t.ifNode, r = t.elseNode if (void 0 === n) return (this.setup(e), this.getNodeType(e)) var i = n.getNodeType(e) if (null !== r) { var a = r.getNodeType(e) if (e.getTypeLength(a) > e.getTypeLength(i)) return a } return i }, }, { key: 'setup', value: function (e) { var t = this.condNode.cache(), n = this.ifNode.cache(), r = this.elseNode ? this.elseNode.cache() : null, i = e.context.nodeBlock ;((e.getDataFromNode(n).parentNodeBlock = i), null !== r && (e.getDataFromNode(r).parentNodeBlock = i)) var a = e.getNodeProperties(this) ;((a.condNode = t), (a.ifNode = n.context({ nodeBlock: n })), (a.elseNode = r ? r.context({ nodeBlock: r }) : null)) }, }, { key: 'generate', value: function (e, t) { var n = this.getNodeType(e), r = e.getDataFromNode(this) if (void 0 !== r.nodeProperty) return r.nodeProperty var i = e.getNodeProperties(this), a = i.condNode, o = i.ifNode, s = i.elseNode, u = 'void' !== t, l = u ? vw(n).build(e) : '' r.nodeProperty = l var c = a.build(e, 'bool') e.addFlowCode( '\n'.concat(e.tab, 'if ( ').concat(c, ' ) {\n\n') ).addFlowTab() var h = o.build(e, n) if ( (h && (h = u ? l + ' = ' + h + ';' : 'return ' + h + ';'), e.removeFlowTab().addFlowCode(e.tab + '\t' + h + '\n\n' + e.tab + '}'), null !== s) ) { e.addFlowCode(' else {\n\n').addFlowTab() var d = s.build(e, n) ;(d && (d = u ? l + ' = ' + d + ';' : 'return ' + d + ';'), e .removeFlowTab() .addFlowCode(e.tab + '\t' + d + '\n\n' + e.tab + '}\n\n')) } else e.addFlowCode('\n\n') return e.format(l, n, t) }, }, ], [ { key: 'type', get: function () { return 'ConditionalNode' }, }, ] ) ) })(TS), NM = kA(IM) zS('select', NM) var PM = function () { return ( console.warn('TSL.ConditionalNode: cond() has been renamed to select().'), NM.apply(void 0, arguments) ) } zS('cond', PM) var LM = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return ( A(this, t), ((n = y(this, t)).isContextNode = !0), (n.node = e), (n.value = r), n ) } return ( x(t, e), T( t, [ { key: 'getScope', value: function () { return this.node.getScope() }, }, { key: 'getNodeType', value: function (e) { return this.node.getNodeType(e) }, }, { key: 'analyze', value: function (e) { this.node.build(e) }, }, { key: 'setup', value: function (e) { var t = e.getContext() e.setContext(s(s({}, e.context), this.value)) var n = this.node.build(e) return (e.setContext(t), n) }, }, { key: 'generate', value: function (e, t) { var n = e.getContext() e.setContext(s(s({}, e.context), this.value)) var r = this.node.build(e, t) return (e.setContext(n), r) }, }, ], [ { key: 'type', get: function () { return 'ContextNode' }, }, ] ) ) })(TS), DM = kA(LM), OM = function (e, t) { return DM(e, { label: t }) } ;(zS('context', DM), zS('label', OM)) var FM = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] return ( A(this, t), ((n = y(this, t)).node = e), (n.name = r), (n.global = !0), (n.isVarNode = !0), (n.readOnly = i), n ) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { return this.name || n(t, 'getHash', this, 3)([e]) }, }, { key: 'getMemberType', value: function (e, t) { return this.node.getMemberType(e, t) }, }, { key: 'getElementType', value: function (e) { return this.node.getElementType(e) }, }, { key: 'getNodeType', value: function (e) { return this.node.getNodeType(e) }, }, { key: 'generate', value: function (e) { var t = this.node, n = this.name, r = this.readOnly, i = !0 === e.renderer.backend.isWebGPUBackend, a = !1, o = !1 r && ((a = e.isDeterministic(t)), (o = i ? r : a)) var s = e.getVectorType(this.getNodeType(e)), u = t.build(e, s), l = e.getVarFromNode(this, n, s, void 0, o), c = e.getPropertyName(l), h = c if (o) if (i) h = a ? 'const '.concat(c) : 'let '.concat(c) else { var d = e.getArrayCount(t) h = 'const '.concat(e.getVar(l.type, c, d)) } return (e.addLineFlowCode(''.concat(h, ' = ').concat(u), this), c) }, }, ], [ { key: 'type', get: function () { return 'VarNode' }, }, ] ) ) })(TS), BM = kA(FM), UM = function (e) { return BM( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null ).append() }, zM = function (e) { return BM( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, !0 ).append() } ;(zS('toVar', UM), zS('toConst', zM)) var VM = function (e) { return ( console.warn( 'TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.' ), BM(e) ) } zS('temp', VM) var HM = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t)).node = e), (n.name = r), (n.isVaryingNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'isGlobal', value: function () { return !0 }, }, { key: 'getHash', value: function (e) { return this.name || n(t, 'getHash', this, 3)([e]) }, }, { key: 'getNodeType', value: function (e) { return this.node.getNodeType(e) }, }, { key: 'setupVarying', value: function (e) { var t = e.getNodeProperties(this), n = t.varying if (void 0 === n) { var r = this.name, i = this.getNodeType(e) ;((t.varying = n = e.getVaryingFromNode(this, r, i)), (t.node = this.node)) } return ( n.needsInterpolation || (n.needsInterpolation = 'fragment' === e.shaderStage), n ) }, }, { key: 'setup', value: function (e) { this.setupVarying(e) }, }, { key: 'analyze', value: function (e) { return (this.setupVarying(e), this.node.analyze(e)) }, }, { key: 'generate', value: function (e) { var t = e.getNodeProperties(this), n = this.setupVarying(e), r = 'fragment' === e.shaderStage && !0 === t.reassignPosition && e.context.needsPositionReassign if (void 0 === t.propertyName || r) { var i = this.getNodeType(e), a = e.getPropertyName(n, yS.VERTEX) ;(e.flowNodeFromShaderStage(yS.VERTEX, this.node, i, a), (t.propertyName = a), r ? (t.reassignPosition = !1) : void 0 === t.reassignPosition && e.context.isPositionNodeInput && (t.reassignPosition = !0)) } return e.getPropertyName(n) }, }, ], [ { key: 'type', get: function () { return 'VaryingNode' }, }, ] ) ) })(TS), WM = kA(HM), GM = function (e) { return WM(e) } ;(zS('toVarying', WM), zS('toVertexStage', GM), zS('varying', function () { return ( console.warn('TSL.VaryingNode: .varying() has been renamed to .toVarying().'), WM.apply(void 0, arguments) ) }), zS('vertexStage', function () { return ( console.warn( 'TSL.VaryingNode: .vertexStage() has been renamed to .toVertexStage().' ), WM.apply(void 0, arguments) ) })) var jM = IA(function (e) { var t = C(e, 1)[0], n = t.mul(0.9478672986).add(0.0521327014).pow(2.4), r = t.mul(0.0773993808), i = t.lessThanEqual(0.04045) return _M(n, r, i) }).setLayout({ name: 'sRGBTransferEOTF', type: 'vec3', inputs: [{ name: 'color', type: 'vec3' }], }), QM = IA(function (e) { var t = C(e, 1)[0], n = t.pow(0.41666).mul(1.055).sub(0.055), r = t.mul(12.92), i = t.lessThanEqual(0.0031308) return _M(n, r, i) }).setLayout({ name: 'sRGBTransferOETF', type: 'vec3', inputs: [{ name: 'color', type: 'vec3' }], }), qM = 'WorkingColorSpace', XM = 'OutputColorSpace', YM = (function (e) { function t(e, n, r) { var i return ( A(this, t), ((i = y(this, t, ['vec4'])).colorNode = e), (i.source = n), (i.target = r), i ) } return ( x(t, e), T( t, [ { key: 'resolveColorSpace', value: function (e, t) { return t === qM ? $c.workingColorSpace : t === XM ? e.context.outputColorSpace || e.renderer.outputColorSpace : t }, }, { key: 'setup', value: function (e) { var t = this.colorNode, n = this.resolveColorSpace(e, this.source), r = this.resolveColorSpace(e, this.target), i = t return !1 !== $c.enabled && n !== r && n && r ? ($c.getTransfer(n) === Sc && (i = YA(jM(i.rgb), i.a)), $c.getPrimaries(n) !== $c.getPrimaries(r) && (i = YA(ew($c._getMatrix(new Hc(), n, r)).mul(i.rgb), i.a)), $c.getTransfer(r) === Sc && (i = YA(QM(i.rgb), i.a)), i) : i }, }, ], [ { key: 'type', get: function () { return 'ColorSpaceNode' }, }, ] ) ) })(CS), KM = function (e) { return MA(new YM(MA(e), qM, XM)) }, ZM = function (e) { return MA(new YM(MA(e), XM, qM)) }, JM = function (e, t) { return MA(new YM(MA(e), qM, t)) }, $M = function (e, t) { return MA(new YM(MA(e), t, qM)) } ;(zS('toOutputColorSpace', KM), zS('toWorkingColorSpace', ZM), zS('workingToColorSpace', JM), zS('colorSpaceToWorking', $M)) var eE = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).referenceNode = e), (r.isReferenceElementNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return this.referenceNode.uniformType }, }, { key: 'generate', value: function (e) { var r = n(t, 'generate', this, 3)([e]), i = this.referenceNode.getNodeType(), a = this.getNodeType() return e.format(r, i, a) }, }, ], [ { key: 'type', get: function () { return 'ReferenceElementNode' }, }, ] ) ) })(MS), tE = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((r = y(this, t)).property = e), (r.uniformType = n), (r.object = i), (r.count = a), (r.properties = e.split('.')), (r.reference = i), (r.node = null), (r.group = null), (r.updateType = _S.OBJECT), r ) } return ( x(t, e), T( t, [ { key: 'setGroup', value: function (e) { return ((this.group = e), this) }, }, { key: 'element', value: function (e) { return MA(new eE(this, MA(e))) }, }, { key: 'setNodeType', value: function (e) { var t = fw(null, e).getSelf() ;(null !== this.group && t.setGroup(this.group), (this.node = t)) }, }, { key: 'getNodeType', value: function (e) { return ( null === this.node && (this.updateReference(e), this.updateValue()), this.node.getNodeType(e) ) }, }, { key: 'getValueFromReference', value: function () { for ( var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.reference, t = this.properties, n = e[t[0]], r = 1; r < t.length; r++ ) n = n[t[r]] return n }, }, { key: 'updateReference', value: function (e) { return ( (this.reference = null !== this.object ? this.object : e.object), this.reference ) }, }, { key: 'setup', value: function () { return (this.updateValue(), this.node) }, }, { key: 'update', value: function () { this.updateValue() }, }, { key: 'updateValue', value: function () { null === this.node && this.setNodeType(this.uniformType) var e = this.getValueFromReference() Array.isArray(e) ? (this.node.array = e) : (this.node.value = e) }, }, ], [ { key: 'type', get: function () { return 'ReferenceBaseNode' }, }, ] ) ) })(TS), nE = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return (A(this, t), ((r = y(this, t, [e, n, i])).renderer = i), r.setGroup(cw), r) } return ( x(t, e), T( t, [ { key: 'updateReference', value: function (e) { return ( (this.reference = null !== this.renderer ? this.renderer : e.renderer), this.reference ) }, }, ], [ { key: 'type', get: function () { return 'RendererReferenceNode' }, }, ] ) ) })(tE), rE = function (e, t) { return MA( new nE(e, t, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null) ) }, iE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : oE, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), ((n = y(this, t, ['vec3'])).toneMapping = e), (n.exposureNode = r), (n.colorNode = i), n ) } return ( x(t, e), T( t, [ { key: 'customCacheKey', value: function () { return oS(this.toneMapping) }, }, { key: 'setup', value: function (e) { var t = this.colorNode || e.context.color, n = this.toneMapping if (0 === n) return t var r = null, i = e.renderer.library.getToneMappingFunction(n) return ( null !== i ? (r = YA(i(t.rgb, this.exposureNode), t.a)) : (console.error( 'ToneMappingNode: Unsupported Tone Mapping configuration.', n ), (r = t)), r ) }, }, ], [ { key: 'type', get: function () { return 'ToneMappingNode' }, }, ] ) ) })(CS), aE = function (e, t, n) { return MA(new iE(e, MA(t), MA(n))) }, oE = rE('toneMappingExposure', 'float') zS('toneMapping', function (e, t, n) { return aE(t, n, e) }) var sE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0 return ( A(this, t), ((n = y(this, t, [e, r])).isBufferNode = !0), (n.bufferType = r), (n.bufferStride = i), (n.bufferOffset = a), (n.usage = wc), (n.instanced = !1), (n.attribute = null), (n.global = !0), e && !0 === e.isBufferAttribute && ((n.attribute = e), (n.usage = e.usage), (n.instanced = e.isInstancedBufferAttribute)), n ) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { if (0 === this.bufferStride && 0 === this.bufferOffset) { var t = e.globalCache.getData(this.value) return ( void 0 === t && ((t = { node: this }), e.globalCache.setData(this.value, t)), t.node.uuid ) } return this.uuid }, }, { key: 'getNodeType', value: function (e) { return ( null === this.bufferType && (this.bufferType = e.getTypeFromAttribute(this.attribute)), this.bufferType ) }, }, { key: 'setup', value: function (e) { if (null === this.attribute) { var t = this.getNodeType(e), n = this.value, r = e.getTypeLength(t), i = this.bufferStride || r, a = this.bufferOffset, o = !0 === n.isInterleavedBuffer ? n : new Bf(n, i), s = new zf(o, r, a) ;(o.setUsage(this.usage), (this.attribute = s), (this.attribute.isInstancedBufferAttribute = this.instanced)) } }, }, { key: 'generate', value: function (e) { var t = this.getNodeType(e), n = e.getBufferAttributeFromNode(this, t), r = e.getPropertyName(n), i = null 'vertex' === e.shaderStage || 'compute' === e.shaderStage ? ((this.name = r), (i = r)) : (i = WM(this).build(e, t)) return i }, }, { key: 'getInputType', value: function () { return 'bufferAttribute' }, }, { key: 'setUsage', value: function (e) { return ( (this.usage = e), this.attribute && !0 === this.attribute.isBufferAttribute && (this.attribute.usage = e), this ) }, }, { key: 'setInstanced', value: function (e) { return ((this.instanced = e), this) }, }, ], [ { key: 'type', get: function () { return 'BufferAttributeNode' }, }, ] ) ) })(LS), uE = function (e) { return MA( new sE( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0 ) ) }, lE = function (e) { return uE( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0 ).setUsage(Tc) }, cE = function (e) { return uE( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0 ).setInstanced(!0) }, hE = function (e) { return lE( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0 ).setInstanced(!0) } zS('toAttribute', function (e) { return uE(e.value) }) var dE = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [64] return ( A(this, t), ((r = y(this, t, ['void'])).isComputeNode = !0), (r.computeNode = e), (r.count = n), (r.workgroupSize = i), (r.dispatchCount = 0), (r.version = 1), (r.name = ''), (r.updateBeforeType = _S.OBJECT), (r.onInitFunction = null), r.updateDispatchCount(), r ) } return ( x(t, e), T( t, [ { key: 'dispose', value: function () { this.dispatchEvent({ type: 'dispose' }) }, }, { key: 'label', value: function (e) { return ((this.name = e), this) }, }, { key: 'updateDispatchCount', value: function () { for ( var e = this.count, t = this.workgroupSize, n = t[0], r = 1; r < t.length; r++ ) n *= t[r] this.dispatchCount = Math.ceil(e / n) }, }, { key: 'onInit', value: function (e) { return ((this.onInitFunction = e), this) }, }, { key: 'updateBefore', value: function (e) { e.renderer.compute(this) }, }, { key: 'generate', value: function (e) { if ('compute' === e.shaderStage) { var t = this.computeNode.build(e, 'void') '' !== t && e.addLineFlowCode(t, this) } }, }, ], [ { key: 'type', get: function () { return 'ComputeNode' }, }, ] ) ) })(TS), fE = function (e, t, n) { return MA(new dE(MA(e), t, n)) } zS('compute', fE) var pE = (function (e) { function t(e) { var n, r = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] return ( A(this, t), ((n = y(this, t)).node = e), (n.parent = r), (n.isCacheNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { var t = e.getCache(), n = e.getCacheFromNode(this, this.parent) e.setCache(n) var r = this.node.getNodeType(e) return (e.setCache(t), r) }, }, { key: 'build', value: function (e) { var t, n = e.getCache(), r = e.getCacheFromNode(this, this.parent) e.setCache(r) for ( var i = arguments.length, a = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++ ) a[o - 1] = arguments[o] var s = (t = this.node).build.apply(t, [e].concat(a)) return (e.setCache(n), s) }, }, ], [ { key: 'type', get: function () { return 'CacheNode' }, }, ] ) ) })(TS), vE = function (e, t) { return MA(new pE(MA(e), t)) } zS('cache', vE) var mE = kA( (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t)).isBypassNode = !0), (r.outputNode = e), (r.callNode = n), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.outputNode.getNodeType(e) }, }, { key: 'generate', value: function (e) { var t = this.callNode.build(e, 'void') return ('' !== t && e.addLineFlowCode(t, this), this.outputNode.build(e)) }, }, ], [ { key: 'type', get: function () { return 'BypassNode' }, }, ] ) ) })(TS) ) zS('bypass', mE) var gE = (function (e) { function t(e, n, r) { var i, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : FA(0), o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : FA(1) return ( A(this, t), ((i = y(this, t)).node = e), (i.inLowNode = n), (i.inHighNode = r), (i.outLowNode = a), (i.outHighNode = o), (i.doClamp = !0), i ) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = this.node, t = this.inLowNode, n = this.inHighNode, r = this.outLowNode, i = this.outHighNode, a = this.doClamp, o = e.sub(t).div(n.sub(t)) return (!0 === a && (o = o.clamp()), o.mul(i.sub(r)).add(r)) }, }, ], [ { key: 'type', get: function () { return 'RemapNode' }, }, ] ) ) })(TS), yE = kA(gE, null, null, { doClamp: !1 }), _E = kA(gE) ;(zS('remap', yE), zS('remapClamp', _E)) var bE = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '', r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'void' return (A(this, t), ((e = y(this, t, [r])).snippet = n), e) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e, t) { var n = this.getNodeType(e), r = this.snippet if ('void' !== n) return e.format('( '.concat(r, ' )'), n, t) e.addLineFlowCode(r, this) }, }, ], [ { key: 'type', get: function () { return 'ExpressionNode' }, }, ] ) ) })(TS), xE = kA(bE), SE = function (e) { return (e ? NM(e, xE('discard')) : xE('discard')).append() } zS('discard', SE) var AE = (function (e) { function t(e, n, r) { var i return ( A(this, t), ((i = y(this, t, ['vec4'])).colorNode = e), (i.toneMapping = n), (i.outputColorSpace = r), (i.isRenderOutputNode = !0), i ) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var t = e.context, n = this.colorNode || t.color, r = (null !== this.toneMapping ? this.toneMapping : t.toneMapping) || 0, i = (null !== this.outputColorSpace ? this.outputColorSpace : t.outputColorSpace) || yc return ( 0 !== r && (n = n.toneMapping(r)), i !== yc && i !== $c.workingColorSpace && (n = n.workingToColorSpace(i)), n ) }, }, ], [ { key: 'type', get: function () { return 'RenderOutputNode' }, }, ] ) ) })(CS), wE = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return MA(new AE(MA(e), t, n)) } zS('renderOutput', wE) var TE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), ((n = y(this, t, [r])).global = !0), (n._attributeName = e), n) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { return this.getAttributeName(e) }, }, { key: 'getNodeType', value: function (e) { var t = this.nodeType if (null === t) { var n = this.getAttributeName(e) if (e.hasGeometryAttribute(n)) { var r = e.geometry.getAttribute(n) t = e.getTypeFromAttribute(r) } else t = 'float' } return t }, }, { key: 'setAttributeName', value: function (e) { return ((this._attributeName = e), this) }, }, { key: 'getAttributeName', value: function () { return this._attributeName }, }, { key: 'generate', value: function (e) { var t = this.getAttributeName(e), n = this.getNodeType(e) if (!0 === e.hasGeometryAttribute(t)) { var r = e.geometry.getAttribute(t), i = e.getTypeFromAttribute(r), a = e.getAttribute(t, i) return 'vertex' === e.shaderStage ? e.format(a.name, i, n) : WM(this).build(e, n) } return ( console.warn( 'AttributeNode: Vertex attribute "'.concat( t, '" not found on geometry.' ) ), e.generateConst(n) ) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.global = this.global), (e._attributeName = this._attributeName)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.global = e.global), (this._attributeName = e._attributeName)) }, }, ], [ { key: 'type', get: function () { return 'AttributeNode' }, }, ] ) ) })(TS), ME = function (e, t) { return MA(new TE(e, t)) }, EE = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0 return ME('uv' + (e > 0 ? e : ''), 'vec2') }, CE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, ['uvec2'])).isTextureSizeNode = !0), (n.textureNode = e), (n.levelNode = r), n ) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e, t) { var n = this.textureNode.build(e, 'property'), r = null === this.levelNode ? '0' : this.levelNode.build(e, 'int') return e.format( '' .concat(e.getMethod('textureDimensions'), '( ') .concat(n, ', ') .concat(r, ' )'), this.getNodeType(e), t ) }, }, ], [ { key: 'type', get: function () { return 'TextureSizeNode' }, }, ] ) ) })(TS), kE = kA(CE), RE = kA( (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, [0]))._textureNode = e), (n.updateType = _S.FRAME), n ) } return ( x(t, e), T( t, [ { key: 'textureNode', get: function () { return this._textureNode }, }, { key: 'texture', get: function () { return this._textureNode.value }, }, { key: 'update', value: function () { var e = this.texture, t = e.images, n = t && t.length > 0 ? (t[0] && t[0].image) || t[0] : e.image if (n && void 0 !== n.width) { var r = n.width, i = n.height this.value = Math.log2(Math.max(r, i)) } }, }, ], [ { key: 'type', get: function () { return 'MaxMipLevelNode' }, }, ] ) ) })(dw) ), IE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((n = y(this, t, [e])).isTextureNode = !0), (n.uvNode = r), (n.levelNode = i), (n.biasNode = a), (n.compareNode = null), (n.depthNode = null), (n.gradNode = null), (n.sampler = !0), (n.updateMatrix = !1), (n.updateType = _S.NONE), (n.referenceNode = null), (n._value = e), (n._matrixUniform = null), n.setUpdateMatrix(null === r), n ) } return ( x(t, e), T( t, [ { key: 'value', get: function () { return this.referenceNode ? this.referenceNode.value : this._value }, set: function (e) { this.referenceNode ? (this.referenceNode.value = e) : (this._value = e) }, }, { key: 'getUniformHash', value: function () { return this.value.uuid }, }, { key: 'getNodeType', value: function () { return !0 === this.value.isDepthTexture ? 'float' : this.value.type === gl ? 'uvec4' : this.value.type === ml ? 'ivec4' : 'vec4' }, }, { key: 'getInputType', value: function () { return 'texture' }, }, { key: 'getDefaultUV', value: function () { return EE(this.value.channel) }, }, { key: 'updateReference', value: function () { return this.value }, }, { key: 'getTransformedUV', value: function (e) { return ( null === this._matrixUniform && (this._matrixUniform = fw(this.value.matrix)), this._matrixUniform.mul(jA(e, 1)).xy ) }, }, { key: 'setUpdateMatrix', value: function (e) { return ( (this.updateMatrix = e), (this.updateType = e ? _S.RENDER : _S.NONE), this ) }, }, { key: 'setupUV', value: function (e, t) { var n = this.value return ( e.isFlipY() && ((n.image instanceof ImageBitmap && !0 === n.flipY) || !0 === n.isRenderTargetTexture || !0 === n.isFramebufferTexture || !0 === n.isDepthTexture) && (t = this.sampler ? t.flipY() : t.setY(BA(kE(this, this.levelNode).y).sub(t.y).sub(1))), t ) }, }, { key: 'setup', value: function (e) { var t = e.getNodeProperties(this) t.referenceNode = this.referenceNode var n = this.value if (!n || !0 !== n.isTexture) throw new Error( 'THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().' ) var r = this.uvNode ;((null !== r && !0 !== e.context.forceUVContext) || !e.context.getUV || (r = e.context.getUV(this)), r || (r = this.getDefaultUV()), !0 === this.updateMatrix && (r = this.getTransformedUV(r)), (r = this.setupUV(e, r))) var i = this.levelNode ;(null === i && e.context.getTextureLevel && (i = e.context.getTextureLevel(this)), (t.uvNode = r), (t.levelNode = i), (t.biasNode = this.biasNode), (t.compareNode = this.compareNode), (t.gradNode = this.gradNode), (t.depthNode = this.depthNode)) }, }, { key: 'generateUV', value: function (e, t) { return t.build(e, !0 === this.sampler ? 'vec2' : 'ivec2') }, }, { key: 'generateSnippet', value: function (e, t, n, r, i, a, o, s) { var u = this.value return r ? e.generateTextureLevel(u, t, n, r, a) : i ? e.generateTextureBias(u, t, n, i, a) : s ? e.generateTextureGrad(u, t, n, s, a) : o ? e.generateTextureCompare(u, t, n, o, a) : !1 === this.sampler ? e.generateTextureLoad(u, t, n, a) : e.generateTexture(u, t, n, a) }, }, { key: 'generate', value: function (e, r) { var i = this.value, a = e.getNodeProperties(this), o = n(t, 'generate', this, 3)([e, 'property']) if ('sampler' === r) return o + '_sampler' if (e.isReference(r)) return o var s = e.getDataFromNode(this), u = s.propertyName if (void 0 === u) { var l = a.uvNode, c = a.levelNode, h = a.biasNode, d = a.compareNode, f = a.depthNode, p = a.gradNode, v = this.generateUV(e, l), m = c ? c.build(e, 'float') : null, g = h ? h.build(e, 'float') : null, y = f ? f.build(e, 'int') : null, _ = d ? d.build(e, 'float') : null, b = p ? [p[0].build(e, 'vec2'), p[1].build(e, 'vec2')] : null, x = e.getVarFromNode(this) u = e.getPropertyName(x) var S = this.generateSnippet(e, o, v, m, g, y, _, b) ;(e.addLineFlowCode(''.concat(u, ' = ').concat(S), this), (s.snippet = S), (s.propertyName = u)) } var A = u, w = this.getNodeType(e) return ( e.needsToWorkingColorSpace(i) && (A = $M(xE(A, w), i.colorSpace).setup(e).build(e, w)), e.format(A, w, r) ) }, }, { key: 'setSampler', value: function (e) { return ((this.sampler = e), this) }, }, { key: 'getSampler', value: function () { return this.sampler }, }, { key: 'uv', value: function (e) { return ( console.warn( 'THREE.TextureNode: .uv() has been renamed. Use .sample() instead.' ), this.sample(e) ) }, }, { key: 'sample', value: function (e) { var t = this.clone() return ((t.uvNode = MA(e)), (t.referenceNode = this.getSelf()), MA(t)) }, }, { key: 'blur', value: function (e) { var t = this.clone() return ( (t.biasNode = MA(e).mul(RE(t))), (t.referenceNode = this.getSelf()), MA(t) ) }, }, { key: 'level', value: function (e) { var t = this.clone() return ((t.levelNode = MA(e)), (t.referenceNode = this.getSelf()), MA(t)) }, }, { key: 'size', value: function (e) { return kE(this, e) }, }, { key: 'bias', value: function (e) { var t = this.clone() return ((t.biasNode = MA(e)), (t.referenceNode = this.getSelf()), MA(t)) }, }, { key: 'compare', value: function (e) { var t = this.clone() return ((t.compareNode = MA(e)), (t.referenceNode = this.getSelf()), MA(t)) }, }, { key: 'grad', value: function (e, t) { var n = this.clone() return ( (n.gradNode = [MA(e), MA(t)]), (n.referenceNode = this.getSelf()), MA(n) ) }, }, { key: 'depth', value: function (e) { var t = this.clone() return ((t.depthNode = MA(e)), (t.referenceNode = this.getSelf()), MA(t)) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.value = this.value.toJSON(e.meta).uuid), (e.sampler = this.sampler), (e.updateMatrix = this.updateMatrix), (e.updateType = this.updateType)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.value = e.meta.textures[e.value]), (this.sampler = e.sampler), (this.updateMatrix = e.updateMatrix), (this.updateType = e.updateType)) }, }, { key: 'update', value: function () { var e = this.value, t = this._matrixUniform ;(null !== t && (t.value = e.matrix), !0 === e.matrixAutoUpdate && e.updateMatrix()) }, }, { key: 'clone', value: function () { var e = new this.constructor( this.value, this.uvNode, this.levelNode, this.biasNode ) return ((e.sampler = this.sampler), e) }, }, ], [ { key: 'type', get: function () { return 'TextureNode' }, }, ] ) ) })(dw), NE = kA(IE), PE = function () { return NE.apply(void 0, arguments).setSampler(!1) }, LE = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return ( A(this, t), ((r = y(this, t, [e, n])).isBufferNode = !0), (r.bufferType = n), (r.bufferCount = i), r ) } return ( x(t, e), T( t, [ { key: 'getElementType', value: function (e) { return this.getNodeType(e) }, }, { key: 'getInputType', value: function () { return 'buffer' }, }, ], [ { key: 'type', get: function () { return 'BufferNode' }, }, ] ) ) })(dw), DE = function (e, t, n) { return MA(new LE(e, t, n)) }, OE = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [e, n])).isArrayBufferElementNode = !0), r) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e) { var r = n(t, 'generate', this, 3)([e]), i = this.getNodeType(), a = this.node.getPaddedType() return e.format(r, a, i) }, }, ], [ { key: 'type', get: function () { return 'UniformArrayElementNode' }, }, ] ) ) })(MS), FE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, [null])).array = e), (n.elementType = null === r ? fS(e[0]) : r), (n.paddedType = n.getPaddedType()), (n.updateType = _S.RENDER), (n.isArrayBufferNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return this.paddedType }, }, { key: 'getElementType', value: function () { return this.elementType }, }, { key: 'getPaddedType', value: function () { var e = this.elementType, t = 'vec4' return ( 'mat2' === e ? (t = 'mat2') : !0 === /mat/.test(e) ? (t = 'mat4') : 'i' === e.charAt(0) ? (t = 'ivec4') : 'u' === e.charAt(0) && (t = 'uvec4'), t ) }, }, { key: 'update', value: function () { var e = this.array, t = this.value, n = this.elementType if ('float' === n || 'int' === n || 'uint' === n) for (var r = 0; r < e.length; r++) { t[4 * r] = e[r] } else if ('color' === n) for (var i = 0; i < e.length; i++) { var a = 4 * i, o = e[i] ;((t[a] = o.r), (t[a + 1] = o.g), (t[a + 2] = o.b || 0)) } else if ('mat2' === n) for (var s = 0; s < e.length; s++) { var u = 4 * s, l = e[s] ;((t[u] = l.elements[0]), (t[u + 1] = l.elements[1]), (t[u + 2] = l.elements[2]), (t[u + 3] = l.elements[3])) } else if ('mat3' === n) for (var c = 0; c < e.length; c++) { var h = 16 * c, d = e[c] ;((t[h] = d.elements[0]), (t[h + 1] = d.elements[1]), (t[h + 2] = d.elements[2]), (t[h + 4] = d.elements[3]), (t[h + 5] = d.elements[4]), (t[h + 6] = d.elements[5]), (t[h + 8] = d.elements[6]), (t[h + 9] = d.elements[7]), (t[h + 10] = d.elements[8]), (t[h + 15] = 1)) } else if ('mat4' === n) for (var f = 0; f < e.length; f++) for (var p = 16 * f, v = e[f], m = 0; m < v.elements.length; m++) t[p + m] = v.elements[m] else for (var g = 0; g < e.length; g++) { var y = 4 * g, _ = e[g] ;((t[y] = _.x), (t[y + 1] = _.y), (t[y + 2] = _.z || 0), (t[y + 3] = _.w || 0)) } }, }, { key: 'setup', value: function (e) { var r = this.array.length, i = this.elementType, a = Float32Array, o = this.paddedType, s = e.getTypeLength(o) return ( 'i' === i.charAt(0) && (a = Int32Array), 'u' === i.charAt(0) && (a = Uint32Array), (this.value = new a(r * s)), (this.bufferCount = r), (this.bufferType = o), n(t, 'setup', this, 3)([e]) ) }, }, { key: 'element', value: function (e) { return MA(new OE(this, MA(e))) }, }, ], [ { key: 'type', get: function () { return 'UniformArrayNode' }, }, ] ) ) })(LE), BE = function (e, t) { return MA(new FE(e, t)) }, UE = fw(0, 'uint').setGroup(uw('cameraIndex')).toVarying('v_cameraIndex'), zE = fw('float') .label('cameraNear') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.near }), VE = fw('float') .label('cameraFar') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.far }), HE = IA(function (e) { var t, n = e.camera if (n.isArrayCamera && n.cameras.length > 0) { var r, i = [], a = L(n.cameras) try { for (a.s(); !(r = a.n()).done; ) { var o = r.value i.push(o.projectionMatrix) } } catch (s) { a.e(s) } finally { a.f() } t = BE(i) .setGroup(cw) .label('cameraProjectionMatrices') .element(UE) .toVar('cameraProjectionMatrix') } else t = fw('mat4') .label('cameraProjectionMatrix') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.projectionMatrix }) return t }).once()(), WE = fw('mat4') .label('cameraProjectionMatrixInverse') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.projectionMatrixInverse }), GE = IA(function (e) { var t, n = e.camera if (n.isArrayCamera && n.cameras.length > 0) { var r, i = [], a = L(n.cameras) try { for (a.s(); !(r = a.n()).done; ) { var o = r.value i.push(o.matrixWorldInverse) } } catch (s) { a.e(s) } finally { a.f() } t = BE(i) .setGroup(cw) .label('cameraViewMatrices') .element(UE) .toVar('cameraViewMatrix') } else t = fw('mat4') .label('cameraViewMatrix') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.matrixWorldInverse }) return t }).once()(), jE = fw('mat4') .label('cameraWorldMatrix') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.matrixWorld }), QE = fw('mat3') .label('cameraNormalMatrix') .setGroup(cw) .onRenderUpdate(function (e) { return e.camera.normalMatrix }), qE = fw(new ph()) .label('cameraPosition') .setGroup(cw) .onRenderUpdate(function (e, t) { var n = e.camera return t.value.setFromMatrixPosition(n.matrixWorld) }), XE = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t)).scope = e), (n.object3d = r), (n.updateType = _S.OBJECT), (n._uniformNode = new dw(null)), n ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { var e = this.scope return e === t.WORLD_MATRIX ? 'mat4' : e === t.POSITION || e === t.VIEW_POSITION || e === t.DIRECTION || e === t.SCALE ? 'vec3' : void 0 }, }, { key: 'update', value: function (e) { var n = this.object3d, r = this._uniformNode, i = this.scope if (i === t.WORLD_MATRIX) r.value = n.matrixWorld else if (i === t.POSITION) ((r.value = r.value || new ph()), r.value.setFromMatrixPosition(n.matrixWorld)) else if (i === t.SCALE) ((r.value = r.value || new ph()), r.value.setFromMatrixScale(n.matrixWorld)) else if (i === t.DIRECTION) ((r.value = r.value || new ph()), n.getWorldDirection(r.value)) else if (i === t.VIEW_POSITION) { var a = e.camera ;((r.value = r.value || new ph()), r.value.setFromMatrixPosition(n.matrixWorld), r.value.applyMatrix4(a.matrixWorldInverse)) } }, }, { key: 'generate', value: function (e) { var n = this.scope return ( n === t.WORLD_MATRIX ? (this._uniformNode.nodeType = 'mat4') : (n !== t.POSITION && n !== t.VIEW_POSITION && n !== t.DIRECTION && n !== t.SCALE) || (this._uniformNode.nodeType = 'vec3'), this._uniformNode.build(e) ) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.scope = this.scope)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.scope = e.scope)) }, }, ], [ { key: 'type', get: function () { return 'Object3DNode' }, }, ] ) ) })(TS) ;((XE.WORLD_MATRIX = 'worldMatrix'), (XE.POSITION = 'position'), (XE.SCALE = 'scale'), (XE.VIEW_POSITION = 'viewPosition'), (XE.DIRECTION = 'direction')) var YE = kA(XE, XE.DIRECTION), KE = kA(XE, XE.WORLD_MATRIX), ZE = kA(XE, XE.POSITION), JE = kA(XE, XE.SCALE), $E = kA(XE, XE.VIEW_POSITION), eC = (function (e) { function t(e) { return (A(this, t), y(this, t, [e])) } return ( x(t, e), T( t, [ { key: 'update', value: function (e) { ;((this.object3d = e.object), n(t, 'update', this, 3)([e])) }, }, ], [ { key: 'type', get: function () { return 'ModelNode' }, }, ] ) ) })(XE), tC = RA(eC, eC.DIRECTION), nC = RA(eC, eC.WORLD_MATRIX), rC = RA(eC, eC.POSITION), iC = RA(eC, eC.SCALE), aC = RA(eC, eC.VIEW_POSITION), oC = fw(new Hc()).onObjectUpdate(function (e, t) { var n = e.object return t.value.getNormalMatrix(n.matrixWorld) }), sC = fw(new Gh()).onObjectUpdate(function (e, t) { var n = e.object return t.value.copy(n.matrixWorld).invert() }), uC = IA(function (e) { return e.renderer.nodes.modelViewMatrix || lC }) .once()() .toVar('modelViewMatrix'), lC = GE.mul(nC), cC = IA(function (e) { return ( (e.context.isHighPrecisionModelViewMatrix = !0), fw('mat4').onObjectUpdate(function (e) { var t = e.object, n = e.camera return t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, t.matrixWorld) }) ) }) .once()() .toVar('highpModelViewMatrix'), hC = IA(function (e) { var t = e.context.isHighPrecisionModelViewMatrix return fw('mat3').onObjectUpdate(function (e) { var n = e.object, r = e.camera return ( !0 !== t && n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse, n.matrixWorld), n.normalMatrix.getNormalMatrix(n.modelViewMatrix) ) }) }) .once()() .toVar('highpModelNormalViewMatrix'), dC = ME('position', 'vec3'), fC = dC.toVarying('positionLocal'), pC = dC.toVarying('positionPrevious'), vC = nC.mul(fC).xyz.toVarying('v_positionWorld').context({ needsPositionReassign: !0 }), mC = fC .transformDirection(nC) .toVarying('v_positionWorldDirection') .normalize() .toVar('positionWorldDirection') .context({ needsPositionReassign: !0 }), gC = IA(function (e) { return e.context.setupPositionView() }, 'vec3') .once()() .toVarying('v_positionView') .context({ needsPositionReassign: !0 }), yC = gC .negate() .toVarying('v_positionViewDirection') .normalize() .toVar('positionViewDirection'), _C = (function (e) { function t() { var e return (A(this, t), ((e = y(this, t, ['bool'])).isFrontFacingNode = !0), e) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e) { var t = e.renderer, n = e.material return t.coordinateSystem === Ec && 1 === n.side ? 'false' : e.getFrontFacing() }, }, ], [ { key: 'type', get: function () { return 'FrontFacingNode' }, }, ] ) ) })(TS), bC = RA(_C), xC = FA(bC).mul(2).sub(1), SC = ME('normal', 'vec3'), AC = IA(function (e) { return !1 === e.geometry.hasAttribute('normal') ? (console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'), jA(0, 1, 0)) : SC }, 'vec3') .once()() .toVar('normalLocal'), wC = gC.dFdx().cross(gC.dFdy()).normalize().toVar('normalFlat'), TC = IA(function (e) { return !0 === e.material.flatShading ? wC : WM(IC(AC), 'v_normalView').normalize() }, 'vec3') .once()() .toVar('normalView'), MC = WM(TC.transformDirection(GE), 'v_normalWorld').normalize().toVar('normalWorld'), EC = IA(function (e) { return e.context.setupNormal().context({ getUV: null }) }, 'vec3') .once()() .mul(xC) .toVar('transformedNormalView'), CC = EC.transformDirection(GE).toVar('transformedNormalWorld'), kC = IA(function (e) { return e.context.setupClearcoatNormal().context({ getUV: null }) }, 'vec3') .once()() .mul(xC) .toVar('transformedClearcoatNormalView'), RC = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = ew(void 0 === r ? nC : r), a = n.div(jA(i[0].dot(i[0]), i[1].dot(i[1]), i[2].dot(i[2]))) return i.mul(a).xyz }), IC = IA(function (e, t) { var n = C(e, 1)[0], r = t.renderer.nodes.modelNormalViewMatrix if (null !== r) return r.transformDirection(n) var i = oC.mul(n) return GE.transformDirection(i) }), NC = fw(0) .onReference(function (e) { return e.material }) .onRenderUpdate(function (e) { return e.material.refractionRatio }), PC = yC.negate().reflect(EC), LC = yC.negate().refract(EC, NC), DC = PC.transformDirection(GE).toVar('reflectVector'), OC = LC.transformDirection(GE).toVar('reflectVector'), FC = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return (A(this, t), ((n = y(this, t, [e, r, i, a])).isCubeTextureNode = !0), n) } return ( x(t, e), T( t, [ { key: 'getInputType', value: function () { return 'cubeTexture' }, }, { key: 'getDefaultUV', value: function () { var e = this.value return e.mapping === tl ? DC : e.mapping === nl ? OC : (console.error( 'THREE.CubeTextureNode: Mapping "%s" not supported.', e.mapping ), jA(0, 0, 0)) }, }, { key: 'setUpdateMatrix', value: function () {} }, { key: 'setupUV', value: function (e, t) { var n = this.value return e.renderer.coordinateSystem !== Cc && n.isRenderTargetTexture ? t : jA(t.x.negate(), t.yz) }, }, { key: 'generateUV', value: function (e, t) { return t.build(e, 'vec3') }, }, ], [ { key: 'type', get: function () { return 'CubeTextureNode' }, }, ] ) ) })(IE), BC = kA(FC), UC = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, [e, n])).referenceNode = e), (r.isReferenceElementNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return this.referenceNode.uniformType }, }, { key: 'generate', value: function (e) { var r = n(t, 'generate', this, 3)([e]), i = this.referenceNode.getNodeType(), a = this.getNodeType() return e.format(r, i, a) }, }, ], [ { key: 'type', get: function () { return 'ReferenceElementNode' }, }, ] ) ) })(MS), zC = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((r = y(this, t)).property = e), (r.uniformType = n), (r.object = i), (r.count = a), (r.properties = e.split('.')), (r.reference = i), (r.node = null), (r.group = null), (r.name = null), (r.updateType = _S.OBJECT), r ) } return ( x(t, e), T( t, [ { key: 'element', value: function (e) { return MA(new UC(this, MA(e))) }, }, { key: 'setGroup', value: function (e) { return ((this.group = e), this) }, }, { key: 'label', value: function (e) { return ((this.name = e), this) }, }, { key: 'setNodeType', value: function (e) { var t = null ;((t = null !== this.count ? DE(null, e, this.count) : Array.isArray(this.getValueFromReference()) ? BE(null, e) : 'texture' === e ? NE(null) : 'cubeTexture' === e ? BC(null) : fw(null, e)), null !== this.group && t.setGroup(this.group), null !== this.name && t.label(this.name), (this.node = t.getSelf())) }, }, { key: 'getNodeType', value: function (e) { return ( null === this.node && (this.updateReference(e), this.updateValue()), this.node.getNodeType(e) ) }, }, { key: 'getValueFromReference', value: function () { for ( var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.reference, t = this.properties, n = e[t[0]], r = 1; r < t.length; r++ ) n = n[t[r]] return n }, }, { key: 'updateReference', value: function (e) { return ( (this.reference = null !== this.object ? this.object : e.object), this.reference ) }, }, { key: 'setup', value: function () { return (this.updateValue(), this.node) }, }, { key: 'update', value: function () { this.updateValue() }, }, { key: 'updateValue', value: function () { null === this.node && this.setNodeType(this.uniformType) var e = this.getValueFromReference() Array.isArray(e) ? (this.node.array = e) : (this.node.value = e) }, }, ], [ { key: 'type', get: function () { return 'ReferenceNode' }, }, ] ) ) })(TS), VC = function (e, t, n) { return MA(new zC(e, t, n)) }, HC = function (e, t, n, r) { return MA(new zC(e, t, r, n)) }, WC = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), ((r = y(this, t, [e, n, i])).material = i), (r.isMaterialReferenceNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'updateReference', value: function (e) { return ( (this.reference = null !== this.material ? this.material : e.material), this.reference ) }, }, ], [ { key: 'type', get: function () { return 'MaterialReferenceNode' }, }, ] ) ) })(zC), GC = function (e, t) { return MA( new WC(e, t, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null) ) }, jC = IA(function (e) { return ( !1 === e.geometry.hasAttribute('tangent') && e.geometry.computeTangents(), ME('tangent', 'vec4') ) })(), QC = jC.xyz.toVar('tangentLocal'), qC = uC.mul(YA(QC, 0)).xyz.toVarying('v_tangentView').normalize().toVar('tangentView'), XC = qC .transformDirection(GE) .toVarying('v_tangentWorld') .normalize() .toVar('tangentWorld'), YC = qC.toVar('transformedTangentView'), KC = YC.transformDirection(GE).normalize().toVar('transformedTangentWorld'), ZC = function (e) { return e.mul(jC.w).xyz }, JC = WM(ZC(SC.cross(jC)), 'v_bitangentGeometry') .normalize() .toVar('bitangentGeometry'), $C = WM(ZC(AC.cross(QC)), 'v_bitangentLocal') .normalize() .toVar('bitangentLocal'), ek = WM(ZC(TC.cross(qC)), 'v_bitangentView') .normalize() .toVar('bitangentView'), tk = WM(ZC(MC.cross(XC)), 'v_bitangentWorld') .normalize() .toVar('bitangentWorld'), nk = ZC(EC.cross(YC)).normalize().toVar('transformedBitangentView'), rk = nk.transformDirection(GE).normalize().toVar('transformedBitangentWorld'), ik = ew(qC, ek, TC), ak = yC.mul(ik), ok = (function () { var e = Iw.cross(yC) return ( (e = e.cross(Iw).normalize()), (e = _M(e, EC, kw.mul(_w.oneMinus()).oneMinus().pow2().pow2()).normalize()) ) })(), sk = IA(function (e) { var t = e.eye_pos, n = e.surf_norm, r = e.mapN, i = e.uv, a = t.dFdx(), o = t.dFdy(), s = i.dFdx(), u = i.dFdy(), l = n, c = o.cross(l), h = l.cross(a), d = c.mul(s.x).add(h.mul(u.x)), f = c.mul(s.y).add(h.mul(u.y)), p = d.dot(d).max(f.dot(f)), v = xC.mul(p.inverseSqrt()) return Kw(d.mul(r.x, v), f.mul(r.y, v), l.mul(r.z)).normalize() }), uk = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, ['vec3'])).node = e), (n.scaleNode = r), (n.normalMapType = 0), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var t = this.normalMapType, n = this.scaleNode, r = this.node.mul(2).sub(1) null !== n && (r = jA(r.xy.mul(n), r.z)) var i = null if (1 === t) i = IC(r) else if (0 === t) { i = !0 === e.hasGeometryAttribute('tangent') ? ik.mul(r).normalize() : sk({ eye_pos: gC, surf_norm: TC, mapN: r, uv: EE() }) } return i }, }, ], [ { key: 'type', get: function () { return 'NormalMapNode' }, }, ] ) ) })(CS), lk = kA(uk), ck = IA(function (e) { var t = e.textureNode, n = e.bumpScale, r = function (e) { return t.cache().context({ getUV: function (t) { return e(t.uvNode || EE()) }, forceUVContext: !0, }) }, i = FA( r(function (e) { return e }) ) return VA( FA( r(function (e) { return e.add(e.dFdx()) }) ).sub(i), FA( r(function (e) { return e.add(e.dFdy()) }) ).sub(i) ).mul(n) }), hk = IA(function (e) { var t = e.surf_pos, n = e.surf_norm, r = e.dHdxy, i = t.dFdx().normalize(), a = n, o = t.dFdy().normalize().cross(a), s = a.cross(i), u = i.dot(o).mul(xC), l = u.sign().mul(r.x.mul(o).add(r.y.mul(s))) return u.abs().mul(n).sub(l).normalize() }), dk = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, ['vec3'])).textureNode = e), (n.scaleNode = r), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = null !== this.scaleNode ? this.scaleNode : 1, t = ck({ textureNode: this.textureNode, bumpScale: e }) return hk({ surf_pos: gC, surf_norm: TC, dHdxy: t }) }, }, ], [ { key: 'type', get: function () { return 'BumpMapNode' }, }, ] ) ) })(CS), fk = kA(dk), pk = new Map(), vk = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).scope = e), n) } return ( x(t, e), T( t, [ { key: 'getCache', value: function (e, t) { var n = pk.get(e) return (void 0 === n && ((n = GC(e, t)), pk.set(e, n)), n) }, }, { key: 'getFloat', value: function (e) { return this.getCache(e, 'float') }, }, { key: 'getColor', value: function (e) { return this.getCache(e, 'color') }, }, { key: 'getTexture', value: function (e) { return this.getCache('map' === e ? 'map' : e + 'Map', 'texture') }, }, { key: 'setup', value: function (e) { var n = e.context.material, r = this.scope, i = null if (r === t.COLOR) { var a = void 0 !== n.color ? this.getColor(r) : jA() i = n.map && !0 === n.map.isTexture ? a.mul(this.getTexture('map')) : a } else if (r === t.OPACITY) { var o = this.getFloat(r) i = n.alphaMap && !0 === n.alphaMap.isTexture ? o.mul(this.getTexture('alpha')) : o } else if (r === t.SPECULAR_STRENGTH) i = n.specularMap && !0 === n.specularMap.isTexture ? this.getTexture('specular').r : FA(1) else if (r === t.SPECULAR_INTENSITY) { var s = this.getFloat(r) i = n.specularIntensityMap && !0 === n.specularIntensityMap.isTexture ? s.mul(this.getTexture(r).a) : s } else if (r === t.SPECULAR_COLOR) { var u = this.getColor(r) i = n.specularColorMap && !0 === n.specularColorMap.isTexture ? u.mul(this.getTexture(r).rgb) : u } else if (r === t.ROUGHNESS) { var l = this.getFloat(r) i = n.roughnessMap && !0 === n.roughnessMap.isTexture ? l.mul(this.getTexture(r).g) : l } else if (r === t.METALNESS) { var c = this.getFloat(r) i = n.metalnessMap && !0 === n.metalnessMap.isTexture ? c.mul(this.getTexture(r).b) : c } else if (r === t.EMISSIVE) { var h = this.getFloat('emissiveIntensity'), d = this.getColor(r).mul(h) i = n.emissiveMap && !0 === n.emissiveMap.isTexture ? d.mul(this.getTexture(r)) : d } else if (r === t.NORMAL) n.normalMap ? ((i = lk( this.getTexture('normal'), this.getCache('normalScale', 'vec2') )).normalMapType = n.normalMapType) : (i = n.bumpMap ? fk(this.getTexture('bump').r, this.getFloat('bumpScale')) : TC) else if (r === t.CLEARCOAT) { var f = this.getFloat(r) i = n.clearcoatMap && !0 === n.clearcoatMap.isTexture ? f.mul(this.getTexture(r).r) : f } else if (r === t.CLEARCOAT_ROUGHNESS) { var p = this.getFloat(r) i = n.clearcoatRoughnessMap && !0 === n.clearcoatRoughnessMap.isTexture ? p.mul(this.getTexture(r).r) : p } else if (r === t.CLEARCOAT_NORMAL) i = n.clearcoatNormalMap ? lk(this.getTexture(r), this.getCache(r + 'Scale', 'vec2')) : TC else if (r === t.SHEEN) { var v = this.getColor('sheenColor').mul(this.getFloat('sheen')) i = n.sheenColorMap && !0 === n.sheenColorMap.isTexture ? v.mul(this.getTexture('sheenColor').rgb) : v } else if (r === t.SHEEN_ROUGHNESS) { var m = this.getFloat(r) i = (i = n.sheenRoughnessMap && !0 === n.sheenRoughnessMap.isTexture ? m.mul(this.getTexture(r).a) : m).clamp(0.07, 1) } else if (r === t.ANISOTROPY) if (n.anisotropyMap && !0 === n.anisotropyMap.isTexture) { var g = this.getTexture(r) i = $A($k.x, $k.y, $k.y.negate(), $k.x).mul( g.rg.mul(2).sub(VA(1)).normalize().mul(g.b) ) } else i = $k else if (r === t.IRIDESCENCE_THICKNESS) { var y = VC('1', 'float', n.iridescenceThicknessRange) if (n.iridescenceThicknessMap) { var _ = VC('0', 'float', n.iridescenceThicknessRange) i = y.sub(_).mul(this.getTexture(r).g).add(_) } else i = y } else if (r === t.TRANSMISSION) { var b = this.getFloat(r) i = n.transmissionMap ? b.mul(this.getTexture(r).r) : b } else if (r === t.THICKNESS) { var x = this.getFloat(r) i = n.thicknessMap ? x.mul(this.getTexture(r).g) : x } else if (r === t.IOR) i = this.getFloat(r) else if (r === t.LIGHT_MAP) i = this.getTexture(r).rgb.mul(this.getFloat('lightMapIntensity')) else if (r === t.AO) i = this.getTexture(r) .r.sub(1) .mul(this.getFloat('aoMapIntensity')) .add(1) else { var S = this.getNodeType(e) i = this.getCache(r, S) } return i }, }, ], [ { key: 'type', get: function () { return 'MaterialNode' }, }, ] ) ) })(TS) ;((vk.ALPHA_TEST = 'alphaTest'), (vk.COLOR = 'color'), (vk.OPACITY = 'opacity'), (vk.SHININESS = 'shininess'), (vk.SPECULAR = 'specular'), (vk.SPECULAR_STRENGTH = 'specularStrength'), (vk.SPECULAR_INTENSITY = 'specularIntensity'), (vk.SPECULAR_COLOR = 'specularColor'), (vk.REFLECTIVITY = 'reflectivity'), (vk.ROUGHNESS = 'roughness'), (vk.METALNESS = 'metalness'), (vk.NORMAL = 'normal'), (vk.CLEARCOAT = 'clearcoat'), (vk.CLEARCOAT_ROUGHNESS = 'clearcoatRoughness'), (vk.CLEARCOAT_NORMAL = 'clearcoatNormal'), (vk.EMISSIVE = 'emissive'), (vk.ROTATION = 'rotation'), (vk.SHEEN = 'sheen'), (vk.SHEEN_ROUGHNESS = 'sheenRoughness'), (vk.ANISOTROPY = 'anisotropy'), (vk.IRIDESCENCE = 'iridescence'), (vk.IRIDESCENCE_IOR = 'iridescenceIOR'), (vk.IRIDESCENCE_THICKNESS = 'iridescenceThickness'), (vk.IOR = 'ior'), (vk.TRANSMISSION = 'transmission'), (vk.THICKNESS = 'thickness'), (vk.ATTENUATION_DISTANCE = 'attenuationDistance'), (vk.ATTENUATION_COLOR = 'attenuationColor'), (vk.LINE_SCALE = 'scale'), (vk.LINE_DASH_SIZE = 'dashSize'), (vk.LINE_GAP_SIZE = 'gapSize'), (vk.LINE_WIDTH = 'linewidth'), (vk.LINE_DASH_OFFSET = 'dashOffset'), (vk.POINT_SIZE = 'size'), (vk.DISPERSION = 'dispersion'), (vk.LIGHT_MAP = 'light'), (vk.AO = 'ao')) var mk = RA(vk, vk.ALPHA_TEST), gk = RA(vk, vk.COLOR), yk = RA(vk, vk.SHININESS), _k = RA(vk, vk.EMISSIVE), bk = RA(vk, vk.OPACITY), xk = RA(vk, vk.SPECULAR), Sk = RA(vk, vk.SPECULAR_INTENSITY), Ak = RA(vk, vk.SPECULAR_COLOR), wk = RA(vk, vk.SPECULAR_STRENGTH), Tk = RA(vk, vk.REFLECTIVITY), Mk = RA(vk, vk.ROUGHNESS), Ek = RA(vk, vk.METALNESS), Ck = RA(vk, vk.NORMAL), kk = RA(vk, vk.CLEARCOAT), Rk = RA(vk, vk.CLEARCOAT_ROUGHNESS), Ik = RA(vk, vk.CLEARCOAT_NORMAL), Nk = RA(vk, vk.ROTATION), Pk = RA(vk, vk.SHEEN), Lk = RA(vk, vk.SHEEN_ROUGHNESS), Dk = RA(vk, vk.ANISOTROPY), Ok = RA(vk, vk.IRIDESCENCE), Fk = RA(vk, vk.IRIDESCENCE_IOR), Bk = RA(vk, vk.IRIDESCENCE_THICKNESS), Uk = RA(vk, vk.TRANSMISSION), zk = RA(vk, vk.THICKNESS), Vk = RA(vk, vk.IOR), Hk = RA(vk, vk.ATTENUATION_DISTANCE), Wk = RA(vk, vk.ATTENUATION_COLOR), Gk = RA(vk, vk.LINE_SCALE), jk = RA(vk, vk.LINE_DASH_SIZE), Qk = RA(vk, vk.LINE_GAP_SIZE), qk = RA(vk, vk.LINE_WIDTH), Xk = RA(vk, vk.LINE_DASH_OFFSET), Yk = RA(vk, vk.POINT_SIZE), Kk = RA(vk, vk.DISPERSION), Zk = RA(vk, vk.LIGHT_MAP), Jk = RA(vk, vk.AO), $k = fw(new Vc()) .onReference(function (e) { return e.material }) .onRenderUpdate(function (e) { var t = e.material this.value.set( t.anisotropy * Math.cos(t.anisotropyRotation), t.anisotropy * Math.sin(t.anisotropyRotation) ) }), eR = IA(function (e) { return e.context.setupModelViewProjection() }, 'vec4') .once()() .toVarying('v_modelViewProjection'), tR = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t, ['uint'])).scope = e), (n.isIndexNode = !0), n) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e) { var n, r, i = this.getNodeType(e), a = this.scope if (a === t.VERTEX) n = e.getVertexIndex() else if (a === t.INSTANCE) n = e.getInstanceIndex() else if (a === t.DRAW) n = e.getDrawIndex() else if (a === t.INVOCATION_LOCAL) n = e.getInvocationLocalIndex() else if (a === t.INVOCATION_SUBGROUP) n = e.getInvocationSubgroupIndex() else { if (a !== t.SUBGROUP) throw new Error('THREE.IndexNode: Unknown scope: ' + a) n = e.getSubgroupIndex() } 'vertex' === e.shaderStage || 'compute' === e.shaderStage ? (r = n) : (r = WM(this).build(e, i)) return r }, }, ], [ { key: 'type', get: function () { return 'IndexNode' }, }, ] ) ) })(TS) ;((tR.VERTEX = 'vertex'), (tR.INSTANCE = 'instance'), (tR.SUBGROUP = 'subgroup'), (tR.INVOCATION_LOCAL = 'invocationLocal'), (tR.INVOCATION_SUBGROUP = 'invocationSubgroup'), (tR.DRAW = 'draw')) var nR = RA(tR, tR.VERTEX), rR = RA(tR, tR.INSTANCE), iR = RA(tR, tR.SUBGROUP), aR = RA(tR, tR.INVOCATION_SUBGROUP), oR = RA(tR, tR.INVOCATION_LOCAL), sR = RA(tR, tR.DRAW), uR = (function (e) { function t(e, n, r) { var i return ( A(this, t), ((i = y(this, t, ['void'])).count = e), (i.instanceMatrix = n), (i.instanceColor = r), (i.instanceMatrixNode = null), (i.instanceColorNode = null), (i.updateType = _S.FRAME), (i.buffer = null), (i.bufferColor = null), i ) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var t = this.count, n = this.instanceMatrix, r = this.instanceColor, i = this.instanceMatrixNode, a = this.instanceColorNode if (null === i) { if (t <= 1e3) i = DE(n.array, 'mat4', Math.max(t, 1)).element(rR) else { var o = new tm(n.array, 16, 1) this.buffer = o var s = n.usage === Tc ? hE : cE, u = [ s(o, 'vec4', 16, 0), s(o, 'vec4', 16, 4), s(o, 'vec4', 16, 8), s(o, 'vec4', 16, 12), ] i = tw.apply(void 0, u) } this.instanceMatrixNode = i } if (r && null === a) { var l = new np(r.array, 3), c = r.usage === Tc ? hE : cE ;((this.bufferColor = l), (a = jA(c(l, 'vec3', 3, 0))), (this.instanceColorNode = a)) } var h = i.mul(fC).xyz if ((fC.assign(h), e.hasGeometryAttribute('normal'))) { var d = RC(AC, i) AC.assign(d) } null !== this.instanceColorNode && mw('vec3', 'vInstanceColor').assign(this.instanceColorNode) }, }, { key: 'update', value: function () { ;(this.instanceMatrix.usage !== Tc && null !== this.buffer && this.instanceMatrix.version !== this.buffer.version && (this.buffer.version = this.instanceMatrix.version), this.instanceColor && this.instanceColor.usage !== Tc && null !== this.bufferColor && this.instanceColor.version !== this.bufferColor.version && (this.bufferColor.version = this.instanceColor.version)) }, }, ], [ { key: 'type', get: function () { return 'InstanceNode' }, }, ] ) ) })(TS), lR = kA(uR), cR = kA( (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, [e.count, e.instanceMatrix, e.instanceColor])).instancedMesh = e), n ) } return ( x(t, e), T(t, null, [ { key: 'type', get: function () { return 'InstancedMeshNode' }, }, ]) ) })(uR) ), hR = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, ['void'])).batchMesh = e), (n.batchingIdNode = null), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var t = this null === this.batchingIdNode && (null === e.getDrawIndex() ? (this.batchingIdNode = rR) : (this.batchingIdNode = sR)) var n = IA(function (e) { var n = C(e, 1)[0], r = BA(kE(PE(t.batchMesh._indirectTexture), 0)), i = BA(n).modInt(r), a = BA(n).div(r) return PE(t.batchMesh._indirectTexture, HA(i, a)).x }).setLayout({ name: 'getIndirectIndex', type: 'uint', inputs: [{ name: 'id', type: 'int' }], }), r = n(BA(this.batchingIdNode)), i = this.batchMesh._matricesTexture, a = kE(PE(i), 0), o = FA(r).mul(4).toInt().toVar(), s = o.modInt(a), u = o.div(BA(a)), l = tw( PE(i, HA(s, u)), PE(i, HA(s.add(1), u)), PE(i, HA(s.add(2), u)), PE(i, HA(s.add(3), u)) ), c = this.batchMesh._colorsTexture if (null !== c) { var h = IA(function (e) { var t = C(e, 1)[0], n = kE(PE(c), 0).x, r = t, i = r.modInt(n), a = r.div(n) return PE(c, HA(i, a)).rgb }).setLayout({ name: 'getBatchingColor', type: 'vec3', inputs: [{ name: 'id', type: 'int' }], }), d = h(r) mw('vec3', 'vBatchColor').assign(d) } var f = ew(l) fC.assign(l.mul(fC)) var p = AC.div(jA(f[0].dot(f[0]), f[1].dot(f[1]), f[2].dot(f[2]))), v = f.mul(p).xyz ;(AC.assign(v), e.hasGeometryAttribute('tangent') && QC.mulAssign(f)) }, }, ], [ { key: 'type', get: function () { return 'BatchNode' }, }, ] ) ) })(TS), dR = kA(hR), fR = new WeakMap(), pR = (function (e) { function t(e) { var n, r, i, a, o = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] return ( A(this, t), ((n = y(this, t, ['void'])).skinnedMesh = e), (n.useReference = o), (n.updateType = _S.OBJECT), (n.skinIndexNode = ME('skinIndex', 'uvec4')), (n.skinWeightNode = ME('skinWeight', 'vec4')), o ? ((r = VC('bindMatrix', 'mat4')), (i = VC('bindMatrixInverse', 'mat4')), (a = HC('skeleton.boneMatrices', 'mat4', e.skeleton.bones.length))) : ((r = fw(e.bindMatrix, 'mat4')), (i = fw(e.bindMatrixInverse, 'mat4')), (a = DE(e.skeleton.boneMatrices, 'mat4', e.skeleton.bones.length))), (n.bindMatrixNode = r), (n.bindMatrixInverseNode = i), (n.boneMatricesNode = a), (n.previousBoneMatricesNode = null), n ) } return ( x(t, e), T( t, [ { key: 'getSkinnedPosition', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.boneMatricesNode, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : fC, n = this.skinIndexNode, r = this.skinWeightNode, i = this.bindMatrixNode, a = this.bindMatrixInverseNode, o = e.element(n.x), s = e.element(n.y), u = e.element(n.z), l = e.element(n.w), c = i.mul(t), h = Kw( o.mul(r.x).mul(c), s.mul(r.y).mul(c), u.mul(r.z).mul(c), l.mul(r.w).mul(c) ) return a.mul(h).xyz }, }, { key: 'getSkinnedNormal', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.boneMatricesNode, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : AC, n = this.skinIndexNode, r = this.skinWeightNode, i = this.bindMatrixNode, a = this.bindMatrixInverseNode, o = e.element(n.x), s = e.element(n.y), u = e.element(n.z), l = e.element(n.w), c = Kw(r.x.mul(o), r.y.mul(s), r.z.mul(u), r.w.mul(l)) return (c = a.mul(c).mul(i)).transformDirection(t).xyz }, }, { key: 'getPreviousSkinnedPosition', value: function (e) { var t = e.object return ( null === this.previousBoneMatricesNode && ((t.skeleton.previousBoneMatrices = new Float32Array( t.skeleton.boneMatrices )), (this.previousBoneMatricesNode = HC( 'skeleton.previousBoneMatrices', 'mat4', t.skeleton.bones.length ))), this.getSkinnedPosition(this.previousBoneMatricesNode, pC) ) }, }, { key: 'needsPreviousBoneMatrices', value: function (e) { var t = e.renderer.getMRT() return (t && t.has('velocity')) || !0 === vS(e.object).useVelocity }, }, { key: 'setup', value: function (e) { this.needsPreviousBoneMatrices(e) && pC.assign(this.getPreviousSkinnedPosition(e)) var t = this.getSkinnedPosition() if ((fC.assign(t), e.hasGeometryAttribute('normal'))) { var n = this.getSkinnedNormal() ;(AC.assign(n), e.hasGeometryAttribute('tangent') && QC.assign(n)) } }, }, { key: 'generate', value: function (e, t) { if ('void' !== t) return fC.build(e, t) }, }, { key: 'update', value: function (e) { var t = (this.useReference ? e.object : this.skinnedMesh).skeleton fR.get(t) !== e.frameId && (fR.set(t, e.frameId), null !== this.previousBoneMatricesNode && t.previousBoneMatrices.set(t.boneMatrices), t.update()) }, }, ], [ { key: 'type', get: function () { return 'SkinningNode' }, }, ] ) ) })(TS), vR = function (e) { return MA(new pR(e, !0)) }, mR = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [] return (A(this, t), ((e = y(this, t)).params = n), e) } return ( x(t, e), T( t, [ { key: 'getVarName', value: function (e) { return String.fromCharCode('i'.charCodeAt(0) + e) }, }, { key: 'getProperties', value: function (e) { var t = e.getNodeProperties(this) if (void 0 !== t.stackNode) return t for (var n = {}, r = 0, i = this.params.length - 1; r < i; r++) { var a = this.params[r], o = (!0 !== a.isNode && a.name) || this.getVarName(r), s = (!0 !== a.isNode && a.type) || 'int' n[o] = xE(o, s) } var u = e.addStack() return ( (t.returnsNode = this.params[this.params.length - 1](n, u, e)), (t.stackNode = u), e.removeStack(), t ) }, }, { key: 'getNodeType', value: function (e) { var t = this.getProperties(e).returnsNode return t ? t.getNodeType(e) : 'void' }, }, { key: 'setup', value: function (e) { this.getProperties(e) }, }, { key: 'generate', value: function (e) { for ( var t = this.getProperties(e), n = this.params, r = t.stackNode, i = 0, a = n.length - 1; i < a; i++ ) { var o = n[i], s = null, u = null, l = null, c = null, h = null, d = null o.isNode ? ((c = 'int'), (l = this.getVarName(i)), (s = '0'), (u = o.build(e, c)), (h = '<')) : ((c = o.type || 'int'), (l = o.name || this.getVarName(i)), (s = o.start), (u = o.end), (h = o.condition), (d = o.update), 'number' == typeof s ? (s = e.generateConst(c, s)) : s && s.isNode && (s = s.build(e, c)), 'number' == typeof u ? (u = e.generateConst(c, u)) : u && u.isNode && (u = u.build(e, c)), void 0 !== s && void 0 === u ? ((s += ' - 1'), (u = '0'), (h = '>=')) : void 0 !== u && void 0 === s && ((s = '0'), (h = '<')), void 0 === h && (h = Number(s) > Number(u) ? '>=' : '<')) var f = { start: s, end: u }, p = f.start, v = f.end, m = '', g = '', y = '' ;(d || (d = 'int' === c || 'uint' === c ? h.includes('<') ? '++' : '--' : h.includes('<') ? '+= 1.' : '-= 1.'), (m += e.getVar(c, l) + ' = ' + p), (g += l + ' ' + h + ' ' + v), (y += l + ' ' + d)) var _ = 'for ( '.concat(m, '; ').concat(g, '; ').concat(y, ' )') e.addFlowCode((0 === i ? '\n' : '') + e.tab + _ + ' {\n\n').addFlowTab() } var b = r.build(e, 'void'), x = t.returnsNode ? t.returnsNode.build(e) : '' e.removeFlowTab().addFlowCode('\n' + e.tab + b) for (var S = 0, A = this.params.length - 1; S < A; S++) e.addFlowCode((0 === S ? '' : e.tab) + '}\n\n').removeFlowTab() return (e.addFlowTab(), x) }, }, ], [ { key: 'type', get: function () { return 'LoopNode' }, }, ] ) ) })(TS), gR = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return MA(new mR(CA(t, 'int'))).append() }, yR = function () { return xE('break').append() }, _R = new WeakMap(), bR = new uh(), xR = IA(function (e) { var t = e.bufferMap, n = e.influence, r = e.stride, i = e.width, a = e.depth, o = e.offset, s = BA(nR).mul(r).add(o), u = s.div(i), l = s.sub(u.mul(i)) return PE(t, HA(l, u)).depth(a).mul(n) }) var SR, AR, wR = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, ['void'])).mesh = e), (n.morphBaseInfluence = fw(1)), (n.updateType = _S.OBJECT), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var t = this, n = e.geometry, r = void 0 !== n.morphAttributes.position, i = n.hasAttribute('normal') && void 0 !== n.morphAttributes.normal, a = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, o = void 0 !== a ? a.length : 0, s = (function (e) { var t = void 0 !== e.morphAttributes.position, n = void 0 !== e.morphAttributes.normal, r = void 0 !== e.morphAttributes.color, i = e.morphAttributes.position || e.morphAttributes.normal || e.morphAttributes.color, a = void 0 !== i ? i.length : 0, o = _R.get(e) if (void 0 === o || o.count !== a) { void 0 !== o && o.texture.dispose() var s = e.morphAttributes.position || [], u = e.morphAttributes.normal || [], l = e.morphAttributes.color || [], c = 0 ;(!0 === t && (c = 1), !0 === n && (c = 2), !0 === r && (c = 3)) var h = e.attributes.position.count * c, d = 1, f = 4096 h > f && ((d = Math.ceil(h / f)), (h = f)) var p = new Float32Array(h * d * 4 * a), v = new hh(p, h, d, a) ;((v.type = yl), (v.needsUpdate = !0)) for (var m = 4 * c, g = 0; g < a; g++) for ( var y = s[g], _ = u[g], b = l[g], x = h * d * 4 * g, S = 0; S < y.count; S++ ) { var A = S * m ;(!0 === t && (bR.fromBufferAttribute(y, S), (p[x + A + 0] = bR.x), (p[x + A + 1] = bR.y), (p[x + A + 2] = bR.z), (p[x + A + 3] = 0)), !0 === n && (bR.fromBufferAttribute(_, S), (p[x + A + 4] = bR.x), (p[x + A + 5] = bR.y), (p[x + A + 6] = bR.z), (p[x + A + 7] = 0)), !0 === r && (bR.fromBufferAttribute(b, S), (p[x + A + 8] = bR.x), (p[x + A + 9] = bR.y), (p[x + A + 10] = bR.z), (p[x + A + 11] = 4 === b.itemSize ? bR.w : 1))) } function w() { ;(v.dispose(), _R.delete(e), e.removeEventListener('dispose', w)) } ;((o = { count: a, texture: v, stride: c, size: new Vc(h, d) }), _R.set(e, o), e.addEventListener('dispose', w)) } return o })(n), u = s.texture, l = s.stride, c = s.size ;(!0 === r && fC.mulAssign(this.morphBaseInfluence), !0 === i && AC.mulAssign(this.morphBaseInfluence)) var h = BA(c.width) gR(o, function (e) { var n = e.i, a = FA(0).toVar() ;(t.mesh.count > 1 && null !== t.mesh.morphTexture && void 0 !== t.mesh.morphTexture ? a.assign(PE(t.mesh.morphTexture, HA(BA(n).add(1), BA(rR))).r) : a.assign(VC('morphTargetInfluences', 'float').element(n).toVar()), !0 === r && fC.addAssign( xR({ bufferMap: u, influence: a, stride: l, width: h, depth: n, offset: BA(0), }) ), !0 === i && AC.addAssign( xR({ bufferMap: u, influence: a, stride: l, width: h, depth: n, offset: BA(1), }) )) }) }, }, { key: 'update', value: function () { var e = this.morphBaseInfluence this.mesh.geometry.morphTargetsRelative ? (e.value = 1) : (e.value = 1 - this.mesh.morphTargetInfluences.reduce(function (e, t) { return e + t }, 0)) }, }, ], [ { key: 'type', get: function () { return 'MorphNode' }, }, ] ) ) })(TS), TR = kA(wR), MR = (function (e) { function t() { var e return (A(this, t), ((e = y(this, t, ['vec3'])).isLightingNode = !0), e) } return ( x(t, e), T(t, null, [ { key: 'type', get: function () { return 'LightingNode' }, }, ]) ) })(TS), ER = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return (A(this, t), ((e = y(this, t)).aoNode = n), e) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { e.context.ambientOcclusion.mulAssign(this.aoNode) }, }, ], [ { key: 'type', get: function () { return 'AONode' }, }, ] ) ) })(MR), CR = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((n = y(this, t, [e])).lightingModel = r), (n.backdropNode = i), (n.backdropAlphaNode = a), (n._value = null), n ) } return ( x(t, e), T( t, [ { key: 'getContext', value: function () { var e = this.backdropNode, t = this.backdropAlphaNode, n = { directDiffuse: jA().toVar('directDiffuse'), directSpecular: jA().toVar('directSpecular'), indirectDiffuse: jA().toVar('indirectDiffuse'), indirectSpecular: jA().toVar('indirectSpecular'), } return { radiance: jA().toVar('radiance'), irradiance: jA().toVar('irradiance'), iblIrradiance: jA().toVar('iblIrradiance'), ambientOcclusion: FA(1).toVar('ambientOcclusion'), reflectedLight: n, backdrop: e, backdropAlpha: t, } }, }, { key: 'setup', value: function (e) { return ( (this.value = this._value || (this._value = this.getContext())), (this.value.lightingModel = this.lightingModel || e.context.lightingModel), n(t, 'setup', this, 3)([e]) ) }, }, ], [ { key: 'type', get: function () { return 'LightingContextNode' }, }, ] ) ) })(LM), kR = kA(CR), RR = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).node = e), n) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { e.context.irradiance.addAssign(this.node) }, }, ], [ { key: 'type', get: function () { return 'IrradianceNode' }, }, ] ) ) })(MR), IR = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).scope = e), (n.isViewportNode = !0), n) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return this.scope === t.VIEWPORT ? 'vec4' : 'vec2' }, }, { key: 'getUpdateType', value: function () { var e = _S.NONE return ( (this.scope !== t.SIZE && this.scope !== t.VIEWPORT) || (e = _S.RENDER), (this.updateType = e), e ) }, }, { key: 'update', value: function (e) { var n = e.renderer, r = n.getRenderTarget() this.scope === t.VIEWPORT ? null !== r ? AR.copy(r.viewport) : (n.getViewport(AR), AR.multiplyScalar(n.getPixelRatio())) : null !== r ? ((SR.width = r.width), (SR.height = r.height)) : n.getDrawingBufferSize(SR) }, }, { key: 'setup', value: function () { var e = this.scope return e === t.SIZE ? fw(SR || (SR = new Vc())) : e === t.VIEWPORT ? fw(AR || (AR = new uh())) : VA(LR.div(PR)) }, }, { key: 'generate', value: function (e) { if (this.scope === t.COORDINATE) { var r = e.getFragCoord() if (e.isFlipY()) { var i = e.getNodeProperties(PR).outputNode.build(e) r = '' .concat(e.getType('vec2'), '( ') .concat(r, '.x, ') .concat(i, '.y - ') .concat(r, '.y )') } return r } return n(t, 'generate', this, 3)([e]) }, }, ], [ { key: 'type', get: function () { return 'ScreenNode' }, }, ] ) ) })(TS) ;((IR.COORDINATE = 'coordinate'), (IR.VIEWPORT = 'viewport'), (IR.SIZE = 'size'), (IR.UV = 'uv')) var NR = RA(IR, IR.UV), PR = RA(IR, IR.SIZE), LR = RA(IR, IR.COORDINATE), DR = RA(IR, IR.VIEWPORT), OR = DR.zw, FR = LR.sub(DR.xy), BR = FR.div(OR), UR = IA(function () { return ( console.warn( 'TSL.ViewportNode: "viewportResolution" is deprecated. Use "screenSize" instead.' ), PR ) }, 'vec2').once()(), zR = IA(function () { return ( console.warn( 'TSL.ViewportNode: "viewportTopLeft" is deprecated. Use "screenUV" instead.' ), NR ) }, 'vec2').once()(), VR = IA(function () { return ( console.warn( 'TSL.ViewportNode: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.' ), NR.flipY() ) }, 'vec2').once()(), HR = new Vc(), WR = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : NR, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), null === i && ((i = new Up()).minFilter = hl), ((e = y(this, t, [i, n, r])).generateMipmaps = !1), (e.isOutputTextureNode = !0), (e.updateBeforeType = _S.FRAME), e ) } return ( x(t, e), T( t, [ { key: 'updateBefore', value: function (e) { var t = e.renderer t.getDrawingBufferSize(HR) var n = this.value ;(n.image.width === HR.width && n.image.height === HR.height) || ((n.image.width = HR.width), (n.image.height = HR.height), (n.needsUpdate = !0)) var r = n.generateMipmaps ;((n.generateMipmaps = this.generateMipmaps), t.copyFramebufferToTexture(n), (n.generateMipmaps = r)) }, }, { key: 'clone', value: function () { var e = new this.constructor(this.uvNode, this.levelNode, this.value) return ((e.generateMipmaps = this.generateMipmaps), e) }, }, ], [ { key: 'type', get: function () { return 'ViewportTextureNode' }, }, ] ) ) })(IE), GR = kA(WR), jR = kA(WR, null, null, { generateMipmaps: !0 }), QR = null, qR = (function (e) { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : NR, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), null === QR && (QR = new zp()), y(this, t, [e, n, QR])) } return ( x(t, e), T(t, null, [ { key: 'type', get: function () { return 'ViewportDepthTextureNode' }, }, ]) ) })(WR), XR = kA(qR), YR = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, ['float'])).scope = e), (n.valueNode = r), (n.isViewportDepthNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'generate', value: function (e) { return this.scope === t.DEPTH_BASE ? e.getFragDepth() : n(t, 'generate', this, 3)([e]) }, }, { key: 'setup', value: function (e) { var n = e.camera, r = this.scope, i = this.valueNode, a = null if (r === t.DEPTH_BASE) null !== i && (a = eI().assign(i)) else if (r === t.DEPTH) a = n.isPerspectiveCamera ? ZR(gC.z, zE, VE) : KR(gC.z, zE, VE) else if (r === t.LINEAR_DEPTH) if (null !== i) if (n.isPerspectiveCamera) { var o = JR(i, zE, VE) a = KR(o, zE, VE) } else a = i else a = KR(gC.z, zE, VE) return a }, }, ], [ { key: 'type', get: function () { return 'ViewportDepthNode' }, }, ] ) ) })(TS) ;((YR.DEPTH_BASE = 'depthBase'), (YR.DEPTH = 'depth'), (YR.LINEAR_DEPTH = 'linearDepth')) var KR = function (e, t, n) { return e.add(t).div(t.sub(n)) }, ZR = function (e, t, n) { return t.add(e).mul(n).div(n.sub(t).mul(e)) }, JR = function (e, t, n) { return t.mul(n).div(n.sub(t).mul(e).sub(n)) }, $R = function (e, t, n) { t = t.max(1e-6).toVar() var r = RT(e.negate().div(t)), i = RT(n.div(t)) return r.div(i) }, eI = kA(YR, YR.DEPTH_BASE), tI = RA(YR, YR.DEPTH), nI = kA(YR, YR.LINEAR_DEPTH), rI = nI(XR()) tI.assign = function (e) { return eI(e) } var iI = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, ['float'])).name = e), (n.isBuiltinNode = !0), n ) } return ( x(t, e), T(t, [ { key: 'generate', value: function () { return this.name }, }, ]) ) })(TS), aI = kA(iI), oI = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t.DEFAULT return (A(this, t), ((e = y(this, t)).scope = n), e) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { n(t, 'setup', this, 3)([e]) var r = e.clippingContext, i = r.intersectionPlanes, a = r.unionPlanes return ( (this.hardwareClipping = e.material.hardwareClipping), this.scope === t.ALPHA_TO_COVERAGE ? this.setupAlphaToCoverage(i, a) : this.scope === t.HARDWARE ? this.setupHardwareClipping(a, e) : this.setupDefault(i, a) ) }, }, { key: 'setupAlphaToCoverage', value: function (e, t) { var n = this return IA(function () { var r = FA().toVar('distanceToPlane'), i = FA().toVar('distanceToGradient'), a = FA(1).toVar('clipOpacity'), o = t.length if (!1 === n.hardwareClipping && o > 0) { var s = BE(t) gR(o, function (e) { var t = e.i, n = s.element(t) ;(r.assign(gC.dot(n.xyz).negate().add(n.w)), i.assign(r.fwidth().div(2)), a.mulAssign(AM(i.negate(), i, r))) }) } var u = e.length if (u > 0) { var l = BE(e), c = FA(1).toVar('intersectionClipOpacity') ;(gR(u, function (e) { var t = e.i, n = l.element(t) ;(r.assign(gC.dot(n.xyz).negate().add(n.w)), i.assign(r.fwidth().div(2)), c.mulAssign(AM(i.negate(), i, r).oneMinus())) }), a.mulAssign(c.oneMinus())) } ;(gw.a.mulAssign(a), gw.a.equal(0).discard()) })() }, }, { key: 'setupDefault', value: function (e, t) { var n = this return IA(function () { var r = t.length if (!1 === n.hardwareClipping && r > 0) { var i = BE(t) gR(r, function (e) { var t = e.i, n = i.element(t) gC.dot(n.xyz).greaterThan(n.w).discard() }) } var a = e.length if (a > 0) { var o = BE(e), s = zA(!0).toVar('clipped') ;(gR(a, function (e) { var t = e.i, n = o.element(t) s.assign(gC.dot(n.xyz).greaterThan(n.w).and(s)) }), s.discard()) } })() }, }, { key: 'setupHardwareClipping', value: function (e, t) { var n = e.length return ( t.enableHardwareClipping(n), IA(function () { var r = BE(e), i = aI(t.getClipDistance()) gR(n, function (e) { var t = e.i, n = r.element(t), a = gC.dot(n.xyz).sub(n.w).negate() i.element(t).assign(a) }) })() ) }, }, ], [ { key: 'type', get: function () { return 'ClippingNode' }, }, ] ) ) })(TS) ;((oI.ALPHA_TO_COVERAGE = 'alphaToCoverage'), (oI.DEFAULT = 'default'), (oI.HARDWARE = 'hardware')) var sI = IA(function (e) { var t = C(e, 1)[0] return OT( Jw(1e4, FT(Jw(17, t.x).add(Jw(0.1, t.y)))).mul( Kw(0.1, WT(FT(Jw(13, t.y).add(t.x)))) ) ) }), uI = IA(function (e) { var t = C(e, 1)[0] return sI(VA(sI(t.xy), t.z)) }), lI = IA(function (e) { var t = C(e, 1)[0], n = iM(jT(XT(t.xyz)), jT(YT(t.xyz))), r = FA(1).div(FA(0.05).mul(n)).toVar('pixScale'), i = VA(CT(PT(RT(r))), CT(LT(RT(r)))), a = VA(uI(PT(i.x.mul(t.xyz))), uI(PT(i.y.mul(t.xyz)))), o = OT(RT(r)), s = Kw(Jw(o.oneMinus(), a.x), Jw(o, a.y)), u = rM(o, o.oneMinus()), l = jA( s.mul(s).div(Jw(2, u).mul(Zw(1, u))), s.sub(Jw(0.5, u)).div(Zw(1, u)), Zw( 1, Zw(1, s) .mul(Zw(1, s)) .div(Jw(2, u).mul(Zw(1, u))) ) ), c = s.lessThan(u.oneMinus()).select(s.lessThan(u).select(l.x, l.y), l.z) return bM(c, 1e-6, 1) }).setLayout({ name: 'getAlphaHashThreshold', type: 'float', inputs: [{ name: 'position', type: 'vec3' }], }), cI = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t)).isNodeMaterial = !0), (e.fog = !0), (e.lights = !1), (e.hardwareClipping = !1), (e.lightsNode = null), (e.envNode = null), (e.aoNode = null), (e.colorNode = null), (e.normalNode = null), (e.opacityNode = null), (e.backdropNode = null), (e.backdropAlphaNode = null), (e.alphaTestNode = null), (e.positionNode = null), (e.geometryNode = null), (e.depthNode = null), (e.shadowPositionNode = null), (e.receivedShadowNode = null), (e.castShadowNode = null), (e.outputNode = null), (e.mrtNode = null), (e.fragmentNode = null), (e.vertexNode = null), e ) } return ( x(t, e), T( t, [ { key: 'type', get: function () { return this.constructor.type }, set: function (e) {}, }, { key: 'customProgramCacheKey', value: function () { return this.type + sS(this) }, }, { key: 'build', value: function (e) { this.setup(e) }, }, { key: 'setupObserver', value: function (e) { return new rS(e) }, }, { key: 'setup', value: function (e) { var t = this ;((e.context.setupNormal = function () { return t.setupNormal(e) }), (e.context.setupPositionView = function () { return t.setupPositionView(e) }), (e.context.setupModelViewProjection = function () { return t.setupModelViewProjection(e) })) var n = e.renderer, r = n.getRenderTarget() e.addStack() var i, a = this.vertexNode || this.setupVertex(e) ;((e.stack.outputNode = a), this.setupHardwareClipping(e), null !== this.geometryNode && (e.stack.outputNode = e.stack.outputNode.bypass(this.geometryNode)), e.addFlow('vertex', e.removeStack()), e.addStack()) var o = this.setupClipping(e) if ( ((!0 !== this.depthWrite && !0 !== this.depthTest) || (null !== r ? !0 === r.depthBuffer && this.setupDepth(e) : !0 === n.depth && this.setupDepth(e)), null === this.fragmentNode) ) { ;(this.setupDiffuseColor(e), this.setupVariants(e)) var s = this.setupLighting(e) null !== o && e.stack.add(o) var u = YA(s, gw.a).max(0) if ( ((i = this.setupOutput(e, u)), Dw.assign(i), null !== this.outputNode && (i = this.outputNode), null !== r) ) { var l = n.getMRT(), c = this.mrtNode null !== l ? ((i = l), null !== c && (i = l.merge(c))) : null !== c && (i = c) } } else { var h = this.fragmentNode ;(!0 !== h.isOutputStructNode && (h = YA(h)), (i = this.setupOutput(e, h))) } ;((e.stack.outputNode = i), e.addFlow('fragment', e.removeStack()), (e.observer = this.setupObserver(e))) }, }, { key: 'setupClipping', value: function (e) { if (null === e.clippingContext) return null var t = e.clippingContext, n = t.unionPlanes, r = t.intersectionPlanes, i = null if (n.length > 0 || r.length > 0) { var a = e.renderer.samples this.alphaToCoverage && a > 1 ? (i = MA(new oI(oI.ALPHA_TO_COVERAGE))) : e.stack.add(MA(new oI())) } return i }, }, { key: 'setupHardwareClipping', value: function (e) { if (((this.hardwareClipping = !1), null !== e.clippingContext)) { var t = e.clippingContext.unionPlanes.length t > 0 && t <= 8 && e.isAvailable('clipDistance') && (e.stack.add(MA(new oI(oI.HARDWARE))), (this.hardwareClipping = !0)) } }, }, { key: 'setupDepth', value: function (e) { var t = e.renderer, n = e.camera, r = this.depthNode if (null === r) { var i = t.getMRT() i && i.has('depth') ? (r = i.get('depth')) : !0 === t.logarithmicDepthBuffer && (r = n.isPerspectiveCamera ? $R(gC.z, zE, VE) : KR(gC.z, zE, VE)) } null !== r && tI.assign(r).append() }, }, { key: 'setupPositionView', value: function () { return uC.mul(fC).xyz }, }, { key: 'setupModelViewProjection', value: function () { return HE.mul(gC) }, }, { key: 'setupVertex', value: function (e) { return ( e.addStack(), this.setupPosition(e), (e.context.vertex = e.removeStack()), eR ) }, }, { key: 'setupPosition', value: function (e) { var t = e.object, n = e.geometry if ( ((n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color) && TR(t).append(), !0 === t.isSkinnedMesh && vR(t).append(), this.displacementMap) ) { var r = GC('displacementMap', 'texture'), i = GC('displacementScale', 'float'), a = GC('displacementBias', 'float') fC.addAssign(AC.normalize().mul(r.x.mul(i).add(a))) } return ( t.isBatchedMesh && dR(t).append(), t.isInstancedMesh && t.instanceMatrix && !0 === t.instanceMatrix.isInstancedBufferAttribute && cR(t).append(), null !== this.positionNode && fC.assign(this.positionNode.context({ isPositionNodeInput: !0 })), fC ) }, }, { key: 'setupDiffuseColor', value: function (e) { var t = e.object, n = e.geometry, r = this.colorNode ? YA(this.colorNode) : gk ;(!0 === this.vertexColors && n.hasAttribute('color') && (r = YA(r.xyz.mul(ME('color', 'vec3')), r.a)), t.instanceColor) && (r = mw('vec3', 'vInstanceColor').mul(r)) t.isBatchedMesh && t._colorsTexture && (r = mw('vec3', 'vBatchColor').mul(r)) gw.assign(r) var i = this.opacityNode ? FA(this.opacityNode) : bk if ( (gw.a.assign(gw.a.mul(i)), null !== this.alphaTestNode || this.alphaTest > 0) ) { var a = null !== this.alphaTestNode ? FA(this.alphaTestNode) : mk gw.a.lessThanEqual(a).discard() } ;(!0 === this.alphaHash && gw.a.lessThan(lI(fC)).discard(), !1 === this.transparent && 1 === this.blending && !1 === this.alphaToCoverage && gw.a.assign(1)) }, }, { key: 'setupVariants', value: function () {} }, { key: 'setupOutgoingLight', value: function () { return !0 === this.lights ? jA(0) : gw.rgb }, }, { key: 'setupNormal', value: function () { return this.normalNode ? jA(this.normalNode) : Ck }, }, { key: 'setupEnvironment', value: function () { var e = null return ( this.envNode ? (e = this.envNode) : this.envMap && (e = this.envMap.isCubeTexture ? GC('envMap', 'cubeTexture') : GC('envMap', 'texture')), e ) }, }, { key: 'setupLightMap', value: function (e) { var t = null return (e.material.lightMap && (t = new RR(Zk)), t) }, }, { key: 'setupLights', value: function (e) { var t = [], n = this.setupEnvironment(e) n && n.isLightingNode && t.push(n) var r = this.setupLightMap(e) if ( (r && r.isLightingNode && t.push(r), null !== this.aoNode || e.material.aoMap) ) { var i = null !== this.aoNode ? this.aoNode : Jk t.push(new ER(i)) } var a = this.lightsNode || e.lightsNode return ( t.length > 0 && (a = e.renderer.lighting.createNode([].concat(I(a.getLights()), t))), a ) }, }, { key: 'setupLightingModel', value: function () {} }, { key: 'setupLighting', value: function (e) { var t = e.material, n = this.backdropNode, r = this.backdropAlphaNode, i = this.emissiveNode, a = !0 === this.lights || null !== this.lightsNode ? this.setupLights(e) : null, o = this.setupOutgoingLight(e) if (a && a.getScope().hasLights) { var s = this.setupLightingModel(e) o = kR(a, s, n, r) } else null !== n && (o = jA(null !== r ? _M(o, n, r) : n)) return ( ((i && !0 === i.isNode) || (t.emissive && !0 === t.emissive.isColor)) && (yw.assign(jA(i || _k)), (o = o.add(yw))), o ) }, }, { key: 'setupOutput', value: function (e, t) { if (!0 === this.fog) { var n = e.fogNode n && (Dw.assign(t), (t = YA(n))) } return t }, }, { key: 'setDefaultValues', value: function (e) { for (var t in e) { var n = e[t] void 0 === this[t] && ((this[t] = n), n && n.clone && (this[t] = n.clone())) } var r = Object.getOwnPropertyDescriptors(e.constructor.prototype) for (var i in r) void 0 === Object.getOwnPropertyDescriptor(this.constructor.prototype, i) && void 0 !== r[i].get && Object.defineProperty(this.constructor.prototype, i, r[i]) }, }, { key: 'toJSON', value: function (e) { var t = void 0 === e || 'string' == typeof e t && (e = { textures: {}, images: {}, nodes: {} }) var n = Ud.prototype.toJSON.call(this, e), r = uS(this) n.inputNodes = {} var i, a = L(r) try { for (a.s(); !(i = a.n()).done; ) { var o = i.value, s = o.property, u = o.childNode n.inputNodes[s] = u.toJSON(e).uuid } } catch (f) { a.e(f) } finally { a.f() } function l(e) { var t = [] for (var n in e) { var r = e[n] ;(delete r.metadata, t.push(r)) } return t } if (t) { var c = l(e.textures), h = l(e.images), d = l(e.nodes) ;(c.length > 0 && (n.textures = c), h.length > 0 && (n.images = h), d.length > 0 && (n.nodes = d)) } return n }, }, { key: 'copy', value: function (e) { return ( (this.lightsNode = e.lightsNode), (this.envNode = e.envNode), (this.colorNode = e.colorNode), (this.normalNode = e.normalNode), (this.opacityNode = e.opacityNode), (this.backdropNode = e.backdropNode), (this.backdropAlphaNode = e.backdropAlphaNode), (this.alphaTestNode = e.alphaTestNode), (this.positionNode = e.positionNode), (this.geometryNode = e.geometryNode), (this.depthNode = e.depthNode), (this.shadowPositionNode = e.shadowPositionNode), (this.receivedShadowNode = e.receivedShadowNode), (this.castShadowNode = e.castShadowNode), (this.outputNode = e.outputNode), (this.mrtNode = e.mrtNode), (this.fragmentNode = e.fragmentNode), (this.vertexNode = e.vertexNode), n(t, 'copy', this, 3)([e]) ) }, }, ], [ { key: 'type', get: function () { return 'NodeMaterial' }, }, ] ) ) })(Ud), hI = null, dI = (function (e) { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : NR, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), null === hI && (hI = new Up()), y(this, t, [e, n, hI])) } return ( x(t, e), T( t, [ { key: 'updateReference', value: function () { return this }, }, ], [ { key: 'type', get: function () { return 'ViewportSharedTextureNode' }, }, ] ) ) })(WR), fI = kA(dI), pI = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : mC return (A(this, t), ((e = y(this, t, ['vec2'])).dirNode = n), e) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = this.dirNode, t = e.z .atan(e.x) .mul(1 / (2 * Math.PI)) .add(0.5), n = e.y .clamp(-1, 1) .asin() .mul(1 / Math.PI) .add(0.5) return VA(t, n) }, }, ], [ { key: 'type', get: function () { return 'EquirectUVNode' }, }, ] ) ) })(CS), vI = kA(pI), mI = IA(function (e) { var t = e.f0, n = e.f90, r = e.dotVH, i = r.mul(-5.55473).sub(6.98316).mul(r).exp2() return t.mul(i.oneMinus()).add(n.mul(i)) }), gI = IA(function (e) { return e.diffuseColor.mul(1 / Math.PI) }), yI = IA(function (e) { if (!1 === e.geometry.hasAttribute('normal')) return FA(0) var t = TC.dFdx().abs().max(TC.dFdy().abs()) return t.x.max(t.y).max(t.z) }), _I = IA(function (e) { var t = e.roughness, n = yI(), r = t.max(0.0525) return (r = (r = r.add(n)).min(1)) }), bI = IA(function (e) { var t = e.alpha, n = e.dotNL, r = e.dotNV, i = t.pow2(), a = n.mul(i.add(i.oneMinus().mul(r.pow2())).sqrt()), o = r.mul(i.add(i.oneMinus().mul(n.pow2())).sqrt()) return $w(0.5, a.add(o).max(_T)) }).setLayout({ name: 'V_GGX_SmithCorrelated', type: 'float', inputs: [ { name: 'alpha', type: 'float' }, { name: 'dotNL', type: 'float' }, { name: 'dotNV', type: 'float' }, ], }), xI = IA(function (e) { var t = e.alphaT, n = e.alphaB, r = e.dotTV, i = e.dotBV, a = e.dotTL, o = e.dotBL, s = e.dotNV, u = e.dotNL, l = u.mul(jA(t.mul(r), n.mul(i), s).length()), c = s.mul(jA(t.mul(a), n.mul(o), u).length()) return $w(0.5, l.add(c)).saturate() }).setLayout({ name: 'V_GGX_SmithCorrelated_Anisotropic', type: 'float', inputs: [ { name: 'alphaT', type: 'float', qualifier: 'in' }, { name: 'alphaB', type: 'float', qualifier: 'in' }, { name: 'dotTV', type: 'float', qualifier: 'in' }, { name: 'dotBV', type: 'float', qualifier: 'in' }, { name: 'dotTL', type: 'float', qualifier: 'in' }, { name: 'dotBL', type: 'float', qualifier: 'in' }, { name: 'dotNV', type: 'float', qualifier: 'in' }, { name: 'dotNL', type: 'float', qualifier: 'in' }, ], }), SI = IA(function (e) { var t = e.alpha, n = e.dotNH, r = t.pow2(), i = n.pow2().mul(r.oneMinus()).oneMinus() return r.div(i.pow2()).mul(1 / Math.PI) }).setLayout({ name: 'D_GGX', type: 'float', inputs: [ { name: 'alpha', type: 'float' }, { name: 'dotNH', type: 'float' }, ], }), AI = FA(1 / Math.PI), wI = IA(function (e) { var t = e.alphaT, n = e.alphaB, r = e.dotNH, i = e.dotTH, a = e.dotBH, o = t.mul(n), s = jA(n.mul(i), t.mul(a), o.mul(r)), u = s.dot(s), l = o.div(u) return AI.mul(o.mul(l.pow2())) }).setLayout({ name: 'D_GGX_Anisotropic', type: 'float', inputs: [ { name: 'alphaT', type: 'float', qualifier: 'in' }, { name: 'alphaB', type: 'float', qualifier: 'in' }, { name: 'dotNH', type: 'float', qualifier: 'in' }, { name: 'dotTH', type: 'float', qualifier: 'in' }, { name: 'dotBH', type: 'float', qualifier: 'in' }, ], }), TI = IA(function (e) { var t, n, r = e.lightDirection, i = e.f0, a = e.f90, o = e.roughness, s = e.f, u = e.USE_IRIDESCENCE, l = e.USE_ANISOTROPY, c = e.normalView || EC, h = o.pow2(), d = r.add(yC).normalize(), f = c.dot(r).clamp(), p = c.dot(yC).clamp(), v = c.dot(d).clamp(), m = yC.dot(d).clamp(), g = mI({ f0: i, f90: a, dotVH: m }) if ((AA(u) && (g = Tw.mix(g, s)), AA(l))) { var y = Rw.dot(r), _ = Rw.dot(yC), b = Rw.dot(d), x = Iw.dot(r), S = Iw.dot(yC), A = Iw.dot(d) ;((t = xI({ alphaT: Cw, alphaB: h, dotTV: _, dotBV: S, dotTL: y, dotBL: x, dotNV: p, dotNL: f, })), (n = wI({ alphaT: Cw, alphaB: h, dotNH: v, dotTH: b, dotBH: A }))) } else ((t = bI({ alpha: h, dotNL: f, dotNV: p })), (n = SI({ alpha: h, dotNH: v }))) return g.mul(t).mul(n) }), MI = IA(function (e) { var t = e.roughness, n = e.dotNV, r = YA(-1, -0.0275, -0.572, 0.022), i = YA(1, 0.0425, 1.04, -0.04), a = t.mul(r).add(i), o = a.x.mul(a.x).min(n.mul(-9.28).exp2()).mul(a.x).add(a.y) return VA(-1.04, 1.04).mul(o).add(a.zw) }).setLayout({ name: 'DFGApprox', type: 'vec2', inputs: [ { name: 'roughness', type: 'float' }, { name: 'dotNV', type: 'vec3' }, ], }), EI = IA(function (e) { var t = e.f, n = e.f90, r = e.dotVH.oneMinus().saturate(), i = r.mul(r), a = r.mul(i, i).clamp(0, 0.9999) return t.sub(jA(n).mul(a)).div(a.oneMinus()) }).setLayout({ name: 'Schlick_to_F0', type: 'vec3', inputs: [ { name: 'f', type: 'vec3' }, { name: 'f90', type: 'float' }, { name: 'dotVH', type: 'float' }, ], }), CI = 1 / 6, kI = function (e) { return Jw(CI, Jw(e, Jw(e, e.negate().add(3)).sub(3)).add(1)) }, RI = function (e) { return Jw(CI, Jw(e, Jw(e, Jw(3, e).sub(6))).add(4)) }, II = function (e) { return Jw(CI, Jw(e, Jw(e, Jw(-3, e).add(3)).add(3)).add(1)) }, NI = function (e) { return Jw(CI, dM(e, 3)) }, PI = function (e) { return kI(e).add(RI(e)) }, LI = function (e) { return II(e).add(NI(e)) }, DI = function (e) { return Kw(-1, RI(e).div(kI(e).add(RI(e)))) }, OI = function (e) { return Kw(1, NI(e).div(II(e).add(NI(e)))) }, FI = function (e, t, n) { var r = e.uvNode, i = Jw(r, t.zw).add(0.5), a = PT(i), o = OT(i), s = PI(o.x), u = LI(o.x), l = DI(o.x), c = OI(o.x), h = DI(o.y), d = OI(o.y), f = VA(a.x.add(l), a.y.add(h)).sub(0.5).mul(t.xy), p = VA(a.x.add(c), a.y.add(h)).sub(0.5).mul(t.xy), v = VA(a.x.add(l), a.y.add(d)).sub(0.5).mul(t.xy), m = VA(a.x.add(c), a.y.add(d)).sub(0.5).mul(t.xy), g = PI(o.y).mul(Kw(s.mul(e.sample(f).level(n)), u.mul(e.sample(p).level(n)))), y = LI(o.y).mul(Kw(s.mul(e.sample(v).level(n)), u.mul(e.sample(m).level(n)))) return g.add(y) }, BI = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = void 0 === r ? FA(3) : r, a = VA(n.size(BA(i))), o = VA(n.size(BA(i.add(1)))), s = $w(1, a), u = $w(1, o), l = FI(n, YA(s, a), PT(i)), c = FI(n, YA(u, o), LT(i)) return OT(i).mix(l, c) }) ;(jA(0.04), FA(1)) var UI = FA(1), zI = FA(-2), VI = FA(0.8), HI = FA(-1), WI = FA(0.4), GI = FA(2), jI = FA(0.305), QI = FA(3), qI = FA(0.21), XI = FA(4), YI = FA(4), KI = FA(16), ZI = IA(function (e) { var t = C(e, 1)[0], n = jA(WT(t)).toVar(), r = FA(-1).toVar() return ( LA(n.x.greaterThan(n.z), function () { LA(n.x.greaterThan(n.y), function () { r.assign(NM(t.x.greaterThan(0), 0, 3)) }).Else(function () { r.assign(NM(t.y.greaterThan(0), 1, 4)) }) }).Else(function () { LA(n.z.greaterThan(n.y), function () { r.assign(NM(t.z.greaterThan(0), 2, 5)) }).Else(function () { r.assign(NM(t.y.greaterThan(0), 1, 4)) }) }), r ) }).setLayout({ name: 'getFace', type: 'float', inputs: [{ name: 'direction', type: 'vec3' }], }), JI = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = VA().toVar() return ( LA(r.equal(0), function () { i.assign(VA(n.z, n.y).div(WT(n.x))) }) .ElseIf(r.equal(1), function () { i.assign(VA(n.x.negate(), n.z.negate()).div(WT(n.y))) }) .ElseIf(r.equal(2), function () { i.assign(VA(n.x.negate(), n.y).div(WT(n.z))) }) .ElseIf(r.equal(3), function () { i.assign(VA(n.z.negate(), n.y).div(WT(n.x))) }) .ElseIf(r.equal(4), function () { i.assign(VA(n.x.negate(), n.z).div(WT(n.y))) }) .Else(function () { i.assign(VA(n.x, n.y).div(WT(n.z))) }), Jw(0.5, i.add(1)) ) }).setLayout({ name: 'getUV', type: 'vec2', inputs: [ { name: 'direction', type: 'vec3' }, { name: 'face', type: 'float' }, ], }), $I = IA(function (e) { var t = C(e, 1)[0], n = FA(0).toVar() return ( LA(t.greaterThanEqual(VI), function () { n.assign(UI.sub(t).mul(HI.sub(zI)).div(UI.sub(VI)).add(zI)) }) .ElseIf(t.greaterThanEqual(WI), function () { n.assign(VI.sub(t).mul(GI.sub(HI)).div(VI.sub(WI)).add(HI)) }) .ElseIf(t.greaterThanEqual(jI), function () { n.assign(WI.sub(t).mul(QI.sub(GI)).div(WI.sub(jI)).add(GI)) }) .ElseIf(t.greaterThanEqual(qI), function () { n.assign(jI.sub(t).mul(XI.sub(QI)).div(jI.sub(qI)).add(QI)) }) .Else(function () { n.assign(FA(-2).mul(RT(Jw(1.16, t)))) }), n ) }).setLayout({ name: 'roughnessToMip', type: 'float', inputs: [{ name: 'roughness', type: 'float' }], }), eN = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = n.toVar() i.assign(Jw(2, i).sub(1)) var a = jA(i, 1).toVar() return ( LA(r.equal(0), function () { a.assign(a.zyx) }) .ElseIf(r.equal(1), function () { ;(a.assign(a.xzy), a.xz.mulAssign(-1)) }) .ElseIf(r.equal(2), function () { a.x.mulAssign(-1) }) .ElseIf(r.equal(3), function () { ;(a.assign(a.zyx), a.xz.mulAssign(-1)) }) .ElseIf(r.equal(4), function () { ;(a.assign(a.xzy), a.xy.mulAssign(-1)) }) .ElseIf(r.equal(5), function () { a.z.mulAssign(-1) }), a ) }).setLayout({ name: 'getDirection', type: 'vec3', inputs: [ { name: 'uv', type: 'vec2' }, { name: 'face', type: 'float' }, ], }), tN = IA(function (e) { var t = C(e, 6), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = FA(i), l = jA(r), c = bM($I(u), zI, s), h = OT(c), d = PT(c), f = jA(nN(n, l, d, a, o, s)).toVar() return ( LA(h.notEqual(0), function () { var e = jA(nN(n, l, d.add(1), a, o, s)).toVar() f.assign(_M(f, e, h)) }), f ) }), nN = IA(function (e) { var t = C(e, 6), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = FA(i).toVar(), l = jA(r), c = FA(ZI(l)).toVar(), h = FA(iM(YI.sub(u), 0)).toVar() u.assign(iM(u, YI)) var d = FA(CT(u)).toVar(), f = VA(JI(l, c).mul(d.sub(2)).add(1)).toVar() return ( LA(c.greaterThan(2), function () { ;(f.y.addAssign(d), c.subAssign(3)) }), f.x.addAssign(c.mul(d)), f.x.addAssign(h.mul(Jw(3, KI))), f.y.addAssign(Jw(4, CT(s).sub(d))), f.x.mulAssign(a), f.y.mulAssign(o), n.sample(f).grad(VA(), VA()) ) }), rN = IA(function (e) { var t = e.envMap, n = e.mipInt, r = e.outputDirection, i = e.theta, a = e.axis, o = e.CUBEUV_TEXEL_WIDTH, s = e.CUBEUV_TEXEL_HEIGHT, u = e.CUBEUV_MAX_MIP, l = BT(i), c = r .mul(l) .add(a.cross(r).mul(FT(i))) .add(a.mul(a.dot(r).mul(l.oneMinus()))) return nN(t, c, n, o, s, u) }), iN = IA(function (e) { var t = e.n, n = e.latitudinal, r = e.poleAxis, i = e.outputDirection, a = e.weights, o = e.samples, s = e.dTheta, u = e.mipInt, l = e.envMap, c = e.CUBEUV_TEXEL_WIDTH, h = e.CUBEUV_TEXEL_HEIGHT, d = e.CUBEUV_MAX_MIP, f = jA(NM(n, r, hM(r, i))).toVar() ;(LA(AT(f.equals(jA(0))), function () { f.assign(jA(i.z, 0, i.x.negate())) }), f.assign(DT(f))) var p = jA().toVar() return ( p.addAssign( a .element(0) .mul( rN({ theta: 0, axis: f, outputDirection: i, mipInt: u, envMap: l, CUBEUV_TEXEL_WIDTH: c, CUBEUV_TEXEL_HEIGHT: h, CUBEUV_MAX_MIP: d, }) ) ), gR({ start: BA(1), end: t }, function (e) { var t = e.i LA(t.greaterThanEqual(o), function () { yR() }) var n = FA(s.mul(FA(t))).toVar() ;(p.addAssign( a .element(t) .mul( rN({ theta: n.mul(-1), axis: f, outputDirection: i, mipInt: u, envMap: l, CUBEUV_TEXEL_WIDTH: c, CUBEUV_TEXEL_HEIGHT: h, CUBEUV_MAX_MIP: d, }) ) ), p.addAssign( a .element(t) .mul( rN({ theta: n, axis: f, outputDirection: i, mipInt: u, envMap: l, CUBEUV_TEXEL_WIDTH: c, CUBEUV_TEXEL_HEIGHT: h, CUBEUV_MAX_MIP: d, }) ) )) }), YA(p, 1) ) }), aN = null, oN = new WeakMap() function sN(e) { var t = oN.get(e) if ((void 0 !== t ? t.pmremVersion : -1) !== e.pmremVersion) { var n = e.image if (e.isCubeTexture) { if ( !(function (e) { if (null == e) return !1 for (var t = 0, n = 6, r = 0; r < n; r++) void 0 !== e[r] && t++ return t === n })(n) ) return null t = aN.fromCubemap(e, t) } else { if ( !(function (e) { return null != e && e.height > 0 })(n) ) return null t = aN.fromEquirectangular(e, t) } ;((t.pmremVersion = e.pmremVersion), oN.set(e, t)) } return t.texture } var uN = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null ;(A(this, t), ((n = y(this, t, ['vec3']))._value = e), (n._pmrem = null), (n.uvNode = r), (n.levelNode = i), (n._generator = null)) var a = new sh() return ( (a.isRenderTargetTexture = !0), (n._texture = NE(a)), (n._width = fw(0)), (n._height = fw(0)), (n._maxMip = fw(0)), (n.updateBeforeType = _S.RENDER), n ) } return ( x(t, e), T( t, [ { key: 'value', get: function () { return this._value }, set: function (e) { ;((this._value = e), (this._pmrem = null)) }, }, { key: 'updateFromTexture', value: function (e) { var t, n, r, i = ((t = e.image.height), (n = Math.log2(t) - 2), (r = 1 / t), { texelWidth: 1 / (3 * Math.max(Math.pow(2, n), 112)), texelHeight: r, maxMip: n, }) ;((this._texture.value = e), (this._width.value = i.texelWidth), (this._height.value = i.texelHeight), (this._maxMip.value = i.maxMip)) }, }, { key: 'updateBefore', value: function () { var e = this._pmrem, t = e ? e.pmremVersion : -1, n = this._value t !== n.pmremVersion && null !== (e = !0 === n.isPMREMTexture ? n : sN(n)) && ((this._pmrem = e), this.updateFromTexture(e)) }, }, { key: 'setup', value: function (e) { ;(null === aN && (aN = e.createPMREMGenerator()), this.updateBefore(e)) var t = this.uvNode null === t && e.context.getUV && (t = e.context.getUV(this)) var n = this.value ;(e.renderer.coordinateSystem === Ec && !0 !== n.isPMREMTexture && !0 === n.isRenderTargetTexture && (t = jA(t.x.negate(), t.yz)), (t = jA(t.x, t.y.negate(), t.z))) var r = this.levelNode return ( null === r && e.context.getTextureLevel && (r = e.context.getTextureLevel(this)), tN(this._texture, t, r, this._width, this._height, this._maxMip) ) }, }, ], [ { key: 'type', get: function () { return 'PMREMNode' }, }, ] ) ) })(CS) var lN = kA(uN), cN = (function (e) { function t() { return (A(this, t), y(this, t, ['vec2'])) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = jA(yC.z, 0, yC.x.negate()).normalize(), t = yC.cross(e) return VA(e.dot(EC), t.dot(EC)).mul(0.495).add(0.5) }, }, ], [ { key: 'type', get: function () { return 'MatcapUVNode' }, }, ] ) ) })(CS), hN = RA(cN), dN = kA( (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).positionNode = e), (r.rotationNode = n), r) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.positionNode.getNodeType(e) }, }, { key: 'setup', value: function (e) { var t = this.rotationNode, n = this.positionNode if ('vec2' === this.getNodeType(e)) { var r = t.cos(), i = t.sin() return $A(r, i, i.negate(), r).mul(n) } var a = t, o = tw( YA(1, 0, 0, 0), YA(0, BT(a.x), FT(a.x).negate(), 0), YA(0, FT(a.x), BT(a.x), 0), YA(0, 0, 0, 1) ), s = tw( YA(BT(a.y), 0, FT(a.y), 0), YA(0, 1, 0, 0), YA(FT(a.y).negate(), 0, BT(a.y), 0), YA(0, 0, 0, 1) ), u = tw( YA(BT(a.z), FT(a.z).negate(), 0, 0), YA(FT(a.z), BT(a.z), 0, 0), YA(0, 0, 1, 0), YA(0, 0, 0, 1) ) return o.mul(s).mul(u).mul(YA(n, 1)).xyz }, }, ], [ { key: 'type', get: function () { return 'RotateNode' }, }, ] ) ) })(CS) ), fN = IA(function (e) { var t = e.texture, n = e.uv, r = 1e-4, i = jA().toVar() return ( LA(n.x.lessThan(r), function () { i.assign(jA(1, 0, 0)) }) .ElseIf(n.y.lessThan(r), function () { i.assign(jA(0, 1, 0)) }) .ElseIf(n.z.lessThan(r), function () { i.assign(jA(0, 0, 1)) }) .ElseIf(n.x.greaterThan(0.9999), function () { i.assign(jA(-1, 0, 0)) }) .ElseIf(n.y.greaterThan(0.9999), function () { i.assign(jA(0, -1, 0)) }) .ElseIf(n.z.greaterThan(0.9999), function () { i.assign(jA(0, 0, -1)) }) .Else(function () { var e = 0.01, r = t.sample(n.add(jA(-0.01, 0, 0))).r.sub(t.sample(n.add(jA(e, 0, 0))).r), a = t.sample(n.add(jA(0, -0.01, 0))).r.sub(t.sample(n.add(jA(0, e, 0))).r), o = t.sample(n.add(jA(0, 0, -0.01))).r.sub(t.sample(n.add(jA(0, 0, e))).r) i.assign(jA(r, a, o)) }), i.normalize() ) }), pN = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return (A(this, t), ((n = y(this, t, [e, r, i])).isTexture3DNode = !0), n) } return ( x(t, e), T( t, [ { key: 'getInputType', value: function () { return 'texture3D' }, }, { key: 'getDefaultUV', value: function () { return jA(0.5, 0.5, 0.5) }, }, { key: 'setUpdateMatrix', value: function () {} }, { key: 'setupUV', value: function (e, t) { var n = this.value return ( !e.isFlipY() || (!0 !== n.isRenderTargetTexture && !0 !== n.isFramebufferTexture) || (t = this.sampler ? t.flipY() : t.setY(BA(kE(this, this.levelNode).y).sub(t.y).sub(1))), t ) }, }, { key: 'generateUV', value: function (e, t) { return t.build(e, 'vec3') }, }, { key: 'normal', value: function (e) { return fN({ texture: this, uv: e }) }, }, ], [ { key: 'type', get: function () { return 'Texture3DNode' }, }, ] ) ) })(IE), vN = kA(pN), mN = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), ((n = y(this, t, [e, r])).isParameterNode = !0), n) } return ( x(t, e), T( t, [ { key: 'getHash', value: function () { return this.uuid }, }, { key: 'generate', value: function () { return this.name }, }, ], [ { key: 'type', get: function () { return 'ParameterNode' }, }, ] ) ) })(pw), gN = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return ( A(this, t), ((e = y(this, t)).nodes = []), (e.outputNode = null), (e.parent = n), (e._currentCond = null), (e.isStackNode = !0), e ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.outputNode ? this.outputNode.getNodeType(e) : 'void' }, }, { key: 'getMemberType', value: function (e, t) { return this.outputNode ? this.outputNode.getMemberType(e, t) : 'void' }, }, { key: 'add', value: function (e) { return (this.nodes.push(e), this) }, }, { key: 'If', value: function (e, t) { var n = new TA(t) return ((this._currentCond = NM(e, n)), this.add(this._currentCond)) }, }, { key: 'ElseIf', value: function (e, t) { var n = new TA(t), r = NM(e, n) return ((this._currentCond.elseNode = r), (this._currentCond = r), this) }, }, { key: 'Else', value: function (e) { return ((this._currentCond.elseNode = new TA(e)), this) }, }, { key: 'build', value: function (e) { var r, i = PA() NA(this) var a, o = L(this.nodes) try { for (o.s(); !(a = o.n()).done; ) { a.value.build(e, 'void') } } catch (c) { o.e(c) } finally { o.f() } NA(i) for ( var s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), l = 1; l < s; l++ ) u[l - 1] = arguments[l] return this.outputNode ? (r = this.outputNode).build.apply(r, [e].concat(u)) : n(t, 'build', this, 3)([e].concat(u)) }, }, { key: 'else', value: function () { return ( console.warn('TSL.StackNode: .else() has been renamed to .Else().'), this.Else.apply(this, arguments) ) }, }, { key: 'elseif', value: function () { return ( console.warn('TSL.StackNode: .elseif() has been renamed to .ElseIf().'), this.ElseIf.apply(this, arguments) ) }, }, ], [ { key: 'type', get: function () { return 'StackNode' }, }, ] ) ) })(TS), yN = kA(gN) var _N = (function (e) { function t(e) { var n, r, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, ['struct'])).membersLayout = ((r = e), Object.entries(r).map(function (e) { var t = C(e, 2), n = t[0], r = t[1] return 'string' == typeof r ? { name: n, type: r, atomic: !1 } : { name: n, type: r.type, atomic: r.atomic || !1 } }))), (n.name = i), (n.isStructLayoutNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'getLength', value: function () { var e, t = 0, n = L(this.membersLayout) try { for (n.s(); !(e = n.n()).done; ) { t += dS(e.value.type) } } catch (r) { n.e(r) } finally { n.f() } return t }, }, { key: 'getMemberType', value: function (e, t) { var n = this.membersLayout.find(function (e) { return e.name === t }) return n ? n.type : 'void' }, }, { key: 'getNodeType', value: function (e) { return e.getStructTypeFromNode(this, this.membersLayout, this.name).name }, }, { key: 'generate', value: function (e) { return this.getNodeType(e) }, }, ], [ { key: 'type', get: function () { return 'StructTypeNode' }, }, ] ) ) })(TS), bN = (function (e) { function t(e, n) { var r return ( A(this, t), ((r = y(this, t, ['vec3'])).structLayoutNode = e), (r.values = n), (r.isStructNode = !0), r ) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.structLayoutNode.getNodeType(e) }, }, { key: 'getMemberType', value: function (e, t) { return this.structLayoutNode.getMemberType(e, t) }, }, { key: 'generate', value: function (e) { var t = e.getVarFromNode(this), n = t.type, r = e.getPropertyName(t) return ( e.addLineFlowCode( '' .concat(r, ' = ') .concat( e.generateStruct( n, this.structLayoutNode.membersLayout, this.values ) ), this ), t.name ) }, }, ], [ { key: 'type', get: function () { return 'StructNode' }, }, ] ) ) })(TS), xN = (function (e) { function t() { var e ;(A(this, t), (e = y(this, t))) for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i] return ((e.members = r), (e.isOutputStructNode = !0), e) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { var t = e.getNodeProperties(this) if (void 0 === t.membersLayout) { for (var n = this.members, r = [], i = 0; i < n.length; i++) { var a = 'm' + i, o = n[i].getNodeType(e) r.push({ name: a, type: o, index: i }) } ;((t.membersLayout = r), (t.structType = e.getOutputStructTypeFromNode(this, t.membersLayout))) } return t.structType.name }, }, { key: 'generate', value: function (e) { for ( var t = e.getOutputStructName(), n = this.members, r = '' !== t ? t + '.' : '', i = 0; i < n.length; i++ ) { var a = n[i].build(e) e.addLineFlowCode(''.concat(r, 'm').concat(i, ' = ').concat(a), this) } return t }, }, ], [ { key: 'type', get: function () { return 'OutputStructNode' }, }, ] ) ) })(TS), SN = kA(xN) function AN(e, t) { for (var n = 0; n < e.length; n++) if (e[n].name === t) return n return -1 } var wN = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).outputNodes = e), (n.isMRTNode = !0), n) } return ( x(t, e), T( t, [ { key: 'has', value: function (e) { return void 0 !== this.outputNodes[e] }, }, { key: 'get', value: function (e) { return this.outputNodes[e] }, }, { key: 'merge', value: function (e) { var t = s(s({}, this.outputNodes), e.outputNodes) return TN(t) }, }, { key: 'setup', value: function (e) { var r = this.outputNodes, i = [], a = e.renderer.getRenderTarget().textures for (var o in r) { i[AN(a, o)] = YA(r[o]) } return ((this.members = i), n(t, 'setup', this, 3)([e])) }, }, ], [ { key: 'type', get: function () { return 'MRTNode' }, }, ] ) ) })(xN), TN = kA(wN), MN = IA(function (e) { var t = C(e, 1)[0].toUint().mul(747796405).add(2891336453), n = t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737) return n .shiftRight(22) .bitXor(n) .toFloat() .mul(1 / Math.pow(2, 32)) }), EN = function (e, t) { return dM(Jw(4, e.mul(Zw(1, e))), t) }, CN = IA(function (e) { return C(e, 1)[0].fract().sub(0.5).abs() }).setLayout({ name: 'tri', type: 'float', inputs: [{ name: 'x', type: 'float' }] }), kN = IA(function (e) { var t = C(e, 1)[0] return jA( CN(t.z.add(CN(t.y.mul(1)))), CN(t.z.add(CN(t.x.mul(1)))), CN(t.y.add(CN(t.x.mul(1)))) ) }).setLayout({ name: 'tri3', type: 'vec3', inputs: [{ name: 'p', type: 'vec3' }] }), RN = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = jA(n).toVar(), o = FA(1.4).toVar(), s = FA(0).toVar(), u = jA(a).toVar() return ( gR({ start: FA(0), end: FA(3), type: 'float', condition: '<=' }, function () { var e = jA(kN(u.mul(2))).toVar() ;(a.addAssign(e.add(i.mul(FA(0.1).mul(r)))), u.mulAssign(1.8), o.mulAssign(1.5), a.mulAssign(1.2)) var t = FA(CN(a.z.add(CN(a.x.add(CN(a.y)))))).toVar() ;(s.addAssign(t.div(o)), u.addAssign(0.14)) }), s ) }).setLayout({ name: 'triNoise3D', type: 'float', inputs: [ { name: 'position', type: 'vec3' }, { name: 'speed', type: 'float' }, { name: 'time', type: 'float' }, ], }), IN = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [] ;(A(this, t), ((e = y(this, t)).functionNodes = n)) for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++) i[a - 1] = arguments[a] return ((e.parametersNodes = i), (e._candidateFnCall = null), (e.global = !0), e) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function () { return this.functionNodes[0].shaderNode.layout.type }, }, { key: 'setup', value: function (e) { var t = this.parametersNodes, n = this._candidateFnCall if (null === n) { var r, i = null, a = -1, o = L(this.functionNodes) try { for (o.s(); !(r = o.n()).done; ) { var s = r.value, u = s.shaderNode.layout if (null === u) throw new Error( 'FunctionOverloadingNode: FunctionNode must be a layout.' ) var l = u.inputs if (t.length === l.length) { for (var c = 0, h = 0; h < t.length; h++) { var d = t[h], f = l[h] d.getNodeType(e) === f.type ? c++ : (c = 0) } c > a && ((i = s), (a = c)) } } } catch (p) { o.e(p) } finally { o.f() } this._candidateFnCall = n = i.apply(void 0, I(t)) } return n }, }, ], [ { key: 'type', get: function () { return 'FunctionOverloadingNode' }, }, ] ) ) })(TS), NN = kA(IN), PN = function (e) { return function () { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r] return NN.apply(void 0, [e].concat(n)) } }, LN = fw(0) .setGroup(cw) .onRenderUpdate(function (e) { return e.time }), DN = fw(0) .setGroup(cw) .onRenderUpdate(function (e) { return e.deltaTime }), ON = fw(0, 'uint') .setGroup(cw) .onRenderUpdate(function (e) { return e.frameId }), FN = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = void 0 === i ? VA(0.5) : i return dN(n.sub(a), r).add(a) }), BN = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = void 0 === i ? VA(0.5) : i, o = n.sub(a), s = o.dot(o), u = s.mul(s).mul(r) return n.add(o.mul(u)) }), UN = IA(function (e) { var t, n = e.position, r = void 0 === n ? null : n, i = e.horizontal, a = void 0 === i || i, o = e.vertical, s = void 0 !== o && o null !== r ? (((t = nC.toVar())[3][0] = r.x), (t[3][1] = r.y), (t[3][2] = r.z)) : (t = nC) var u = GE.mul(t) return ( AA(a) && ((u[0][0] = nC[0].length()), (u[0][1] = 0), (u[0][2] = 0)), AA(s) && ((u[1][0] = 0), (u[1][1] = nC[1].length()), (u[1][2] = 0)), (u[2][0] = 0), (u[2][1] = 0), (u[2][2] = 1), HE.mul(u).mul(fC) ) }), zN = IA(function (e) { var t = C(e, 1)[0], n = void 0 === t ? null : t, r = nI() return nI(XR(n)).sub(r).lessThan(0).select(NR, n) }), VN = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : EE(), i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : FA(0) return ( A(this, t), ((n = y(this, t, ['vec2'])).countNode = e), (n.uvNode = r), (n.frameNode = i), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = this.frameNode, t = this.uvNode, n = this.countNode, r = n.width, i = n.height, a = e.mod(r.mul(i)).floor(), o = a.mod(r), s = i.sub(a.add(1).div(r).ceil()), u = n.reciprocal(), l = VA(o, s) return t.add(l).mul(u) }, }, ], [ { key: 'type', get: function () { return 'SpriteSheetUVNode' }, }, ] ) ) })(TS), HN = kA(VN), WN = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : FA(1), o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : fC, s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : AC return ( A(this, t), ((n = y(this, t, ['vec4'])).textureXNode = e), (n.textureYNode = r), (n.textureZNode = i), (n.scaleNode = a), (n.positionNode = o), (n.normalNode = s), n ) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = this.textureXNode, t = this.textureYNode, n = this.textureZNode, r = this.scaleNode, i = this.positionNode, a = this.normalNode.abs().normalize() a = a.div(a.dot(jA(1))) var o = i.yz.mul(r), s = i.zx.mul(r), u = i.xy.mul(r), l = e.value, c = null !== t ? t.value : l, h = null !== n ? n.value : l, d = NE(l, o).mul(a.x), f = NE(c, s).mul(a.y), p = NE(h, u).mul(a.z) return Kw(d, f, p) }, }, ], [ { key: 'type', get: function () { return 'TriplanarTexturesNode' }, }, ] ) ) })(TS), GN = kA(WN), jN = new pp(), QN = new ph(), qN = new ph(), XN = new ph(), YN = new Gh(), KN = new ph(0, 0, -1), ZN = new uh(), JN = new ph(), $N = new ph(), eP = new uh(), tP = new Vc(), nP = new lh(), rP = NR.flipX() nP.depthTexture = new zp(1, 1) var iP = !1, aP = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} return ( A(this, t), ((e = y(this, t, [n.defaultTexture || nP.texture, rP]))._reflectorBaseNode = n.reflector || new oP(e, n)), (e._depthNode = null), e.setUpdateMatrix(!1), e ) } return ( x(t, e), T( t, [ { key: 'reflector', get: function () { return this._reflectorBaseNode }, }, { key: 'target', get: function () { return this._reflectorBaseNode.target }, }, { key: 'getDepthNode', value: function () { if (null === this._depthNode) { if (!0 !== this._reflectorBaseNode.depth) throw new Error( 'THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ' ) this._depthNode = MA( new t({ defaultTexture: nP.depthTexture, reflector: this._reflectorBaseNode, }) ) } return this._depthNode }, }, { key: 'setup', value: function (e) { return ( e.object.isQuadMesh || this._reflectorBaseNode.build(e), n(t, 'setup', this, 3)([e]) ) }, }, { key: 'clone', value: function () { var e = new this.constructor(this.reflectorNode) return ((e._reflectorBaseNode = this._reflectorBaseNode), e) }, }, ], [ { key: 'type', get: function () { return 'ReflectorNode' }, }, ] ) ) })(IE), oP = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} ;(A(this, t), (n = y(this, t))) var i = r.target, a = void 0 === i ? new gd() : i, o = r.resolution, s = void 0 === o ? 1 : o, u = r.generateMipmaps, l = void 0 !== u && u, c = r.bounces, h = void 0 === c || c, d = r.depth, f = void 0 !== d && d return ( (n.textureNode = e), (n.target = a), (n.resolution = s), (n.generateMipmaps = l), (n.bounces = h), (n.depth = f), (n.updateBeforeType = h ? _S.RENDER : _S.FRAME), (n.virtualCameras = new WeakMap()), (n.renderTargets = new WeakMap()), n ) } return ( x(t, e), T( t, [ { key: '_updateResolution', value: function (e, t) { var n = this.resolution ;(t.getDrawingBufferSize(tP), e.setSize(Math.round(tP.width * n), Math.round(tP.height * n))) }, }, { key: 'setup', value: function (e) { return (this._updateResolution(nP, e.renderer), n(t, 'setup', this, 3)([e])) }, }, { key: 'getVirtualCamera', value: function (e) { var t = this.virtualCameras.get(e) return (void 0 === t && ((t = e.clone()), this.virtualCameras.set(e, t)), t) }, }, { key: 'getRenderTarget', value: function (e) { var t = this.renderTargets.get(e) return ( void 0 === t && ((t = new lh(0, 0, { type: _l })), !0 === this.generateMipmaps && ((t.texture.minFilter = 1008), (t.texture.generateMipmaps = !0)), !0 === this.depth && (t.depthTexture = new zp()), this.renderTargets.set(e, t)), t ) }, }, { key: 'updateBefore', value: function (e) { if (!1 === this.bounces && iP) return !1 iP = !0 var t = e.scene, n = e.camera, r = e.renderer, i = e.material, a = this.target, o = this.getVirtualCamera(n), s = this.getRenderTarget(o) if ( (r.getDrawingBufferSize(tP), this._updateResolution(s, r), qN.setFromMatrixPosition(a.matrixWorld), XN.setFromMatrixPosition(n.matrixWorld), YN.extractRotation(a.matrixWorld), QN.set(0, 0, 1), QN.applyMatrix4(YN), JN.subVectors(qN, XN), !(JN.dot(QN) > 0)) ) { ;(JN.reflect(QN).negate(), JN.add(qN), YN.extractRotation(n.matrixWorld), KN.set(0, 0, -1), KN.applyMatrix4(YN), KN.add(XN), $N.subVectors(qN, KN), $N.reflect(QN).negate(), $N.add(qN), (o.coordinateSystem = n.coordinateSystem), o.position.copy(JN), o.up.set(0, 1, 0), o.up.applyMatrix4(YN), o.up.reflect(QN), o.lookAt($N), (o.near = n.near), (o.far = n.far), o.updateMatrixWorld(), o.projectionMatrix.copy(n.projectionMatrix), jN.setFromNormalAndCoplanarPoint(QN, qN), jN.applyMatrix4(o.matrixWorldInverse), ZN.set(jN.normal.x, jN.normal.y, jN.normal.z, jN.constant)) var u = o.projectionMatrix ;((eP.x = (Math.sign(ZN.x) + u.elements[8]) / u.elements[0]), (eP.y = (Math.sign(ZN.y) + u.elements[9]) / u.elements[5]), (eP.z = -1), (eP.w = (1 + u.elements[10]) / u.elements[14]), ZN.multiplyScalar(1 / ZN.dot(eP))) ;((u.elements[2] = ZN.x), (u.elements[6] = ZN.y), (u.elements[10] = r.coordinateSystem === Cc ? ZN.z - 0 : ZN.z + 1 - 0), (u.elements[14] = ZN.w), (this.textureNode.value = s.texture), !0 === this.depth && (this.textureNode.getDepthNode().value = s.depthTexture), (i.visible = !1)) var l = r.getRenderTarget(), c = r.getMRT(), h = r.autoClear ;(r.setMRT(null), r.setRenderTarget(s), (r.autoClear = !0), r.render(t, o), r.setMRT(c), r.setRenderTarget(l), (r.autoClear = h), (i.visible = !0), (iP = !1)) } }, }, ], [ { key: 'type', get: function () { return 'ReflectorBaseNode' }, }, ] ) ) })(TS), sP = new Lv(-1, 1, 1, -1, 0, 1), uP = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] A(this, t) var r = !1 === n ? [0, -1, 0, 1, 2, 1] : [0, 2, 0, 0, 2, 0] return ( (e = y(this, t)).setAttribute( 'position', new Kd([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3) ), e.setAttribute('uv', new Kd(r, 2)), e ) } return (x(t, e), T(t)) })(af), lP = new uP(), cP = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return (A(this, t), ((e = y(this, t, [lP, n])).camera = sP), (e.isQuadMesh = !0), e) } return ( x(t, e), T(t, [ { key: 'renderAsync', value: ((n = v( d().m(function e(t) { return d().w( function (e) { for (;;) if (0 === e.n) return e.a(2, t.renderAsync(this, sP)) }, e, this ) }) )), function (e) { return n.apply(this, arguments) }), }, { key: 'render', value: function (e) { e.render(this, sP) }, }, ]) ) var n })(gf), hP = new Vc(), dP = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { type: _l } A(this, t) var o = new lh(r, i, a) return ( ((n = y(this, t, [o.texture, EE()])).node = e), (n.width = r), (n.height = i), (n.pixelRatio = 1), (n.renderTarget = o), (n.textureNeedsUpdate = !0), (n.autoUpdate = !0), (n._rttNode = null), (n._quadMesh = new cP(new cI())), (n.updateBeforeType = _S.RENDER), n ) } return ( x(t, e), T( t, [ { key: 'autoSize', get: function () { return null === this.width }, }, { key: 'setup', value: function (e) { return ( (this._rttNode = this.node.context(e.getSharedContext())), (this._quadMesh.material.name = 'RTT'), (this._quadMesh.material.needsUpdate = !0), n(t, 'setup', this, 3)([e]) ) }, }, { key: 'setSize', value: function (e, t) { ;((this.width = e), (this.height = t)) var n = e * this.pixelRatio, r = t * this.pixelRatio ;(this.renderTarget.setSize(n, r), (this.textureNeedsUpdate = !0)) }, }, { key: 'setPixelRatio', value: function (e) { ;((this.pixelRatio = e), this.setSize(this.width, this.height)) }, }, { key: 'updateBefore', value: function (e) { var t = e.renderer if (!1 !== this.textureNeedsUpdate || !1 !== this.autoUpdate) { if (((this.textureNeedsUpdate = !1), !0 === this.autoSize)) { this.pixelRatio = t.getPixelRatio() var n = t.getSize(hP) this.setSize(n.width, n.height) } this._quadMesh.material.fragmentNode = this._rttNode var r = t.getRenderTarget() ;(t.setRenderTarget(this.renderTarget), this._quadMesh.render(t), t.setRenderTarget(r)) } }, }, { key: 'clone', value: function () { var e = new IE(this.value, this.uvNode, this.levelNode) return ((e.sampler = this.sampler), (e.referenceNode = this), e) }, }, ], [ { key: 'type', get: function () { return 'RTTNode' }, }, ] ) ) })(IE), fP = function (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 MA(g(dP, [MA(e)].concat(n))) }, pP = IA(function (e, t) { var n, r = C(e, 3), i = r[0], a = r[1], o = r[2] t.renderer.coordinateSystem === Cc ? ((i = VA(i.x, i.y.oneMinus()).mul(2).sub(1)), (n = YA(jA(i, a), 1))) : (n = YA(jA(i.x, i.y.oneMinus(), a).mul(2).sub(1), 1)) var s = YA(o.mul(n)) return s.xyz.div(s.w) }), vP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1].mul(YA(n, 1)), i = r.xy.div(r.w).mul(0.5).add(0.5).toVar() return VA(i.x, i.y.oneMinus()) }), mP = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = kE(PE(r)), o = HA(n.mul(a)).toVar(), s = PE(r, o).toVar(), u = PE(r, o.sub(HA(2, 0))).toVar(), l = PE(r, o.sub(HA(1, 0))).toVar(), c = PE(r, o.add(HA(1, 0))).toVar(), h = PE(r, o.add(HA(2, 0))).toVar(), d = PE(r, o.add(HA(0, 2))).toVar(), f = PE(r, o.add(HA(0, 1))).toVar(), p = PE(r, o.sub(HA(0, 1))).toVar(), v = PE(r, o.sub(HA(0, 2))).toVar(), m = WT(Zw(FA(2).mul(l).sub(u), s)).toVar(), g = WT(Zw(FA(2).mul(c).sub(h), s)).toVar(), y = WT(Zw(FA(2).mul(f).sub(d), s)).toVar(), _ = WT(Zw(FA(2).mul(p).sub(v), s)).toVar(), b = pP(n, s, i).toVar(), x = m .lessThan(g) .select( b.sub(pP(n.sub(VA(FA(1).div(a.x), 0)), l, i)), b.negate().add(pP(n.add(VA(FA(1).div(a.x), 0)), c, i)) ), S = y .lessThan(_) .select( b.sub(pP(n.add(VA(0, FA(1).div(a.y))), f, i)), b.negate().add(pP(n.sub(VA(0, FA(1).div(a.y))), p, i)) ) return DT(hM(x, S)) }), gP = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Float32Array return ( A(this, t), ((r = y(this, t, [ ArrayBuffer.isView(e) ? e : new i(e * n), n, ])).isStorageInstancedBufferAttribute = !0), r ) } return (x(t, e), T(t)) })(np), yP = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Float32Array return ( A(this, t), ((r = y(this, t, [ ArrayBuffer.isView(e) ? e : new i(e * n), n, ])).isStorageBufferAttribute = !0), r ) } return (x(t, e), T(t)) })(qd), _P = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [e, n])).isStorageArrayElementNode = !0), r) } return ( x(t, e), T( t, [ { key: 'storageBufferNode', get: function () { return this.node }, set: function (e) { this.node = e }, }, { key: 'getMemberType', value: function (e, t) { var n = this.storageBufferNode.structTypeNode return n ? n.getMemberType(e, t) : 'void' }, }, { key: 'setup', value: function (e) { return ( !1 === e.isAvailable('storageBuffer') && !0 === this.node.isPBO && e.setupPBO(this.node), n(t, 'setup', this, 3)([e]) ) }, }, { key: 'generate', value: function (e, r) { var i, a = e.context.assign if ( ((i = !1 === e.isAvailable('storageBuffer') ? !0 !== this.node.isPBO || !0 === a || (!this.node.value.isInstancedBufferAttribute && 'compute' === e.shaderStage) ? this.node.build(e) : e.generatePBO(this) : n(t, 'generate', this, 3)([e])), !0 !== a) ) { var o = this.getNodeType(e) i = e.format(i, o, r) } return i }, }, ], [ { key: 'type', get: function () { return 'StorageArrayElementNode' }, }, ] ) ) })(MS), bP = kA(_P), xP = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 A(this, t) var a, o = null return ( r && r.isStruct ? ((a = 'struct'), (o = r.layout)) : null === r && (e.isStorageBufferAttribute || e.isStorageInstancedBufferAttribute) ? ((a = (function (e) { return lS.get(e) })(e.itemSize)), (i = e.count)) : (a = r), ((n = y(this, t, [e, a, i])).isStorageBufferNode = !0), (n.structTypeNode = o), (n.access = bS.READ_WRITE), (n.isAtomic = !1), (n.isPBO = !1), (n._attribute = null), (n._varying = null), (n.global = !0), !0 !== e.isStorageBufferAttribute && !0 !== e.isStorageInstancedBufferAttribute && (e.isInstancedBufferAttribute ? (e.isStorageInstancedBufferAttribute = !0) : (e.isStorageBufferAttribute = !0)), n ) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { if (0 === this.bufferCount) { var t = e.globalCache.getData(this.value) return ( void 0 === t && ((t = { node: this }), e.globalCache.setData(this.value, t)), t.node.uuid ) } return this.uuid }, }, { key: 'getInputType', value: function () { return this.value.isIndirectStorageBufferAttribute ? 'indirectStorageBuffer' : 'storageBuffer' }, }, { key: 'element', value: function (e) { return bP(this, e) }, }, { key: 'setPBO', value: function (e) { return ((this.isPBO = e), this) }, }, { key: 'getPBO', value: function () { return this.isPBO }, }, { key: 'setAccess', value: function (e) { return ((this.access = e), this) }, }, { key: 'toReadOnly', value: function () { return this.setAccess(bS.READ_ONLY) }, }, { key: 'setAtomic', value: function (e) { return ((this.isAtomic = e), this) }, }, { key: 'toAtomic', value: function () { return this.setAtomic(!0) }, }, { key: 'getAttributeData', value: function () { return ( null === this._attribute && ((this._attribute = uE(this.value)), (this._varying = WM(this._attribute))), { attribute: this._attribute, varying: this._varying } ) }, }, { key: 'getNodeType', value: function (e) { return null !== this.structTypeNode ? this.structTypeNode.getNodeType(e) : e.isAvailable('storageBuffer') || e.isAvailable('indirectStorageBuffer') ? n(t, 'getNodeType', this, 3)([e]) : this.getAttributeData().attribute.getNodeType(e) }, }, { key: 'generate', value: function (e) { if ( (null !== this.structTypeNode && this.structTypeNode.build(e), e.isAvailable('storageBuffer') || e.isAvailable('indirectStorageBuffer')) ) return n(t, 'generate', this, 3)([e]) var r = this.getAttributeData(), i = r.attribute, a = r.varying.build(e) return (e.registerTransform(a, i), a) }, }, ], [ { key: 'type', get: function () { return 'StorageBufferNode' }, }, ] ) ) })(LE), SP = function (e) { return MA( new xP( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 ) ) }, AP = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0 return ( A(this, t), ((e = y(this, t, [null, 'vec4'])).isVertexColorNode = !0), (e.index = n), e ) } return ( x(t, e), T( t, [ { key: 'getAttributeName', value: function () { var e = this.index return 'color' + (e > 0 ? e : '') }, }, { key: 'generate', value: function (e) { var r = this.getAttributeName(e) return !0 === e.hasGeometryAttribute(r) ? n(t, 'generate', this, 3)([e]) : e.generateConst(this.nodeType, new uh(1, 1, 1, 1)) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.index = this.index)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.index = e.index)) }, }, ], [ { key: 'type', get: function () { return 'VertexColorNode' }, }, ] ) ) })(TE), wP = RA( (function (e) { function t() { var e return (A(this, t), ((e = y(this, t, ['vec2'])).isPointUVNode = !0), e) } return ( x(t, e), T( t, [ { key: 'generate', value: function () { return 'vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )' }, }, ], [ { key: 'type', get: function () { return 'PointUVNode' }, }, ] ) ) })(TS) ), TP = new ed(), MP = new Gh(), EP = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t.BACKGROUND_BLURRINESS, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return (A(this, t), ((e = y(this, t)).scope = n), (e.scene = r), e) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { var n, r = this.scope, i = null !== this.scene ? this.scene : e.scene return ( r === t.BACKGROUND_BLURRINESS ? (n = VC('backgroundBlurriness', 'float', i)) : r === t.BACKGROUND_INTENSITY ? (n = VC('backgroundIntensity', 'float', i)) : r === t.BACKGROUND_ROTATION ? (n = fw('mat4') .label('backgroundRotation') .setGroup(cw) .onRenderUpdate(function () { var e = i.background return ( null !== e && e.isTexture && 300 !== e.mapping ? (TP.copy(i.backgroundRotation), (TP.x *= -1), (TP.y *= -1), (TP.z *= -1), MP.makeRotationFromEuler(TP)) : MP.identity(), MP ) })) : console.error('THREE.SceneNode: Unknown scope:', r), n ) }, }, ], [ { key: 'type', get: function () { return 'SceneNode' }, }, ] ) ) })(TS) ;((EP.BACKGROUND_BLURRINESS = 'backgroundBlurriness'), (EP.BACKGROUND_INTENSITY = 'backgroundIntensity'), (EP.BACKGROUND_ROTATION = 'backgroundRotation')) var CP = RA(EP, EP.BACKGROUND_BLURRINESS), kP = RA(EP, EP.BACKGROUND_INTENSITY), RP = RA(EP, EP.BACKGROUND_ROTATION), IP = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return ( A(this, t), ((r = y(this, t, [e, n])).storeNode = i), (r.isStorageTextureNode = !0), (r.access = bS.WRITE_ONLY), r ) } return ( x(t, e), T( t, [ { key: 'getInputType', value: function () { return 'storageTexture' }, }, { key: 'setup', value: function (e) { ;(n(t, 'setup', this, 3)([e]), (e.getNodeProperties(this).storeNode = this.storeNode)) }, }, { key: 'setAccess', value: function (e) { return ((this.access = e), this) }, }, { key: 'generate', value: function (e, r) { return null !== this.storeNode ? this.generateStore(e) : n(t, 'generate', this, 3)([e, r]) }, }, { key: 'toReadWrite', value: function () { return this.setAccess(bS.READ_WRITE) }, }, { key: 'toReadOnly', value: function () { return this.setAccess(bS.READ_ONLY) }, }, { key: 'toWriteOnly', value: function () { return this.setAccess(bS.WRITE_ONLY) }, }, { key: 'generateStore', value: function (e) { var r = e.getNodeProperties(this), i = r.uvNode, a = r.storeNode, o = n(t, 'generate', this, 3)([e, 'property']), s = i.build(e, 'uvec2'), u = a.build(e, 'vec4'), l = e.generateTextureStore(e, o, s, u) e.addLineFlowCode(l, this) }, }, ], [ { key: 'type', get: function () { return 'StorageTextureNode' }, }, ] ) ) })(IE), NP = kA(IP), PP = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return (A(this, t), ((r = y(this, t, [e, n, i])).userData = i), r) } return ( x(t, e), T( t, [ { key: 'updateReference', value: function (e) { return ( (this.reference = null !== this.userData ? this.userData : e.object.userData), this.reference ) }, }, ], [ { key: 'type', get: function () { return 'UserDataNode' }, }, ] ) ) })(zC), LP = new WeakMap() function DP(e) { var t = LP.get(e) return (void 0 === t && ((t = {}), LP.set(e, t)), t) } function OP(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n = DP(e), r = n[t] return (void 0 === r && (n[t] = r = new Gh()), r) } var FP = RA( (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t, ['vec2'])).projectionMatrix = null), (e.updateType = _S.OBJECT), (e.updateAfterType = _S.OBJECT), (e.previousModelWorldMatrix = fw(new Gh())), (e.previousProjectionMatrix = fw(new Gh()).setGroup(cw)), (e.previousCameraViewMatrix = fw(new Gh())), e ) } return ( x(t, e), T( t, [ { key: 'setProjectionMatrix', value: function (e) { this.projectionMatrix = e }, }, { key: 'update', value: function (e) { var t = e.frameId, n = e.camera, r = OP(e.object) this.previousModelWorldMatrix.value.copy(r) var i = DP(n) i.frameId !== t && ((i.frameId = t), void 0 === i.previousProjectionMatrix ? ((i.previousProjectionMatrix = new Gh()), (i.previousCameraViewMatrix = new Gh()), (i.currentProjectionMatrix = new Gh()), (i.currentCameraViewMatrix = new Gh()), i.previousProjectionMatrix.copy( this.projectionMatrix || n.projectionMatrix ), i.previousCameraViewMatrix.copy(n.matrixWorldInverse)) : (i.previousProjectionMatrix.copy(i.currentProjectionMatrix), i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)), i.currentProjectionMatrix.copy( this.projectionMatrix || n.projectionMatrix ), i.currentCameraViewMatrix.copy(n.matrixWorldInverse), this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix), this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix)) }, }, { key: 'updateAfter', value: function (e) { var t = e.object OP(t).copy(t.matrixWorld) }, }, { key: 'setup', value: function () { var e = null === this.projectionMatrix ? HE : fw(this.projectionMatrix), t = this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix), n = e.mul(uC).mul(fC), r = this.previousProjectionMatrix.mul(t).mul(pC), i = n.xy.div(n.w), a = r.xy.div(r.w) return Zw(i, a) }, }, ], [ { key: 'type', get: function () { return 'VelocityNode' }, }, ] ) ) })(CS) ), BP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return rM(1, n.oneMinus().div(r)).oneMinus() }).setLayout({ name: 'blendBurn', type: 'vec3', inputs: [ { name: 'base', type: 'vec3' }, { name: 'blend', type: 'vec3' }, ], }), UP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return rM(n.div(r.oneMinus()), 1) }).setLayout({ name: 'blendDodge', type: 'vec3', inputs: [ { name: 'base', type: 'vec3' }, { name: 'blend', type: 'vec3' }, ], }), zP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return n.oneMinus().mul(r.oneMinus()).oneMinus() }).setLayout({ name: 'blendScreen', type: 'vec3', inputs: [ { name: 'base', type: 'vec3' }, { name: 'blend', type: 'vec3' }, ], }), VP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return _M( n.mul(2).mul(r), n.oneMinus().mul(2).mul(r.oneMinus()).oneMinus(), oM(0.5, n) ) }).setLayout({ name: 'blendOverlay', type: 'vec3', inputs: [ { name: 'base', type: 'vec3' }, { name: 'blend', type: 'vec3' }, ], }), HP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = r.a.add(n.a.mul(r.a.oneMinus())) return YA(r.rgb.mul(r.a).add(n.rgb.mul(n.a).mul(r.a.oneMinus())).div(i), i) }).setLayout({ name: 'blendColor', type: 'vec4', inputs: [ { name: 'base', type: 'vec4' }, { name: 'blend', type: 'vec4' }, ], }), WP = IA(function (e) { var t = C(e, 1)[0] return qP(t.rgb) }), GP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return (void 0 === r ? FA(1) : r).mix(qP(n.rgb), n.rgb) }), jP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = void 0 === r ? FA(1) : r, a = Kw(n.r, n.g, n.b).div(3), o = n.r.max(n.g.max(n.b)), s = o.sub(a).mul(i).mul(-3) return _M(n.rgb, o, s) }), QP = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = void 0 === r ? FA(1) : r, a = jA(0.57735, 0.57735, 0.57735), o = i.cos() return jA( n.rgb.mul(o).add( a .cross(n.rgb) .mul(i.sin()) .add(a.mul(cM(a, n.rgb).mul(o.oneMinus()))) ) ) }), qP = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : jA($c.getLuminanceCoefficients(new ph())) return cM(e, t) }, XP = IA(function (e) { var t = C(e, 6), n = t[0], r = t[1], i = void 0 === r ? jA(1) : r, a = t[2], o = void 0 === a ? jA(0) : a, s = t[3], u = void 0 === s ? jA(1) : s, l = t[4], c = void 0 === l ? FA(1) : l, h = t[5], d = void 0 === h ? jA($c.getLuminanceCoefficients(new ph(), bc)) : h, f = n.rgb.dot(jA(d)), p = iM(n.rgb.mul(i).add(o), 0).toVar(), v = p.pow(u).toVar() return ( LA(p.r.greaterThan(0), function () { p.r.assign(v.r) }), LA(p.g.greaterThan(0), function () { p.g.assign(v.g) }), LA(p.b.greaterThan(0), function () { p.b.assign(v.b) }), p.assign(f.add(p.sub(f).mul(c))), YA(p.rgb, n.a) ) }), YP = kA( (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t)).sourceNode = e), (r.stepsNode = n), r) } return ( x(t, e), T( t, [ { key: 'setup', value: function () { var e = this.sourceNode, t = this.stepsNode return e.mul(t).floor().div(t) }, }, ], [ { key: 'type', get: function () { return 'PosterizeNode' }, }, ] ) ) })(CS) ), KP = new Vc(), ZP = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [n])).passNode = e), r.setUpdateMatrix(!1), r) } return ( x(t, e), T( t, [ { key: 'setup', value: function (e) { return ( e.object.isQuadMesh && this.passNode.build(e), n(t, 'setup', this, 3)([e]) ) }, }, { key: 'clone', value: function () { return new this.constructor(this.passNode, this.value) }, }, ], [ { key: 'type', get: function () { return 'PassTextureNode' }, }, ] ) ) })(IE), JP = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] return ( A(this, t), ((r = y(this, t, [e, null])).textureName = n), (r.previousTexture = i), r ) } return ( x(t, e), T( t, [ { key: 'updateTexture', value: function () { this.value = this.previousTexture ? this.passNode.getPreviousTexture(this.textureName) : this.passNode.getTexture(this.textureName) }, }, { key: 'setup', value: function (e) { return (this.updateTexture(), n(t, 'setup', this, 3)([e])) }, }, { key: 'clone', value: function () { return new this.constructor( this.passNode, this.textureName, this.previousTexture ) }, }, ], [ { key: 'type', get: function () { return 'PassMultipleTextureNode' }, }, ] ) ) })(ZP), $P = (function (e) { function t(e, n, r) { var i, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {} ;(A(this, t), ((i = y(this, t, ['vec4'])).scope = e), (i.scene = n), (i.camera = r), (i.options = a), (i._pixelRatio = 1), (i._width = 1), (i._height = 1)) var o = new zp() ;((o.isRenderTargetTexture = !0), (o.name = 'depth')) var u = new lh( i._width * i._pixelRatio, i._height * i._pixelRatio, s({ type: _l }, a) ) return ( (u.texture.name = 'output'), (u.depthTexture = o), (i.renderTarget = u), (i._textures = { output: u.texture, depth: o }), (i._textureNodes = {}), (i._linearDepthNodes = {}), (i._viewZNodes = {}), (i._previousTextures = {}), (i._previousTextureNodes = {}), (i._cameraNear = fw(0)), (i._cameraFar = fw(0)), (i._mrt = null), (i.isPassNode = !0), (i.updateBeforeType = _S.FRAME), i ) } return ( x(t, e), T( t, [ { key: 'setMRT', value: function (e) { return ((this._mrt = e), this) }, }, { key: 'getMRT', value: function () { return this._mrt }, }, { key: 'isGlobal', value: function () { return !0 }, }, { key: 'getTexture', value: function (e) { var t = this._textures[e] void 0 === t && (((t = this.renderTarget.texture.clone()).name = e), (this._textures[e] = t), this.renderTarget.textures.push(t)) return t }, }, { key: 'getPreviousTexture', value: function (e) { var t = this._previousTextures[e] return ( void 0 === t && ((t = this.getTexture(e).clone()), (this._previousTextures[e] = t)), t ) }, }, { key: 'toggleTexture', value: function (e) { var t = this._previousTextures[e] if (void 0 !== t) { var n = this._textures[e], r = this.renderTarget.textures.indexOf(n) ;((this.renderTarget.textures[r] = t), (this._textures[e] = t), (this._previousTextures[e] = n), this._textureNodes[e].updateTexture(), this._previousTextureNodes[e].updateTexture()) } }, }, { key: 'getTextureNode', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'output', t = this._textureNodes[e] return ( void 0 === t && ((t = MA(new JP(this, e))).updateTexture(), (this._textureNodes[e] = t)), t ) }, }, { key: 'getPreviousTextureNode', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'output', t = this._previousTextureNodes[e] return ( void 0 === t && (void 0 === this._textureNodes[e] && this.getTextureNode(e), (t = MA(new JP(this, e, !0))).updateTexture(), (this._previousTextureNodes[e] = t)), t ) }, }, { key: 'getViewZNode', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'depth', t = this._viewZNodes[e] if (void 0 === t) { var n = this._cameraNear, r = this._cameraFar this._viewZNodes[e] = t = JR(this.getTextureNode(e), n, r) } return t }, }, { key: 'getLinearDepthNode', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'depth', t = this._linearDepthNodes[e] if (void 0 === t) { var n = this._cameraNear, r = this._cameraFar, i = this.getViewZNode(e) this._linearDepthNodes[e] = t = KR(i, n, r) } return t }, }, { key: 'setup', value: function (e) { var n = e.renderer return ( (this.renderTarget.samples = void 0 === this.options.samples ? n.samples : this.options.samples), !0 === n.backend.isWebGLBackend && (this.renderTarget.samples = 0), (this.renderTarget.texture.type = n.getColorBufferType()), this.scope === t.COLOR ? this.getTextureNode() : this.getLinearDepthNode() ) }, }, { key: 'updateBefore', value: function (e) { var t = e.renderer, n = this.scene, r = this.camera this._pixelRatio = t.getPixelRatio() var i = t.getSize(KP) this.setSize(i.width, i.height) var a = t.getRenderTarget(), o = t.getMRT() for (var s in ((this._cameraNear.value = r.near), (this._cameraFar.value = r.far), this._previousTextures)) this.toggleTexture(s) ;(t.setRenderTarget(this.renderTarget), t.setMRT(this._mrt), t.render(n, r), t.setRenderTarget(a), t.setMRT(o)) }, }, { key: 'setSize', value: function (e, t) { ;((this._width = e), (this._height = t)) var n = this._width * this._pixelRatio, r = this._height * this._pixelRatio this.renderTarget.setSize(n, r) }, }, { key: 'setPixelRatio', value: function (e) { ;((this._pixelRatio = e), this.setSize(this._width, this._height)) }, }, { key: 'dispose', value: function () { this.renderTarget.dispose() }, }, ], [ { key: 'type', get: function () { return 'PassNode' }, }, ] ) ) })(CS) ;(($P.COLOR = 'color'), ($P.DEPTH = 'depth')) var eL = (function (e) { function t(e, n, r, i, a) { var o return ( A(this, t), ((o = y(this, t, [$P.COLOR, e, n])).colorNode = r), (o.thicknessNode = i), (o.alphaNode = a), (o._materialCache = new WeakMap()), o ) } return ( x(t, e), T( t, [ { key: 'updateBefore', value: function (e) { var r = this, i = e.renderer, a = i.getRenderObjectFunction() ;(i.setRenderObjectFunction(function (e, t, n, a, o, s, u, l) { if ( (o.isMeshToonMaterial || o.isMeshToonNodeMaterial) && !1 === o.wireframe ) { var c = r._getOutlineMaterial(o) i.renderObject(e, t, n, a, c, s, u, l) } i.renderObject(e, t, n, a, o, s, u, l) }), n(t, 'updateBefore', this, 3)([e]), i.setRenderObjectFunction(a)) }, }, { key: '_createMaterial', value: function () { var e = new cI() ;((e.isMeshToonOutlineMaterial = !0), (e.name = 'Toon_Outline'), (e.side = 1)) var t = AC.negate(), n = HE.mul(uC), r = FA(1), i = n.mul(YA(fC, 1)), a = n.mul(YA(fC.add(t), 1)), o = DT(i.sub(a)) return ( (e.vertexNode = i.add(o.mul(this.thicknessNode).mul(i.w).mul(r))), (e.colorNode = YA(this.colorNode, this.alphaNode)), e ) }, }, { key: '_getOutlineMaterial', value: function (e) { var t = this._materialCache.get(e) return ( void 0 === t && ((t = this._createMaterial()), this._materialCache.set(e, t)), t ) }, }, ], [ { key: 'type', get: function () { return 'ToonOutlinePassNode' }, }, ] ) ) })($P), tL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return n.mul(r).clamp() }).setLayout({ name: 'linearToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), nL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return (n = n.mul(r)).div(n.add(1)).clamp() }).setLayout({ name: 'reinhardToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), rL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = (n = (n = n.mul(r)).sub(0.004).max(0)).mul(n.mul(6.2).add(0.5)), a = n.mul(n.mul(6.2).add(1.7)).add(0.06) return i.div(a).pow(2.2) }).setLayout({ name: 'cineonToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), iL = IA(function (e) { var t = C(e, 1)[0], n = t.mul(t.add(0.0245786)).sub(90537e-9), r = t.mul(t.add(0.432951).mul(0.983729)).add(0.238081) return n.div(r) }), aL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = ew( 0.59719, 0.35458, 0.04823, 0.076, 0.90834, 0.01566, 0.0284, 0.13383, 0.83777 ), a = ew( 1.60475, -0.53108, -0.07367, -0.10208, 1.10813, -0.00605, -0.00327, -0.07276, 1.07602 ) return ((n = n.mul(r).div(0.6)), (n = i.mul(n)), (n = iL(n)), (n = a.mul(n)).clamp()) }).setLayout({ name: 'acesFilmicToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), oL = ew( jA(1.6605, -0.1246, -0.0182), jA(-0.5876, 1.1329, -0.1006), jA(-0.0728, -0.0083, 1.1187) ), sL = ew( jA(0.6274, 0.0691, 0.0164), jA(0.3293, 0.9195, 0.088), jA(0.0433, 0.0113, 0.8956) ), uL = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = jA(n.mul(n)).toVar(), i = jA(r.mul(r)).toVar() return FA(15.5) .mul(i.mul(r)) .sub(Jw(40.14, i.mul(n))) .add( Jw(31.96, i) .sub(Jw(6.868, r.mul(n))) .add(Jw(0.4298, r).add(Jw(0.1191, n).sub(0.00232))) ) }), lL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = jA(n).toVar(), a = ew( jA(0.856627153315983, 0.137318972929847, 0.11189821299995), jA(0.0951212405381588, 0.761241990602591, 0.0767994186031903), jA(0.0482516061458583, 0.101439036467562, 0.811302368396859) ), o = ew( jA(1.1271005818144368, -0.1413297634984383, -0.14132976349843826), jA(-0.11060664309660323, 1.157823702216272, -0.11060664309660294), jA(-0.016493938717834573, -0.016493938717834257, 1.2519364065950405) ), s = FA(-12.47393), u = FA(4.026069) return ( i.mulAssign(r), i.assign(sL.mul(i)), i.assign(a.mul(i)), i.assign(iM(i, 1e-10)), i.assign(RT(i)), i.assign(i.sub(s).div(u.sub(s))), i.assign(bM(i, 0, 1)), i.assign(uL(i)), i.assign(o.mul(i)), i.assign(dM(iM(jA(0), i), jA(2.2))), i.assign(oL.mul(i)), i.assign(bM(i, 0, 1)), i ) }).setLayout({ name: 'agxToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), cL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = FA(0.76), a = FA(0.15) n = n.mul(r) var o = rM(n.r, rM(n.g, n.b)), s = NM(o.lessThan(0.08), o.sub(Jw(6.25, o.mul(o))), 0.04) n.subAssign(s) var u = iM(n.r, iM(n.g, n.b)) LA(u.lessThan(i), function () { return n }) var l = Zw(1, i), c = Zw(1, l.mul(l).div(u.add(l.sub(i)))) n.mulAssign(c.div(u)) var h = Zw(1, $w(1, a.mul(u.sub(c)).add(1))) return _M(n, jA(c), h) }).setLayout({ name: 'neutralToneMapping', type: 'vec3', inputs: [ { name: 'color', type: 'vec3' }, { name: 'exposure', type: 'float' }, ], }), hL = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '', r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '' return ( A(this, t), ((e = y(this, t, ['code'])).isCodeNode = !0), (e.code = n), (e.includes = r), (e.language = i), e ) } return ( x(t, e), T( t, [ { key: 'isGlobal', value: function () { return !0 }, }, { key: 'setIncludes', value: function (e) { return ((this.includes = e), this) }, }, { key: 'getIncludes', value: function () { return this.includes }, }, { key: 'generate', value: function (e) { var t, n = L(this.getIncludes(e)) try { for (n.s(); !(t = n.n()).done; ) { t.value.build(e) } } catch (i) { n.e(i) } finally { n.f() } var r = e.getCodeFromNode(this, this.getNodeType(e)) return ((r.code = this.code), r.code) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.code = this.code), (e.language = this.language)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.code = e.code), (this.language = e.language)) }, }, ], [ { key: 'type', get: function () { return 'CodeNode' }, }, ] ) ) })(TS), dL = kA(hL), fL = (function (e) { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '', n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '' return (A(this, t), y(this, t, [e, n, r])) } return ( x(t, e), T( t, [ { key: 'getNodeType', value: function (e) { return this.getNodeFunction(e).type }, }, { key: 'getInputs', value: function (e) { return this.getNodeFunction(e).inputs }, }, { key: 'getNodeFunction', value: function (e) { var t = e.getDataFromNode(this), n = t.nodeFunction return ( void 0 === n && ((n = e.parser.parseFunction(this.code)), (t.nodeFunction = n)), n ) }, }, { key: 'generate', value: function (e, r) { n(t, 'generate', this, 3)([e]) var i = this.getNodeFunction(e), a = i.name, o = i.type, s = e.getCodeFromNode(this, o) '' !== a && (s.name = a) var u = e.getPropertyName(s), l = this.getNodeFunction(e).getCode(u) return ( (s.code = l + '\n'), 'property' === r ? u : e.format(''.concat(u, '()'), o, r) ) }, }, ], [ { key: 'type', get: function () { return 'FunctionNode' }, }, ] ) ) })(hL), pL = function (e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '', r = 0; r < t.length; r++ ) { var i = t[r] 'function' == typeof i && (t[r] = i.functionNode) } var a = MA(new fL(e, t, n)), o = function () { return a.call.apply(a, arguments) } return ((o.functionNode = a), o) }, vL = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null return ( A(this, t), ((e = y(this, t))._value = n), (e._cache = null), (e.inputType = null), (e.outputType = null), (e.events = new kc()), (e.isScriptableValueNode = !0), e ) } return ( x(t, e), T( t, [ { key: 'isScriptableOutputNode', get: function () { return null !== this.outputType }, }, { key: 'value', get: function () { return this._value }, set: function (e) { this._value !== e && (this._cache && 'URL' === this.inputType && this.value.value instanceof ArrayBuffer && (URL.revokeObjectURL(this._cache), (this._cache = null)), (this._value = e), this.events.dispatchEvent({ type: 'change' }), this.refresh()) }, }, { key: 'refresh', value: function () { this.events.dispatchEvent({ type: 'refresh' }) }, }, { key: 'getValue', value: function () { var e = this.value if ( e && null === this._cache && 'URL' === this.inputType && e.value instanceof ArrayBuffer ) this._cache = URL.createObjectURL(new Blob([e.value])) else if ( e && null !== e.value && void 0 !== e.value && ((('URL' === this.inputType || 'String' === this.inputType) && 'string' == typeof e.value) || ('Number' === this.inputType && 'number' == typeof e.value) || ('Vector2' === this.inputType && e.value.isVector2) || ('Vector3' === this.inputType && e.value.isVector3) || ('Vector4' === this.inputType && e.value.isVector4) || ('Color' === this.inputType && e.value.isColor) || ('Matrix3' === this.inputType && e.value.isMatrix3) || ('Matrix4' === this.inputType && e.value.isMatrix4)) ) return e.value return this._cache || e }, }, { key: 'getNodeType', value: function (e) { return this.value && this.value.isNode ? this.value.getNodeType(e) : 'float' }, }, { key: 'setup', value: function () { return this.value && this.value.isNode ? this.value : FA() }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), null !== this.value ? 'ArrayBuffer' === this.inputType ? (e.value = mS(this.value)) : (e.value = this.value ? this.value.toJSON(e.meta).uuid : null) : (e.value = null), (e.inputType = this.inputType), (e.outputType = this.outputType)) }, }, { key: 'deserialize', value: function (e) { n(t, 'deserialize', this, 3)([e]) var r = null ;(null !== e.value && (r = 'ArrayBuffer' === e.inputType ? gS(e.value) : 'Texture' === e.inputType ? e.meta.textures[e.value] : e.meta.nodes[e.value] || null), (this.value = r), (this.inputType = e.inputType), (this.outputType = e.outputType)) }, }, ], [ { key: 'type', get: function () { return 'ScriptableValueNode' }, }, ] ) ) })(TS), mL = kA(vL), gL = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return ( x(t, e), T(t, [ { key: 'get', value: function (e) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null if (this.has(e)) return n(t, 'get', this, 3)([e]) if (null !== r) { for ( var i = arguments.length, a = new Array(i > 2 ? i - 2 : 0), o = 2; o < i; o++ ) a[o - 2] = arguments[o] var s = r.apply(void 0, a) return (this.set(e, s), s) } }, }, ]) ) })(m(Map)), yL = (function () { return T( function e(t) { ;(A(this, e), (this.scriptableNode = t)) }, [ { key: 'parameters', get: function () { return this.scriptableNode.parameters }, }, { key: 'layout', get: function () { return this.scriptableNode.getLayout() }, }, { key: 'getInputLayout', value: function (e) { return this.scriptableNode.getInputLayout(e) }, }, { key: 'get', value: function (e) { var t = this.parameters[e] return t ? t.getValue() : null }, }, ] ) })(), _L = new gL(), bL = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return ( A(this, t), ((e = y(this, t)).codeNode = n), (e.parameters = r), (e._local = new gL()), (e._output = mL()), (e._outputs = {}), (e._source = e.source), (e._method = null), (e._object = null), (e._value = null), (e._needsOutputUpdate = !0), (e.onRefresh = e.onRefresh.bind(e)), (e.isScriptableNode = !0), e ) } return ( x(t, e), T( t, [ { key: 'source', get: function () { return this.codeNode ? this.codeNode.code : '' }, }, { key: 'setLocal', value: function (e, t) { return this._local.set(e, t) }, }, { key: 'getLocal', value: function (e) { return this._local.get(e) }, }, { key: 'onRefresh', value: function () { this._refresh() }, }, { key: 'getInputLayout', value: function (e) { var t, n = L(this.getLayout()) try { for (n.s(); !(t = n.n()).done; ) { var r = t.value if (r.inputType && (r.id === e || r.name === e)) return r } } catch (i) { n.e(i) } finally { n.f() } }, }, { key: 'getOutputLayout', value: function (e) { var t, n = L(this.getLayout()) try { for (n.s(); !(t = n.n()).done; ) { var r = t.value if (r.outputType && (r.id === e || r.name === e)) return r } } catch (i) { n.e(i) } finally { n.f() } }, }, { key: 'setOutput', value: function (e, t) { var n = this._outputs return (void 0 === n[e] ? (n[e] = mL(t)) : (n[e].value = t), this) }, }, { key: 'getOutput', value: function (e) { return this._outputs[e] }, }, { key: 'getParameter', value: function (e) { return this.parameters[e] }, }, { key: 'setParameter', value: function (e, t) { var n = this.parameters return ( t && t.isScriptableNode ? (this.deleteParameter(e), (n[e] = t), n[e] .getDefaultOutput() .events.addEventListener('refresh', this.onRefresh)) : t && t.isScriptableValueNode ? (this.deleteParameter(e), (n[e] = t), n[e].events.addEventListener('refresh', this.onRefresh)) : void 0 === n[e] ? ((n[e] = mL(t)), n[e].events.addEventListener('refresh', this.onRefresh)) : (n[e].value = t), this ) }, }, { key: 'getValue', value: function () { return this.getDefaultOutput().getValue() }, }, { key: 'deleteParameter', value: function (e) { var t = this.parameters[e] return ( t && (t.isScriptableNode && (t = t.getDefaultOutput()), t.events.removeEventListener('refresh', this.onRefresh)), this ) }, }, { key: 'clearParameters', value: function () { for (var e = 0, t = Object.keys(this.parameters); e < t.length; e++) { var n = t[e] this.deleteParameter(n) } return ((this.needsUpdate = !0), this) }, }, { key: 'call', value: function (e) { var t = this.getObject()[e] if ('function' == typeof t) { for ( var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++ ) r[i - 1] = arguments[i] return t.apply(void 0, r) } }, }, { key: 'callAsync', value: ((r = v( d().m(function e(t) { var n, r, i, a, o, s, u = arguments return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((n = this.getObject()), 'function' != typeof (r = n[t])) ) { e.n = 4 break } for ( i = u.length, a = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++ ) a[o - 1] = u[o] if ('AsyncFunction' !== r.constructor.name) { e.n = 2 break } return ((e.n = 1), r.apply(void 0, a)) case 1: ;((s = e.v), (e.n = 3)) break case 2: s = r.apply(void 0, a) case 3: return e.a(2, s) case 4: return e.a(2) } }, e, this ) }) )), function (e) { return r.apply(this, arguments) }), }, { key: 'getNodeType', value: function (e) { return this.getDefaultOutputNode().getNodeType(e) }, }, { key: 'refresh', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null null !== e ? this.getOutput(e).refresh() : this._refresh() }, }, { key: 'getObject', value: function () { var e = this if ((this.needsUpdate && this.dispose(), null !== this._object)) return this._object var t = new yL(this), n = _L.get('THREE'), r = _L.get('TSL'), i = this.getMethod(), a = [ t, this._local, _L, function () { return e.refresh() }, function (t, n) { return e.setOutput(t, n) }, n, r, ] this._object = i.apply(void 0, a) var o = this._object.layout if ( o && (!1 === o.cache && this._local.clear(), (this._output.outputType = o.outputType || null), Array.isArray(o.elements)) ) { var s, u = L(o.elements) try { for (u.s(); !(s = u.n()).done; ) { var l = s.value, c = l.id || l.name ;(l.inputType && (void 0 === this.getParameter(c) && this.setParameter(c, null), (this.getParameter(c).inputType = l.inputType)), l.outputType && (void 0 === this.getOutput(c) && this.setOutput(c, null), (this.getOutput(c).outputType = l.outputType))) } } catch (h) { u.e(h) } finally { u.f() } } return this._object }, }, { key: 'deserialize', value: function (e) { for (var r in (n(t, 'deserialize', this, 3)([e]), this.parameters)) { var i = this.parameters[r] ;(i.isScriptableNode && (i = i.getDefaultOutput()), i.events.addEventListener('refresh', this.onRefresh)) } }, }, { key: 'getLayout', value: function () { return this.getObject().layout }, }, { key: 'getDefaultOutputNode', value: function () { var e = this.getDefaultOutput().value return e && e.isNode ? e : FA() }, }, { key: 'getDefaultOutput', value: function () { return this._exec()._output }, }, { key: 'getMethod', value: function () { if ((this.needsUpdate && this.dispose(), null !== this._method)) return this._method var e = ['layout', 'init', 'main', 'dispose'].join(', '), t = '\nreturn { ...output, ' + e + ' };', n = 'var ' + e + '; var output = {};\n' + this.codeNode.code + t return ( (this._method = g( Function, [ 'parameters', 'local', 'global', 'refresh', 'setOutput', 'THREE', 'TSL', ].concat([n]) )), this._method ) }, }, { key: 'dispose', value: function () { null !== this._method && (this._object && 'function' == typeof this._object.dispose && this._object.dispose(), (this._method = null), (this._object = null), (this._source = null), (this._value = null), (this._needsOutputUpdate = !0), (this._output.value = null), (this._outputs = {})) }, }, { key: 'setup', value: function () { return this.getDefaultOutputNode() }, }, { key: 'getCacheKey', value: function (e) { var t, n = [ ((t = this.source), iS(t)), this.getDefaultOutputNode().getCacheKey(e), ] for (var r in this.parameters) n.push(this.parameters[r].getCacheKey(e)) return aS(n) }, }, { key: 'needsUpdate', get: function () { return this.source !== this._source }, set: function (e) { !0 === e && this.dispose() }, }, { key: '_exec', value: function () { return ( null === this.codeNode || (!0 === this._needsOutputUpdate && ((this._value = this.call('main')), (this._needsOutputUpdate = !1)), (this._output.value = this._value)), this ) }, }, { key: '_refresh', value: function () { ;((this.needsUpdate = !0), this._exec(), this._output.refresh()) }, }, ], [ { key: 'type', get: function () { return 'ScriptableNode' }, }, ] ) ) var r })(TS), xL = kA(bL) function SL(e) { var t, n = e.context.getViewZ return (void 0 !== n && (t = n(this)), (t || gC.z).negate()) } var AL = IA(function (e, t) { var n = C(e, 2), r = n[0], i = n[1], a = SL(t) return AM(r, i, a) }), wL = IA(function (e, t) { var n = C(e, 1)[0], r = SL(t) return n.mul(n, r, r).negate().exp().oneMinus() }), TL = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1] return YA(r.toFloat().mix(Dw.rgb, n.toVec3()), Dw.a) }) var ML = null, EL = null, CL = (function (e) { function t() { var e, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : FA(), r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : FA() return (A(this, t), ((e = y(this, t)).minNode = n), (e.maxNode = r), e) } return ( x(t, e), T( t, [ { key: 'getVectorLength', value: function (e) { var t = e.getTypeLength(fS(this.minNode.value)), n = e.getTypeLength(fS(this.maxNode.value)) return t > n ? t : n }, }, { key: 'getNodeType', value: function (e) { return e.object.count > 1 ? e.getTypeFromLength(this.getVectorLength(e)) : 'float' }, }, { key: 'setup', value: function (e) { var t = e.object, n = null if (t.count > 1) { var r = this.minNode.value, i = this.maxNode.value, a = e.getTypeLength(fS(r)), o = e.getTypeLength(fS(i)) ;((ML = ML || new uh()), (EL = EL || new uh()), ML.setScalar(0), EL.setScalar(0), 1 === a ? ML.setScalar(r) : r.isColor ? ML.set(r.r, r.g, r.b, 1) : ML.set(r.x, r.y, r.z || 0, r.w || 0), 1 === o ? EL.setScalar(i) : i.isColor ? EL.set(i.r, i.g, i.b, 1) : EL.set(i.x, i.y, i.z || 0, i.w || 0)) for (var s = 4 * t.count, u = new Float32Array(s), l = 0; l < s; l++) { var c = l % 4, h = ML.getComponent(c), d = EL.getComponent(c) u[l] = zc.lerp(h, d, Math.random()) } var f = this.getNodeType(e) if (t.count <= 4096) n = DE(u, 'vec4', t.count).element(rR).convert(f) else { var p = new np(u, 4) ;(e.geometry.setAttribute('__range' + this.id, p), (n = cE(p).convert(f))) } } else n = FA(0) return n }, }, ], [ { key: 'type', get: function () { return 'RangeNode' }, }, ] ) ) })(TS), kL = kA(CL), RL = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [n]))._builtinName = e), r) } return ( x(t, e), T( t, [ { key: 'getHash', value: function (e) { return this.getBuiltinName(e) }, }, { key: 'getNodeType', value: function () { return this.nodeType }, }, { key: 'setBuiltinName', value: function (e) { return ((this._builtinName = e), this) }, }, { key: 'getBuiltinName', value: function () { return this._builtinName }, }, { key: 'hasBuiltin', value: function (e) { e.hasBuiltin(this._builtinName) }, }, { key: 'generate', value: function (e, t) { var n = this.getBuiltinName(e), r = this.getNodeType(e) return 'compute' === e.shaderStage ? e.format(n, r, t) : (console.warn( 'ComputeBuiltinNode: Compute built-in value ' .concat(n, ' can not be accessed in the ') .concat(e.shaderStage, ' stage') ), e.generateConst(r)) }, }, { key: 'serialize', value: function (e) { ;(n(t, 'serialize', this, 3)([e]), (e.global = this.global), (e._builtinName = this._builtinName)) }, }, { key: 'deserialize', value: function (e) { ;(n(t, 'deserialize', this, 3)([e]), (this.global = e.global), (this._builtinName = e._builtinName)) }, }, ], [ { key: 'type', get: function () { return 'ComputeBuiltinNode' }, }, ] ) ) })(TS), IL = function (e, t) { return MA(new RL(e, t)) }, NL = IL('numWorkgroups', 'uvec3'), PL = IL('workgroupId', 'uvec3'), LL = IL('globalId', 'uvec3'), DL = IL('localId', 'uvec3'), OL = IL('subgroupSize', 'uint'), FL = (function (e) { function t(e) { var n return (A(this, t), ((n = y(this, t)).scope = e), n) } return ( x(t, e), T(t, [ { key: 'generate', value: function (e) { var t = this.scope !0 === e.renderer.backend.isWebGLBackend ? e.addFlowCode('\t// '.concat(t, 'Barrier \n')) : e.addLineFlowCode(''.concat(t, 'Barrier()'), this) }, }, ]) ) })(TS), BL = kA(FL), UL = (function (e) { function t(e, n) { var r return (A(this, t), ((r = y(this, t, [e, n])).isWorkgroupInfoElementNode = !0), r) } return ( x(t, e), T(t, [ { key: 'generate', value: function (e, r) { var i, a = e.context.assign if (((i = n(t, 'generate', this, 3)([e])), !0 !== a)) { var o = this.getNodeType(e) i = e.format(i, o, r) } return i }, }, ]) ) })(MS), zL = (function (e) { function t(e, n) { var r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return ( A(this, t), ((r = y(this, t, [n])).bufferType = n), (r.bufferCount = i), (r.isWorkgroupInfoNode = !0), (r.elementType = n), (r.scope = e), r ) } return ( x(t, e), T(t, [ { key: 'label', value: function (e) { return ((this.name = e), this) }, }, { key: 'setScope', value: function (e) { return ((this.scope = e), this) }, }, { key: 'getElementType', value: function () { return this.elementType }, }, { key: 'getInputType', value: function () { return ''.concat(this.scope, 'Array') }, }, { key: 'element', value: function (e) { return MA(new UL(this, e)) }, }, { key: 'generate', value: function (e) { return e.getScopedArray( this.name || ''.concat(this.scope, 'Array_').concat(this.id), this.scope.toLowerCase(), this.bufferType, this.bufferCount ) }, }, ]) ) })(TS), VL = (function (e) { function t(e, n, r) { var i, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null return ( A(this, t), ((i = y(this, t, ['uint'])).method = e), (i.pointerNode = n), (i.valueNode = r), (i.storeNode = a), i ) } return ( x(t, e), T( t, [ { key: 'getInputType', value: function (e) { return this.pointerNode.getNodeType(e) }, }, { key: 'getNodeType', value: function (e) { return this.getInputType(e) }, }, { key: 'generate', value: function (e) { var t = this.method, n = this.getNodeType(e), r = this.getInputType(e), i = this.pointerNode, a = this.valueNode, o = [] ;(o.push('&'.concat(i.build(e, r))), null !== a && o.push(a.build(e, r))) var s = ''.concat(e.getMethod(t, n), '( ').concat(o.join(', '), ' )') if (null !== this.storeNode) { var u = this.storeNode.build(e, r) e.addLineFlowCode(''.concat(u, ' = ').concat(s), this) } else e.addLineFlowCode(s, this) }, }, ], [ { key: 'type', get: function () { return 'AtomicFunctionNode' }, }, ] ) ) })(CS) ;((VL.ATOMIC_LOAD = 'atomicLoad'), (VL.ATOMIC_STORE = 'atomicStore'), (VL.ATOMIC_ADD = 'atomicAdd'), (VL.ATOMIC_SUB = 'atomicSub'), (VL.ATOMIC_MAX = 'atomicMax'), (VL.ATOMIC_MIN = 'atomicMin'), (VL.ATOMIC_AND = 'atomicAnd'), (VL.ATOMIC_OR = 'atomicOr'), (VL.ATOMIC_XOR = 'atomicXor')) var HL, WL = kA(VL), GL = function (e, t, n) { var r = WL( e, t, n, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null ) return (r.append(), r) } function jL(e) { var t = (HL = HL || new WeakMap()).get(e) return (void 0 === t && HL.set(e, (t = {})), t) } function QL(e) { var t = jL(e) return ( t.shadowMatrix || (t.shadowMatrix = fw('mat4') .setGroup(cw) .onRenderUpdate(function () { return (!0 !== e.castShadow && e.shadow.updateMatrices(e), e.shadow.matrix) })) ) } function qL(e) { var t = jL(e) return ( t.position || (t.position = fw(new ph()) .setGroup(cw) .onRenderUpdate(function (t, n) { return n.value.setFromMatrixPosition(e.matrixWorld) })) ) } function XL(e) { var t = jL(e) return ( t.targetPosition || (t.targetPosition = fw(new ph()) .setGroup(cw) .onRenderUpdate(function (t, n) { return n.value.setFromMatrixPosition(e.target.matrixWorld) })) ) } var YL = function (e, t) { var n, r = L(t) try { for (r.s(); !(n = r.n()).done; ) { var i = n.value if (i.isAnalyticLightNode && i.light.id === e) return i } } catch (a) { r.e(a) } finally { r.f() } return null }, KL = new WeakMap(), ZL = (function (e) { function t() { var e return ( A(this, t), ((e = y(this, t, ['vec3'])).totalDiffuseNode = jA().toVar('totalDiffuse')), (e.totalSpecularNode = jA().toVar('totalSpecular')), (e.outgoingLightNode = jA().toVar('outgoingLight')), (e._lights = []), (e._lightNodes = null), (e._lightNodesHash = null), (e.global = !0), e ) } return ( x(t, e), T( t, [ { key: 'customCacheKey', value: function () { for (var e = [], t = this._lights, n = 0; n < t.length; n++) e.push(t[n].id) return aS(e) }, }, { key: 'getHash', value: function (e) { if (null === this._lightNodesHash) { null === this._lightNodes && this.setupLightsNode(e) var t, n = [], r = L(this._lightNodes) try { for (r.s(); !(t = r.n()).done; ) { var i = t.value n.push(i.getSelf().getHash()) } } catch (a) { r.e(a) } finally { r.f() } this._lightNodesHash = 'lights-' + n.join(',') } return this._lightNodesHash }, }, { key: 'analyze', value: function (e) { var t, n = L(e.getDataFromNode(this).nodes) try { for (n.s(); !(t = n.n()).done; ) { t.value.build(e) } } catch (r) { n.e(r) } finally { n.f() } }, }, { key: 'setupLightsNode', value: function (e) { var t, n = [], r = this._lightNodes, i = (function (e) { return e.sort(function (e, t) { return e.id - t.id }) })(this._lights), a = e.renderer.library, o = L(i) try { for (o.s(); !(t = o.n()).done; ) { var s = t.value if (s.isNode) n.push(MA(s)) else { var u = null if ((null !== r && (u = YL(s.id, r)), null === u)) { var l = a.getLightNodeClass(s.constructor) if (null === l) { console.warn( 'LightsNode.setupNodeLights: Light node not found for '.concat( s.constructor.name ) ) continue } var c = null ;(KL.has(s) ? (c = KL.get(s)) : ((c = MA(new l(s))), KL.set(s, c)), n.push(c)) } } } } catch (h) { o.e(h) } finally { o.f() } this._lightNodes = n }, }, { key: 'setupLights', value: function (e, t) { var n, r = L(t) try { for (r.s(); !(n = r.n()).done; ) { n.value.build(e) } } catch (i) { r.e(i) } finally { r.f() } }, }, { key: 'setup', value: function (e) { null === this._lightNodes && this.setupLightsNode(e) var t = e.context, n = t.lightingModel, r = this.outgoingLightNode if (n) { var i = this._lightNodes, a = this.totalDiffuseNode, o = this.totalSpecularNode t.outgoingLight = r var s = e.addStack() ;((e.getDataFromNode(this).nodes = s.nodes), n.start(t, s, e), this.setupLights(e, i), n.indirect(t, s, e)) var u = t.backdrop, l = t.backdropAlpha, c = t.reflectedLight, h = c.directDiffuse, d = c.directSpecular, f = c.indirectDiffuse, p = c.indirectSpecular, v = h.add(f) ;(null !== u && ((v = jA(null !== l ? l.mix(v, u) : u)), (t.material.transparent = !0)), a.assign(v), o.assign(d.add(p)), r.assign(a.add(o)), n.finish(t, s, e), (r = r.bypass(e.removeStack()))) } return r }, }, { key: 'setLights', value: function (e) { return ( (this._lights = e), (this._lightNodes = null), (this._lightNodesHash = null), this ) }, }, { key: 'getLights', value: function () { return this._lights }, }, { key: 'hasLights', get: function () { return this._lights.length > 0 }, }, ], [ { key: 'type', get: function () { return 'LightsNode' }, }, ] ) ) })(TS), JL = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t)).light = e), (n.updateBeforeType = _S.RENDER), (n.isShadowBaseNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'setupShadowPosition', value: function (e) { var t = e.material $L.assign(t.shadowPositionNode || vC) }, }, { key: 'dispose', value: function () { this.updateBeforeType = _S.NONE }, }, ], [ { key: 'type', get: function () { return 'ShadowBaseNode' }, }, ] ) ) })(TS), $L = jA().toVar('shadowPositionWorld') function eD(e, t) { return ( (t = (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return ( (t.toneMapping = e.toneMapping), (t.toneMappingExposure = e.toneMappingExposure), (t.outputColorSpace = e.outputColorSpace), (t.renderTarget = e.getRenderTarget()), (t.activeCubeFace = e.getActiveCubeFace()), (t.activeMipmapLevel = e.getActiveMipmapLevel()), (t.renderObjectFunction = e.getRenderObjectFunction()), (t.pixelRatio = e.getPixelRatio()), (t.mrt = e.getMRT()), (t.clearColor = e.getClearColor(t.clearColor || new Od())), (t.clearAlpha = e.getClearAlpha()), (t.autoClear = e.autoClear), (t.scissorTest = e.getScissorTest()), t ) })(e, t)), e.setMRT(null), e.setRenderObjectFunction(null), e.setClearColor(0, 1), (e.autoClear = !0), t ) } var tD, nD = new WeakMap(), rD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = vC.sub(n).length() return (a = (a = a.sub(r).div(i.sub(r))).saturate()) }), iD = function (e) { var t = nD.get(e) if (void 0 === t) { var n = e.isPointLight ? (function (e) { var t = e.shadow.camera, n = VC('near', 'float', t).setGroup(cw), r = VC('far', 'float', t).setGroup(cw), i = ZE(e) return rD(i, n, r) })(e) : null ;(((t = new cI()).colorNode = YA(0, 0, 0, 1)), (t.depthNode = n), (t.isShadowPassMaterial = !0), (t.name = 'ShadowMaterial'), (t.fog = !1), nD.set(e, t)) } return t }, aD = IA(function (e) { var t = e.depthTexture, n = e.shadowCoord return NE(t, n.xy).compare(n.z) }), oD = IA(function (e) { var t = e.depthTexture, n = e.shadowCoord, r = e.shadow, i = function (e, n) { return NE(t, e).compare(n) }, a = VC('mapSize', 'vec2', r).setGroup(cw), o = VC('radius', 'float', r).setGroup(cw), s = VA(1).div(a), u = s.x.negate().mul(o), l = s.y.negate().mul(o), c = s.x.mul(o), h = s.y.mul(o), d = u.div(2), f = l.div(2), p = c.div(2), v = h.div(2) return Kw( i(n.xy.add(VA(u, l)), n.z), i(n.xy.add(VA(0, l)), n.z), i(n.xy.add(VA(c, l)), n.z), i(n.xy.add(VA(d, f)), n.z), i(n.xy.add(VA(0, f)), n.z), i(n.xy.add(VA(p, f)), n.z), i(n.xy.add(VA(u, 0)), n.z), i(n.xy.add(VA(d, 0)), n.z), i(n.xy, n.z), i(n.xy.add(VA(p, 0)), n.z), i(n.xy.add(VA(c, 0)), n.z), i(n.xy.add(VA(d, v)), n.z), i(n.xy.add(VA(0, v)), n.z), i(n.xy.add(VA(p, v)), n.z), i(n.xy.add(VA(u, h)), n.z), i(n.xy.add(VA(0, h)), n.z), i(n.xy.add(VA(c, h)), n.z) ).mul(1 / 17) }), sD = IA(function (e) { var t = e.depthTexture, n = e.shadowCoord, r = e.shadow, i = function (e, n) { return NE(t, e).compare(n) }, a = VC('mapSize', 'vec2', r).setGroup(cw), o = VA(1).div(a), s = o.x, u = o.y, l = n.xy, c = OT(l.mul(a).add(0.5)) return ( l.subAssign(c.mul(o)), Kw( i(l, n.z), i(l.add(VA(s, 0)), n.z), i(l.add(VA(0, u)), n.z), i(l.add(o), n.z), _M(i(l.add(VA(s.negate(), 0)), n.z), i(l.add(VA(s.mul(2), 0)), n.z), c.x), _M(i(l.add(VA(s.negate(), u)), n.z), i(l.add(VA(s.mul(2), u)), n.z), c.x), _M(i(l.add(VA(0, u.negate())), n.z), i(l.add(VA(0, u.mul(2))), n.z), c.y), _M(i(l.add(VA(s, u.negate())), n.z), i(l.add(VA(s, u.mul(2))), n.z), c.y), _M( _M( i(l.add(VA(s.negate(), u.negate())), n.z), i(l.add(VA(s.mul(2), u.negate())), n.z), c.x ), _M( i(l.add(VA(s.negate(), u.mul(2))), n.z), i(l.add(VA(s.mul(2), u.mul(2))), n.z), c.x ), c.y ) ).mul(1 / 9) ) }), uD = IA(function (e) { var t = e.depthTexture, n = e.shadowCoord, r = FA(1).toVar(), i = NE(t).sample(n.xy).rg, a = oM(n.z, i.x) return ( LA(a.notEqual(FA(1)), function () { var e = n.z.sub(i.x), t = iM(0, i.y.mul(i.y)), o = t.div(t.add(e.mul(e))) ;((o = bM(Zw(o, 0.3).div(0.95 - 0.3))), r.assign(bM(iM(a, o)))) }), r ) }), lD = IA(function (e) { var t = e.samples, n = e.radius, r = e.size, i = e.shadowPass, a = FA(0).toVar(), o = FA(0).toVar(), s = t.lessThanEqual(FA(1)).select(FA(0), FA(2).div(t.sub(1))), u = t.lessThanEqual(FA(1)).select(FA(0), FA(-1)) ;(gR({ start: BA(0), end: BA(t), type: 'int', condition: '<' }, function (e) { var t = e.i, l = u.add(FA(t).mul(s)), c = i.sample(Kw(LR.xy, VA(0, l).mul(n)).div(r)).x ;(a.addAssign(c), o.addAssign(c.mul(c))) }), a.divAssign(t), o.divAssign(t)) var l = IT(o.sub(a.mul(a))) return VA(a, l) }), cD = IA(function (e) { var t = e.samples, n = e.radius, r = e.size, i = e.shadowPass, a = FA(0).toVar(), o = FA(0).toVar(), s = t.lessThanEqual(FA(1)).select(FA(0), FA(2).div(t.sub(1))), u = t.lessThanEqual(FA(1)).select(FA(0), FA(-1)) ;(gR({ start: BA(0), end: BA(t), type: 'int', condition: '<' }, function (e) { var t = e.i, l = u.add(FA(t).mul(s)), c = i.sample(Kw(LR.xy, VA(l, 0).mul(n)).div(r)) ;(a.addAssign(c.x), o.addAssign(Kw(c.y.mul(c.y), c.x.mul(c.x)))) }), a.divAssign(t), o.divAssign(t)) var l = IT(o.sub(a.mul(a))) return VA(a, l) }), hD = [aD, oD, sD, uD], dD = new cP(), fD = (function (e) { function t(e) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return ( A(this, t), ((n = y(this, t, [e])).shadow = r || e.shadow), (n.shadowMap = null), (n.vsmShadowMapVertical = null), (n.vsmShadowMapHorizontal = null), (n.vsmMaterialVertical = null), (n.vsmMaterialHorizontal = null), (n._node = null), (n.isShadowNode = !0), n ) } return ( x(t, e), T( t, [ { key: 'setupShadowFilter', value: function (e, t) { var n = t.filterFn, r = t.depthTexture, i = t.shadowCoord, a = t.shadow, o = i.x .greaterThanEqual(0) .and(i.x.lessThanEqual(1)) .and(i.y.greaterThanEqual(0)) .and(i.y.lessThanEqual(1)) .and(i.z.lessThanEqual(1)), s = n({ depthTexture: r, shadowCoord: i, shadow: a }) return o.select(s, FA(1)) }, }, { key: 'setupShadowCoord', value: function (e, t) { var n, r = this.shadow, i = e.renderer, a = VC('bias', 'float', r).setGroup(cw), o = t if (r.camera.isOrthographicCamera || !0 !== i.logarithmicDepthBuffer) ((n = (o = o.xyz.div(o.w)).z), i.coordinateSystem === Cc && (n = n.mul(2).sub(1))) else { var s = o.w o = o.xy.div(s) var u = VC('near', 'float', r.camera).setGroup(cw), l = VC('far', 'float', r.camera).setGroup(cw) n = $R(s.negate(), u, l) } return (o = jA(o.x, o.y.oneMinus(), n.add(a))) }, }, { key: 'getShadowFilterFn', value: function (e) { return hD[e] }, }, { key: 'setupShadow', value: function (e) { var t = e.renderer, n = this.light, r = this.shadow, i = t.shadowMap.type, a = new zp(r.mapSize.width, r.mapSize.height) a.compareFunction = 513 var o = e.createRenderTarget(r.mapSize.width, r.mapSize.height) if (((o.depthTexture = a), r.camera.updateProjectionMatrix(), 3 === i)) { ;((a.compareFunction = null), (this.vsmShadowMapVertical = e.createRenderTarget( r.mapSize.width, r.mapSize.height, { format: kl, type: _l } )), (this.vsmShadowMapHorizontal = e.createRenderTarget( r.mapSize.width, r.mapSize.height, { format: kl, type: _l } ))) var s = NE(a), u = NE(this.vsmShadowMapVertical.texture), l = VC('blurSamples', 'float', r).setGroup(cw), c = VC('radius', 'float', r).setGroup(cw), h = VC('mapSize', 'vec2', r).setGroup(cw), d = this.vsmMaterialVertical || (this.vsmMaterialVertical = new cI()) ;((d.fragmentNode = lD({ samples: l, radius: c, size: h, shadowPass: s, }).context(e.getSharedContext())), (d.name = 'VSMVertical'), ((d = this.vsmMaterialHorizontal || (this.vsmMaterialHorizontal = new cI())).fragmentNode = cD({ samples: l, radius: c, size: h, shadowPass: u, }).context(e.getSharedContext())), (d.name = 'VSMHorizontal')) } var f = VC('intensity', 'float', r).setGroup(cw), p = VC('normalBias', 'float', r).setGroup(cw), v = QL(n).mul($L.add(CC.mul(p))), m = this.setupShadowCoord(e, v), g = r.filterNode || this.getShadowFilterFn(t.shadowMap.type) || null if (null === g) throw new Error( 'THREE.WebGPURenderer: Shadow map type not supported yet.' ) var y = 3 === i ? this.vsmShadowMapHorizontal.texture : a, _ = this.setupShadowFilter(e, { filterFn: g, shadowTexture: o.texture, depthTexture: y, shadowCoord: m, shadow: r, }), b = NE(o.texture, m), x = _M(1, _.rgb.mix(b, 1), f.mul(b.a)).toVar() return ((this.shadowMap = o), (this.shadow.map = o), x) }, }, { key: 'setup', value: function (e) { var t = this if (!1 !== e.renderer.shadowMap.enabled) return IA(function () { var n = t._node return ( t.setupShadowPosition(e), null === n && (t._node = n = t.setupShadow(e)), e.material.shadowNode && console.warn( 'THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.' ), e.material.receivedShadowNode && (n = e.material.receivedShadowNode(n)), n ) })() }, }, { key: 'renderShadow', value: function (e) { var t = this.shadow, n = this.shadowMap, r = this.light, i = e.renderer, a = e.scene ;(t.updateMatrices(r), n.setSize(t.mapSize.width, t.mapSize.height), i.render(a, t.camera)) }, }, { key: 'updateShadow', value: function (e) { var t = this.shadowMap, n = this.light, r = this.shadow, i = e.renderer, a = e.scene, o = e.camera, s = i.shadowMap.type, u = t.depthTexture.version ;((this._depthVersionCached = u), (r.camera.layers.mask = o.layers.mask)) var l = i.getRenderObjectFunction(), c = i.getMRT(), h = !!c && c.has('velocity') ;((tD = (function (e, t, n) { return ( (n = (function (e, t) { return ( (t = (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return ( (t.background = e.background), (t.backgroundNode = e.backgroundNode), (t.overrideMaterial = e.overrideMaterial), t ) })(e, t)), (e.background = null), (e.backgroundNode = null), (e.overrideMaterial = null), t ) })(t, (n = eD(e, n)))), n ) })(i, a, tD)), (a.overrideMaterial = iD(n)), i.setRenderObjectFunction(function (e, t, n, a, u, l) { if (!0 === e.castShadow || (e.receiveShadow && 3 === s)) { ;(h && (vS(e).useVelocity = !0), e.onBeforeShadow(i, e, o, r.camera, a, t.overrideMaterial, l)) for ( var c = arguments.length, d = new Array(c > 6 ? c - 6 : 0), f = 6; f < c; f++ ) d[f - 6] = arguments[f] ;(i.renderObject.apply(i, [e, t, n, a, u, l].concat(d)), e.onAfterShadow(i, e, o, r.camera, a, t.overrideMaterial, l)) } }), i.setRenderTarget(t), this.renderShadow(e), i.setRenderObjectFunction(l), !0 !== n.isPointLight && 3 === s && this.vsmPass(i), (function (e, t, n) { ;(!(function (e, t) { ;((e.toneMapping = t.toneMapping), (e.toneMappingExposure = t.toneMappingExposure), (e.outputColorSpace = t.outputColorSpace), e.setRenderTarget( t.renderTarget, t.activeCubeFace, t.activeMipmapLevel ), e.setRenderObjectFunction(t.renderObjectFunction), e.setPixelRatio(t.pixelRatio), e.setMRT(t.mrt), e.setClearColor(t.clearColor, t.clearAlpha), (e.autoClear = t.autoClear), e.setScissorTest(t.scissorTest)) })(e, n), (function (e, t) { ;((e.background = t.background), (e.backgroundNode = t.backgroundNode), (e.overrideMaterial = t.overrideMaterial)) })(t, n)) })(i, a, tD)) }, }, { key: 'vsmPass', value: function (e) { var t = this.shadow ;(this.vsmShadowMapVertical.setSize(t.mapSize.width, t.mapSize.height), this.vsmShadowMapHorizontal.setSize(t.mapSize.width, t.mapSize.height), e.setRenderTarget(this.vsmShadowMapVertical), (dD.material = this.vsmMaterialVertical), dD.render(e), e.setRenderTarget(this.vsmShadowMapHorizontal), (dD.material = this.vsmMaterialHorizontal), dD.render(e)) }, }, { key: 'dispose', value: function () { ;(this.shadowMap.dispose(), (this.shadowMap = null), null !== this.vsmShadowMapVertical && (this.vsmShadowMapVertical.dispose(), (this.vsmShadowMapVertical = null), this.vsmMaterialVertical.dispose(), (this.vsmMaterialVertical = null)), null !== this.vsmShadowMapHorizontal && (this.vsmShadowMapHorizontal.dispose(), (this.vsmShadowMapHorizontal = null), this.vsmMaterialHorizontal.dispose(), (this.vsmMaterialHorizontal = null)), n(t, 'dispose', this, 3)([])) }, }, { key: 'updateBefore', value: function (e) { var t = this.shadow ;(t.needsUpdate || t.autoUpdate) && (this.updateShadow(e), this.shadowMap.depthTexture.version === this._depthVersionCached && (t.needsUpdate = !1)) }, }, ], [ { key: 'type', get: function () { return 'ShadowNode' }, }, ] ) ) })(JL), pD = IA(function (e) { var t = e.lightDistance, n = e.cutoffDistance, r = e.decayExponent, i = t.pow(r).max(0.01).reciprocal() return n.greaterThan(0).select(i.mul(t.div(n).pow4().oneMinus().clamp().pow2()), i) }), vD = IA(function (e, t) { var n = e.color, r = e.lightViewPosition, i = e.cutoffDistance, a = e.decayExponent, o = t.context.lightingModel, s = r.sub(gC), u = s.normalize(), l = s.length(), c = pD({ lightDistance: l, cutoffDistance: i, decayExponent: a }), h = n.mul(c), d = t.context.reflectedLight o.direct({ lightDirection: u, lightColor: h, reflectedLight: d }, t.stack, t) }), mD = IA(function (e) { var t = C(e, 1)[0], n = (void 0 === t ? EE() : t).mul(2), r = n.x.floor(), i = n.y.floor() return r.add(i).mod(2).sign() }), gD = IA(function (e, t) { var n = C(e, 1)[0], r = void 0 === n ? EE() : n, i = t.renderer, a = t.material, o = FA(1).toVar(), s = yM(r.mul(2).sub(1)) if (a.alphaToCoverage && i.samples > 1) { var u = FA(s.fwidth()).toVar() o.assign(AM(u.oneMinus(), u.add(1), s).oneMinus()) } else s.greaterThan(1).discard() return o }), yD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = FA(i).toVar(), o = FA(r).toVar(), s = zA(n).toVar() return NM(s, o, a) }).setLayout({ name: 'mx_select', type: 'float', inputs: [ { name: 'b', type: 'bool' }, { name: 't', type: 'float' }, { name: 'f', type: 'float' }, ], }), _D = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = zA(r).toVar(), a = FA(n).toVar() return NM(i, a.negate(), a) }).setLayout({ name: 'mx_negate_if', type: 'float', inputs: [ { name: 'val', type: 'float' }, { name: 'b', type: 'bool' }, ], }), bD = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar() return BA(PT(n)) }).setLayout({ name: 'mx_floor', type: 'int', inputs: [{ name: 'x', type: 'float' }] }), xD = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = FA(n).toVar() return (r.assign(bD(i)), i.sub(FA(r))) }), SD = IA(function (e) { var t = C(e, 6), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = FA(s).toVar(), l = FA(o).toVar(), c = FA(a).toVar(), h = FA(i).toVar(), d = FA(r).toVar(), f = FA(n).toVar(), p = FA(Zw(1, l)).toVar() return Zw(1, u) .mul(f.mul(p).add(d.mul(l))) .add(u.mul(h.mul(p).add(c.mul(l)))) }).setLayout({ name: 'mx_bilerp_0', type: 'float', inputs: [ { name: 'v0', type: 'float' }, { name: 'v1', type: 'float' }, { name: 'v2', type: 'float' }, { name: 'v3', type: 'float' }, { name: 's', type: 'float' }, { name: 't', type: 'float' }, ], }), AD = IA(function (e) { var t = C(e, 6), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = FA(s).toVar(), l = FA(o).toVar(), c = jA(a).toVar(), h = jA(i).toVar(), d = jA(r).toVar(), f = jA(n).toVar(), p = FA(Zw(1, l)).toVar() return Zw(1, u) .mul(f.mul(p).add(d.mul(l))) .add(u.mul(h.mul(p).add(c.mul(l)))) }).setLayout({ name: 'mx_bilerp_1', type: 'vec3', inputs: [ { name: 'v0', type: 'vec3' }, { name: 'v1', type: 'vec3' }, { name: 'v2', type: 'vec3' }, { name: 'v3', type: 'vec3' }, { name: 's', type: 'float' }, { name: 't', type: 'float' }, ], }), wD = PN([SD, AD]), TD = IA(function (e) { var t = C(e, 11), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = t[6], l = t[7], c = t[8], h = t[9], d = t[10], f = FA(d).toVar(), p = FA(h).toVar(), v = FA(c).toVar(), m = FA(l).toVar(), g = FA(u).toVar(), y = FA(s).toVar(), _ = FA(o).toVar(), b = FA(a).toVar(), x = FA(i).toVar(), S = FA(r).toVar(), A = FA(n).toVar(), w = FA(Zw(1, v)).toVar(), T = FA(Zw(1, p)).toVar() return FA(Zw(1, f)) .toVar() .mul(T.mul(A.mul(w).add(S.mul(v))).add(p.mul(x.mul(w).add(b.mul(v))))) .add(f.mul(T.mul(_.mul(w).add(y.mul(v))).add(p.mul(g.mul(w).add(m.mul(v)))))) }).setLayout({ name: 'mx_trilerp_0', type: 'float', inputs: [ { name: 'v0', type: 'float' }, { name: 'v1', type: 'float' }, { name: 'v2', type: 'float' }, { name: 'v3', type: 'float' }, { name: 'v4', type: 'float' }, { name: 'v5', type: 'float' }, { name: 'v6', type: 'float' }, { name: 'v7', type: 'float' }, { name: 's', type: 'float' }, { name: 't', type: 'float' }, { name: 'r', type: 'float' }, ], }), MD = IA(function (e) { var t = C(e, 11), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = t[6], l = t[7], c = t[8], h = t[9], d = t[10], f = FA(d).toVar(), p = FA(h).toVar(), v = FA(c).toVar(), m = jA(l).toVar(), g = jA(u).toVar(), y = jA(s).toVar(), _ = jA(o).toVar(), b = jA(a).toVar(), x = jA(i).toVar(), S = jA(r).toVar(), A = jA(n).toVar(), w = FA(Zw(1, v)).toVar(), T = FA(Zw(1, p)).toVar() return FA(Zw(1, f)) .toVar() .mul(T.mul(A.mul(w).add(S.mul(v))).add(p.mul(x.mul(w).add(b.mul(v))))) .add(f.mul(T.mul(_.mul(w).add(y.mul(v))).add(p.mul(g.mul(w).add(m.mul(v)))))) }).setLayout({ name: 'mx_trilerp_1', type: 'vec3', inputs: [ { name: 'v0', type: 'vec3' }, { name: 'v1', type: 'vec3' }, { name: 'v2', type: 'vec3' }, { name: 'v3', type: 'vec3' }, { name: 'v4', type: 'vec3' }, { name: 'v5', type: 'vec3' }, { name: 'v6', type: 'vec3' }, { name: 'v7', type: 'vec3' }, { name: 's', type: 'float' }, { name: 't', type: 'float' }, { name: 'r', type: 'float' }, ], }), ED = PN([TD, MD]), CD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = FA(i).toVar(), o = FA(r).toVar(), s = UA(n).toVar(), u = UA(s.bitAnd(UA(7))).toVar(), l = FA(yD(u.lessThan(UA(4)), o, a)).toVar(), c = FA(Jw(2, yD(u.lessThan(UA(4)), a, o))).toVar() return _D(l, zA(u.bitAnd(UA(1)))).add(_D(c, zA(u.bitAnd(UA(2))))) }).setLayout({ name: 'mx_gradient_float_0', type: 'float', inputs: [ { name: 'hash', type: 'uint' }, { name: 'x', type: 'float' }, { name: 'y', type: 'float' }, ], }), kD = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = FA(r).toVar(), l = UA(n).toVar(), c = UA(l.bitAnd(UA(15))).toVar(), h = FA(yD(c.lessThan(UA(8)), u, s)).toVar(), d = FA( yD(c.lessThan(UA(4)), s, yD(c.equal(UA(12)).or(c.equal(UA(14))), u, o)) ).toVar() return _D(h, zA(c.bitAnd(UA(1)))).add(_D(d, zA(c.bitAnd(UA(2))))) }).setLayout({ name: 'mx_gradient_float_1', type: 'float', inputs: [ { name: 'hash', type: 'uint' }, { name: 'x', type: 'float' }, { name: 'y', type: 'float' }, { name: 'z', type: 'float' }, ], }), RD = PN([CD, kD]), ID = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = FA(i).toVar(), o = FA(r).toVar(), s = qA(n).toVar() return jA(RD(s.x, o, a), RD(s.y, o, a), RD(s.z, o, a)) }).setLayout({ name: 'mx_gradient_vec3_0', type: 'vec3', inputs: [ { name: 'hash', type: 'uvec3' }, { name: 'x', type: 'float' }, { name: 'y', type: 'float' }, ], }), ND = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = FA(r).toVar(), l = qA(n).toVar() return jA(RD(l.x, u, s, o), RD(l.y, u, s, o), RD(l.z, u, s, o)) }).setLayout({ name: 'mx_gradient_vec3_1', type: 'vec3', inputs: [ { name: 'hash', type: 'uvec3' }, { name: 'x', type: 'float' }, { name: 'y', type: 'float' }, { name: 'z', type: 'float' }, ], }), PD = PN([ID, ND]), LD = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar() return Jw(0.6616, n) }).setLayout({ name: 'mx_gradient_scale2d_0', type: 'float', inputs: [{ name: 'v', type: 'float' }], }), DD = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar() return Jw(0.982, n) }).setLayout({ name: 'mx_gradient_scale3d_0', type: 'float', inputs: [{ name: 'v', type: 'float' }], }), OD = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar() return Jw(0.6616, n) }).setLayout({ name: 'mx_gradient_scale2d_1', type: 'vec3', inputs: [{ name: 'v', type: 'vec3' }], }), FD = PN([LD, OD]), BD = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar() return Jw(0.982, n) }).setLayout({ name: 'mx_gradient_scale3d_1', type: 'vec3', inputs: [{ name: 'v', type: 'vec3' }], }), UD = PN([DD, BD]), zD = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = BA(r).toVar(), a = UA(n).toVar() return a.shiftLeft(i).bitOr(a.shiftRight(BA(32).sub(i))) }).setLayout({ name: 'mx_rotl32', type: 'uint', inputs: [ { name: 'x', type: 'uint' }, { name: 'k', type: 'int' }, ], }), VD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2] ;(n.subAssign(i), n.bitXorAssign(zD(i, BA(4))), i.addAssign(r), r.subAssign(n), r.bitXorAssign(zD(n, BA(6))), n.addAssign(i), i.subAssign(r), i.bitXorAssign(zD(r, BA(8))), r.addAssign(n), n.subAssign(i), n.bitXorAssign(zD(i, BA(16))), i.addAssign(r), r.subAssign(n), r.bitXorAssign(zD(n, BA(19))), n.addAssign(i), i.subAssign(r), i.bitXorAssign(zD(r, BA(4))), r.addAssign(n)) }), HD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = UA(i).toVar(), o = UA(r).toVar(), s = UA(n).toVar() return ( a.bitXorAssign(o), a.subAssign(zD(o, BA(14))), s.bitXorAssign(a), s.subAssign(zD(a, BA(11))), o.bitXorAssign(s), o.subAssign(zD(s, BA(25))), a.bitXorAssign(o), a.subAssign(zD(o, BA(16))), s.bitXorAssign(a), s.subAssign(zD(a, BA(4))), o.bitXorAssign(s), o.subAssign(zD(s, BA(14))), a.bitXorAssign(o), a.subAssign(zD(o, BA(24))), a ) }).setLayout({ name: 'mx_bjfinal', type: 'uint', inputs: [ { name: 'a', type: 'uint' }, { name: 'b', type: 'uint' }, { name: 'c', type: 'uint' }, ], }), WD = IA(function (e) { var t = C(e, 1)[0], n = UA(t).toVar() return FA(n).div(FA(UA(BA(4294967295)))) }).setLayout({ name: 'mx_bits_to_01', type: 'float', inputs: [{ name: 'bits', type: 'uint' }], }), GD = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar() return n .mul(n) .mul(n) .mul(n.mul(n.mul(6).sub(15)).add(10)) }).setLayout({ name: 'mx_fade', type: 'float', inputs: [{ name: 't', type: 'float' }], }), jD = IA(function (e) { var t = C(e, 1)[0], n = BA(t).toVar(), r = UA(UA(1)).toVar(), i = UA( UA(BA(3735928559)) .add(r.shiftLeft(UA(2))) .add(UA(13)) ).toVar() return HD(i.add(UA(n)), i, i) }).setLayout({ name: 'mx_hash_int_0', type: 'uint', inputs: [{ name: 'x', type: 'int' }], }), QD = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = BA(r).toVar(), a = BA(n).toVar(), o = UA(UA(2)).toVar(), s = UA().toVar(), u = UA().toVar(), l = UA().toVar() return ( s.assign( u.assign( l.assign( UA(BA(3735928559)) .add(o.shiftLeft(UA(2))) .add(UA(13)) ) ) ), s.addAssign(UA(a)), u.addAssign(UA(i)), HD(s, u, l) ) }).setLayout({ name: 'mx_hash_int_1', type: 'uint', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, ], }), qD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = BA(r).toVar(), s = BA(n).toVar(), u = UA(UA(3)).toVar(), l = UA().toVar(), c = UA().toVar(), h = UA().toVar() return ( l.assign( c.assign( h.assign( UA(BA(3735928559)) .add(u.shiftLeft(UA(2))) .add(UA(13)) ) ) ), l.addAssign(UA(s)), c.addAssign(UA(o)), h.addAssign(UA(a)), HD(l, c, h) ) }).setLayout({ name: 'mx_hash_int_2', type: 'uint', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'z', type: 'int' }, ], }), XD = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = BA(a).toVar(), s = BA(i).toVar(), u = BA(r).toVar(), l = BA(n).toVar(), c = UA(UA(4)).toVar(), h = UA().toVar(), d = UA().toVar(), f = UA().toVar() return ( h.assign( d.assign( f.assign( UA(BA(3735928559)) .add(c.shiftLeft(UA(2))) .add(UA(13)) ) ) ), h.addAssign(UA(l)), d.addAssign(UA(u)), f.addAssign(UA(s)), VD(h, d, f), h.addAssign(UA(o)), HD(h, d, f) ) }).setLayout({ name: 'mx_hash_int_3', type: 'uint', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'z', type: 'int' }, { name: 'xx', type: 'int' }, ], }), YD = IA(function (e) { var t = C(e, 5), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = BA(o).toVar(), u = BA(a).toVar(), l = BA(i).toVar(), c = BA(r).toVar(), h = BA(n).toVar(), d = UA(UA(5)).toVar(), f = UA().toVar(), p = UA().toVar(), v = UA().toVar() return ( f.assign( p.assign( v.assign( UA(BA(3735928559)) .add(d.shiftLeft(UA(2))) .add(UA(13)) ) ) ), f.addAssign(UA(h)), p.addAssign(UA(c)), v.addAssign(UA(l)), VD(f, p, v), f.addAssign(UA(u)), p.addAssign(UA(s)), HD(f, p, v) ) }).setLayout({ name: 'mx_hash_int_4', type: 'uint', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'z', type: 'int' }, { name: 'xx', type: 'int' }, { name: 'yy', type: 'int' }, ], }), KD = PN([jD, QD, qD, XD, YD]), ZD = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = BA(r).toVar(), a = BA(n).toVar(), o = UA(KD(a, i)).toVar(), s = qA().toVar() return ( s.x.assign(o.bitAnd(BA(255))), s.y.assign(o.shiftRight(BA(8)).bitAnd(BA(255))), s.z.assign(o.shiftRight(BA(16)).bitAnd(BA(255))), s ) }).setLayout({ name: 'mx_hash_vec3_0', type: 'uvec3', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, ], }), JD = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = BA(r).toVar(), s = BA(n).toVar(), u = UA(KD(s, o, a)).toVar(), l = qA().toVar() return ( l.x.assign(u.bitAnd(BA(255))), l.y.assign(u.shiftRight(BA(8)).bitAnd(BA(255))), l.z.assign(u.shiftRight(BA(16)).bitAnd(BA(255))), l ) }).setLayout({ name: 'mx_hash_vec3_1', type: 'uvec3', inputs: [ { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'z', type: 'int' }, ], }), $D = PN([ZD, JD]), eO = IA(function (e) { var t = C(e, 1)[0], n = VA(t).toVar(), r = BA().toVar(), i = BA().toVar(), a = FA(xD(n.x, r)).toVar(), o = FA(xD(n.y, i)).toVar(), s = FA(GD(a)).toVar(), u = FA(GD(o)).toVar(), l = FA( wD( RD(KD(r, i), a, o), RD(KD(r.add(BA(1)), i), a.sub(1), o), RD(KD(r, i.add(BA(1))), a, o.sub(1)), RD(KD(r.add(BA(1)), i.add(BA(1))), a.sub(1), o.sub(1)), s, u ) ).toVar() return FD(l) }).setLayout({ name: 'mx_perlin_noise_float_0', type: 'float', inputs: [{ name: 'p', type: 'vec2' }], }), tO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = BA().toVar(), i = BA().toVar(), a = BA().toVar(), o = FA(xD(n.x, r)).toVar(), s = FA(xD(n.y, i)).toVar(), u = FA(xD(n.z, a)).toVar(), l = FA(GD(o)).toVar(), c = FA(GD(s)).toVar(), h = FA(GD(u)).toVar(), d = FA( ED( RD(KD(r, i, a), o, s, u), RD(KD(r.add(BA(1)), i, a), o.sub(1), s, u), RD(KD(r, i.add(BA(1)), a), o, s.sub(1), u), RD(KD(r.add(BA(1)), i.add(BA(1)), a), o.sub(1), s.sub(1), u), RD(KD(r, i, a.add(BA(1))), o, s, u.sub(1)), RD(KD(r.add(BA(1)), i, a.add(BA(1))), o.sub(1), s, u.sub(1)), RD(KD(r, i.add(BA(1)), a.add(BA(1))), o, s.sub(1), u.sub(1)), RD(KD(r.add(BA(1)), i.add(BA(1)), a.add(BA(1))), o.sub(1), s.sub(1), u.sub(1)), l, c, h ) ).toVar() return UD(d) }).setLayout({ name: 'mx_perlin_noise_float_1', type: 'float', inputs: [{ name: 'p', type: 'vec3' }], }), nO = PN([eO, tO]), rO = IA(function (e) { var t = C(e, 1)[0], n = VA(t).toVar(), r = BA().toVar(), i = BA().toVar(), a = FA(xD(n.x, r)).toVar(), o = FA(xD(n.y, i)).toVar(), s = FA(GD(a)).toVar(), u = FA(GD(o)).toVar(), l = jA( wD( PD($D(r, i), a, o), PD($D(r.add(BA(1)), i), a.sub(1), o), PD($D(r, i.add(BA(1))), a, o.sub(1)), PD($D(r.add(BA(1)), i.add(BA(1))), a.sub(1), o.sub(1)), s, u ) ).toVar() return FD(l) }).setLayout({ name: 'mx_perlin_noise_vec3_0', type: 'vec3', inputs: [{ name: 'p', type: 'vec2' }], }), iO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = BA().toVar(), i = BA().toVar(), a = BA().toVar(), o = FA(xD(n.x, r)).toVar(), s = FA(xD(n.y, i)).toVar(), u = FA(xD(n.z, a)).toVar(), l = FA(GD(o)).toVar(), c = FA(GD(s)).toVar(), h = FA(GD(u)).toVar(), d = jA( ED( PD($D(r, i, a), o, s, u), PD($D(r.add(BA(1)), i, a), o.sub(1), s, u), PD($D(r, i.add(BA(1)), a), o, s.sub(1), u), PD($D(r.add(BA(1)), i.add(BA(1)), a), o.sub(1), s.sub(1), u), PD($D(r, i, a.add(BA(1))), o, s, u.sub(1)), PD($D(r.add(BA(1)), i, a.add(BA(1))), o.sub(1), s, u.sub(1)), PD($D(r, i.add(BA(1)), a.add(BA(1))), o, s.sub(1), u.sub(1)), PD($D(r.add(BA(1)), i.add(BA(1)), a.add(BA(1))), o.sub(1), s.sub(1), u.sub(1)), l, c, h ) ).toVar() return UD(d) }).setLayout({ name: 'mx_perlin_noise_vec3_1', type: 'vec3', inputs: [{ name: 'p', type: 'vec3' }], }), aO = PN([rO, iO]), oO = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar(), r = BA(bD(n)).toVar() return WD(KD(r)) }).setLayout({ name: 'mx_cell_noise_float_0', type: 'float', inputs: [{ name: 'p', type: 'float' }], }), sO = IA(function (e) { var t = C(e, 1)[0], n = VA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar() return WD(KD(r, i)) }).setLayout({ name: 'mx_cell_noise_float_1', type: 'float', inputs: [{ name: 'p', type: 'vec2' }], }), uO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar(), a = BA(bD(n.z)).toVar() return WD(KD(r, i, a)) }).setLayout({ name: 'mx_cell_noise_float_2', type: 'float', inputs: [{ name: 'p', type: 'vec3' }], }), lO = IA(function (e) { var t = C(e, 1)[0], n = YA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar(), a = BA(bD(n.z)).toVar(), o = BA(bD(n.w)).toVar() return WD(KD(r, i, a, o)) }).setLayout({ name: 'mx_cell_noise_float_3', type: 'float', inputs: [{ name: 'p', type: 'vec4' }], }), cO = PN([oO, sO, uO, lO]), hO = IA(function (e) { var t = C(e, 1)[0], n = FA(t).toVar(), r = BA(bD(n)).toVar() return jA(WD(KD(r, BA(0))), WD(KD(r, BA(1))), WD(KD(r, BA(2)))) }).setLayout({ name: 'mx_cell_noise_vec3_0', type: 'vec3', inputs: [{ name: 'p', type: 'float' }], }), dO = IA(function (e) { var t = C(e, 1)[0], n = VA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar() return jA(WD(KD(r, i, BA(0))), WD(KD(r, i, BA(1))), WD(KD(r, i, BA(2)))) }).setLayout({ name: 'mx_cell_noise_vec3_1', type: 'vec3', inputs: [{ name: 'p', type: 'vec2' }], }), fO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar(), a = BA(bD(n.z)).toVar() return jA(WD(KD(r, i, a, BA(0))), WD(KD(r, i, a, BA(1))), WD(KD(r, i, a, BA(2)))) }).setLayout({ name: 'mx_cell_noise_vec3_2', type: 'vec3', inputs: [{ name: 'p', type: 'vec3' }], }), pO = IA(function (e) { var t = C(e, 1)[0], n = YA(t).toVar(), r = BA(bD(n.x)).toVar(), i = BA(bD(n.y)).toVar(), a = BA(bD(n.z)).toVar(), o = BA(bD(n.w)).toVar() return jA( WD(KD(r, i, a, o, BA(0))), WD(KD(r, i, a, o, BA(1))), WD(KD(r, i, a, o, BA(2))) ) }).setLayout({ name: 'mx_cell_noise_vec3_3', type: 'vec3', inputs: [{ name: 'p', type: 'vec4' }], }), vO = PN([hO, dO, fO, pO]), mO = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = BA(r).toVar(), l = jA(n).toVar(), c = FA(0).toVar(), h = FA(1).toVar() return ( gR(u, function () { ;(c.addAssign(h.mul(nO(l))), h.mulAssign(o), l.mulAssign(s)) }), c ) }).setLayout({ name: 'mx_fractal_noise_float', type: 'float', inputs: [ { name: 'p', type: 'vec3' }, { name: 'octaves', type: 'int' }, { name: 'lacunarity', type: 'float' }, { name: 'diminish', type: 'float' }, ], }), gO = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = BA(r).toVar(), l = jA(n).toVar(), c = jA(0).toVar(), h = FA(1).toVar() return ( gR(u, function () { ;(c.addAssign(h.mul(aO(l))), h.mulAssign(o), l.mulAssign(s)) }), c ) }).setLayout({ name: 'mx_fractal_noise_vec3', type: 'vec3', inputs: [ { name: 'p', type: 'vec3' }, { name: 'octaves', type: 'int' }, { name: 'lacunarity', type: 'float' }, { name: 'diminish', type: 'float' }, ], }), yO = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = BA(r).toVar(), l = jA(n).toVar() return VA(mO(l, u, s, o), mO(l.add(jA(BA(19), BA(193), BA(17))), u, s, o)) }).setLayout({ name: 'mx_fractal_noise_vec2', type: 'vec2', inputs: [ { name: 'p', type: 'vec3' }, { name: 'octaves', type: 'int' }, { name: 'lacunarity', type: 'float' }, { name: 'diminish', type: 'float' }, ], }), _O = IA(function (e) { var t = C(e, 4), n = t[0], r = t[1], i = t[2], a = t[3], o = FA(a).toVar(), s = FA(i).toVar(), u = BA(r).toVar(), l = jA(n).toVar(), c = jA(gO(l, u, s, o)).toVar(), h = FA(mO(l.add(jA(BA(19), BA(193), BA(17))), u, s, o)).toVar() return YA(c, h) }).setLayout({ name: 'mx_fractal_noise_vec4', type: 'vec4', inputs: [ { name: 'p', type: 'vec3' }, { name: 'octaves', type: 'int' }, { name: 'lacunarity', type: 'float' }, { name: 'diminish', type: 'float' }, ], }), bO = IA(function (e) { var t = C(e, 7), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = t[6], l = BA(u).toVar(), c = FA(s).toVar(), h = BA(o).toVar(), d = BA(a).toVar(), f = BA(i).toVar(), p = BA(r).toVar(), v = VA(n).toVar(), m = jA(vO(VA(p.add(d), f.add(h)))).toVar(), g = VA(m.x, m.y).toVar() ;(g.subAssign(0.5), g.mulAssign(c), g.addAssign(0.5)) var y = VA(VA(FA(p), FA(f)).add(g)).toVar(), _ = VA(y.sub(v)).toVar() return ( LA(l.equal(BA(2)), function () { return WT(_.x).add(WT(_.y)) }), LA(l.equal(BA(3)), function () { return iM(WT(_.x), WT(_.y)) }), cM(_, _) ) }).setLayout({ name: 'mx_worley_distance_0', type: 'float', inputs: [ { name: 'p', type: 'vec2' }, { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'xoff', type: 'int' }, { name: 'yoff', type: 'int' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), xO = IA(function (e) { var t = C(e, 9), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], u = t[6], l = t[7], c = t[8], h = BA(c).toVar(), d = FA(l).toVar(), f = BA(u).toVar(), p = BA(s).toVar(), v = BA(o).toVar(), m = BA(a).toVar(), g = BA(i).toVar(), y = BA(r).toVar(), _ = jA(n).toVar(), b = jA(vO(jA(y.add(v), g.add(p), m.add(f)))).toVar() ;(b.subAssign(0.5), b.mulAssign(d), b.addAssign(0.5)) var x = jA(jA(FA(y), FA(g), FA(m)).add(b)).toVar(), S = jA(x.sub(_)).toVar() return ( LA(h.equal(BA(2)), function () { return WT(S.x).add(WT(S.y)).add(WT(S.z)) }), LA(h.equal(BA(3)), function () { return iM(iM(WT(S.x), WT(S.y)), WT(S.z)) }), cM(S, S) ) }).setLayout({ name: 'mx_worley_distance_1', type: 'float', inputs: [ { name: 'p', type: 'vec3' }, { name: 'x', type: 'int' }, { name: 'y', type: 'int' }, { name: 'z', type: 'int' }, { name: 'xoff', type: 'int' }, { name: 'yoff', type: 'int' }, { name: 'zoff', type: 'int' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), SO = PN([bO, xO]), AO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = VA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = VA(xD(s.x, u), xD(s.y, l)).toVar(), h = FA(1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y, r = FA(SO(c, t, n, u, l, o, a)).toVar() h.assign(rM(h, r)) }) }), LA(a.equal(BA(0)), function () { h.assign(IT(h)) }), h ) }).setLayout({ name: 'mx_worley_noise_float_0', type: 'float', inputs: [ { name: 'p', type: 'vec2' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), wO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = VA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = VA(xD(s.x, u), xD(s.y, l)).toVar(), h = VA(1e6, 1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y, r = FA(SO(c, t, n, u, l, o, a)).toVar() LA(r.lessThan(h.x), function () { ;(h.y.assign(h.x), h.x.assign(r)) }).ElseIf(r.lessThan(h.y), function () { h.y.assign(r) }) }) }), LA(a.equal(BA(0)), function () { h.assign(IT(h)) }), h ) }).setLayout({ name: 'mx_worley_noise_vec2_0', type: 'vec2', inputs: [ { name: 'p', type: 'vec2' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), TO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = VA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = VA(xD(s.x, u), xD(s.y, l)).toVar(), h = jA(1e6, 1e6, 1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y, r = FA(SO(c, t, n, u, l, o, a)).toVar() LA(r.lessThan(h.x), function () { ;(h.z.assign(h.y), h.y.assign(h.x), h.x.assign(r)) }) .ElseIf(r.lessThan(h.y), function () { ;(h.z.assign(h.y), h.y.assign(r)) }) .ElseIf(r.lessThan(h.z), function () { h.z.assign(r) }) }) }), LA(a.equal(BA(0)), function () { h.assign(IT(h)) }), h ) }).setLayout({ name: 'mx_worley_noise_vec3_0', type: 'vec3', inputs: [ { name: 'p', type: 'vec2' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), MO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = jA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = BA().toVar(), h = jA(xD(s.x, u), xD(s.y, l), xD(s.z, c)).toVar(), d = FA(1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y gR({ start: -1, end: BA(1), name: 'z', condition: '<=' }, function (e) { var r = e.z, i = FA(SO(h, t, n, r, u, l, c, o, a)).toVar() d.assign(rM(d, i)) }) }) }), LA(a.equal(BA(0)), function () { d.assign(IT(d)) }), d ) }).setLayout({ name: 'mx_worley_noise_float_1', type: 'float', inputs: [ { name: 'p', type: 'vec3' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), EO = PN([AO, MO]), CO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = jA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = BA().toVar(), h = jA(xD(s.x, u), xD(s.y, l), xD(s.z, c)).toVar(), d = VA(1e6, 1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y gR({ start: -1, end: BA(1), name: 'z', condition: '<=' }, function (e) { var r = e.z, i = FA(SO(h, t, n, r, u, l, c, o, a)).toVar() LA(i.lessThan(d.x), function () { ;(d.y.assign(d.x), d.x.assign(i)) }).ElseIf(i.lessThan(d.y), function () { d.y.assign(i) }) }) }) }), LA(a.equal(BA(0)), function () { d.assign(IT(d)) }), d ) }).setLayout({ name: 'mx_worley_noise_vec2_1', type: 'vec2', inputs: [ { name: 'p', type: 'vec3' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), kO = PN([wO, CO]), RO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = BA(i).toVar(), o = FA(r).toVar(), s = jA(n).toVar(), u = BA().toVar(), l = BA().toVar(), c = BA().toVar(), h = jA(xD(s.x, u), xD(s.y, l), xD(s.z, c)).toVar(), d = jA(1e6, 1e6, 1e6).toVar() return ( gR({ start: -1, end: BA(1), name: 'x', condition: '<=' }, function (e) { var t = e.x gR({ start: -1, end: BA(1), name: 'y', condition: '<=' }, function (e) { var n = e.y gR({ start: -1, end: BA(1), name: 'z', condition: '<=' }, function (e) { var r = e.z, i = FA(SO(h, t, n, r, u, l, c, o, a)).toVar() LA(i.lessThan(d.x), function () { ;(d.z.assign(d.y), d.y.assign(d.x), d.x.assign(i)) }) .ElseIf(i.lessThan(d.y), function () { ;(d.z.assign(d.y), d.y.assign(i)) }) .ElseIf(i.lessThan(d.z), function () { d.z.assign(i) }) }) }) }), LA(a.equal(BA(0)), function () { d.assign(IT(d)) }), d ) }).setLayout({ name: 'mx_worley_noise_vec3_1', type: 'vec3', inputs: [ { name: 'p', type: 'vec3' }, { name: 'jitter', type: 'float' }, { name: 'metric', type: 'int' }, ], }), IO = PN([TO, RO]), NO = IA(function (e) { var t = C(e, 1)[0], n = t.y, r = t.z, i = jA().toVar() return ( LA(n.lessThan(1e-4), function () { i.assign(jA(r, r, r)) }).Else(function () { var e = t.x e = e.sub(PT(e)).mul(6).toVar() var a = BA(JT(e)), o = e.sub(FA(a)), s = r.mul(n.oneMinus()), u = r.mul(n.mul(o).oneMinus()), l = r.mul(n.mul(o.oneMinus()).oneMinus()) LA(a.equal(BA(0)), function () { i.assign(jA(r, l, s)) }) .ElseIf(a.equal(BA(1)), function () { i.assign(jA(u, r, s)) }) .ElseIf(a.equal(BA(2)), function () { i.assign(jA(s, r, l)) }) .ElseIf(a.equal(BA(3)), function () { i.assign(jA(s, u, r)) }) .ElseIf(a.equal(BA(4)), function () { i.assign(jA(l, s, r)) }) .Else(function () { i.assign(jA(r, s, u)) }) }), i ) }).setLayout({ name: 'mx_hsvtorgb', type: 'vec3', inputs: [{ name: 'hsv', type: 'vec3' }], }), PO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = FA(n.x).toVar(), i = FA(n.y).toVar(), a = FA(n.z).toVar(), o = FA(rM(r, rM(i, a))).toVar(), s = FA(iM(r, iM(i, a))).toVar(), u = FA(s.sub(o)).toVar(), l = FA().toVar(), c = FA().toVar(), h = FA().toVar() return ( h.assign(s), LA(s.greaterThan(0), function () { c.assign(u.div(s)) }).Else(function () { c.assign(0) }), LA(c.lessThanEqual(0), function () { l.assign(0) }).Else(function () { ;(LA(r.greaterThanEqual(s), function () { l.assign(i.sub(a).div(u)) }) .ElseIf(i.greaterThanEqual(s), function () { l.assign(Kw(2, a.sub(r).div(u))) }) .Else(function () { l.assign(Kw(4, r.sub(i).div(u))) }), l.mulAssign(1 / 6), LA(l.lessThan(0), function () { l.addAssign(1) })) }), jA(l, c, h) ) }).setLayout({ name: 'mx_rgbtohsv', type: 'vec3', inputs: [{ name: 'c', type: 'vec3' }], }), LO = IA(function (e) { var t = C(e, 1)[0], n = jA(t).toVar(), r = XA(iT(n, jA(0.04045))).toVar(), i = jA(n.div(12.92)).toVar(), a = jA(dM(iM(n.add(jA(0.055)), jA(0)).div(1.055), jA(2.4))).toVar() return _M(i, a, r) }).setLayout({ name: 'mx_srgb_texture_to_lin_rec709', type: 'vec3', inputs: [{ name: 'color', type: 'vec3' }], }), DO = function (e, t) { ;((e = FA(e)), (t = FA(t))) var n = VA(t.dFdx(), t.dFdy()).length().mul(0.7071067811865476) return AM(e.sub(n), e.add(n), t) }, OO = function (e, t, n, r) { return _M(e, t, n[r].clamp()) }, FO = function (e, t, n, r, i) { return _M(e, t, DO(n, r[i])) }, BO = IA(function (e) { var t = C(e, 3), n = t[0], r = t[1], i = t[2], a = DT(n).toVar('nDir'), o = Zw(FA(0.5).mul(r.sub(i)), vC) .div(a) .toVar('rbmax'), s = Zw(FA(-0.5).mul(r.sub(i)), vC) .div(a) .toVar('rbmin'), u = jA().toVar('rbminmax') ;((u.x = a.x.greaterThan(FA(0)).select(o.x, s.x)), (u.y = a.y.greaterThan(FA(0)).select(o.y, s.y)), (u.z = a.z.greaterThan(FA(0)).select(o.z, s.z))) var l = rM(rM(u.x, u.y), u.z).toVar('correction') return vC.add(a.mul(l)).toVar('boxIntersection').sub(i) }), UO = IA(function (e) { var t = C(e, 2), n = t[0], r = t[1], i = n.x, a = n.y, o = n.z, s = r.element(0).mul(0.886227) return (s = (s = (s = (s = (s = (s = (s = (s = s.add( r.element(1).mul(1.023328).mul(a) )).add(r.element(2).mul(1.023328).mul(o))).add( r.element(3).mul(1.023328).mul(i) )).add(r.element(4).mul(0.858086).mul(i).mul(a))).add( r.element(5).mul(0.858086).mul(a).mul(o) )).add(r.element(6).mul(o.mul(o).mul(0.743125).sub(0.247708)))).add( r.element(7).mul(0.858086).mul(i).mul(o) )).add( r .element(8) .mul(0.429043) .mul(Jw(i, i).sub(Jw(a, a))) )) }), zO = Object.freeze({ __proto__: null, BRDF_GGX: TI, BRDF_Lambert: gI, BasicShadowFilter: aD, Break: yR, Const: zM, Continue: function () { return xE('continue').append() }, DFGApprox: MI, D_GGX: SI, Discard: SE, EPSILON: _T, F_Schlick: mI, Fn: IA, INFINITY: bT, If: LA, Loop: gR, NodeAccess: bS, NodeShaderStage: yS, NodeType: { BOOLEAN: 'bool', INTEGER: 'int', FLOAT: 'float', VECTOR2: 'vec2', VECTOR3: 'vec3', VECTOR4: 'vec4', MATRIX2: 'mat2', MATRIX3: 'mat3', MATRIX4: 'mat4', }, NodeUpdateType: _S, PCFShadowFilter: oD, PCFSoftShadowFilter: sD, PI: xT, PI2: ST, Return: function () { return xE('return').append() }, Schlick_to_F0: EI, ScriptableNodeResources: _L, ShaderNode: TA, TBNViewMatrix: ik, VSMShadowFilter: uD, V_GGX_SmithCorrelated: bI, Var: UM, abs: WT, acesFilmicToneMapping: aL, acos: VT, add: Kw, addMethodChaining: zS, addNodeElement: function (e) { console.warn( 'THREE.TSLBase: AddNodeElement has been removed in favor of tree-shaking. Trying add', e ) }, agxToneMapping: lL, all: AT, alphaT: Cw, and: sT, anisotropy: kw, anisotropyB: Iw, anisotropyT: Rw, any: wT, append: DA, array: aw, arrayBuffer: function (e) { return MA(new OS(e, 'ArrayBuffer')) }, asin: zT, assign: Qw, atan: HT, atan2: CM, atomicAdd: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_ADD, e, t, n) }, atomicAnd: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_AND, e, t, n) }, atomicFunc: GL, atomicLoad: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null return GL(VL.ATOMIC_LOAD, e, null, t) }, atomicMax: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_MAX, e, t, n) }, atomicMin: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_MIN, e, t, n) }, atomicOr: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_OR, e, t, n) }, atomicStore: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_STORE, e, t, n) }, atomicSub: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_SUB, e, t, n) }, atomicXor: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null return GL(VL.ATOMIC_XOR, e, t, n) }, attenuationColor: Ww, attenuationDistance: Hw, attribute: ME, attributeArray: function (e) { var t, n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'float' !0 === r.isStruct ? ((t = r.layout.getLength()), (n = hS('float'))) : ((t = dS(r)), (n = hS(r))) var i = new yP(e, t, n) return SP(i, r, e) }, backgroundBlurriness: CP, backgroundIntensity: kP, backgroundRotation: RP, batch: dR, billboarding: UN, bitAnd: hT, bitNot: dT, bitOr: fT, bitXor: pT, bitangentGeometry: JC, bitangentLocal: $C, bitangentView: ek, bitangentWorld: tk, bitcast: tM, blendBurn: BP, blendColor: HP, blendDodge: UP, blendOverlay: VP, blendScreen: zP, blur: iN, bool: zA, buffer: DE, bufferAttribute: uE, bumpMap: fk, burn: function () { console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.') for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return BP(t) }, bvec2: GA, bvec3: XA, bvec4: JA, bypass: mE, cache: vE, call: Xw, cameraFar: VE, cameraIndex: UE, cameraNear: zE, cameraNormalMatrix: QE, cameraPosition: qE, cameraProjectionMatrix: HE, cameraProjectionMatrixInverse: WE, cameraViewMatrix: GE, cameraWorldMatrix: jE, cbrt: gM, cdl: XP, ceil: LT, checker: mD, cineonToneMapping: rL, clamp: bM, clearcoat: xw, clearcoatRoughness: Sw, code: dL, color: OA, colorSpaceToWorking: $M, colorToDirection: function (e) { return MA(e).mul(2).sub(1) }, compute: fE, cond: PM, context: DM, convert: rw, convertColorSpace: function (e, t, n) { return MA(new YM(MA(e), t, n)) }, convertToTexture: function (e) { if (e.isTextureNode) return e if (e.isPassNode) return e.getTextureNode() for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r] return fP.apply(void 0, [e].concat(n)) }, cos: BT, cross: hM, cubeTexture: BC, dFdx: XT, dFdy: YT, dashSize: Ow, defaultBuildStages: ['setup', 'analyze', 'generate'], defaultShaderStages: xS, defined: AA, degrees: MT, deltaTime: DN, densityFog: function (e, t) { return ( console.warn( 'THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.' ), TL(e, wL(t)) ) }, densityFogFactor: wL, depth: tI, depthPass: function (e, t, n) { return MA(new $P($P.DEPTH, e, t, n)) }, difference: lM, diffuseColor: gw, directPointLight: vD, directionToColor: function (e) { return MA(e).mul(0.5).add(0.5) }, dispersion: Gw, distance: uM, div: $w, dodge: function () { console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.') for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return UP(t) }, dot: cM, drawIndex: sR, dynamicBufferAttribute: lE, element: nw, emissive: yw, equal: tT, equals: nM, equirectUV: vI, exp: ET, exp2: CT, expression: xE, faceDirection: xC, faceForward: wM, faceforward: kM, float: FA, floor: PT, fog: TL, fract: OT, frameGroup: lw, frameId: ON, frontFacing: bC, fwidth: $T, gain: function (e, t) { return e.lessThan(0.5) ? EN(e.mul(2), t).div(2) : Zw(1, EN(Jw(Zw(1, e), 2), t).div(2)) }, gapSize: Fw, getConstNodeType: wA, getCurrentStack: PA, getDirection: eN, getDistanceAttenuation: pD, getGeometryRoughness: yI, getNormalFromDepth: mP, getParallaxCorrectNormal: BO, getRoughness: _I, getScreenPosition: vP, getShIrradianceAt: UO, getTextureIndex: AN, getViewPosition: pP, globalId: LL, glsl: function (e, t) { return dL(e, t, 'glsl') }, glslFn: function (e, t) { return pL(e, t, 'glsl') }, grayscale: WP, greaterThan: iT, greaterThanEqual: oT, hash: MN, highpModelNormalViewMatrix: hC, highpModelViewMatrix: cC, hue: QP, instance: lR, instanceIndex: rR, instancedArray: function (e) { var t, n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'float' !0 === r.isStruct ? ((t = r.layout.getLength()), (n = hS('float'))) : ((t = dS(r)), (n = hS(r))) var i = new gP(e, t, n) return SP(i, r, e) }, instancedBufferAttribute: cE, instancedDynamicBufferAttribute: hE, instancedMesh: cR, int: BA, inverseSqrt: NT, inversesqrt: RM, invocationLocalIndex: oR, invocationSubgroupIndex: aR, ior: Uw, iridescence: Tw, iridescenceIOR: Mw, iridescenceThickness: Ew, ivec2: HA, ivec3: QA, ivec4: KA, js: function (e, t) { return dL(e, t, 'js') }, label: OM, length: jT, lengthSq: yM, lessThan: rT, lessThanEqual: aT, lightPosition: qL, lightProjectionUV: function (e) { var t = jL(e) if (void 0 === t.projectionUV) { var n = QL(e).mul(vC) t.projectionUV = n.xyz.div(n.w) } return t.projectionUV }, lightShadowMatrix: QL, lightTargetDirection: function (e) { return GE.transformDirection(qL(e).sub(XL(e))) }, lightTargetPosition: XL, lightViewPosition: function (e) { var t = jL(e) return ( t.viewPosition || (t.viewPosition = fw(new ph()) .setGroup(cw) .onRenderUpdate(function (t, n) { var r = t.camera ;((n.value = n.value || new ph()), n.value.setFromMatrixPosition(e.matrixWorld), n.value.applyMatrix4(r.matrixWorldInverse)) })) ) }, lightingContext: kR, lights: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [] return MA(new ZL()).setLights(e) }, linearDepth: nI, linearToneMapping: tL, localId: DL, log: kT, log2: RT, logarithmicDepthToViewZ: function (e, t, n) { var r = e.mul(kT(n.div(t))) return FA(Math.E).pow(r).mul(t).negate() }, loop: function () { return ( console.warn('TSL.LoopNode: loop() has been renamed to Loop().'), gR.apply(void 0, arguments) ) }, luminance: qP, mat2: $A, mat3: ew, mat4: tw, matcapUV: hN, materialAO: Jk, materialAlphaTest: mk, materialAnisotropy: Dk, materialAnisotropyVector: $k, materialAttenuationColor: Wk, materialAttenuationDistance: Hk, materialClearcoat: kk, materialClearcoatNormal: Ik, materialClearcoatRoughness: Rk, materialColor: gk, materialDispersion: Kk, materialEmissive: _k, materialIOR: Vk, materialIridescence: Ok, materialIridescenceIOR: Fk, materialIridescenceThickness: Bk, materialLightMap: Zk, materialLineDashOffset: Xk, materialLineDashSize: jk, materialLineGapSize: Qk, materialLineScale: Gk, materialLineWidth: qk, materialMetalness: Ek, materialNormal: Ck, materialOpacity: bk, materialPointSize: Yk, materialReference: GC, materialReflectivity: Tk, materialRefractionRatio: NC, materialRotation: Nk, materialRoughness: Mk, materialSheen: Pk, materialSheenRoughness: Lk, materialShininess: yk, materialSpecular: xk, materialSpecularColor: Ak, materialSpecularIntensity: Sk, materialSpecularStrength: wk, materialThickness: zk, materialTransmission: Uk, max: iM, maxMipLevel: RE, mediumpModelViewMatrix: lC, metalness: bw, min: rM, mix: _M, mixElement: MM, mod: aM, modInt: eT, modelDirection: tC, modelNormalMatrix: oC, modelPosition: rC, modelScale: iC, modelViewMatrix: uC, modelViewPosition: aC, modelViewProjection: eR, modelWorldMatrix: nC, modelWorldMatrixInverse: sC, morphReference: TR, mrt: TN, mul: Jw, mx_aastep: DO, mx_cell_noise_float: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE() return cO(e.convert('vec2|vec3')) }, mx_contrast: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0.5 return FA(e).sub(n).mul(t).add(n) }, mx_fractal_noise_float: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.5, r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1 return mO( e, BA(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3), t, n ).mul(r) }, mx_fractal_noise_vec2: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.5, r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1 return yO( e, BA(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3), t, n ).mul(r) }, mx_fractal_noise_vec3: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.5, r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1 return gO( e, BA(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3), t, n ).mul(r) }, mx_fractal_noise_vec4: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.5, r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1 return _O( e, BA(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3), t, n ).mul(r) }, mx_hsvtorgb: NO, mx_noise_float: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return nO(e.convert('vec2|vec3')).mul(t).add(n) }, mx_noise_vec3: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return aO(e.convert('vec2|vec3')).mul(t).add(n) }, mx_noise_vec4: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 return ( (e = e.convert('vec2|vec3')), YA(aO(e), nO(e.add(VA(19, 73)))) .mul(t) .add(n) ) }, mx_ramplr: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : EE() return OO(e, t, n, 'x') }, mx_ramptb: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : EE() return OO(e, t, n, 'y') }, mx_rgbtohsv: PO, mx_safepower: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return (e = FA(e)).abs().pow(t).mul(e.sign()) }, mx_splitlr: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : EE() return FO(e, t, n, r, 'x') }, mx_splittb: function (e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : EE() return FO(e, t, n, r, 'y') }, mx_srgb_texture_to_lin_rec709: LO, mx_transform_uv: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0 return (arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : EE()) .mul(e) .add(t) }, mx_worley_noise_float: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return EO(e.convert('vec2|vec3'), t, BA(1)) }, mx_worley_noise_vec2: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return kO(e.convert('vec2|vec3'), t, BA(1)) }, mx_worley_noise_vec3: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : EE(), t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 return IO(e.convert('vec2|vec3'), t, BA(1)) }, negate: QT, neutralToneMapping: cL, nodeArray: CA, nodeImmutable: RA, nodeObject: MA, nodeObjects: EA, nodeProxy: kA, normalFlat: wC, normalGeometry: SC, normalLocal: AC, normalMap: lk, normalView: TC, normalWorld: MC, normalize: DT, not: lT, notEqual: nT, numWorkgroups: NL, objectDirection: YE, objectGroup: hw, objectPosition: ZE, objectScale: JE, objectViewPosition: $E, objectWorldMatrix: KE, oneMinus: qT, or: uT, orthographicDepthToViewZ: function (e, t, n) { return t.sub(n).mul(e).sub(t) }, oscSawtooth: function () { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : LN).fract() }, oscSine: function () { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : LN) .add(0.75) .mul(2 * Math.PI) .sin() .mul(0.5) .add(0.5) }, oscSquare: function () { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : LN) .fract() .round() }, oscTriangle: function () { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : LN) .add(0.5) .fract() .mul(2) .sub(1) .abs() }, output: Dw, outputStruct: SN, overlay: function () { console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.') for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return VP(t) }, overloadingFn: PN, parabola: EN, parallaxDirection: ak, parallaxUV: function (e, t) { return e.sub(ak.mul(t)) }, parameter: function (e, t) { return MA(new mN(e, t)) }, pass: function (e, t, n) { return MA(new $P($P.COLOR, e, t, n)) }, passTexture: function (e, t) { return MA(new ZP(e, t)) }, pcurve: function (e, t, n) { return dM($w(dM(e, t), Kw(dM(e, t), dM(Zw(1, e), n))), 1 / t) }, perspectiveDepthToViewZ: JR, pmremTexture: lN, pointUV: wP, pointWidth: Bw, positionGeometry: dC, positionLocal: fC, positionPrevious: pC, positionView: gC, positionViewDirection: yC, positionWorld: vC, positionWorldDirection: mC, posterize: YP, pow: dM, pow2: fM, pow3: pM, pow4: vM, property: vw, radians: TT, rand: TM, range: kL, rangeFog: function (e, t, n) { return ( console.warn( 'THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.' ), TL(e, AL(t, n)) ) }, rangeFogFactor: AL, reciprocal: ZT, reference: VC, referenceBuffer: HC, reflect: sM, reflectVector: DC, reflectView: PC, reflector: function (e) { return MA(new aP(e)) }, refract: SM, refractVector: OC, refractView: LC, reinhardToneMapping: nL, remainder: gT, remap: yE, remapClamp: _E, renderGroup: cw, renderOutput: wE, rendererReference: rE, rotate: dN, rotateUV: FN, roughness: _w, round: KT, rtt: fP, sRGBTransferEOTF: jM, sRGBTransferOETF: QM, sampler: function (e) { return (!0 === e.isNode ? e : NE(e)).convert('sampler') }, saturate: xM, saturation: GP, screen: function () { console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.') for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return zP(t) }, screenCoordinate: LR, screenSize: PR, screenUV: NR, scriptable: xL, scriptableValue: mL, select: NM, setCurrentStack: NA, shaderStages: SS, shadow: function (e, t) { return MA(new fD(e, t)) }, shadowPositionWorld: $L, shapeCircle: gD, sharedUniformGroup: uw, sheen: Aw, sheenRoughness: ww, shiftLeft: vT, shiftRight: mT, shininess: Lw, sign: GT, sin: FT, sinc: function (e, t) { return FT(xT.mul(t.mul(e).sub(1))).div(xT.mul(t.mul(e).sub(1))) }, skinning: function (e) { return MA(new pR(e)) }, skinningReference: vR, smoothstep: AM, smoothstepElement: EM, specularColor: Nw, specularF90: Pw, spherizeUV: BN, split: function (e, t) { return MA(new IS(MA(e), t)) }, spritesheetUV: HN, sqrt: IT, stack: yN, step: oM, storage: SP, storageBarrier: function () { return BL('storage').append() }, storageObject: function (e, t, n) { return ( console.warn( 'THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.' ), SP(e, t, n).setPBO(!0) ) }, storageTexture: NP, string: function () { return MA( new OS( arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '', 'string' ) ) }, struct: function (e) { var t = new _N( e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null ), n = function () { for (var n = null, r = arguments.length, i = new Array(r), a = 0; a < r; a++) i[a] = arguments[a] if (i.length > 0) if (i[0].isNode) { n = {} for (var o = Object.keys(e), s = 0; s < i.length; s++) n[o[s]] = i[s] } else n = i[0] return MA(new bN(t, n)) } return ((n.layout = t), (n.isStruct = !0), n) }, sub: Zw, subgroupIndex: iR, subgroupSize: OL, tan: UT, tangentGeometry: jC, tangentLocal: QC, tangentView: qC, tangentWorld: XC, temp: VM, texture: NE, texture3D: vN, textureBarrier: function () { return BL('texture').append() }, textureBicubic: BI, textureCubeUV: tN, textureLoad: PE, textureSize: kE, textureStore: function (e, t, n) { var r = NP(e, t, n) return (null !== n && r.append(), r) }, thickness: Vw, time: LN, timerDelta: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1 return ( console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'), DN.mul(e) ) }, timerGlobal: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1 return ( console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'), LN.mul(e) ) }, timerLocal: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1 return ( console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'), LN.mul(e) ) }, toOutputColorSpace: KM, toWorkingColorSpace: ZM, toneMapping: aE, toneMappingExposure: oE, toonOutlinePass: function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new Od(0, 0, 0), r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.003, i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1 return MA(new eL(e, t, MA(n), MA(r), MA(i))) }, transformDirection: mM, transformNormal: RC, transformNormalToView: IC, transformedBentNormalView: ok, transformedBitangentView: nk, transformedBitangentWorld: rk, transformedClearcoatNormalView: kC, transformedNormalView: EC, transformedNormalWorld: CC, transformedTangentView: YC, transformedTangentWorld: KC, transmission: zw, transpose: eM, triNoise3D: RN, triplanarTexture: function () { return GN.apply(void 0, arguments) }, triplanarTextures: GN, trunc: JT, tslFn: function () { return ( console.warn('TSL.ShaderNode: tslFn() has been renamed to Fn().'), IA.apply(void 0, arguments) ) }, uint: UA, uniform: fw, uniformArray: BE, uniformGroup: sw, uniforms: function (e, t) { return ( console.warn( 'TSL.UniformArrayNode: uniforms() has been renamed to uniformArray().' ), MA(new FE(e, t)) ) }, userData: function (e, t, n) { return MA(new PP(e, t, n)) }, uv: EE, uvec2: WA, uvec3: qA, uvec4: ZA, varying: WM, varyingProperty: mw, vec2: VA, vec3: jA, vec4: YA, vectorComponents: AS, velocity: FP, vertexColor: function (e) { return MA(new AP(e)) }, vertexIndex: nR, vertexStage: GM, vibrance: jP, viewZToLogarithmicDepth: $R, viewZToOrthographicDepth: KR, viewZToPerspectiveDepth: ZR, viewport: DR, viewportBottomLeft: VR, viewportCoordinate: FR, viewportDepthTexture: XR, viewportLinearDepth: rI, viewportMipTexture: jR, viewportResolution: UR, viewportSafeUV: zN, viewportSharedTexture: fI, viewportSize: OR, viewportTexture: GR, viewportTopLeft: zR, viewportUV: BR, wgsl: function (e, t) { return dL(e, t, 'wgsl') }, wgslFn: function (e, t) { return pL(e, t, 'wgsl') }, workgroupArray: function (e, t) { return MA(new zL('Workgroup', e, t)) }, workgroupBarrier: function () { return BL('workgroup').append() }, workgroupId: PL, workingToColorSpace: JM, xor: cT, }), VO = eN(EE(), ME('faceIndex')).normalize() ;(VO.x, VO.y, VO.z) var HO = 'undefined' != typeof self ? self.GPUShaderStage : { VERTEX: 1, FRAGMENT: 2, COMPUTE: 4 } ;(M(M(M({}, bS.READ_ONLY, 'read'), bS.WRITE_ONLY, 'write'), bS.READ_WRITE, 'read_write'), HO && HO.VERTEX, HO && HO.FRAGMENT, HO && HO.COMPUTE) var WO = { tsl_xor: new hL( 'fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }' ), mod_float: new hL( 'fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }' ), mod_vec2: new hL( 'fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }' ), mod_vec3: new hL( 'fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }' ), mod_vec4: new hL( 'fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }' ), equals_bool: new hL( 'fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }' ), equals_bvec2: new hL( 'fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2 { return vec2( a.x == b.x, a.y == b.y ); }' ), equals_bvec3: new hL( 'fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3 { return vec3( a.x == b.x, a.y == b.y, a.z == b.z ); }' ), equals_bvec4: new hL( 'fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4 { return vec4( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }' ), repeatWrapping_float: new hL( 'fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }' ), mirrorWrapping_float: new hL( 'fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }' ), clampWrapping_float: new hL( 'fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }' ), biquadraticTexture: new hL( '\nfn tsl_biquadraticTexture( map : texture_2d, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n' ), } ;('undefined' != typeof navigator && /Windows/g.test(navigator.userAgent) && ((WO.pow_float = new hL( 'fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }' )), (WO.pow_vec2 = new hL( 'fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }', [WO.pow_float] )), (WO.pow_vec3 = new hL( 'fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }', [WO.pow_float] )), (WO.pow_vec4 = new hL( 'fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }', [WO.pow_float] ))), /** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ zO.BRDF_GGX, zO.BRDF_Lambert, zO.BasicShadowFilter, zO.Break, zO.Continue, zO.DFGApprox, zO.D_GGX, zO.Discard, zO.EPSILON, zO.F_Schlick, zO.Fn, zO.INFINITY, zO.If, zO.Loop, zO.NodeShaderStage, zO.NodeType, zO.NodeUpdateType, zO.NodeAccess, zO.PCFShadowFilter, zO.PCFSoftShadowFilter, zO.PI, zO.PI2, zO.Return, zO.Schlick_to_F0, zO.ScriptableNodeResources, zO.ShaderNode, zO.TBNViewMatrix, zO.VSMShadowFilter, zO.V_GGX_SmithCorrelated, zO.abs, zO.acesFilmicToneMapping, zO.acos, zO.add, zO.addNodeElement, zO.agxToneMapping, zO.all, zO.alphaT, zO.and, zO.anisotropy, zO.anisotropyB, zO.anisotropyT, zO.any, zO.append, zO.array, zO.arrayBuffer, zO.asin, zO.assign, zO.atan, zO.atan2, zO.atomicAdd, zO.atomicAnd, zO.atomicFunc, zO.atomicMax, zO.atomicMin, zO.atomicOr, zO.atomicStore, zO.atomicSub, zO.atomicXor, zO.atomicLoad, zO.attenuationColor, zO.attenuationDistance, zO.attribute, zO.attributeArray, zO.backgroundBlurriness, zO.backgroundIntensity, zO.backgroundRotation, zO.batch, zO.billboarding, zO.bitAnd, zO.bitNot, zO.bitOr, zO.bitXor, zO.bitangentGeometry, zO.bitangentLocal, zO.bitangentView, zO.bitangentWorld, zO.bitcast, zO.blendBurn, zO.blendColor, zO.blendDodge, zO.blendOverlay, zO.blendScreen, zO.blur, zO.bool, zO.buffer, zO.bufferAttribute, zO.bumpMap, zO.burn, zO.bvec2, zO.bvec3, zO.bvec4, zO.bypass, zO.cache, zO.call, zO.cameraFar, zO.cameraIndex, zO.cameraNear, zO.cameraNormalMatrix, zO.cameraPosition, zO.cameraProjectionMatrix, zO.cameraProjectionMatrixInverse, zO.cameraViewMatrix, zO.cameraWorldMatrix, zO.cbrt, zO.cdl, zO.ceil, zO.checker, zO.cineonToneMapping, zO.clamp, zO.clearcoat, zO.clearcoatRoughness, zO.code, zO.color, zO.colorSpaceToWorking, zO.colorToDirection, zO.compute, zO.cond, zO.Const, zO.context, zO.convert, zO.convertColorSpace, zO.convertToTexture, zO.cos, zO.cross, zO.cubeTexture, zO.dFdx, zO.dFdy, zO.dashSize, zO.defaultBuildStages, zO.defaultShaderStages, zO.defined, zO.degrees, zO.deltaTime, zO.densityFog, zO.densityFogFactor, zO.depth, zO.depthPass, zO.difference, zO.diffuseColor, zO.directPointLight, zO.directionToColor, zO.dispersion, zO.distance, zO.div, zO.dodge, zO.dot, zO.drawIndex, zO.dynamicBufferAttribute, zO.element, zO.emissive, zO.equal, zO.equals, zO.equirectUV, zO.exp, zO.exp2, zO.expression, zO.faceDirection, zO.faceForward, zO.faceforward, zO.float, zO.floor, zO.fog, zO.fract, zO.frameGroup, zO.frameId, zO.frontFacing, zO.fwidth, zO.gain, zO.gapSize, zO.getConstNodeType, zO.getCurrentStack, zO.getDirection, zO.getDistanceAttenuation, zO.getGeometryRoughness, zO.getNormalFromDepth, zO.getParallaxCorrectNormal, zO.getRoughness, zO.getScreenPosition, zO.getShIrradianceAt, zO.getTextureIndex, zO.getViewPosition, zO.glsl, zO.glslFn, zO.grayscale, zO.greaterThan, zO.greaterThanEqual, zO.hash, zO.highpModelNormalViewMatrix, zO.highpModelViewMatrix, zO.hue, zO.instance, zO.instanceIndex, zO.instancedArray, zO.instancedBufferAttribute, zO.instancedDynamicBufferAttribute, zO.instancedMesh, zO.int, zO.inverseSqrt, zO.inversesqrt, zO.invocationLocalIndex, zO.invocationSubgroupIndex, zO.ior, zO.iridescence, zO.iridescenceIOR, zO.iridescenceThickness, zO.ivec2, zO.ivec3, zO.ivec4, zO.js, zO.label, zO.length, zO.lengthSq, zO.lessThan, zO.lessThanEqual, zO.lightPosition, zO.lightTargetDirection, zO.lightTargetPosition, zO.lightViewPosition, zO.lightingContext, zO.lights, zO.linearDepth, zO.linearToneMapping, zO.localId, zO.globalId, zO.log, zO.log2, zO.logarithmicDepthToViewZ, zO.loop, zO.luminance, zO.mediumpModelViewMatrix, zO.mat2, zO.mat3, zO.mat4, zO.matcapUV, zO.materialAO, zO.materialAlphaTest, zO.materialAnisotropy, zO.materialAnisotropyVector, zO.materialAttenuationColor, zO.materialAttenuationDistance, zO.materialClearcoat, zO.materialClearcoatNormal, zO.materialClearcoatRoughness, zO.materialColor, zO.materialDispersion, zO.materialEmissive, zO.materialIOR, zO.materialIridescence, zO.materialIridescenceIOR, zO.materialIridescenceThickness, zO.materialLightMap, zO.materialLineDashOffset, zO.materialLineDashSize, zO.materialLineGapSize, zO.materialLineScale, zO.materialLineWidth, zO.materialMetalness, zO.materialNormal, zO.materialOpacity, zO.materialPointSize, zO.materialReference, zO.materialReflectivity, zO.materialRefractionRatio, zO.materialRotation, zO.materialRoughness, zO.materialSheen, zO.materialSheenRoughness, zO.materialShininess, zO.materialSpecular, zO.materialSpecularColor, zO.materialSpecularIntensity, zO.materialSpecularStrength, zO.materialThickness, zO.materialTransmission, zO.max, zO.maxMipLevel, zO.metalness, zO.min, zO.mix, zO.mixElement, zO.mod, zO.modInt, zO.modelDirection, zO.modelNormalMatrix, zO.modelPosition, zO.modelScale, zO.modelViewMatrix, zO.modelViewPosition, zO.modelViewProjection, zO.modelWorldMatrix, zO.modelWorldMatrixInverse, zO.morphReference, zO.mrt, zO.mul, zO.mx_aastep, zO.mx_cell_noise_float, zO.mx_contrast, zO.mx_fractal_noise_float, zO.mx_fractal_noise_vec2, zO.mx_fractal_noise_vec3, zO.mx_fractal_noise_vec4, zO.mx_hsvtorgb, zO.mx_noise_float, zO.mx_noise_vec3, zO.mx_noise_vec4, zO.mx_ramplr, zO.mx_ramptb, zO.mx_rgbtohsv, zO.mx_safepower, zO.mx_splitlr, zO.mx_splittb, zO.mx_srgb_texture_to_lin_rec709, zO.mx_transform_uv, zO.mx_worley_noise_float, zO.mx_worley_noise_vec2, zO.mx_worley_noise_vec3, zO.negate, zO.neutralToneMapping, zO.nodeArray, zO.nodeImmutable, zO.nodeObject, zO.nodeObjects, zO.nodeProxy, zO.normalFlat, zO.normalGeometry, zO.normalLocal, zO.normalMap, zO.normalView, zO.normalWorld, zO.normalize, zO.not, zO.notEqual, zO.numWorkgroups, zO.objectDirection, zO.objectGroup, zO.objectPosition, zO.objectScale, zO.objectViewPosition, zO.objectWorldMatrix, zO.oneMinus, zO.or, zO.orthographicDepthToViewZ, zO.oscSawtooth, zO.oscSine, zO.oscSquare, zO.oscTriangle, zO.output, zO.outputStruct, zO.overlay, zO.overloadingFn, zO.parabola, zO.parallaxDirection, zO.parallaxUV, zO.parameter, zO.pass, zO.passTexture, zO.pcurve, zO.perspectiveDepthToViewZ, zO.pmremTexture, zO.pointUV, zO.pointWidth, zO.positionGeometry, zO.positionLocal, zO.positionPrevious, zO.positionView, zO.positionViewDirection, zO.positionWorld, zO.positionWorldDirection, zO.posterize, zO.pow, zO.pow2, zO.pow3, zO.pow4, zO.property, zO.radians, zO.rand, zO.range, zO.rangeFog, zO.rangeFogFactor, zO.reciprocal, zO.reference, zO.referenceBuffer, zO.reflect, zO.reflectVector, zO.reflectView, zO.reflector, zO.refract, zO.refractVector, zO.refractView, zO.reinhardToneMapping, zO.remainder, zO.remap, zO.remapClamp, zO.renderGroup, zO.renderOutput, zO.rendererReference, zO.rotate, zO.rotateUV, zO.roughness, zO.round, zO.rtt, zO.sRGBTransferEOTF, zO.sRGBTransferOETF, zO.sampler, zO.saturate, zO.saturation, zO.screen, zO.screenCoordinate, zO.screenSize, zO.screenUV, zO.scriptable, zO.scriptableValue, zO.select, zO.setCurrentStack, zO.shaderStages, zO.shadow, zO.shadowPositionWorld, zO.sharedUniformGroup, zO.shapeCircle, zO.sheen, zO.sheenRoughness, zO.shiftLeft, zO.shiftRight, zO.shininess, zO.sign, zO.sin, zO.sinc, zO.skinning, zO.skinningReference, zO.smoothstep, zO.smoothstepElement, zO.specularColor, zO.specularF90, zO.spherizeUV, zO.split, zO.spritesheetUV, zO.sqrt, zO.stack, zO.step, zO.storage, zO.storageBarrier, zO.storageObject, zO.storageTexture, zO.string, zO.struct, zO.sub, zO.subgroupIndex, zO.subgroupSize, zO.tan, zO.tangentGeometry, zO.tangentLocal, zO.tangentView, zO.tangentWorld, zO.temp, zO.texture, zO.texture3D, zO.textureBarrier, zO.textureBicubic, zO.textureCubeUV, zO.textureLoad, zO.textureSize, zO.textureStore, zO.thickness, zO.threshold, zO.time, zO.timerDelta, zO.timerGlobal, zO.timerLocal, zO.toOutputColorSpace, zO.toWorkingColorSpace, zO.toneMapping, zO.toneMappingExposure, zO.toonOutlinePass, zO.transformDirection, zO.transformNormal, zO.transformNormalToView, zO.transformedBentNormalView, zO.transformedBitangentView, zO.transformedBitangentWorld, zO.transformedClearcoatNormalView, zO.transformedNormalView, zO.transformedNormalWorld, zO.transformedTangentView, zO.transformedTangentWorld, zO.transmission, zO.transpose, zO.tri, zO.tri3, zO.triNoise3D, zO.triplanarTexture, zO.triplanarTextures, zO.trunc, zO.tslFn, zO.uint, zO.uniform, zO.uniformArray, zO.uniformGroup, zO.uniforms, zO.userData, zO.uv, zO.uvec2, zO.uvec3, zO.uvec4, zO.Var, zO.varying, zO.varyingProperty, zO.vec2, zO.vec3, zO.vec4, zO.vectorComponents, zO.velocity, zO.vertexColor, zO.vertexIndex, zO.vibrance, zO.viewZToLogarithmicDepth, zO.viewZToOrthographicDepth, zO.viewZToPerspectiveDepth, zO.viewport, zO.viewportBottomLeft, zO.viewportCoordinate, zO.viewportDepthTexture, zO.viewportLinearDepth, zO.viewportMipTexture, zO.viewportResolution, zO.viewportSafeUV, zO.viewportSharedTexture, zO.viewportSize, zO.viewportTexture, zO.viewportTopLeft, zO.viewportUV, zO.wgsl, zO.wgslFn, zO.workgroupArray, zO.workgroupBarrier, zO.workgroupId, zO.workingToColorSpace, zO.xor) var GO, jO = (function () { function e() { var t, n, r, i, a, o, s, u, l, c, h, d = this, f = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} if ( (A(this, e), M(this, 'tempForward', new ph()), M(this, 'tempMatrixLeft', new Gh()), M(this, 'tempMatrixRight', new Gh()), M(this, 'onKeyDown', function (e) { switch ( (d.tempForward.set(0, 0, -1), d.tempForward.transformDirection(d.camera.matrixWorld), d.tempMatrixLeft.makeRotationAxis(d.tempForward, Math.PI / 128), d.tempMatrixRight.makeRotationAxis(d.tempForward, -Math.PI / 128), e.code) ) { case 'KeyG': ;((d.focalAdjustment += 0.02), d.forceRenderNextFrame()) break case 'KeyF': ;((d.focalAdjustment -= 0.02), d.forceRenderNextFrame()) break case 'ArrowLeft': d.camera.up.transformDirection(d.tempMatrixLeft) break case 'ArrowRight': d.camera.up.transformDirection(d.tempMatrixRight) break case 'KeyC': d.showMeshCursor = !d.showMeshCursor break case 'KeyU': d.showControlPlane = !d.showControlPlane break case 'KeyI': ;((d.showInfo = !d.showInfo), d.showInfo) break case 'KeyO': d.usingExternalCamera || d.setOrthographicMode(!d.camera.isOrthographicCamera) break case 'KeyP': d.usingExternalCamera || d.splatMesh.setPointCloudModeEnabled( !d.splatMesh.getPointCloudModeEnabled() ) break case 'Equal': d.usingExternalCamera || d.splatMesh.setSplatScale(d.splatMesh.getSplatScale() + 0.05) break case 'Minus': d.usingExternalCamera || d.splatMesh.setSplatScale(Math.max(d.splatMesh.getSplatScale() - 0.05, 0)) } }), M( this, 'onMouseUp', ((t = new Vc()), function (e) { ;(t.copy(this.mousePosition).sub(this.mouseDownPosition), Pu() - this.mouseDownTime < 0.5 && t.length() < 2 && this.onMouseClick(e)) }) ), M(this, 'checkPointRenderDimensions', new Vc()), M(this, 'checkPointToNewFocalPoint', new ph()), M(this, 'checkPointOutHits', []), M(this, 'checkForFocalPointChange', function () { if ( !d.transitioningCameraTarget && (d.getRenderDimensions(d.checkPointRenderDimensions), (d.checkPointOutHits.length = 0), d.raycaster.setFromCameraAndScreenPosition( d.camera, d.mousePosition, d.checkPointRenderDimensions ), d.raycaster.intersectSplatMesh(d.splatMesh, d.checkPointOutHits), d.checkPointOutHits.length > 0) ) { var e = d.checkPointOutHits[0].origin ;(d.checkPointToNewFocalPoint.copy(e).sub(d.camera.position), d.checkPointToNewFocalPoint.length() > 0.75 && (d.previousCameraTarget.copy(d.controls.target), d.nextCameraTarget.copy(e), (d.transitioningCameraTarget = !0), (d.transitioningCameraTargetStartTime = Pu()))) } }), M( this, 'updateSplatMesh', ((n = new Vc()), function () { if (this.splatMesh && this.splatMesh.getSplatCount() > 0) { ;(this.splatMesh.updateVisibleRegionFadeDistance(this.sceneRevealMode), this.splatMesh.updateTransforms(), this.getRenderDimensions(n)) var e = 0.5 * this.camera.projectionMatrix.elements[0] * this.devicePixelRatio * n.x, t = 0.5 * this.camera.projectionMatrix.elements[5] * this.devicePixelRatio * n.y, r = this.camera.isOrthographicCamera ? 1 / this.devicePixelRatio : 1, i = this.focalAdjustment * r, a = 1 / i ;(this.adjustForWebXRStereo(n), this.splatMesh.updateUniforms( n, e * i, t * i, this.camera.isOrthographicCamera, this.camera.zoom || 1, a )) } }) ), M(this, 'addSplatBuffers', function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], a = arguments.length > 5 && void 0 !== arguments[5] && arguments[5], o = arguments.length > 6 && void 0 !== arguments[6] && arguments[6], s = !(arguments.length > 7 && void 0 !== arguments[7]) || arguments[7] if (d.isDisposingOrDisposed()) return Promise.resolve() var u = null, l = function () { null !== u && (d.loadingSpinner.removeTask(u), (u = null)) } return ( (d.splatRenderReady = !1), new Promise(function (c) { ;(r && (u = d.loadingSpinner.addTask('Processing splats...')), Du(function () { if (d.isDisposingOrDisposed()) c() else { var r = d.addSplatBuffersToMesh(e, t, n, i, a, s), u = d.splatMesh.getMaxSplatCount() ;(d.sortWorker && d.sortWorker.maxSplatCount !== u && d.disposeSortWorker(), d.gpuAcceleratedSort || d.preSortMessages.push({ centers: r.centers.buffer, sceneIndexes: r.sceneIndexes.buffer, range: { from: r.from, to: r.to, count: r.count }, }), (!d.sortWorker && u > 0 ? d.setupSortWorker(d.splatMesh) : Promise.resolve() ).then(function () { d.isDisposingOrDisposed() || d.runSplatSort(!0, !0).then(function (e) { d.sortWorker && e ? (o ? (d.splatRenderReady = !0) : d.runAfterNextSort.push(function () { d.splatRenderReady = !0 }), d.runAfterNextSort.push(function () { ;(l(), c()) })) : ((d.splatRenderReady = !0), l(), c()) }) })) } }, !0)) }) ) }), M(this, 'addSplatBuffersToMesh', function (e, t) { var n, i, a = this, o = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], s = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], u = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], l = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5] if (!this.isDisposingOrDisposed()) { var c = [], h = [] ;(u || ((c = this.splatMesh.scenes.map(function (e) { return e.splatBuffer }) || []), (h = this.splatMesh.sceneOptions ? this.splatMesh.sceneOptions.map(function (e) { return e }) : [])), (n = c).push.apply(n, I(e)), (i = h).push.apply(i, I(t)), this.renderer && this.splatMesh.setRenderer(this.renderer)) var d = this.splatMesh.build( c, h, !0, o, function (e) { if (!a.isDisposingOrDisposed()) { var t = a.splatMesh.getSplatCount() s && t >= 15e5 && (e || r || (a.loadingSpinner.setMinimized(!0, !0), (r = a.loadingSpinner.addTask('Optimizing data structures...')))) } }, function (e) { a.isDisposingOrDisposed() || (e && r && (a.loadingSpinner.removeTask(r), (r = null))) }, l ) return ( o && this.freeIntermediateSplatData && this.splatMesh.freeIntermediateSplatData(), d ) } }), M(this, 'vsyncNum', 4), M( this, 'shouldRender', ((i = 0), (a = new ph()), (o = new fh()), (s = 1e-4), function () { if ( !this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed() ) return !1 var e, t = !1 if (this.camera) { var n = this.camera.position, r = this.camera.quaternion t = Math.abs(n.x - a.x) > s || Math.abs(n.y - a.y) > s || Math.abs(n.z - a.z) > s || Math.abs(r.x - o.x) > s || Math.abs(r.y - o.y) > s || Math.abs(r.z - o.z) > s || Math.abs(r.w - o.w) > s } return ( (e = this.renderMode !== tS && (0 === i || this.splatMesh.visibleRegionChanging || t || this.renderMode === eS || !0 === this.dynamicMode || this.renderNextFrame)), this.camera && (a.copy(this.camera.position), o.copy(this.camera.quaternion)), i++, e ) }) ), M(this, 'render', function () { if ( this.initialized && this.splatRenderReady && !this.isDisposingOrDisposed() ) { var e = this.renderer.autoClear ;((function (e) { var t, n = L(e.children) try { for (n.s(); !(t = n.n()).done; ) if (t.value.visible) return !0 } catch (r) { n.e(r) } finally { n.f() } return !1 })(this.threeScene) && (this.renderer.render(this.threeScene, this.camera), (this.renderer.autoClear = !1)), this.renderer.render(this.splatMesh, this.camera), (this.renderer.autoClear = !1), this.sceneHelper.getFocusMarkerOpacity() > 0 && this.renderer.render(this.sceneHelper.focusMarker, this.camera), this.showControlPlane && this.renderer.render(this.sceneHelper.controlPlane, this.camera), (this.renderer.autoClear = e)) } }), M(this, 'sortedIndexes', void 0), M(this, 'lastCalcTime', Pu()), M(this, 'fpsFrameCount', 0), M(this, 'updateFPS', function () { if (d.consecutiveRenderFrames > 60) { var e = Pu() e - d.lastCalcTime >= 1 ? ((d.currentFPS = d.fpsFrameCount), (d.fpsFrameCount = 0), (d.lastCalcTime = e)) : d.fpsFrameCount++ } else d.currentFPS = null }), M( this, 'updateForRendererSizeChanges', ((l = new Vc()), (c = new Vc()), function () { this.usingExternalCamera || (this.renderer.getSize(c), (void 0 !== u && u === this.camera.isOrthographicCamera && c.x === l.x && c.y === l.y) || (this.camera.isOrthographicCamera ? ((this.camera.left = -c.x / 2), (this.camera.right = c.x / 2), (this.camera.top = c.y / 2), (this.camera.bottom = -c.y / 2)) : (this.camera.aspect = c.x / c.y), this.camera.updateProjectionMatrix(), l.copy(c), (u = this.camera.isOrthographicCamera))) }) ), M(this, 'timingSensitiveUpdates', function () { var e = Pu() h || (h = e) var t = e - h ;(this.updateCameraTransition(e), this.updateFocusMarker(t), (h = e)) }), M(this, 'tempCameraTarget', new ph()), M(this, 'toPreviousTarget', new ph()), M(this, 'toNextTarget', new ph()), M(this, 'updateCameraTransition', function (e) { if (d.transitioningCameraTarget) { ;(d.toPreviousTarget .copy(d.previousCameraTarget) .sub(d.camera.position) .normalize(), d.toNextTarget.copy(d.nextCameraTarget).sub(d.camera.position).normalize()) var t = Math.acos(d.toPreviousTarget.dot(d.toNextTarget)), n = (((t / (Math.PI / 3)) * 0.65 + 0.3) / t) * (e - d.transitioningCameraTargetStartTime) ;(d.tempCameraTarget.copy(d.previousCameraTarget).lerp(d.nextCameraTarget, n), d.camera.lookAt(d.tempCameraTarget), d.controls.target.copy(d.tempCameraTarget), n >= 1 && (d.transitioningCameraTarget = !1)) } }), M( this, 'updateFocusMarker', (function () { var e = new Vc(), t = !1 return function (n) { if ((this.getRenderDimensions(e), this.transitioningCameraTarget)) { this.sceneHelper.setFocusMarkerVisibility(!0) var r = Math.max(this.sceneHelper.getFocusMarkerOpacity(), 0), i = Math.min(r + 10 * n, 1) ;(this.sceneHelper.setFocusMarkerOpacity(i), this.sceneHelper.updateFocusMarker( this.nextCameraTarget, this.camera, e ), (t = !0), this.forceRenderNextFrame()) } else { var a if ( (a = t ? 1 : Math.min(this.sceneHelper.getFocusMarkerOpacity(), 1)) > 0 ) { this.sceneHelper.updateFocusMarker( this.nextCameraTarget, this.camera, e ) var o = Math.max(a - 2.5 * n, 0) ;(this.sceneHelper.setFocusMarkerOpacity(o), 0 === o && this.sceneHelper.setFocusMarkerVisibility(!1)) } ;(a > 0 && this.forceRenderNextFrame(), (t = !1)) } } })() ), M( this, 'updateMeshCursor', (function () { var e = [], t = new Vc() return function () { this.showMeshCursor ? (this.forceRenderNextFrame(), this.getRenderDimensions(t), (e.length = 0), this.raycaster.setFromCameraAndScreenPosition( this.camera, this.mousePosition, t ), this.raycaster.intersectSplatMesh(this.splatMesh, e), e.length > 0 ? (this.sceneHelper.setMeshCursorVisibility(!0), this.sceneHelper.positionAndOrientMeshCursor( e[0].origin, this.camera )) : this.sceneHelper.setMeshCursorVisibility(!1)) : (this.sceneHelper.getMeschCursorVisibility() && this.forceRenderNextFrame(), this.sceneHelper.setMeshCursorVisibility(!1)) } })() ), M( this, 'updateInfoPanel', (function () { var e = new Vc() return function () { if (this.showInfo) { var t = this.splatMesh.getSplatCount() ;(this.getRenderDimensions(e), this.controls && this.controls.target, this.showMeshCursor && this.sceneHelper.meshCursor.position, t > 0 && this.splatRenderCount) } } })() ), M(this, 'mvpMatrix', new Gh()), M(this, 'cameraPositionArray', []), M(this, 'lastSortViewDir', new ph(0, 0, -1)), M(this, 'sortViewDir', new ph(0, 0, -1)), M(this, 'lastSortViewPos', new ph()), M(this, 'sortViewOffset', new ph()), M(this, 'queuedSorts', []), M(this, 'partialSorts', [ { angleThreshold: 0.55, sortFractions: [0.125, 0.33333, 0.75] }, { angleThreshold: 0.65, sortFractions: [0.33333, 0.66667] }, { angleThreshold: 0.8, sortFractions: [0.5] }, ]), M(this, 'runSplatSort', function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] if (!d.initialized) return Promise.resolve(!1) if (d.sortRunning) return Promise.resolve(!0) if (d.splatMesh.getSplatCount() <= 0) return ((d.splatRenderCount = 0), Promise.resolve(!1)) var n, r, i = !1, a = !1 if ( (d.sortViewDir.set(0, 0, -1).applyQuaternion(d.camera.quaternion), (n = d.sortViewDir.dot(d.lastSortViewDir)), (r = d.sortViewOffset .copy(d.camera.position) .sub(d.lastSortViewPos) .length()), !( e || d.splatMesh.dynamicMode || 0 !== d.queuedSorts.length || (n <= 0.99 && (i = !0), r >= 1 && (a = !0), i || a) )) ) return Promise.resolve(!1) d.sortRunning = !0 var o = d.gatherSceneNodesForSort(), s = o.splatRenderCount, u = o.shouldSortAll ;((u = u || t), (d.splatRenderCount = s), d.mvpMatrix.copy(d.camera.matrixWorld).invert()) var l = d.perspectiveCamera || d.camera ;(d.mvpMatrix.premultiply(l.projectionMatrix), d.splatMesh.dynamicMode || d.mvpMatrix.multiply(d.splatMesh.matrixWorld)) var c = Promise.resolve(!0) return ( d.gpuAcceleratedSort && (d.queuedSorts.length <= 1 || d.queuedSorts.length % 2 == 0) && (c = d.splatMesh.computeDistancesOnGPU( d.mvpMatrix, d.sortWorkerPrecomputedDistances )), c.then(function () { if (0 === d.queuedSorts.length) if (d.splatMesh.dynamicMode || u) d.queuedSorts.push(d.splatRenderCount) else { var e, t = L(partialSorts) try { for (t.s(); !(e = t.n()).done; ) { var r = e.value if (n < r.angleThreshold) { var i, a = L(r.sortFractions) try { for (a.s(); !(i = a.n()).done; ) { var o = i.value d.queuedSorts.push(Math.floor(d.splatRenderCount * o)) } } catch (c) { a.e(c) } finally { a.f() } break } } } catch (c) { t.e(c) } finally { t.f() } d.queuedSorts.push(d.splatRenderCount) } var s = Math.min(d.queuedSorts.shift(), d.splatRenderCount) ;((d.splatSortCount = s), (d.cameraPositionArray[0] = d.camera.position.x), (d.cameraPositionArray[1] = d.camera.position.y), (d.cameraPositionArray[2] = d.camera.position.z)) var l = { modelViewProj: d.mvpMatrix.elements, cameraPosition: d.cameraPositionArray, splatRenderCount: d.splatRenderCount, splatSortCount: s, usePrecomputedDistances: d.gpuAcceleratedSort, } return ( d.splatMesh.dynamicMode && d.splatMesh.fillTransformsArray(d.sortWorkerTransforms), d.sharedMemoryForWorkers || ((l.indexesToSort = d.sortWorkerIndexesToSort), (l.transforms = d.sortWorkerTransforms), d.gpuAcceleratedSort && (l.precomputedDistances = d.sortWorkerPrecomputedDistances)), (d.sortPromise = new Promise(function (e) { d.sortPromiseResolver = e })), d.preSortMessages.length > 0 && (d.preSortMessages.forEach(function (e) { d.sortWorker.postMessage(e) }), (d.preSortMessages = [])), d.sortWorker.postMessage({ sort: l }), 0 === d.queuedSorts.length && (d.lastSortViewPos.copy(d.camera.position), d.lastSortViewDir.copy(d.sortViewDir)), !0 ) }), c ) }), M( this, 'gatherSceneNodesForSort', (function () { var e = [], t = null, n = new ph(), r = new ph(), i = new ph(), a = new Gh(), o = new Gh(), s = new Gh(), u = new ph(), l = new ph(0, 0, -1), c = new ph(), h = function (e) { return c.copy(e.max).sub(e.min).length() } return function () { var c = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] this.getRenderDimensions(u) var d = u.y / 2 / Math.tan((this.camera.fov / 2) * zc.DEG2RAD), f = Math.atan(u.x / 2 / d), p = Math.atan(u.y / 2 / d), v = Math.cos(f), m = Math.cos(p), g = this.splatMesh.getSplatTree() if (g) { ;(o.copy(this.camera.matrixWorld).invert(), this.splatMesh.dynamicMode || o.multiply(this.splatMesh.matrixWorld)) for (var y = 0, _ = 0, b = 0; b < g.subTrees.length; b++) { var x = g.subTrees[b] ;(a.copy(o), this.splatMesh.dynamicMode && (this.splatMesh.getSceneTransform(b, s), a.multiply(s))) for (var S = x.nodesWithIndexes.length, A = 0; A < S; A++) { var w = x.nodesWithIndexes[A] if (w.data && w.data.indexes && 0 !== w.data.indexes.length) { i.copy(w.center).applyMatrix4(a) var T = i.length() ;(i.normalize(), n.copy(i).setX(0).normalize(), r.copy(i).setY(0).normalize()) var M = l.dot(r), E = l.dot(n), C = h(w) ;(!c && (M < v - 0.6 || E < m - 0.6) && T > C) || ((_ += w.data.indexes.length), (e[y] = w), (w.data.distanceToNode = T), y++) } } } ;((e.length = y), e.sort(function (e, t) { return e.data.distanceToNode < t.data.distanceToNode ? -1 : 1 })) for (var k = _ * zy.BytesPerInt, R = 0; R < y; R++) { var I = e[R], N = I.data.indexes.length, P = N * zy.BytesPerInt ;(new Uint32Array(this.sortWorkerIndexesToSort.buffer, k - P, N).set( I.data.indexes ), (k -= P)) } return { splatRenderCount: _, shouldSortAll: !1 } } var L = this.splatMesh.getSplatCount() if (!t || t.length !== L) { t = new Uint32Array(L) for (var D = 0; D < L; D++) t[D] = D } return ( this.sortWorkerIndexesToSort.set(t), { splatRenderCount: L, shouldSortAll: !0 } ) } })() ), f.cameraUp || (f.cameraUp = [0, 1, 0]), (this.cameraUp = new ph().fromArray(f.cameraUp)), f.initialCameraPosition || (f.initialCameraPosition = [0, 10, 15]), (this.initialCameraPosition = new ph().fromArray(f.initialCameraPosition)), f.initialCameraRotation || (f.initialCameraRotation = [0, 0, 0]), (this.initialCameraRotation = new ph().fromArray(f.initialCameraRotation)), (this.backgroundColor = f.backgroundColor), f.initialCameraLookAt || (f.initialCameraLookAt = [0, 0, 0]), (this.initialCameraLookAt = new ph().fromArray(f.initialCameraLookAt)), (this.dropInMode = f.dropInMode || !1), (void 0 !== f.selfDrivenMode && null !== f.selfDrivenMode) || (f.selfDrivenMode = !0), (this.selfDrivenMode = f.selfDrivenMode && !this.dropInMode), (this.selfDrivenUpdateFunc = this.selfDrivenUpdate.bind(this)), void 0 === f.useBuiltInControls && (f.useBuiltInControls = !0), (this.useBuiltInControls = f.useBuiltInControls), (this.rootElement = f.rootElement), (this.canvas = f.threejsCanvas), (this.ignoreDevicePixelRatio = f.ignoreDevicePixelRatio || !1), (this.devicePixelRatio = this.ignoreDevicePixelRatio ? 1 : window.devicePixelRatio || 1), (this.halfPrecisionCovariancesOnGPU = f.halfPrecisionCovariancesOnGPU || !1), (this.threeScene = f.threeScene), (this.renderer = f.renderer), (this.camera = f.camera), (this.gpuAcceleratedSort = f.gpuAcceleratedSort || !1), (void 0 !== f.integerBasedSort && null !== f.integerBasedSort) || (f.integerBasedSort = !0), (this.integerBasedSort = f.integerBasedSort), (void 0 !== f.sharedMemoryForWorkers && null !== f.sharedMemoryForWorkers) || (f.sharedMemoryForWorkers = !0), (this.sharedMemoryForWorkers = !1), (this.dynamicScene = !!f.dynamicScene), (this.antialiased = f.antialiased || !1), (this.kernel2DSize = void 0 === f.kernel2DSize ? 0.3 : f.kernel2DSize), (this.webXRMode = f.webXRMode || Yx), this.webXRMode !== Yx && (this.gpuAcceleratedSort = !1), (this.webXRActive = !1), (this.webXRSessionInit = f.webXRSessionInit || {}), (this.renderMode = f.renderMode || eS), (this.sceneRevealMode = f.sceneRevealMode || Bx), (this.focalAdjustment = f.focalAdjustment || 1), (this.maxScreenSpaceSplatSize = f.maxScreenSpaceSplatSize || 1024), (this.logLevel = f.logLevel || zx), (this.sphericalHarmonicsDegree = f.sphericalHarmonicsDegree || 0), (this.enableOptionalEffects = f.enableOptionalEffects || !1), (void 0 !== f.enableSIMDInSort && null !== f.enableSIMDInSort) || (f.enableSIMDInSort = !0), (this.enableSIMDInSort = f.enableSIMDInSort), (void 0 !== f.inMemoryCompressionLevel && null !== f.inMemoryCompressionLevel) || (f.inMemoryCompressionLevel = 0), (this.inMemoryCompressionLevel = f.inMemoryCompressionLevel), (void 0 !== f.optimizeSplatData && null !== f.optimizeSplatData) || (f.optimizeSplatData = !0), (this.optimizeSplatData = f.optimizeSplatData), (void 0 !== f.freeIntermediateSplatData && null !== f.freeIntermediateSplatData) || (f.freeIntermediateSplatData = !1), (this.freeIntermediateSplatData = f.freeIntermediateSplatData), zu()) ) { var p = Vu() ;(p.major < 17 && (this.enableSIMDInSort = !1), p.major < 16 && (this.sharedMemoryForWorkers = !1)) } ;((void 0 !== f.splatRenderMode && null !== f.splatRenderMode) || (f.splatRenderMode = wx), (this.splatRenderMode = f.splatRenderMode), (this.sceneFadeInRateMultiplier = f.sceneFadeInRateMultiplier || 1), (this.splatSortDistanceMapPrecision = f.splatSortDistanceMapPrecision || zy.DefaultSplatSortDistanceMapPrecision)) var v = this.integerBasedSort ? 20 : 24 ;((this.splatSortDistanceMapPrecision = Nu( this.splatSortDistanceMapPrecision, 10, v )), (this.onSplatMeshChangedCallback = null), this.createSplatMesh(), (this.controls = null), (this.perspectiveControls = null), (this.orthographicControls = null), (this.orthographicCamera = null), (this.perspectiveCamera = null), (this.showMeshCursor = !1), (this.showControlPlane = !1), (this.showInfo = !1), (this.sceneHelper = null), (this.sortWorker = null), (this.sortRunning = !1), (this.splatRenderCount = 0), (this.splatSortCount = 0), (this.lastSplatSortCount = 0), (this.sortWorkerIndexesToSort = null), (this.sortWorkerSortedIndexes = null), (this.sortWorkerPrecomputedDistances = null), (this.sortWorkerTransforms = null), (this.preSortMessages = []), (this.runAfterNextSort = []), (this.selfDrivenModeRunning = !1), (this.splatRenderReady = !1), (this.raycaster = new Mx()), (this.infoPanel = null), (this.startInOrthographicMode = !1), (this.currentFPS = 0), (this.lastSortTime = 0), (this.consecutiveRenderFrames = 0), (this.previousCameraTarget = new ph()), (this.nextCameraTarget = new ph()), (this.mousePosition = new Vc()), (this.mouseDownPosition = new Vc()), (this.mouseDownTime = null), (this.resizeObserver = null), (this.mouseMoveListener = null), (this.mouseDownListener = null), (this.mouseUpListener = null), (this.keyDownListener = null), (this.sortPromise = null), (this.sortPromiseResolver = null), (this.splatSceneDownloadPromises = {}), (this.splatSceneDownloadAndBuildPromise = null), (this.splatSceneRemovalPromise = null), (this.loadingSpinner = new px(null, this.rootElement || document.body)), this.loadingSpinner.hide(), (this.loadingProgressBar = new vx(this.rootElement || document.body)), this.loadingProgressBar.hide(), (this.usingExternalCamera = !(!this.dropInMode && !this.camera)), (this.usingExternalRenderer = !(!this.dropInMode && !this.renderer)), (this.initialized = !1), (this.disposing = !1), (this.disposed = !1), (this.disposePromise = null), (this.lastTime = 0), (this.gaussianSplatCount = 0), (this.totalFrames = 0), (this.flame_params = null), (this.bone_tree = null), (this.lbs_weight_80k = null), (this.frame = 0), (this.useFlame = !0), (this.bones = null), (this.skeleton = null), (this.avatarMesh = null), (this.skinModel = null), (this.boneRoot = null), (this.baseMesh = null), (this.setSkinAttibutes = !1), this.dropInMode || this.init()) } return T( e, [ { key: 'createSplatMesh', value: function () { ;((this.splatMesh = new jx( this.splatRenderMode, this.dynamicScene, this.enableOptionalEffects, this.halfPrecisionCovariancesOnGPU, this.devicePixelRatio, this.gpuAcceleratedSort, this.integerBasedSort, this.antialiased, this.maxScreenSpaceSplatSize, this.logLevel, this.sphericalHarmonicsDegree, this.sceneFadeInRateMultiplier, this.kernel2DSize )), (this.splatMesh.frustumCulled = !1), this.onSplatMeshChangedCallback && this.onSplatMeshChangedCallback()) }, }, { key: 'init', value: function () { this.initialized || (this.rootElement || (this.usingExternalRenderer ? (this.rootElement = this.renderer.domElement || document.body) : ((this.rootElement = document.createElement('div')), (this.rootElement.style.width = '100%'), (this.rootElement.style.height = '100%'), (this.rootElement.style.position = 'absolute'), document.body.appendChild(this.rootElement))), this.setupCamera(), this.setupRenderer(), this.setupWebXR(this.webXRSessionInit), this.setupEventHandlers(), (this.threeScene = this.threeScene || new Ff()), (this.sceneHelper = new yx(this.threeScene)), this.sceneHelper.setupMeshCursor(), this.sceneHelper.setupFocusMarker(), this.sceneHelper.setupControlPlane(), this.loadingProgressBar.setContainer(this.rootElement), this.loadingSpinner.setContainer(this.rootElement), (this.initialized = !0)) }, }, { key: 'setupCamera', value: function () { if (!this.usingExternalCamera) { var e = new Vc() ;(this.getRenderDimensions(e), (this.perspectiveCamera = new kf(50, e.x / e.y, 0.1, 1e3)), (this.orthographicCamera = new Lv( e.x / -2, e.x / 2, e.y / 2, e.y / -2, 0.1, 1e3 )), (this.camera = this.startInOrthographicMode ? this.orthographicCamera : this.perspectiveCamera), this.camera.position.copy(this.initialCameraPosition), this.camera.rotateX(zc.degToRad(this.initialCameraRotation.x)), this.camera.rotateY(zc.degToRad(this.initialCameraRotation.y)), this.camera.rotateZ(zc.degToRad(this.initialCameraRotation.z))) } }, }, { key: 'setupRenderer', value: function () { var e = this if (!this.usingExternalRenderer) { var t = new Vc() ;(this.getRenderDimensions(t), (this.renderer = new Uy({ antialias: !1, precision: 'highp', canvas: this.canvas, })), this.renderer.setPixelRatio(this.devicePixelRatio), (this.renderer.autoClear = !0), this.renderer.setClearColor(this.backgroundColor, 1), this.renderer.setSize(t.x, t.y), (this.resizeObserver = new ResizeObserver(function () { ;(e.getRenderDimensions(t), e.renderer.setSize(t.x, t.y), e.forceRenderNextFrame()) })), this.resizeObserver.observe(this.rootElement), this.rootElement.appendChild(this.renderer.domElement)) } }, }, { key: 'setupWebXR', value: function (e) { var t = this this.webXRMode && (this.webXRMode === Kx ? this.rootElement.appendChild(Jx.createButton(this.renderer, e)) : this.webXRMode === Zx && this.rootElement.appendChild($x.createButton(this.renderer, e)), this.renderer.xr.addEventListener('sessionstart', function (e) { t.webXRActive = !0 }), this.renderer.xr.addEventListener('sessionend', function (e) { t.webXRActive = !1 }), (this.renderer.xr.enabled = !0), this.camera.position.copy(this.initialCameraPosition), this.camera.up.copy(this.cameraUp).normalize(), this.camera.lookAt(this.initialCameraLookAt)) }, }, { key: 'setupControls', value: function () { if (this.useBuiltInControls && this.webXRMode === Yx) { this.usingExternalCamera ? this.camera.isOrthographicCamera ? (this.orthographicControls = new fx( this.camera, this.renderer.domElement )) : (this.perspectiveControls = new fx( this.camera, this.renderer.domElement )) : ((this.perspectiveControls = new fx( this.perspectiveCamera, this.renderer.domElement )), (this.orthographicControls = new fx( this.orthographicCamera, this.renderer.domElement ))) for ( var e = 0, t = [this.orthographicControls, this.perspectiveControls]; e < t.length; e++ ) { var n = t[e] n && (n.listenToKeyEvents(window), (n.rotateSpeed = 0.5), (n.maxPolarAngle = 0.5 * Math.PI), (n.minPolarAngle = 0.5 * Math.PI), (n.enableDamping = !0), (n.dampingFactor = 0.05), n.target.copy(this.initialCameraLookAt), n.update()) } ;((this.controls = this.camera.isOrthographicCamera ? this.orthographicControls : this.perspectiveControls), this.controls.update()) } }, }, { key: 'setupEventHandlers', value: function () { this.useBuiltInControls && this.webXRMode === Yx && ((this.mouseMoveListener = this.onMouseMove.bind(this)), this.renderer.domElement.addEventListener( 'pointermove', this.mouseMoveListener, !1 ), (this.mouseDownListener = this.onMouseDown.bind(this)), this.renderer.domElement.addEventListener( 'pointerdown', this.mouseDownListener, !1 ), (this.mouseUpListener = this.onMouseUp.bind(this)), this.renderer.domElement.addEventListener( 'pointerup', this.mouseUpListener, !1 ), (this.keyDownListener = this.onKeyDown.bind(this))) }, }, { key: 'removeEventHandlers', value: function () { this.useBuiltInControls && (this.renderer.domElement.removeEventListener( 'pointermove', this.mouseMoveListener ), (this.mouseMoveListener = null), this.renderer.domElement.removeEventListener( 'pointerdown', this.mouseDownListener ), (this.mouseDownListener = null), this.renderer.domElement.removeEventListener( 'pointerup', this.mouseUpListener ), (this.mouseUpListener = null), window.removeEventListener('keydown', this.keyDownListener), (this.keyDownListener = null)) }, }, { key: 'setRenderMode', value: function (e) { this.renderMode = e }, }, { key: 'setActiveSphericalHarmonicsDegrees', value: function (e) { ;((this.splatMesh.material.uniforms.sphericalHarmonicsDegree.value = e), (this.splatMesh.material.uniformsNeedUpdate = !0)) }, }, { key: 'onSplatMeshChanged', value: function (e) { this.onSplatMeshChangedCallback = e }, }, { key: 'onMouseMove', value: function (e) { this.mousePosition.set(e.offsetX, e.offsetY) }, }, { key: 'onMouseDown', value: function () { ;(this.mouseDownPosition.copy(this.mousePosition), (this.mouseDownTime = Pu())) }, }, { key: 'onMouseClick', value: function (e) { ;(this.mousePosition.set(e.offsetX, e.offsetY), this.checkForFocalPointChange()) }, }, { key: 'getRenderDimensions', value: function (e) { this.rootElement ? ((e.x = this.rootElement.offsetWidth), (e.y = this.rootElement.offsetHeight)) : this.renderer.getSize(e) }, }, { key: 'setOrthographicMode', value: function (t) { if (t !== this.camera.isOrthographicCamera) { var n = this.camera, r = t ? this.orthographicCamera : this.perspectiveCamera if ( (r.position.copy(n.position), r.up.copy(n.up), r.rotation.copy(n.rotation), r.quaternion.copy(n.quaternion), r.matrix.copy(n.matrix), (this.camera = r), this.controls) ) { var i = function (e) { ;(e.saveState(), e.reset()) }, a = this.controls, o = t ? this.orthographicControls : this.perspectiveControls ;(i(o), i(a), o.target.copy(a.target), t ? e.setCameraZoomFromPosition(r, n, a) : e.setCameraPositionFromZoom(r, n, o), (this.controls = o), this.camera.lookAt(this.controls.target)) } } }, }, { key: 'adjustForWebXRStereo', value: function (e) { if (this.camera && this.webXRActive) { var t = this.renderer.xr.getCamera().projectionMatrix.elements[0], n = this.camera.projectionMatrix.elements[0] e.x *= n / t } }, }, { key: 'isLoadingOrUnloading', value: function () { return ( Object.keys(this.splatSceneDownloadPromises).length > 0 || null !== this.splatSceneDownloadAndBuildPromise || null !== this.splatSceneRemovalPromise ) }, }, { key: 'isDisposingOrDisposed', value: function () { return this.disposing || this.disposed }, }, { key: 'addSplatSceneDownloadPromise', value: function (e) { this.splatSceneDownloadPromises[e.id] = e }, }, { key: 'removeSplatSceneDownloadPromise', value: function (e) { delete this.splatSceneDownloadPromises[e.id] }, }, { key: 'setSplatSceneDownloadAndBuildPromise', value: function (e) { this.splatSceneDownloadAndBuildPromise = e }, }, { key: 'clearSplatSceneDownloadAndBuildPromise', value: function () { this.splatSceneDownloadAndBuildPromise = null }, }, { key: 'addSplatScene', value: function (t) { var n = this, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} if (this.isLoadingOrUnloading()) throw new Error( 'Cannot add splat scene while another load or unload is already in progress.' ) if (this.isDisposingOrDisposed()) throw new Error('Cannot add splat scene after dispose() is called.') r.progressiveLoad && this.splatMesh.scenes && this.splatMesh.scenes.length > 0 && (console.log( 'addSplatScene(): "progressiveLoad" option ignore because there are multiple splat scenes' ), (r.progressiveLoad = !1)) var i = void 0 !== r.format && null !== r.format ? r.format : ox(t), a = e.isProgressivelyLoadable(i) && r.progressiveLoad, o = void 0 === r.showLoadingUI || null === r.showLoadingUI || r.showLoadingUI, s = null o && (this.loadingSpinner.removeAllTasks(), (s = this.loadingSpinner.addTask('Downloading...'))) var u = !1, l = 0 return ( a ? this.downloadAndBuildSingleSplatSceneProgressiveLoad.bind(this) : this.downloadAndBuildSingleSplatSceneStandardLoad.bind(this) )( t, i, r.splatAlphaRemovalThreshold, function (e, t, i) { !a && r.onProgress && r.onProgress(0, '0%', Wb) var c = { rotation: r.rotation || r.orientation, position: r.position, scale: r.scale, splatAlphaRemovalThreshold: r.splatAlphaRemovalThreshold, } return n.addSplatBuffers([e], [c], i, t && o, o, a, a).then(function () { ;(!a && r.onProgress && r.onProgress(100, '100%', Wb), (function (e, t) { o && (((e && a) || (t && !a)) && (n.loadingSpinner.removeTask(s), t || u || n.loadingProgressBar.show()), a && (t ? ((u = !0), n.loadingProgressBar.hide()) : n.loadingProgressBar.setProgress(l))) })(t, i)) }) }.bind(this), function (e, t, i) { ;((l = e), (function (e, t, r) { if (o) if (r === Hb) if (100 == e) n.loadingSpinner.setMessageForTask(s, 'Download complete!') else if (a) n.loadingSpinner.setMessageForTask(s, 'Downloading splats...') else { var i = t ? ': '.concat(t) : '...' n.loadingSpinner.setMessageForTask(s, 'Downloading'.concat(i)) } else r === Wb && (console.log('loaderStatus === LoaderStatus.Processing'), n.loadingSpinner.setMessageForTask(s, 'Processing splats...')) })(e, t, i), r.onProgress && r.onProgress(e, t, i)) }, function () { ;(n.loadingProgressBar.hide(), n.loadingSpinner.removeAllTasks()) }.bind(this), r.headers ) }, }, { key: 'downloadAndBuildSingleSplatSceneStandardLoad', value: function (e, t, n, r, i, a, o) { var s = this, u = this.downloadSplatSceneToSplatBuffer(e, n, i, !1, void 0, t, o), l = Bu(u.abortHandler) return ( u .then(function (e) { return ( s.removeSplatSceneDownloadPromise(u), r(e, !0, !0).then(function () { ;(l.resolve(), s.clearSplatSceneDownloadAndBuildPromise()) }) ) }) .catch(function (t) { ;(a && a(), s.clearSplatSceneDownloadAndBuildPromise(), s.removeSplatSceneDownloadPromise(u)) var n = t instanceof Cu ? t : new Error( 'Viewer::addSplatScene -> Could not load file '.concat(e) ) l.reject(n) }), this.addSplatSceneDownloadPromise(u), this.setSplatSceneDownloadAndBuildPromise(l.promise), l.promise ) }, }, { key: 'downloadAndBuildSingleSplatSceneProgressiveLoad', value: function (e, t, n, r, i, a, o) { var s = this, u = 0, l = !1, c = [], h = function () { if (c.length > 0 && !l && !s.isDisposingOrDisposed()) { l = !0 var e = c.shift() r(e.splatBuffer, e.firstBuild, e.finalBuild).then(function () { ;((l = !1), e.firstBuild ? f.resolve() : e.finalBuild && (p.resolve(), s.clearSplatSceneDownloadAndBuildPromise()), c.length > 0 && Du(function () { return h() })) }) } }, d = this.downloadSplatSceneToSplatBuffer( e, n, i, !0, function (e, t) { s.isDisposingOrDisposed() || ((t || 0 === c.length || e.getSplatCount() > c[0].splatBuffer.getSplatCount()) && (c.push({ splatBuffer: e, firstBuild: 0 === u, finalBuild: t }), u++, h())) }, t, o ), f = Bu(d.abortHandler), p = Bu() return ( this.addSplatSceneDownloadPromise(d), this.setSplatSceneDownloadAndBuildPromise(p.promise), d .then(function () { s.removeSplatSceneDownloadPromise(d) }) .catch(function (e) { ;(s.clearSplatSceneDownloadAndBuildPromise(), s.removeSplatSceneDownloadPromise(d)) var t = e instanceof Cu ? e : new Error( 'Viewer::addSplatScene -> Could not load one or more scenes' ) ;(f.reject(t), a && a(t)) }), f.promise ) }, }, { key: 'addSplatScenes', value: function (e) { var t = this, n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0 if (this.isLoadingOrUnloading()) throw new Error( 'Cannot add splat scene while another load or unload is already in progress.' ) if (this.isDisposingOrDisposed()) throw new Error('Cannot add splat scene after dispose() is called.') var i, a = e.length, o = [] n && (this.loadingSpinner.removeAllTasks(), (i = this.loadingSpinner.addTask('Downloading...'))) for ( var s = function (e, s, u, l) { o[e] = s for (var c = 0, h = 0; h < a; h++) c += o[h] || 0 ;((u = ''.concat((c /= a).toFixed(2), '%')), n && l === Hb && t.loadingSpinner.setMessageForTask( i, 100 == c ? 'Download complete!' : 'Downloading: '.concat(u) ), r && r(c, u, l)) }, u = [], l = [], c = 0; c < e.length; c++ ) { var h = e[c], d = void 0 !== h.format && null !== h.format ? h.format : ox(h.path), f = this.downloadSplatSceneToSplatBuffer( h.path, h.splatAlphaRemovalThreshold, s.bind(this, c), !1, void 0, d, h.headers ) ;(u.push(f), l.push(f.promise)) } var p = new Mu( function (a, o) { Promise.all(l) .then(function (o) { ;(n && t.loadingSpinner.removeTask(i), r && r(0, '0%', Wb), t.addSplatBuffers(o, e, !0, n, n, !1, !1).then(function () { ;(r && r(100, '100%', Wb), t.clearSplatSceneDownloadAndBuildPromise(), a()) })) }) .catch(function (e) { ;(n && t.loadingSpinner.removeTask(i), t.clearSplatSceneDownloadAndBuildPromise()) var r = e instanceof Cu ? e : new Error( 'Viewer::addSplatScenes -> Could not load one or more splat scenes.' ) o(r) }) .finally(function () { t.removeSplatSceneDownloadPromise(p) }) }, function (e) { for (var t = 0, n = u; t < n.length; t++) { n[t].abort(e) } } ) return ( this.addSplatSceneDownloadPromise(p), this.setSplatSceneDownloadAndBuildPromise(p), p ) }, }, { key: 'downloadSplatSceneToSplatBuffer', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : void 0, a = arguments.length > 5 ? arguments[5] : void 0, o = arguments.length > 6 ? arguments[6] : void 0, s = !r && this.optimizeSplatData try { if (a === rx) return tx.loadFromURL(e, n, r, i, t, this.inMemoryCompressionLevel, s, o) if (a === ix) return nx.loadFromURL(e, n, r, i, o) if (a === ax) return Zb.loadFromURL( e, n, r, i, t, this.inMemoryCompressionLevel, s, this.sphericalHarmonicsDegree, o ) } catch (ZJ) { throw ZJ instanceof jb ? new Error('File type or server does not support progressive loading.') : ZJ } throw new Error( 'Viewer::downloadSplatSceneToSplatBuffer -> File format not supported: '.concat( e ) ) }, }, { key: 'setupSortWorker', value: ((n = v( d().m(function e(t) { var n = this return d().w( function (e) { for (;;) switch (e.n) { case 0: if (!this.isDisposingOrDisposed()) { e.n = 1 break } return e.a(2) case 1: return e.a( 2, new Promise( (function () { var e = v( d().m(function e(r) { var i, a, o return d().w(function (e) { for (;;) switch (e.n) { case 0: return ( (i = n.integerBasedSort ? Int32Array : Float32Array), (a = t.getSplatCount()), (o = t.getMaxSplatCount()), (e.n = 1), Xx( o, n.sharedMemoryForWorkers, n.enableSIMDInSort, n.integerBasedSort, n.splatMesh.dynamicMode, n.splatSortDistanceMapPrecision ) ) case 1: ;((n.sortWorker = e.v), (n.sortWorker.onmessage = function (e) { if (e.data.sortDone) { if ( ((n.sortRunning = !1), Array.from( { length: n.gaussianSplatCount }, function (e, t) { return t } ), n.sharedMemoryForWorkers) ) n.splatMesh.updateRenderIndexes( n.sortWorkerSortedIndexes, e.data.splatRenderCount ) else { var t = new Uint32Array( e.data.sortedIndexes.buffer, 0, e.data.splatRenderCount ) n.splatMesh.updateRenderIndexes( t, e.data.splatRenderCount ) } ;((n.lastSplatSortCount = n.splatSortCount), (n.lastSortTime = e.data.sortTime), n.sortPromiseResolver(), (n.sortPromiseResolver = null), n.forceRenderNextFrame(), n.runAfterNextSort.length > 0 && (n.runAfterNextSort.forEach( function (e) { e() } ), (n.runAfterNextSort.length = 0))) } else if (e.data.sortCanceled) n.sortRunning = !1 else if (e.data.sortSetupPhase1Complete) { ;(n.logLevel >= Vx && console.log( 'Sorting web worker WASM setup complete.' ), n.sharedMemoryForWorkers ? ((n.sortWorkerSortedIndexes = new Uint32Array( e.data.sortedIndexesBuffer, e.data.sortedIndexesOffset, o )), (n.sortWorkerIndexesToSort = new Uint32Array( e.data.indexesToSortBuffer, e.data.indexesToSortOffset, o )), (n.sortWorkerPrecomputedDistances = new i( e.data.precomputedDistancesBuffer, e.data.precomputedDistancesOffset, o )), (n.sortWorkerTransforms = new Float32Array( e.data.transformsBuffer, e.data.transformsOffset, 16 * zy.MaxScenes ))) : ((n.sortWorkerIndexesToSort = new Uint32Array(o)), (n.sortWorkerPrecomputedDistances = new i(o)), (n.sortWorkerTransforms = new Float32Array( 16 * zy.MaxScenes )))) for (var s = 0; s < a; s++) n.sortWorkerIndexesToSort[s] = s if ( ((n.sortWorker.maxSplatCount = o), n.logLevel >= Vx) ) { console.log( 'Sorting web worker ready.' ) var u = n.splatMesh.getSplatDataTextures(), l = u.covariances.size, c = u.centerColors.size ;(console.log( 'Covariances texture size: ' + l.x + ' x ' + l.y ), console.log( 'Centers/colors texture size: ' + c.x + ' x ' + c.y )) } r() } })) case 2: return e.a(2) } }, e) }) ) return function (t) { return e.apply(this, arguments) } })() ) ) } }, e, this ) }) )), function (e) { return n.apply(this, arguments) }), }, { key: 'disposeSortWorker', value: function () { ;(this.sortWorker && this.sortWorker.terminate(), (this.sortWorker = null), (this.sortPromise = null), this.sortPromiseResolver && (this.sortPromiseResolver(), (this.sortPromiseResolver = null)), (this.preSortMessages = []), (this.sortRunning = !1)) }, }, { key: 'removeSplatScene', value: function (e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] return this.removeSplatScenes([e], t) }, }, { key: 'removeSplatScenes', value: function (e) { var t = this, n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] if (this.isLoadingOrUnloading()) throw new Error( 'Cannot remove splat scene while another load or unload is already in progress.' ) if (this.isDisposingOrDisposed()) throw new Error('Cannot remove splat scene after dispose() is called.') return ( (this.splatSceneRemovalPromise = new Promise(function (r, i) { var a n && (t.loadingSpinner.removeAllTasks(), t.loadingSpinner.show(), (a = t.loadingSpinner.addTask('Removing splat scene...'))) var o = function () { n && (t.loadingSpinner.hide(), t.loadingSpinner.removeTask(a)) }, s = function (e) { ;(o(), (t.splatSceneRemovalPromise = null), e ? i(e) : r()) }, u = function () { return !!t.isDisposingOrDisposed() && (s(), !0) } ;(t.sortPromise || Promise.resolve()).then(function () { if (!u()) { for ( var n = [], r = [], i = [], a = 0; a < t.splatMesh.scenes.length; a++ ) { var l, c = !1, h = L(e) try { for (h.s(); !(l = h.n()).done; ) { if (l.value === a) { c = !0 break } } } catch (f) { h.e(f) } finally { h.f() } if (!c) { var d = t.splatMesh.scenes[a] ;(n.push(d.splatBuffer), r.push(t.splatMesh.sceneOptions[a]), i.push({ position: d.position.clone(), quaternion: d.quaternion.clone(), scale: d.scale.clone(), })) } } ;(t.disposeSortWorker(), t.splatMesh.dispose(), (t.sceneRevealMode = Ux), t.createSplatMesh(), t .addSplatBuffers(n, r, !0, !1, !0) .then(function () { u() || (o(), t.splatMesh.scenes.forEach(function (e, t) { ;(e.position.copy(i[t].position), e.quaternion.copy(i[t].quaternion), e.scale.copy(i[t].scale)) }), t.splatMesh.updateTransforms(), (t.splatRenderReady = !1), t.runSplatSort(!0).then(function () { u() ? (t.splatRenderReady = !0) : (t.sortPromise || Promise.resolve()).then(function () { ;((t.splatRenderReady = !0), s()) }) })) }) .catch(function (e) { s(e) })) } }) })), this.splatSceneRemovalPromise ) }, }, { key: 'start', value: function () { if (!this.selfDrivenMode) throw new Error('Cannot start viewer unless it is in self driven mode.') ;(this.webXRMode ? this.renderer.setAnimationLoop(this.selfDrivenUpdateFunc) : (this.requestFrameId = requestAnimationFrame(this.selfDrivenUpdateFunc)), (this.selfDrivenModeRunning = !0)) }, }, { key: 'stop', value: function () { this.selfDrivenMode && this.selfDrivenModeRunning && (this.webXRMode ? this.renderer.setAnimationLoop(null) : cancelAnimationFrame(this.requestFrameId), (this.selfDrivenModeRunning = !1)) }, }, { key: 'dispose', value: ((t = v( d().m(function e() { var t, n, r, i, a = this return d().w( function (e) { for (;;) switch (e.n) { case 0: if (!this.isDisposingOrDisposed()) { e.n = 1 break } return e.a(2, this.disposePromise) case 1: for (r in ((t = []), (n = []), this.splatSceneDownloadPromises)) this.splatSceneDownloadPromises.hasOwnProperty(r) && ((i = this.splatSceneDownloadPromises[r]), n.push(i), t.push(i.promise)) return ( this.sortPromise && t.push(this.sortPromise), (this.disposing = !0), (this.disposePromise = Promise.all(t).finally(function () { ;(a.stop(), a.orthographicControls && (a.orthographicControls.dispose(), (a.orthographicControls = null)), a.perspectiveControls && (a.perspectiveControls.dispose(), (a.perspectiveControls = null)), (a.controls = null), a.splatMesh && (a.splatMesh.dispose(), (a.splatMesh = null)), a.sceneHelper && (a.sceneHelper.dispose(), (a.sceneHelper = null)), a.resizeObserver && (a.resizeObserver.unobserve(a.rootElement), (a.resizeObserver = null)), a.disposeSortWorker(), a.removeEventHandlers(), a.loadingSpinner.removeAllTasks(), a.loadingSpinner.setContainer(null), a.loadingProgressBar.hide(), a.loadingProgressBar.setContainer(null), (a.camera = null), (a.threeScene = null), (a.splatRenderReady = !1), (a.initialized = !1), a.renderer && (a.usingExternalRenderer || (a.rootElement.removeChild(a.renderer.domElement), a.renderer.dispose()), (a.renderer = null)), a.usingExternalRenderer, (a.sortWorkerSortedIndexes = null), (a.sortWorkerIndexesToSort = null), (a.sortWorkerPrecomputedDistances = null), (a.sortWorkerTransforms = null), (a.disposed = !0), (a.disposing = !1), (a.disposePromise = null)) })), n.forEach(function (e) { e.abort('Scene disposed') }), e.a(2, this.disposePromise) ) } }, e, this ) }) )), function () { return t.apply(this, arguments) }), }, { key: 'selfDrivenUpdate', value: function () { ;(this.selfDrivenMode && !this.webXRMode && (this.requestFrameId = requestAnimationFrame(this.selfDrivenUpdateFunc)), this.vsyncCount++, this.vsyncCount < this.vsyncNum || ((this.vsyncCount = 0), this.update(), this.shouldRender() ? (this.render(), this.consecutiveRenderFrames++) : (this.consecutiveRenderFrames = 0), (this.renderNextFrame = !1))) }, }, { key: 'forceRenderNextFrame', value: function () { this.renderNextFrame = !0 }, }, { key: 'update', value: function (t, n) { var r = document.getElementById('fps') ;(r && (r.textContent = 'FPS: '.concat(this.currentFPS)), this.frame >= this.totalFrames && (this.frame = 0), this.dropInMode && this.updateForDropInMode(t, n), this.initialized && this.splatRenderReady && !this.isDisposingOrDisposed() && (this.controls && (this.controls.update(), this.camera.isOrthographicCamera && !this.usingExternalCamera && e.setCameraPositionFromZoom(this.camera, this.camera, this.controls)), this.runMorphUpdate(), this.runSplatSort(!0, !0), this.updateForRendererSizeChanges(), this.updateSplatMesh(), this.updateMeshCursor(), this.updateFPS(), this.timingSensitiveUpdates(), this.updateControlPlane())) }, }, { key: 'updateForDropInMode', value: function (e, t) { ;((this.renderer = e), this.splatMesh && this.splatMesh.setRenderer(this.renderer), (this.camera = t), this.controls && (this.controls.object = t), this.init()) }, }, { key: 'updateControlPlane', value: function () { this.showControlPlane ? (this.sceneHelper.setControlPlaneVisibility(!0), this.sceneHelper.positionAndOrientControlPlane( this.controls.target, this.camera.up )) : this.sceneHelper.setControlPlaneVisibility(!1) }, }, { key: 'getSplatMesh', value: function () { return this.splatMesh }, }, { key: 'getSplatScene', value: function (e) { return this.splatMesh.getScene(e) }, }, { key: 'getSceneCount', value: function () { return this.splatMesh.getSceneCount() }, }, { key: 'isMobile', value: function () { return navigator.userAgent.includes('Mobi') }, }, { key: 'createBonesFromJson', value: function (e) { var t = [] function n(e) { var r, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, a = new Zf() return ( (a.name = e.name), i && i.add(a), (r = a.position).set.apply(r, I(e.position)), t.push(a), e.children && e.children.forEach(function (e) { return n(e, a) }), a ) } return ( e.forEach(function (e) { return n(e) }), t ) }, }, { key: 'updateMorphTarget', value: function (e) { if ( ((this.avatarMesh = e), (this.splatMesh.flameModel = e), (this.splatMesh.useFlameModel = this.useFlame), 1 == this.useFlame) ) { this.bones = this.createBonesFromJson(this.bone_tree.bones) var t = [ new ph( this.bones[0].position.x, this.bones[0].position.y, this.bones[0].position.z ), new ph( this.bones[1].position.x, this.bones[1].position.y, this.bones[1].position.z ), new ph( this.bones[2].position.x, this.bones[2].position.y, this.bones[2].position.z ), new ph( this.bones[3].position.x, this.bones[3].position.y, this.bones[3].position.z ), new ph( this.bones[4].position.x, this.bones[4].position.y, this.bones[4].position.z ), ] ;(this.bones[1].position.copy( new ph(t[1].x - t[0].x, t[1].y - t[0].y, t[1].z - t[0].z) ), this.bones[2].position.copy( new ph(t[2].x - t[1].x, t[2].y - t[1].y, t[2].z - t[1].z) ), this.bones[3].position.copy( new ph(t[3].x - t[1].x, t[3].y - t[1].y, t[3].z - t[1].z) ), this.bones[4].position.copy( new ph(t[4].x - t[1].x, t[4].y - t[1].y, t[4].z - t[1].z) ), this.bones[0].updateMatrixWorld(!0)) var n = [ this.bones[0].matrixWorld.clone().invert(), this.bones[1].matrixWorld.clone().invert(), this.bones[2].matrixWorld.clone().invert(), this.bones[3].matrixWorld.clone().invert(), this.bones[4].matrixWorld.clone().invert(), ] this.skeleton = new tp(this.bones, n) } ;(this.runMorphUpdate(), (this.splatMesh.gaussianSplatCount = this.gaussianSplatCount)) }, }, { key: 'updatedBoneMatrices', value: function (e) { for ( var t = this, n = [], r = function () { !(function (e, t) { for (var n = e.elements, r = 0; r < n.length; r++) t.push(n[r]) })( t.skeleton.bones[i].matrixWorld .clone() .multiply(t.skeleton.boneInverses[i].clone()), n ) }, i = 0; i < e; i++ ) r() return new Float32Array(n) }, }, { key: 'runMorphUpdate', value: function () { this.gaussianSplatCount = this.avatarMesh.geometry.attributes.position.count var e = new Float32Array(this.avatarMesh.geometry.attributes.position.array) if (((this.splatMesh.bonesNum = 5), 0 == this.useFlame)) { if ( (this.skinModel.skeleton.update(), this.boneRoot.updateMatrixWorld(!0), this.splatMesh.geometry.getAttribute('splatIndex') && !1 === this.setSkinAttibutes) ) { this.setSkinAttibutes = !0 var t = this.splatMesh.geometry, n = this.skinModel.geometry.attributes.skinIndex, r = this.skinModel.geometry.attributes.skinWeight, i = new np(new n.array.constructor(n.array), 4, n.normalized, 1), a = new np(new r.array.constructor(r.array), 4, r.normalized, 1) ;(i.setUsage(Tc), a.setUsage(Tc), t.setAttribute('skinIndex', i), t.setAttribute('skinWeight', a)) } } else this.updateFlameBones() this.splatMesh.morphedMesh = e var o = this.splatMesh.morphedMesh.length / 3 null != this.splatMesh.splatDataTextures.flameModel && this.splatMesh.updateTetureAfterBSAndSkeleton(0, o - 1, this.useFlame) }, }, { key: 'updateFlameBones', value: function () { function e(e, t) { var n if (1 == (arguments.length > 2 && void 0 !== arguments[2] && arguments[2])) n = new fh(t[0], t[1], t[2], t[3]) else { var r = new ph(t[0], t[1], t[2]), i = r.length(), a = r.normalize() n = new fh().setFromAxisAngle(a, i) } ;(e.quaternion.copy(n), e.updateMatrixWorld(!0)) } this.splatMesh.bsWeight = this.flame_params.expr[this.frame] var t = this.flame_params.rotation[this.frame] ;(e(this.skeleton.bones[0], t), (t = this.flame_params.neck_pose[this.frame]), e(this.skeleton.bones[1], t), (t = this.flame_params.jaw_pose[this.frame]), e(this.skeleton.bones[2], t), (t = this.flame_params.eyes_pose[this.frame]), e(this.skeleton.bones[3], t), e(this.skeleton.bones[4], [t[3], t[4], t[5]]), this.skeleton.update()) var n = this.updatedBoneMatrices(5) ;((this.splatMesh.bonesMatrix = n), (this.splatMesh.bonesNum = 5), (this.splatMesh.bonesWeight = this.lbs_weight_80k)) }, }, ], [ { key: 'isProgressivelyLoadable', value: function (e) { return e === rx || e === ix || e === ax }, }, ] ) var t, n })() function QO(e, t, n, r) { return new (n || (n = Promise))(function (i, a) { function o(e) { try { u(r.next(e)) } catch (ZJ) { a(ZJ) } } function s(e) { try { u(r.throw(e)) } catch (ZJ) { a(ZJ) } } function u(e) { var t e.done ? i(e.value) : ((t = e.value), t instanceof n ? t : new n(function (e) { e(t) })).then(o, s) } u((r = r.apply(e, t || [])).next()) }) } function qO(e, t) { return function () { return e.apply(t, arguments) } } ;(M( jO, 'setCameraPositionFromZoom', ((GO = new ph()), function (e, t, n) { var r = 1 / (0.001 * t.zoom) ;(GO.copy(n.target).sub(e.position).normalize().multiplyScalar(r).negate(), e.position.copy(n.target).add(GO)) }) ), M( jO, 'setCameraZoomFromPosition', (function () { var e = new ph() return function (t, n, r) { var i = e.copy(r.target).sub(n.position).length() t.zoom = 1 / (0.001 * i) } })() ), 'function' == typeof SuppressedError && SuppressedError) var XO = Object.prototype.toString, YO = Object.getPrototypeOf, KO = (function (e) { return function (t) { var n = XO.call(t) return e[n] || (e[n] = n.slice(8, -1).toLowerCase()) } })(Object.create(null)), ZO = function (e) { return ( (e = e.toLowerCase()), function (t) { return KO(t) === e } ) }, JO = function (e) { return function (t) { return P(t) === e } }, $O = Array.isArray, eF = JO('undefined') var tF = ZO('ArrayBuffer') var nF = JO('string'), rF = JO('function'), iF = JO('number'), aF = function (e) { return null !== e && 'object' === P(e) }, oF = function (e) { if ('object' !== KO(e)) return !1 var t = YO(e) return !( (null !== t && t !== Object.prototype && null !== Object.getPrototypeOf(t)) || Symbol.toStringTag in e || Symbol.iterator in e ) }, sF = ZO('Date'), uF = ZO('File'), lF = ZO('Blob'), cF = ZO('FileList'), hF = ZO('URLSearchParams'), dF = C(['ReadableStream', 'Request', 'Response', 'Headers'].map(ZO), 4), fF = dF[0], pF = dF[1], vF = dF[2], mF = dF[3] function gF(e, t) { var n, r, i = (arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}).allOwnKeys, a = void 0 !== i && i if (null != e) if (('object' !== P(e) && (e = [e]), $O(e))) for (n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e) else { var o, s = a ? Object.getOwnPropertyNames(e) : Object.keys(e), u = s.length for (n = 0; n < u; n++) ((o = s[n]), t.call(null, e[o], o, e)) } } function yF(e, t) { t = t.toLowerCase() for (var n, r = Object.keys(e), i = r.length; i-- > 0; ) if (t === (n = r[i]).toLowerCase()) return n return null } var _F = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : global, bF = function (e) { return !eF(e) && e !== _F } var xF, SF = ((xF = 'undefined' != typeof Uint8Array && YO(Uint8Array)), function (e) { return xF && e instanceof xF }), AF = ZO('HTMLFormElement'), wF = (function () { var e = Object.prototype.hasOwnProperty return function (t, n) { return e.call(t, n) } })(), TF = ZO('RegExp'), MF = function (e, t) { var n = Object.getOwnPropertyDescriptors(e), r = {} ;(gF(n, function (n, i) { var a !1 !== (a = t(n, i, e)) && (r[i] = a || n) }), Object.defineProperties(e, r)) } var EF, CF, kF = ZO('AsyncFunction'), RF = ((EF = 'function' == typeof setImmediate), (CF = rF(_F.postMessage)), EF ? setImmediate : CF ? (function (e, t) { return ( _F.addEventListener( 'message', function (n) { var r = n.source, i = n.data r === _F && i === e && t.length && t.shift()() }, !1 ), function (n) { ;(t.push(n), _F.postMessage(e, '*')) } ) })('axios@'.concat(Math.random()), []) : function (e) { return setTimeout(e) }), IF = 'undefined' != typeof queueMicrotask ? queueMicrotask.bind(_F) : ('undefined' != typeof process && process.nextTick) || RF, NF = { isArray: $O, isArrayBuffer: tF, isBuffer: function (e) { return ( null !== e && !eF(e) && null !== e.constructor && !eF(e.constructor) && rF(e.constructor.isBuffer) && e.constructor.isBuffer(e) ) }, isFormData: function (e) { var t return ( e && (('function' == typeof FormData && e instanceof FormData) || (rF(e.append) && ('formdata' === (t = KO(e)) || ('object' === t && rF(e.toString) && '[object FormData]' === e.toString())))) ) }, isArrayBufferView: function (e) { return 'undefined' != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && tF(e.buffer) }, isString: nF, isNumber: iF, isBoolean: function (e) { return !0 === e || !1 === e }, isObject: aF, isPlainObject: oF, isReadableStream: fF, isRequest: pF, isResponse: vF, isHeaders: mF, isUndefined: eF, isDate: sF, isFile: uF, isBlob: lF, isRegExp: TF, isFunction: rF, isStream: function (e) { return aF(e) && rF(e.pipe) }, isURLSearchParams: hF, isTypedArray: SF, isFileList: cF, forEach: gF, merge: function e() { for ( var t = ((bF(this) && this) || {}).caseless, n = {}, r = function (r, i) { var a = (t && yF(n, i)) || i oF(n[a]) && oF(r) ? (n[a] = e(n[a], r)) : oF(r) ? (n[a] = e({}, r)) : $O(r) ? (n[a] = r.slice()) : (n[a] = r) }, i = 0, a = arguments.length; i < a; i++ ) arguments[i] && gF(arguments[i], r) return n }, extend: function (e, t, n) { return ( gF( t, function (t, r) { n && rF(t) ? (e[r] = qO(t, n)) : (e[r] = t) }, { allOwnKeys: (arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {} ).allOwnKeys, } ), e ) }, trim: function (e) { return e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '') }, stripBOM: function (e) { return (65279 === e.charCodeAt(0) && (e = e.slice(1)), e) }, inherits: function (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)) }, toFlatObject: function (e, t, n, r) { var i, a, o, s = {} if (((t = t || {}), null == e)) return t do { for (a = (i = Object.getOwnPropertyNames(e)).length; a-- > 0; ) ((o = i[a]), (r && !r(o, e, t)) || s[o] || ((t[o] = e[o]), (s[o] = !0))) e = !1 !== n && YO(e) } while (e && (!n || n(e, t)) && e !== Object.prototype) return t }, kindOf: KO, kindOfTest: ZO, endsWith: function (e, t, n) { ;((e = String(e)), (void 0 === n || n > e.length) && (n = e.length), (n -= t.length)) var r = e.indexOf(t, n) return -1 !== r && r === n }, toArray: function (e) { if (!e) return null if ($O(e)) return e var t = e.length if (!iF(t)) return null for (var n = new Array(t); t-- > 0; ) n[t] = e[t] return n }, forEachEntry: function (e, t) { for (var n, r = (e && e[Symbol.iterator]).call(e); (n = r.next()) && !n.done; ) { var i = n.value t.call(e, i[0], i[1]) } }, matchAll: function (e, t) { for (var n, r = []; null !== (n = e.exec(t)); ) r.push(n) return r }, isHTMLForm: AF, hasOwnProperty: wF, hasOwnProp: wF, reduceDescriptors: MF, freezeMethods: function (e) { MF(e, function (t, n) { if (rF(e) && -1 !== ['arguments', 'caller', 'callee'].indexOf(n)) return !1 var r = e[n] rF(r) && ((t.enumerable = !1), 'writable' in t ? (t.writable = !1) : t.set || (t.set = function () { throw Error("Can not rewrite read-only method '" + n + "'") })) }) }, toObjectSet: function (e, t) { var n = {}, r = function (e) { e.forEach(function (e) { n[e] = !0 }) } return ($O(e) ? r(e) : r(String(e).split(t)), n) }, toCamelCase: function (e) { return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function (e, t, n) { return t.toUpperCase() + n }) }, noop: function () {}, toFiniteNumber: function (e, t) { return null != e && Number.isFinite((e = +e)) ? e : t }, findKey: yF, global: _F, isContextDefined: bF, isSpecCompliantForm: function (e) { return !!( e && rF(e.append) && 'FormData' === e[Symbol.toStringTag] && e[Symbol.iterator] ) }, toJSONObject: function (e) { var t = new Array(10), n = function (e, r) { if (aF(e)) { if (t.indexOf(e) >= 0) return if (!('toJSON' in e)) { t[r] = e var i = $O(e) ? [] : {} return ( gF(e, function (e, t) { var a = n(e, r + 1) !eF(a) && (i[t] = a) }), (t[r] = void 0), i ) } } return e } return n(e, 0) }, isAsyncFn: kF, isThenable: function (e) { return e && (aF(e) || rF(e)) && rF(e.then) && rF(e.catch) }, setImmediate: RF, asap: IF, } function PF(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), (this.status = i.status ? i.status : null))) } NF.inherits(PF, 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: NF.toJSONObject(this.config), code: this.code, status: this.status, } }, }) var LF = PF.prototype, DF = {} ;([ '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(function (e) { DF[e] = { value: e } }), Object.defineProperties(PF, DF), Object.defineProperty(LF, 'isAxiosError', { value: !0 }), (PF.from = function (e, t, n, r, i, a) { var o = Object.create(LF) return ( NF.toFlatObject( e, o, function (e) { return e !== Error.prototype }, function (e) { return 'isAxiosError' !== e } ), PF.call(o, e.message, t, n, r, i), (o.cause = e), (o.name = e.name), a && Object.assign(o, a), o ) })) function OF(e) { return NF.isPlainObject(e) || NF.isArray(e) } function FF(e) { return NF.endsWith(e, '[]') ? e.slice(0, -2) : e } function BF(e, t, n) { return e ? e .concat(t) .map(function (e, t) { return ((e = FF(e)), !n && t ? '[' + e + ']' : e) }) .join(n ? '.' : '') : t } var UF = NF.toFlatObject(NF, {}, null, function (e) { return /^is[A-Z]/.test(e) }) function zF(e, t, n) { if (!NF.isObject(e)) throw new TypeError('target must be an object') t = t || new FormData() var r = (n = NF.toFlatObject( n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function (e, t) { return !NF.isUndefined(t[e]) } )).metaTokens, i = n.visitor || l, a = n.dots, o = n.indexes, s = (n.Blob || ('undefined' != typeof Blob && Blob)) && NF.isSpecCompliantForm(t) if (!NF.isFunction(i)) throw new TypeError('visitor must be a function') function u(e) { if (null === e) return '' if (NF.isDate(e)) return e.toISOString() if (!s && NF.isBlob(e)) throw new PF('Blob is not supported. Use a Buffer instead.') return NF.isArrayBuffer(e) || NF.isTypedArray(e) ? s && 'function' == typeof Blob ? new Blob([e]) : Buffer.from(e) : e } function l(e, n, i) { var s = e if (e && !i && 'object' === P(e)) if (NF.endsWith(n, '{}')) ((n = r ? n : n.slice(0, -2)), (e = JSON.stringify(e))) else if ( (NF.isArray(e) && (function (e) { return NF.isArray(e) && !e.some(OF) })(e)) || ((NF.isFileList(e) || NF.endsWith(n, '[]')) && (s = NF.toArray(e))) ) return ( (n = FF(n)), s.forEach(function (e, r) { !NF.isUndefined(e) && null !== e && t.append(!0 === o ? BF([n], r, a) : null === o ? n : n + '[]', u(e)) }), !1 ) return !!OF(e) || (t.append(BF(i, n, a), u(e)), !1) } var c = [], h = Object.assign(UF, { defaultVisitor: l, convertValue: u, isVisitable: OF }) if (!NF.isObject(e)) throw new TypeError('data must be an object') return ( (function e(n, r) { if (!NF.isUndefined(n)) { if (-1 !== c.indexOf(n)) throw Error('Circular reference detected in ' + r.join('.')) ;(c.push(n), NF.forEach(n, function (n, a) { !0 === (!(NF.isUndefined(n) || null === n) && i.call(t, n, NF.isString(a) ? a.trim() : a, r, h)) && e(n, r ? r.concat(a) : [a]) }), c.pop()) } })(e), t ) } function VF(e) { var t = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+', '%00': '\0', } return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function (e) { return t[e] }) } function HF(e, t) { ;((this._pairs = []), e && zF(e, this, t)) } var WF = HF.prototype function GF(e) { return encodeURIComponent(e) .replace(/%3A/gi, ':') .replace(/%24/g, '$') .replace(/%2C/gi, ',') .replace(/%20/g, '+') .replace(/%5B/gi, '[') .replace(/%5D/gi, ']') } function jF(e, t, n) { if (!t) return e var r = (n && n.encode) || GF NF.isFunction(n) && (n = { serialize: n }) var i, a = n && n.serialize if ( (i = a ? a(t, n) : NF.isURLSearchParams(t) ? t.toString() : new HF(t, n).toString(r)) ) { var o = e.indexOf('#') ;(-1 !== o && (e = e.slice(0, o)), (e += (-1 === e.indexOf('?') ? '?' : '&') + i)) } return e } ;((WF.append = function (e, t) { this._pairs.push([e, t]) }), (WF.toString = function (e) { var t = e ? function (t) { return e.call(this, t, VF) } : VF return this._pairs .map(function (e) { return t(e[0]) + '=' + t(e[1]) }, '') .join('&') })) var QF = (function () { return T( function e() { ;(A(this, e), (this.handlers = [])) }, [ { key: 'use', value: function (e, t, n) { return ( this.handlers.push({ fulfilled: e, rejected: t, synchronous: !!n && n.synchronous, runWhen: n ? n.runWhen : null, }), this.handlers.length - 1 ) }, }, { key: 'eject', value: function (e) { this.handlers[e] && (this.handlers[e] = null) }, }, { key: 'clear', value: function () { this.handlers && (this.handlers = []) }, }, { key: 'forEach', value: function (e) { NF.forEach(this.handlers, function (t) { null !== t && e(t) }) }, }, ] ) })(), qF = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, XF = { isBrowser: !0, classes: { URLSearchParams: 'undefined' != typeof URLSearchParams ? URLSearchParams : HF, FormData: 'undefined' != typeof FormData ? FormData : null, Blob: 'undefined' != typeof Blob ? Blob : null, }, protocols: ['http', 'https', 'file', 'blob', 'url', 'data'], }, YF = 'undefined' != typeof window && 'undefined' != typeof document, KF = ('object' === ('undefined' == typeof navigator ? 'undefined' : P(navigator)) && navigator) || void 0, ZF = YF && (!KF || ['ReactNative', 'NativeScript', 'NS'].indexOf(KF.product) < 0), JF = 'undefined' != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && 'function' == typeof self.importScripts, $F = (YF && window.location.href) || 'http://localhost', eB = s( s( {}, Object.freeze({ __proto__: null, hasBrowserEnv: YF, hasStandardBrowserEnv: ZF, hasStandardBrowserWebWorkerEnv: JF, navigator: KF, origin: $F, }) ), XF ) function tB(e) { function t(e, n, r, i) { var a = e[i++] if ('__proto__' === a) return !0 var o = Number.isFinite(+a), s = i >= e.length return ( (a = !a && NF.isArray(r) ? r.length : a), s ? (NF.hasOwnProp(r, a) ? (r[a] = [r[a], n]) : (r[a] = n), !o) : ((r[a] && NF.isObject(r[a])) || (r[a] = []), t(e, n, r[a], i) && NF.isArray(r[a]) && (r[a] = (function (e) { var t, n, r = {}, i = Object.keys(e), a = i.length for (t = 0; t < a; t++) r[(n = i[t])] = e[n] return r })(r[a])), !o) ) } if (NF.isFormData(e) && NF.isFunction(e.entries)) { var n = {} return ( NF.forEachEntry(e, function (e, r) { t( (function (e) { return NF.matchAll(/\w+|\[(\w*)]/g, e).map(function (e) { return '[]' === e[0] ? '' : e[1] || e[0] }) })(e), r, n, 0 ) }), n ) } return null } var nB = { transitional: qF, adapter: ['xhr', 'http', 'fetch'], transformRequest: [ function (e, t) { var n, r = t.getContentType() || '', i = r.indexOf('application/json') > -1, a = NF.isObject(e) if ((a && NF.isHTMLForm(e) && (e = new FormData(e)), NF.isFormData(e))) return i ? JSON.stringify(tB(e)) : e if ( NF.isArrayBuffer(e) || NF.isBuffer(e) || NF.isStream(e) || NF.isFile(e) || NF.isBlob(e) || NF.isReadableStream(e) ) return e if (NF.isArrayBufferView(e)) return e.buffer if (NF.isURLSearchParams(e)) return ( t.setContentType('application/x-www-form-urlencoded;charset=utf-8', !1), e.toString() ) if (a) { if (r.indexOf('application/x-www-form-urlencoded') > -1) return (function (e, t) { return zF( e, new eB.classes.URLSearchParams(), Object.assign( { visitor: function (e, t, n, r) { return eB.isNode && NF.isBuffer(e) ? (this.append(t, e.toString('base64')), !1) : r.defaultVisitor.apply(this, arguments) }, }, t ) ) })(e, this.formSerializer).toString() if ((n = NF.isFileList(e)) || r.indexOf('multipart/form-data') > -1) { var o = this.env && this.env.FormData return zF(n ? { 'files[]': e } : e, o && new o(), this.formSerializer) } } return a || i ? (t.setContentType('application/json', !1), (function (e, t, n) { if (NF.isString(e)) try { return ((t || JSON.parse)(e), NF.trim(e)) } catch (ZJ) { if ('SyntaxError' !== ZJ.name) throw ZJ } return (n || JSON.stringify)(e) })(e)) : e }, ], transformResponse: [ function (e) { var t = this.transitional || nB.transitional, n = t && t.forcedJSONParsing, r = 'json' === this.responseType if (NF.isResponse(e) || NF.isReadableStream(e)) return e if (e && NF.isString(e) && ((n && !this.responseType) || r)) { var i = !(t && t.silentJSONParsing) && r try { return JSON.parse(e) } catch (ZJ) { if (i) { if ('SyntaxError' === ZJ.name) throw PF.from(ZJ, PF.ERR_BAD_RESPONSE, this, null, this.response) throw ZJ } } } return e }, ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: eB.classes.FormData, Blob: eB.classes.Blob }, validateStatus: function (e) { return e >= 200 && e < 300 }, headers: { common: { Accept: 'application/json, text/plain, */*', 'Content-Type': void 0 }, }, } NF.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (e) { nB.headers[e] = {} }) var rB = NF.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', ]), iB = Symbol('internals') function aB(e) { return e && String(e).trim().toLowerCase() } function oB(e) { return !1 === e || null == e ? e : NF.isArray(e) ? e.map(oB) : String(e) } function sB(e, t, n, r, i) { return NF.isFunction(r) ? r.call(this, t, n) : (i && (t = n), NF.isString(t) ? NF.isString(r) ? -1 !== t.indexOf(r) : NF.isRegExp(r) ? r.test(t) : void 0 : void 0) } var uB = (function () { return T( function e(t) { ;(A(this, e), t && this.set(t)) }, [ { key: 'set', value: function (e, t, n) { var r = this function i(e, t, n) { var i = aB(t) if (!i) throw new Error('header name must be a non-empty string') var a = NF.findKey(r, i) ;(!a || void 0 === r[a] || !0 === n || (void 0 === n && !1 !== r[a])) && (r[a || t] = oB(e)) } var a = function (e, t) { return NF.forEach(e, function (e, n) { return i(e, n, t) }) } if (NF.isPlainObject(e) || e instanceof this.constructor) a(e, t) else if ( NF.isString(e) && (e = e.trim()) && !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()) ) a( (function (e) { var t, n, r, i = {} return ( e && e.split('\n').forEach(function (e) { ;((r = e.indexOf(':')), (t = e.substring(0, r).trim().toLowerCase()), (n = e.substring(r + 1).trim()), !t || (i[t] && rB[t]) || ('set-cookie' === t ? i[t] ? i[t].push(n) : (i[t] = [n]) : (i[t] = i[t] ? i[t] + ', ' + n : n))) }), i ) })(e), t ) else if (NF.isHeaders(e)) { var o, s = L(e.entries()) try { for (s.s(); !(o = s.n()).done; ) { var u = C(o.value, 2), l = u[0] i(u[1], l, n) } } catch (c) { s.e(c) } finally { s.f() } } else null != e && i(t, e, n) return this }, }, { key: 'get', value: function (e, t) { if ((e = aB(e))) { var n = NF.findKey(this, e) if (n) { var r = this[n] if (!t) return r if (!0 === t) return (function (e) { for ( var t, n = Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; (t = r.exec(e)); ) n[t[1]] = t[2] return n })(r) if (NF.isFunction(t)) return t.call(this, r, n) if (NF.isRegExp(t)) return t.exec(r) throw new TypeError('parser must be boolean|regexp|function') } } }, }, { key: 'has', value: function (e, t) { if ((e = aB(e))) { var n = NF.findKey(this, e) return !(!n || void 0 === this[n] || (t && !sB(0, this[n], n, t))) } return !1 }, }, { key: 'delete', value: function (e, t) { var n = this, r = !1 function i(e) { if ((e = aB(e))) { var i = NF.findKey(n, e) !i || (t && !sB(0, n[i], i, t)) || (delete n[i], (r = !0)) } } return (NF.isArray(e) ? e.forEach(i) : i(e), r) }, }, { key: 'clear', value: function (e) { for (var t = Object.keys(this), n = t.length, r = !1; n--; ) { var i = t[n] ;(e && !sB(0, this[i], i, e, !0)) || (delete this[i], (r = !0)) } return r }, }, { key: 'normalize', value: function (e) { var t = this, n = {} return ( NF.forEach(this, function (r, i) { var a = NF.findKey(n, i) if (a) return ((t[a] = oB(r)), void delete t[i]) var o = e ? (function (e) { return e .trim() .toLowerCase() .replace(/([a-z\d])(\w*)/g, function (e, t, n) { return t.toUpperCase() + n }) })(i) : String(i).trim() ;(o !== i && delete t[i], (t[o] = oB(r)), (n[o] = !0)) }), this ) }, }, { key: 'concat', value: function () { for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r] return (e = this.constructor).concat.apply(e, [this].concat(n)) }, }, { key: 'toJSON', value: function (e) { var t = Object.create(null) return ( NF.forEach(this, function (n, r) { null != n && !1 !== n && (t[r] = e && NF.isArray(n) ? n.join(', ') : n) }), t ) }, }, { key: Symbol.iterator, value: function () { return Object.entries(this.toJSON())[Symbol.iterator]() }, }, { key: 'toString', value: function () { return Object.entries(this.toJSON()) .map(function (e) { var t = C(e, 2) return t[0] + ': ' + t[1] }) .join('\n') }, }, { key: Symbol.toStringTag, get: function () { return 'AxiosHeaders' }, }, ], [ { key: 'from', value: function (e) { return e instanceof this ? e : new this(e) }, }, { key: 'concat', value: function (e) { for ( var t = new this(e), n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++ ) r[i - 1] = arguments[i] return ( r.forEach(function (e) { return t.set(e) }), t ) }, }, { key: 'accessor', value: function (e) { var t = (this[iB] = this[iB] = { accessors: {} }).accessors, n = this.prototype function r(e) { var r = aB(e) t[r] || (!(function (e, t) { var n = NF.toCamelCase(' ' + t) ;['get', 'set', 'has'].forEach(function (r) { Object.defineProperty(e, r + n, { value: function (e, n, i) { return this[r].call(this, t, e, n, i) }, configurable: !0, }) }) })(n, e), (t[r] = !0)) } return (NF.isArray(e) ? e.forEach(r) : r(e), this) }, }, ] ) })() function lB(e, t) { var n = this || nB, r = t || n, i = uB.from(r.headers), a = r.data return ( NF.forEach(e, function (e) { a = e.call(n, a, i.normalize(), t ? t.status : void 0) }), i.normalize(), a ) } function cB(e) { return !(!e || !e.__CANCEL__) } function hB(e, t, n) { ;(PF.call(this, null == e ? 'canceled' : e, PF.ERR_CANCELED, t, n), (this.name = 'CanceledError')) } function dB(e, t, n) { var r = n.config.validateStatus n.status && r && !r(n.status) ? t( new PF( 'Request failed with status code ' + n.status, [PF.ERR_BAD_REQUEST, PF.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n ) ) : e(n) } ;(uB.accessor([ 'Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization', ]), NF.reduceDescriptors(uB.prototype, function (e, t) { var n = e.value, r = t[0].toUpperCase() + t.slice(1) return { get: function () { return n }, set: function (e) { this[r] = e }, } }), NF.freezeMethods(uB), NF.inherits(hB, PF, { __CANCEL__: !0 })) var fB = function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 3, r = 0, i = (function (e, t) { e = e || 10 var n, r = new Array(e), i = new Array(e), a = 0, o = 0 return ( (t = void 0 !== t ? t : 1e3), function (s) { var u = Date.now(), l = i[o] ;(n || (n = u), (r[a] = s), (i[a] = u)) for (var c = o, h = 0; c !== a; ) ((h += r[c++]), (c %= e)) if (((a = (a + 1) % e) === o && (o = (o + 1) % e), !(u - n < t))) { var d = l && u - l return d ? Math.round((1e3 * h) / d) : void 0 } } ) })(50, 250) return (function (e, t) { var n, r, i = 0, a = 1e3 / t, o = function (t) { var a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Date.now() ;((i = a), (n = null), r && (clearTimeout(r), (r = null)), e.apply(null, t)) } return [ function () { for ( var e = Date.now(), t = e - i, s = arguments.length, u = new Array(s), l = 0; l < s; l++ ) u[l] = arguments[l] t >= a ? o(u, e) : ((n = u), r || (r = setTimeout(function () { ;((r = null), o(n)) }, a - t))) }, function () { return n && o(n) }, ] })(function (n) { var a = n.loaded, o = n.lengthComputable ? n.total : void 0, s = a - r, u = i(s) r = a var l = M( { loaded: a, total: o, progress: o ? a / o : void 0, bytes: s, rate: u || void 0, estimated: u && o && a <= o ? (o - a) / u : void 0, event: n, lengthComputable: null != o, }, t ? 'download' : 'upload', !0 ) e(l) }, n) }, pB = function (e, t) { var n = null != e return [ function (r) { return t[0]({ lengthComputable: n, total: e, loaded: r }) }, t[1], ] }, vB = function (e) { return function () { for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r] return NF.asap(function () { return e.apply(void 0, n) }) } }, mB = eB.hasStandardBrowserEnv ? (function (e, t) { return function (n) { return ( (n = new URL(n, eB.origin)), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port) ) } })( new URL(eB.origin), eB.navigator && /(msie|trident)/i.test(eB.navigator.userAgent) ) : function () { return !0 }, gB = eB.hasStandardBrowserEnv ? { write: function (e, t, n, r, i, a) { var o = [e + '=' + encodeURIComponent(t)] ;(NF.isNumber(n) && o.push('expires=' + new Date(n).toGMTString()), NF.isString(r) && o.push('path=' + r), NF.isString(i) && o.push('domain=' + i), !0 === a && o.push('secure'), (document.cookie = o.join('; '))) }, read: function (e) { var t = document.cookie.match(new RegExp('(^|;\\s*)(' + e + ')=([^;]*)')) return t ? decodeURIComponent(t[3]) : null }, remove: function (e) { this.write(e, '', Date.now() - 864e5) }, } : { write: function () {}, read: function () { return null }, remove: function () {}, } function yB(e, t, n) { var r = !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t) return e && (r || 0 == n) ? (function (e, t) { return t ? e.replace(/\/?\/$/, '') + '/' + t.replace(/^\/+/, '') : e })(e, t) : t } var _B = function (e) { return e instanceof uB ? s({}, e) : e } function bB(e, t) { t = t || {} var n = {} function r(e, t, n, r) { return NF.isPlainObject(e) && NF.isPlainObject(t) ? NF.merge.call({ caseless: r }, e, t) : NF.isPlainObject(t) ? NF.merge({}, t) : NF.isArray(t) ? t.slice() : t } function i(e, t, n, i) { return NF.isUndefined(t) ? NF.isUndefined(e) ? void 0 : r(void 0, e, 0, i) : r(e, t, 0, i) } function a(e, t) { if (!NF.isUndefined(t)) return r(void 0, t) } function o(e, t) { return NF.isUndefined(t) ? (NF.isUndefined(e) ? void 0 : r(void 0, e)) : r(void 0, t) } function s(n, i, a) { return a in t ? r(n, i) : a in e ? r(void 0, n) : void 0 } var u = { url: a, method: a, data: a, baseURL: o, transformRequest: o, transformResponse: o, paramsSerializer: o, timeout: o, timeoutMessage: o, withCredentials: o, withXSRFToken: o, adapter: o, responseType: o, xsrfCookieName: o, xsrfHeaderName: o, onUploadProgress: o, onDownloadProgress: o, decompress: o, maxContentLength: o, maxBodyLength: o, beforeRedirect: o, transport: o, httpAgent: o, httpsAgent: o, cancelToken: o, socketPath: o, responseEncoding: o, validateStatus: s, headers: function (e, t, n) { return i(_B(e), _B(t), 0, !0) }, } return ( NF.forEach(Object.keys(Object.assign({}, e, t)), function (r) { var a = u[r] || i, o = a(e[r], t[r], r) ;(NF.isUndefined(o) && a !== s) || (n[r] = o) }), n ) } var xB, SB, AB = function (e) { var t, n = bB({}, e), r = n.data, i = n.withXSRFToken, a = n.xsrfHeaderName, o = n.xsrfCookieName, s = n.headers, u = n.auth if ( ((n.headers = s = uB.from(s)), (n.url = jF( yB(n.baseURL, n.url, n.allowAbsoluteUrls), e.params, e.paramsSerializer )), u && s.set( 'Authorization', 'Basic ' + btoa( (u.username || '') + ':' + (u.password ? unescape(encodeURIComponent(u.password)) : '') ) ), NF.isFormData(r)) ) if (eB.hasStandardBrowserEnv || eB.hasStandardBrowserWebWorkerEnv) s.setContentType(void 0) else if (!1 !== (t = s.getContentType())) { var l = t ? t .split(';') .map(function (e) { return e.trim() }) .filter(Boolean) : [], c = (function (e) { return R(e) || N(e) || D(e) || k() })(l), h = c[0], d = c.slice(1) s.setContentType([h || 'multipart/form-data'].concat(I(d)).join('; ')) } if ( eB.hasStandardBrowserEnv && (i && NF.isFunction(i) && (i = i(n)), i || (!1 !== i && mB(n.url))) ) { var f = a && o && gB.read(o) f && s.set(a, f) } return n }, wB = 'undefined' != typeof XMLHttpRequest && function (e) { return new Promise(function (t, n) { var r, i, a, o, s, u = AB(e), l = u.data, c = uB.from(u.headers).normalize(), h = u.responseType, d = u.onUploadProgress, f = u.onDownloadProgress function p() { ;(o && o(), s && s(), u.cancelToken && u.cancelToken.unsubscribe(r), u.signal && u.signal.removeEventListener('abort', r)) } var v = new XMLHttpRequest() function m() { if (v) { var r = uB.from('getAllResponseHeaders' in v && v.getAllResponseHeaders()) ;(dB( function (e) { ;(t(e), p()) }, function (e) { ;(n(e), p()) }, { data: h && 'text' !== h && 'json' !== h ? v.response : v.responseText, status: v.status, statusText: v.statusText, headers: r, config: e, request: v, } ), (v = null)) } } if ( (v.open(u.method.toUpperCase(), u.url, !0), (v.timeout = u.timeout), 'onloadend' in v ? (v.onloadend = m) : (v.onreadystatechange = function () { v && 4 === v.readyState && (0 !== v.status || (v.responseURL && 0 === v.responseURL.indexOf('file:'))) && setTimeout(m) }), (v.onabort = function () { v && (n(new PF('Request aborted', PF.ECONNABORTED, e, v)), (v = null)) }), (v.onerror = function () { ;(n(new PF('Network Error', PF.ERR_NETWORK, e, v)), (v = null)) }), (v.ontimeout = function () { var t = u.timeout ? 'timeout of ' + u.timeout + 'ms exceeded' : 'timeout exceeded', r = u.transitional || qF ;(u.timeoutErrorMessage && (t = u.timeoutErrorMessage), n(new PF(t, r.clarifyTimeoutError ? PF.ETIMEDOUT : PF.ECONNABORTED, e, v)), (v = null)) }), void 0 === l && c.setContentType(null), 'setRequestHeader' in v && NF.forEach(c.toJSON(), function (e, t) { v.setRequestHeader(t, e) }), NF.isUndefined(u.withCredentials) || (v.withCredentials = !!u.withCredentials), h && 'json' !== h && (v.responseType = u.responseType), f) ) { var g = C(fB(f, !0), 2) ;((a = g[0]), (s = g[1]), v.addEventListener('progress', a)) } if (d && v.upload) { var y = C(fB(d), 2) ;((i = y[0]), (o = y[1]), v.upload.addEventListener('progress', i), v.upload.addEventListener('loadend', o)) } ;(u.cancelToken || u.signal) && ((r = function (t) { v && (n(!t || t.type ? new hB(null, e, v) : t), v.abort(), (v = null)) }), u.cancelToken && u.cancelToken.subscribe(r), u.signal && (u.signal.aborted ? r() : u.signal.addEventListener('abort', r))) var _, b, x = ((_ = u.url), ((b = /^([-+\w]{1,25})(:?\/\/|:)/.exec(_)) && b[1]) || '') x && -1 === eB.protocols.indexOf(x) ? n(new PF('Unsupported protocol ' + x + ':', PF.ERR_BAD_REQUEST, e)) : v.send(l || null) }) }, TB = function (e, t) { var n = (e = e ? e.filter(Boolean) : []).length if (t || n) { var r, i = new AbortController(), a = function (e) { if (!r) { ;((r = !0), s()) var t = e instanceof Error ? e : this.reason i.abort(t instanceof PF ? t : new hB(t instanceof Error ? t.message : t)) } }, o = t && setTimeout(function () { ;((o = null), a(new PF('timeout '.concat(t, ' of ms exceeded'), PF.ETIMEDOUT))) }, t), s = function () { e && (o && clearTimeout(o), (o = null), e.forEach(function (e) { e.unsubscribe ? e.unsubscribe(a) : e.removeEventListener('abort', a) }), (e = null)) } e.forEach(function (e) { return e.addEventListener('abort', a) }) var u = i.signal return ( (u.unsubscribe = function () { return NF.asap(s) }), u ) } }, MB = d().m(function e(t, n) { var r, i, a return d().w(function (e) { for (;;) switch (e.n) { case 0: if (!((r = t.byteLength) < n)) { e.n = 2 break } return ((e.n = 1), t) case 1: return e.a(2) case 2: i = 0 case 3: if (!(i < r)) { e.n = 5 break } return ((a = i + n), (e.n = 4), t.slice(i, a)) case 4: ;((i = a), (e.n = 3)) break case 5: return e.a(2) } }, e) }), EB = (function () { var t = F( d().m(function t(n, r) { var i, a, o, s, u, l, c return d().w( function (t) { for (;;) switch (t.n) { case 0: ;((i = !1), (a = !1), (t.p = 1), (s = H(CB(n)))) case 2: return ((t.n = 3), U(s.next())) case 3: if (!(i = !(u = t.v).done)) { t.n = 5 break } return ((l = u.value), t.d(e(z(H(MB(l, r)))), 4)) case 4: ;((i = !1), (t.n = 2)) break case 5: t.n = 7 break case 6: ;((t.p = 6), (c = t.v), (a = !0), (o = c)) case 7: if (((t.p = 7), (t.p = 8), !i || null == s.return)) { t.n = 9 break } return ((t.n = 9), U(s.return())) case 9: if (((t.p = 9), !a)) { t.n = 10 break } throw o case 10: return t.f(9) case 11: return t.f(7) case 12: return t.a(2) } }, t, null, [ [8, , 9, 11], [1, 6, 7, 12], ] ) }) ) return function (e, n) { return t.apply(this, arguments) } })(), CB = (function () { var t = F( d().m(function t(n) { var r, i, a, o return d().w( function (t) { for (;;) switch (t.n) { case 0: if (!n[Symbol.asyncIterator]) { t.n = 2 break } return t.d(e(z(H(n))), 1) case 1: return t.a(2) case 2: ;((r = n.getReader()), (t.p = 3)) case 4: return ((t.n = 5), U(r.read())) case 5: if (((i = t.v), (a = i.done), (o = i.value), !a)) { t.n = 6 break } return t.a(3, 8) case 6: return ((t.n = 7), o) case 7: t.n = 4 break case 8: return ((t.p = 8), (t.n = 9), U(r.cancel())) case 9: return t.f(8) case 10: return t.a(2) } }, t, null, [[3, , 8, 10]] ) }) ) return function (e) { return t.apply(this, arguments) } })(), kB = function (e, t, n, r) { var i, a = EB(e, t), o = 0, s = function (e) { i || ((i = !0), r && r(e)) } return new ReadableStream( { pull: function (e) { return v( d().m(function t() { var r, i, u, l, c, h return d().w( function (t) { for (;;) switch (t.n) { case 0: return ((t.p = 0), (t.n = 1), a.next()) case 1: if (((r = t.v), (i = r.done), (u = r.value), !i)) { t.n = 2 break } return (s(), e.close(), t.a(2)) case 2: ;((l = u.byteLength), n && ((c = o += l), n(c)), e.enqueue(new Uint8Array(u)), (t.n = 4)) break case 3: throw ((t.p = 3), (h = t.v), s(h), h) case 4: return t.a(2) } }, t, null, [[0, 3]] ) }) )() }, cancel: function (e) { return (s(e), a.return()) }, }, { highWaterMark: 2 } ) }, RB = 'function' == typeof fetch && 'function' == typeof Request && 'function' == typeof Response, IB = RB && 'function' == typeof ReadableStream, NB = RB && ('function' == typeof TextEncoder ? ((xB = new TextEncoder()), function (e) { return xB.encode(e) }) : (function () { var e = v( d().m(function e(t) { var n, r return d().w(function (e) { for (;;) switch (e.n) { case 0: return ((n = Uint8Array), (e.n = 1), new Response(t).arrayBuffer()) case 1: return ((r = e.v), e.a(2, new n(r))) } }, e) }) ) return function (t) { return e.apply(this, arguments) } })()), PB = function (e) { try { for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r] return !!e.apply(void 0, n) } catch (ZJ) { return !1 } }, LB = IB && PB(function () { var e = !1, t = new Request(eB.origin, { body: new ReadableStream(), method: 'POST', get duplex() { return ((e = !0), 'half') }, }).headers.has('Content-Type') return e && !t }), DB = IB && PB(function () { return NF.isReadableStream(new Response('').body) }), OB = { stream: DB && function (e) { return e.body }, } RB && ((SB = new Response()), ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (e) { !OB[e] && (OB[e] = NF.isFunction(SB[e]) ? function (t) { return t[e]() } : function (t, n) { throw new PF( "Response type '".concat(e, "' is not supported"), PF.ERR_NOT_SUPPORT, n ) }) })) var FB = (function () { var e = v( d().m(function e(t) { var n return d().w(function (e) { for (;;) switch (e.n) { case 0: if (null != t) { e.n = 1 break } return e.a(2, 0) case 1: if (!NF.isBlob(t)) { e.n = 2 break } return e.a(2, t.size) case 2: if (!NF.isSpecCompliantForm(t)) { e.n = 4 break } return ( (n = new Request(eB.origin, { method: 'POST', body: t })), (e.n = 3), n.arrayBuffer() ) case 3: case 6: return e.a(2, e.v.byteLength) case 4: if (!NF.isArrayBufferView(t) && !NF.isArrayBuffer(t)) { e.n = 5 break } return e.a(2, t.byteLength) case 5: if ((NF.isURLSearchParams(t) && (t += ''), !NF.isString(t))) { e.n = 7 break } return ((e.n = 6), NB(t)) case 7: return e.a(2) } }, e) }) ) return function (t) { return e.apply(this, arguments) } })(), BB = (function () { var e = v( d().m(function e(t, n) { var r return d().w(function (e) { for (;;) if (0 === e.n) return ( (r = NF.toFiniteNumber(t.getContentLength())), e.a(2, null == r ? FB(n) : r) ) }, e) }) ) return function (t, n) { return e.apply(this, arguments) } })(), UB = RB && (function () { var e = v( d().m(function e(t) { var n, r, i, a, o, u, l, c, h, f, p, v, m, g, y, _, b, x, S, A, w, T, M, E, k, R, I, N, P, L, D, O, F, B, U, z, V return d().w( function (e) { for (;;) switch (e.n) { case 0: if ( ((n = AB(t)), (r = n.url), (i = n.method), (a = n.data), (o = n.signal), (u = n.cancelToken), (l = n.timeout), (c = n.onDownloadProgress), (h = n.onUploadProgress), (f = n.responseType), (p = n.headers), (v = n.withCredentials), (m = void 0 === v ? 'same-origin' : v), (g = n.fetchOptions), (f = f ? (f + '').toLowerCase() : 'text'), (y = TB([o, u && u.toAbortSignal()], l)), (b = y && y.unsubscribe && function () { y.unsubscribe() }), (e.p = 1), !(U = h && LB && 'get' !== i && 'head' !== i)) ) { e.n = 3 break } return ((e.n = 2), BB(p, a)) case 2: ;((z = x = e.v), (U = 0 !== z)) case 3: if (!U) { e.n = 4 break } ;((S = new Request(r, { method: 'POST', body: a, duplex: 'half' })), NF.isFormData(a) && (A = S.headers.get('content-type')) && p.setContentType(A), S.body && ((w = pB(x, fB(vB(h)))), (T = C(w, 2)), (M = T[0]), (E = T[1]), (a = kB(S.body, 65536, M, E)))) case 4: return ( NF.isString(m) || (m = m ? 'include' : 'omit'), (k = 'credentials' in Request.prototype), (_ = new Request( r, s( s({}, g), {}, { signal: y, method: i.toUpperCase(), headers: p.normalize().toJSON(), body: a, duplex: 'half', credentials: k ? m : void 0, } ) )), (e.n = 5), fetch(_) ) case 5: return ( (R = e.v), (I = DB && ('stream' === f || 'response' === f)), DB && (c || (I && b)) && ((N = {}), ['status', 'statusText', 'headers'].forEach(function (e) { N[e] = R[e] }), (P = NF.toFiniteNumber(R.headers.get('content-length'))), (L = (c && pB(P, fB(vB(c), !0))) || []), (D = C(L, 2)), (O = D[0]), (F = D[1]), (R = new Response( kB(R.body, 65536, O, function () { ;(F && F(), b && b()) }), N ))), (f = f || 'text'), (e.n = 6), OB[NF.findKey(OB, f) || 'text'](R, t) ) case 6: return ( (B = e.v), !I && b && b(), (e.n = 7), new Promise(function (e, n) { dB(e, n, { data: B, headers: uB.from(R.headers), status: R.status, statusText: R.statusText, config: t, request: _, }) }) ) case 7: return e.a(2, e.v) case 8: if ( ((e.p = 8), (V = e.v), b && b(), !V || 'TypeError' !== V.name || !/fetch/i.test(V.message)) ) { e.n = 9 break } throw Object.assign(new PF('Network Error', PF.ERR_NETWORK, t, _), { cause: V.cause || V, }) case 9: throw PF.from(V, V && V.code, t, _) case 10: return e.a(2) } }, e, null, [[1, 8]] ) }) ) return function (t) { return e.apply(this, arguments) } })(), zB = { http: null, xhr: wB, fetch: UB } NF.forEach(zB, function (e, t) { if (e) { try { Object.defineProperty(e, 'name', { value: t }) } catch (ZJ) {} Object.defineProperty(e, 'adapterName', { value: t }) } }) var VB = function (e) { return '- '.concat(e) }, HB = function (e) { return NF.isFunction(e) || null === e || !1 === e }, WB = function (e) { for (var t, n, r = (e = NF.isArray(e) ? e : [e]).length, i = {}, a = 0; a < r; a++) { var o = void 0 if (((n = t = e[a]), !HB(t) && void 0 === (n = zB[(o = String(t)).toLowerCase()]))) throw new PF("Unknown adapter '".concat(o, "'")) if (n) break i[o || '#' + a] = n } if (!n) { var s = Object.entries(i).map(function (e) { var t = C(e, 2), n = t[0], r = t[1] return ( 'adapter '.concat(n, ' ') + (!1 === r ? 'is not supported by the environment' : 'is not available in the build') ) }) throw new PF( 'There is no suitable adapter to dispatch the request ' + (r ? s.length > 1 ? 'since :\n' + s.map(VB).join('\n') : ' ' + VB(s[0]) : 'as no adapter specified'), 'ERR_NOT_SUPPORT' ) } return n } function GB(e) { if ((e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)) throw new hB(null, e) } function jB(e) { return ( GB(e), (e.headers = uB.from(e.headers)), (e.data = lB.call(e, e.transformRequest)), -1 !== ['post', 'put', 'patch'].indexOf(e.method) && e.headers.setContentType('application/x-www-form-urlencoded', !1), WB(e.adapter || nB.adapter)(e).then( function (t) { return ( GB(e), (t.data = lB.call(e, e.transformResponse, t)), (t.headers = uB.from(t.headers)), t ) }, function (t) { return ( cB(t) || (GB(e), t && t.response && ((t.response.data = lB.call(e, e.transformResponse, t.response)), (t.response.headers = uB.from(t.response.headers)))), Promise.reject(t) ) } ) ) } var QB = '1.8.4', qB = {} ;['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (e, t) { qB[e] = function (n) { return P(n) === e || 'a' + (t < 1 ? 'n ' : ' ') + e } }) var XB = {} ;((qB.transitional = function (e, t, n) { function r(e, t) { return "[Axios v1.8.4] Transitional option '" + e + "'" + t + (n ? '. ' + n : '') } return function (n, i, a) { if (!1 === e) throw new PF(r(i, ' has been removed' + (t ? ' in ' + t : '')), PF.ERR_DEPRECATED) return ( t && !XB[i] && ((XB[i] = !0), console.warn( r( i, ' has been deprecated since v' + t + ' and will be removed in the near future' ) )), !e || e(n, i, a) ) } }), (qB.spelling = function (e) { return function (t, n) { return (console.warn(''.concat(n, ' is likely a misspelling of ').concat(e)), !0) } })) var YB = { assertOptions: function (e, t, n) { if ('object' !== P(e)) throw new PF('options must be an object', PF.ERR_BAD_OPTION_VALUE) for (var r = Object.keys(e), i = r.length; i-- > 0; ) { var a = r[i], o = t[a] if (o) { var s = e[a], u = void 0 === s || o(s, a, e) if (!0 !== u) throw new PF('option ' + a + ' must be ' + u, PF.ERR_BAD_OPTION_VALUE) } else if (!0 !== n) throw new PF('Unknown option ' + a, PF.ERR_BAD_OPTION) } }, validators: qB, }, KB = YB.validators, ZB = (function () { return T( function e(t) { ;(A(this, e), (this.defaults = t), (this.interceptors = { request: new QF(), response: new QF() })) }, [ { key: 'request', value: ((e = v( d().m(function e(t, n) { var r, i, a return d().w( function (e) { for (;;) switch (e.n) { case 0: return ((e.p = 0), (e.n = 1), this._request(t, n)) case 1: return e.a(2, e.v) case 2: if (((e.p = 2), (a = e.v) instanceof Error)) { ;((r = {}), Error.captureStackTrace ? Error.captureStackTrace(r) : (r = new Error()), (i = r.stack ? r.stack.replace(/^.+\n/, '') : '')) try { a.stack ? i && !String(a.stack).endsWith(i.replace(/^.+\n.+\n/, '')) && (a.stack += '\n' + i) : (a.stack = i) } catch (ZJ) {} } throw a case 3: return e.a(2) } }, e, this, [[0, 2]] ) }) )), function (t, n) { return e.apply(this, arguments) }), }, { key: '_request', value: function (e, t) { 'string' == typeof e ? ((t = t || {}).url = e) : (t = e || {}) var n = (t = bB(this.defaults, t)), r = n.transitional, i = n.paramsSerializer, a = n.headers ;(void 0 !== r && YB.assertOptions( r, { silentJSONParsing: KB.transitional(KB.boolean), forcedJSONParsing: KB.transitional(KB.boolean), clarifyTimeoutError: KB.transitional(KB.boolean), }, !1 ), null != i && (NF.isFunction(i) ? (t.paramsSerializer = { serialize: i }) : YB.assertOptions( i, { encode: KB.function, serialize: KB.function }, !0 )), void 0 !== t.allowAbsoluteUrls || (void 0 !== this.defaults.allowAbsoluteUrls ? (t.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls) : (t.allowAbsoluteUrls = !0)), YB.assertOptions( t, { baseUrl: KB.spelling('baseURL'), withXsrfToken: KB.spelling('withXSRFToken'), }, !0 ), (t.method = (t.method || this.defaults.method || 'get').toLowerCase())) var o = a && NF.merge(a.common, a[t.method]) ;(a && NF.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (e) { delete a[e] } ), (t.headers = uB.concat(o, a))) var s = [], u = !0 this.interceptors.request.forEach(function (e) { ;('function' == typeof e.runWhen && !1 === e.runWhen(t)) || ((u = u && e.synchronous), s.unshift(e.fulfilled, e.rejected)) }) var l, c = [] this.interceptors.response.forEach(function (e) { c.push(e.fulfilled, e.rejected) }) var h, d = 0 if (!u) { var f = [jB.bind(this), void 0] for ( f.unshift.apply(f, s), f.push.apply(f, c), h = f.length, l = Promise.resolve(t); d < h; ) l = l.then(f[d++], f[d++]) return l } h = s.length var p = t for (d = 0; d < h; ) { var v = s[d++], m = s[d++] try { p = v(p) } catch (g) { m.call(this, g) break } } try { l = jB.call(this, p) } catch (g) { return Promise.reject(g) } for (d = 0, h = c.length; d < h; ) l = l.then(c[d++], c[d++]) return l }, }, { key: 'getUri', value: function (e) { return jF( yB((e = bB(this.defaults, e)).baseURL, e.url, e.allowAbsoluteUrls), e.params, e.paramsSerializer ) }, }, ] ) var e })() ;(NF.forEach(['delete', 'get', 'head', 'options'], function (e) { ZB.prototype[e] = function (t, n) { return this.request(bB(n || {}, { method: e, url: t, data: (n || {}).data })) } }), NF.forEach(['post', 'put', 'patch'], function (e) { function t(t) { return function (n, r, i) { return this.request( bB(i || {}, { method: e, headers: t ? { 'Content-Type': 'multipart/form-data' } : {}, url: n, data: r, }) ) } } ;((ZB.prototype[e] = t()), (ZB.prototype[e + 'Form'] = t(!0))) })) var JB = (function () { function e(t) { if ((A(this, e), 'function' != typeof t)) throw new TypeError('executor must be a function.') var n this.promise = new Promise(function (e) { n = e }) var r = this ;(this.promise.then(function (e) { if (r._listeners) { for (var t = r._listeners.length; t-- > 0; ) r._listeners[t](e) r._listeners = null } }), (this.promise.then = function (e) { var t, n = new Promise(function (e) { ;(r.subscribe(e), (t = e)) }).then(e) return ( (n.cancel = function () { r.unsubscribe(t) }), n ) }), t(function (e, t, i) { r.reason || ((r.reason = new hB(e, t, i)), n(r.reason)) })) } return T( e, [ { key: 'throwIfRequested', value: function () { if (this.reason) throw this.reason }, }, { key: 'subscribe', value: function (e) { this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : (this._listeners = [e]) }, }, { key: 'unsubscribe', value: function (e) { if (this._listeners) { var t = this._listeners.indexOf(e) ;-1 !== t && this._listeners.splice(t, 1) } }, }, { key: 'toAbortSignal', value: function () { var e = this, t = new AbortController(), n = function (e) { t.abort(e) } return ( this.subscribe(n), (t.signal.unsubscribe = function () { return e.unsubscribe(n) }), t.signal ) }, }, ], [ { key: 'source', value: function () { var t, n = new e(function (e) { t = e }) return { token: n, cancel: t } }, }, ] ) })() var $B = { 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($B).forEach(function (e) { var t = C(e, 2), n = t[0], r = t[1] $B[r] = n }) var eU = (function e(t) { var n = new ZB(t), r = qO(ZB.prototype.request, n) return ( NF.extend(r, ZB.prototype, n, { allOwnKeys: !0 }), NF.extend(r, n, null, { allOwnKeys: !0 }), (r.create = function (n) { return e(bB(t, n)) }), r ) })(nB) ;((eU.Axios = ZB), (eU.CanceledError = hB), (eU.CancelToken = JB), (eU.isCancel = cB), (eU.VERSION = QB), (eU.toFormData = zF), (eU.AxiosError = PF), (eU.Cancel = eU.CanceledError), (eU.all = function (e) { return Promise.all(e) }), (eU.spread = function (e) { return function (t) { return e.apply(null, t) } }), (eU.isAxiosError = function (e) { return NF.isObject(e) && !0 === e.isAxiosError }), (eU.mergeConfig = bB), (eU.AxiosHeaders = uB), (eU.formToJSON = function (e) { return tB(NF.isHTMLForm(e) ? new FormData(e) : e) }), (eU.getAdapter = WB), (eU.HttpStatusCode = $B), (eU.default = eU)) ;(eU.Axios, eU.AxiosError, eU.CanceledError, eU.isCancel, eU.CancelToken, eU.VERSION, eU.all, eU.Cancel, eU.isAxiosError, eU.spread, eU.toFormData, eU.AxiosHeaders, eU.HttpStatusCode, eU.formToJSON, eU.getAdapter, eU.mergeConfig) var tU = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : {} function nU(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e } function rU(e) { throw new Error( 'Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.' ) } var iU, aU = { exports: {} } var oU, sU, uU = (iU || ((iU = 1), (function (e) { e.exports = (function e(t, n, r) { function i(o, s) { if (!n[o]) { if (!t[o]) { if (!s && rU) return rU(o) if (a) return a(o, !0) var u = new Error("Cannot find module '" + o + "'") throw ((u.code = 'MODULE_NOT_FOUND'), u) } var l = (n[o] = { exports: {} }) t[o][0].call( l.exports, function (e) { return i(t[o][1][e] || e) }, l, l.exports, e, t, n, r ) } return n[o].exports } for (var a = rU, o = 0; o < r.length; o++) i(r[o]) return i })( { 1: [ function (e, t, n) { var r = e('./utils'), i = e('./support'), a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' ;((n.encode = function (e) { for ( var t, n, i, o, s, u, l, c = [], h = 0, d = e.length, f = d, p = 'string' !== r.getTypeOf(e); h < e.length; ) ((f = d - h), (i = p ? ((t = e[h++]), (n = h < d ? e[h++] : 0), h < d ? e[h++] : 0) : ((t = e.charCodeAt(h++)), (n = h < d ? e.charCodeAt(h++) : 0), h < d ? e.charCodeAt(h++) : 0)), (o = t >> 2), (s = ((3 & t) << 4) | (n >> 4)), (u = 1 < f ? ((15 & n) << 2) | (i >> 6) : 64), (l = 2 < f ? 63 & i : 64), c.push(a.charAt(o) + a.charAt(s) + a.charAt(u) + a.charAt(l))) return c.join('') }), (n.decode = function (e) { var t, n, r, o, s, u, l = 0, c = 0, h = 'data:' if (e.substr(0, h.length) === h) throw new Error('Invalid base64 input, it looks like a data url.') var d, f = (3 * (e = e.replace(/[^A-Za-z0-9+/=]/g, '')).length) / 4 if ( (e.charAt(e.length - 1) === a.charAt(64) && f--, e.charAt(e.length - 2) === a.charAt(64) && f--, f % 1 != 0) ) throw new Error('Invalid base64 input, bad content length.') for ( d = i.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); l < e.length; ) ((t = (a.indexOf(e.charAt(l++)) << 2) | ((o = a.indexOf(e.charAt(l++))) >> 4)), (n = ((15 & o) << 4) | ((s = a.indexOf(e.charAt(l++))) >> 2)), (r = ((3 & s) << 6) | (u = a.indexOf(e.charAt(l++)))), (d[c++] = t), 64 !== s && (d[c++] = n), 64 !== u && (d[c++] = r)) return d })) }, { './support': 30, './utils': 32 }, ], 2: [ function (e, t, n) { var r = e('./external'), i = e('./stream/DataWorker'), a = e('./stream/Crc32Probe'), o = e('./stream/DataLengthProbe') function s(e, t, n, r, i) { ;((this.compressedSize = e), (this.uncompressedSize = t), (this.crc32 = n), (this.compression = r), (this.compressedContent = i)) } ;((s.prototype = { getContentWorker: function () { var e = new i(r.Promise.resolve(this.compressedContent)) .pipe(this.compression.uncompressWorker()) .pipe(new o('data_length')), t = this return ( e.on('end', function () { if (this.streamInfo.data_length !== t.uncompressedSize) throw new Error('Bug : uncompressed data size mismatch') }), e ) }, getCompressedWorker: function () { return new i(r.Promise.resolve(this.compressedContent)) .withStreamInfo('compressedSize', this.compressedSize) .withStreamInfo('uncompressedSize', this.uncompressedSize) .withStreamInfo('crc32', this.crc32) .withStreamInfo('compression', this.compression) }, }), (s.createWorkerFrom = function (e, t, n) { return e .pipe(new a()) .pipe(new o('uncompressedSize')) .pipe(t.compressWorker(n)) .pipe(new o('compressedSize')) .withStreamInfo('compression', t) }), (t.exports = s)) }, { './external': 6, './stream/Crc32Probe': 25, './stream/DataLengthProbe': 26, './stream/DataWorker': 27, }, ], 3: [ function (e, t, n) { var r = e('./stream/GenericWorker') ;((n.STORE = { magic: '\0\0', compressWorker: function () { return new r('STORE compression') }, uncompressWorker: function () { return new r('STORE decompression') }, }), (n.DEFLATE = e('./flate'))) }, { './flate': 7, './stream/GenericWorker': 28 }, ], 4: [ function (e, t, n) { var r = e('./utils'), i = (function () { for (var e, t = [], n = 0; n < 256; n++) { e = n for (var r = 0; r < 8; r++) e = 1 & e ? 3988292384 ^ (e >>> 1) : e >>> 1 t[n] = e } return t })() t.exports = function (e, t) { return void 0 !== e && e.length ? 'string' !== r.getTypeOf(e) ? (function (e, t, n, r) { var a = i, o = r + n e ^= -1 for (var s = r; s < o; s++) e = (e >>> 8) ^ a[255 & (e ^ t[s])] return -1 ^ e })(0 | t, e, e.length, 0) : (function (e, t, n, r) { var a = i, o = r + n e ^= -1 for (var s = r; s < o; s++) e = (e >>> 8) ^ a[255 & (e ^ t.charCodeAt(s))] return -1 ^ e })(0 | t, e, e.length, 0) : 0 } }, { './utils': 32 }, ], 5: [ function (e, t, n) { ;((n.base64 = !1), (n.binary = !1), (n.dir = !1), (n.createFolders = !0), (n.date = null), (n.compression = null), (n.compressionOptions = null), (n.comment = null), (n.unixPermissions = null), (n.dosPermissions = null)) }, {}, ], 6: [ function (e, t, n) { var r = null ;((r = 'undefined' != typeof Promise ? Promise : e('lie')), (t.exports = { Promise: r })) }, { lie: 37 }, ], 7: [ function (e, t, n) { var r = 'undefined' != typeof Uint8Array && 'undefined' != typeof Uint16Array && 'undefined' != typeof Uint32Array, i = e('pako'), a = e('./utils'), o = e('./stream/GenericWorker'), s = r ? 'uint8array' : 'array' function u(e, t) { ;(o.call(this, 'FlateWorker/' + e), (this._pako = null), (this._pakoAction = e), (this._pakoOptions = t), (this.meta = {})) } ;((n.magic = '\b\0'), a.inherits(u, o), (u.prototype.processChunk = function (e) { ;((this.meta = e.meta), null === this._pako && this._createPako(), this._pako.push(a.transformTo(s, e.data), !1)) }), (u.prototype.flush = function () { ;(o.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], !0)) }), (u.prototype.cleanUp = function () { ;(o.prototype.cleanUp.call(this), (this._pako = null)) }), (u.prototype._createPako = function () { this._pako = new i[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1, }) var e = this this._pako.onData = function (t) { e.push({ data: t, meta: e.meta }) } }), (n.compressWorker = function (e) { return new u('Deflate', e) }), (n.uncompressWorker = function () { return new u('Inflate', {}) })) }, { './stream/GenericWorker': 28, './utils': 32, pako: 38 }, ], 8: [ function (e, t, n) { function r(e, t) { var n, r = '' for (n = 0; n < t; n++) ((r += String.fromCharCode(255 & e)), (e >>>= 8)) return r } function i(e, t, n, i, o, c) { var h, d, f = e.file, p = e.compression, v = c !== s.utf8encode, m = a.transformTo('string', c(f.name)), g = a.transformTo('string', s.utf8encode(f.name)), y = f.comment, _ = a.transformTo('string', c(y)), b = a.transformTo('string', s.utf8encode(y)), x = g.length !== f.name.length, S = b.length !== y.length, A = '', w = '', T = '', M = f.dir, E = f.date, C = { crc32: 0, compressedSize: 0, uncompressedSize: 0 } ;(t && !n) || ((C.crc32 = e.crc32), (C.compressedSize = e.compressedSize), (C.uncompressedSize = e.uncompressedSize)) var k = 0 ;(t && (k |= 8), v || (!x && !S) || (k |= 2048)) var R = 0, I = 0 ;(M && (R |= 16), 'UNIX' === o ? ((I = 798), (R |= (function (e, t) { var n = e return (e || (n = t ? 16893 : 33204), (65535 & n) << 16) })(f.unixPermissions, M))) : ((I = 20), (R |= (function (e) { return 63 & (e || 0) })(f.dosPermissions))), (h = E.getUTCHours()), (h <<= 6), (h |= E.getUTCMinutes()), (h <<= 5), (h |= E.getUTCSeconds() / 2), (d = E.getUTCFullYear() - 1980), (d <<= 4), (d |= E.getUTCMonth() + 1), (d <<= 5), (d |= E.getUTCDate()), x && ((w = r(1, 1) + r(u(m), 4) + g), (A += 'up' + r(w.length, 2) + w)), S && ((T = r(1, 1) + r(u(_), 4) + b), (A += 'uc' + r(T.length, 2) + T))) var N = '' return ( (N += '\n\0'), (N += r(k, 2)), (N += p.magic), (N += r(h, 2)), (N += r(d, 2)), (N += r(C.crc32, 4)), (N += r(C.compressedSize, 4)), (N += r(C.uncompressedSize, 4)), (N += r(m.length, 2)), (N += r(A.length, 2)), { fileRecord: l.LOCAL_FILE_HEADER + N + m + A, dirRecord: l.CENTRAL_FILE_HEADER + r(I, 2) + N + r(_.length, 2) + '\0\0\0\0' + r(R, 4) + r(i, 4) + m + A + _, } ) } var a = e('../utils'), o = e('../stream/GenericWorker'), s = e('../utf8'), u = e('../crc32'), l = e('../signature') function c(e, t, n, r) { ;(o.call(this, 'ZipFileWorker'), (this.bytesWritten = 0), (this.zipComment = t), (this.zipPlatform = n), (this.encodeFileName = r), (this.streamFiles = e), (this.accumulate = !1), (this.contentBuffer = []), (this.dirRecords = []), (this.currentSourceOffset = 0), (this.entriesCount = 0), (this.currentFile = null), (this._sources = [])) } ;(a.inherits(c, o), (c.prototype.push = function (e) { var t = e.meta.percent || 0, n = this.entriesCount, r = this._sources.length this.accumulate ? this.contentBuffer.push(e) : ((this.bytesWritten += e.data.length), o.prototype.push.call(this, { data: e.data, meta: { currentFile: this.currentFile, percent: n ? (t + 100 * (n - r - 1)) / n : 100, }, })) }), (c.prototype.openedSource = function (e) { ;((this.currentSourceOffset = this.bytesWritten), (this.currentFile = e.file.name)) var t = this.streamFiles && !e.file.dir if (t) { var n = i( e, t, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName ) this.push({ data: n.fileRecord, meta: { percent: 0 } }) } else this.accumulate = !0 }), (c.prototype.closedSource = function (e) { this.accumulate = !1 var t = this.streamFiles && !e.file.dir, n = i( e, t, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName ) if ((this.dirRecords.push(n.dirRecord), t)) this.push({ data: (function (e) { return ( l.DATA_DESCRIPTOR + r(e.crc32, 4) + r(e.compressedSize, 4) + r(e.uncompressedSize, 4) ) })(e), meta: { percent: 100 }, }) else for ( this.push({ data: n.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()) this.currentFile = null }), (c.prototype.flush = function () { for ( var e = this.bytesWritten, t = 0; t < this.dirRecords.length; t++ ) this.push({ data: this.dirRecords[t], meta: { percent: 100 } }) var n = this.bytesWritten - e, i = (function (e, t, n, i, o) { var s = a.transformTo('string', o(i)) return ( l.CENTRAL_DIRECTORY_END + '\0\0\0\0' + r(e, 2) + r(e, 2) + r(t, 4) + r(n, 4) + r(s.length, 2) + s ) })( this.dirRecords.length, n, e, this.zipComment, this.encodeFileName ) this.push({ data: i, meta: { percent: 100 } }) }), (c.prototype.prepareNextSource = function () { ;((this.previous = this._sources.shift()), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume()) }), (c.prototype.registerPrevious = function (e) { this._sources.push(e) var t = this return ( e.on('data', function (e) { t.processChunk(e) }), e.on('end', function () { ;(t.closedSource(t.previous.streamInfo), t._sources.length ? t.prepareNextSource() : t.end()) }), e.on('error', function (e) { t.error(e) }), this ) }), (c.prototype.resume = function () { return ( !!o.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0)) ) }), (c.prototype.error = function (e) { var t = this._sources if (!o.prototype.error.call(this, e)) return !1 for (var n = 0; n < t.length; n++) try { t[n].error(e) } catch (e) {} return !0 }), (c.prototype.lock = function () { o.prototype.lock.call(this) for (var e = this._sources, t = 0; t < e.length; t++) e[t].lock() }), (t.exports = c)) }, { '../crc32': 4, '../signature': 23, '../stream/GenericWorker': 28, '../utf8': 31, '../utils': 32, }, ], 9: [ function (e, t, n) { var r = e('../compressions'), i = e('./ZipFileWorker') n.generateWorker = function (e, t, n) { var a = new i(t.streamFiles, n, t.platform, t.encodeFileName), o = 0 try { ;(e.forEach(function (e, n) { o++ var i = (function (e, t) { var n = e || t, i = r[n] if (!i) throw new Error(n + ' is not a valid compression method !') return i })(n.options.compression, t.compression), s = n.options.compressionOptions || t.compressionOptions || {}, u = n.dir, l = n.date n._compressWorker(i, s) .withStreamInfo('file', { name: e, dir: u, date: l, comment: n.comment || '', unixPermissions: n.unixPermissions, dosPermissions: n.dosPermissions, }) .pipe(a) }), (a.entriesCount = o)) } catch (e) { a.error(e) } return a } }, { '../compressions': 3, './ZipFileWorker': 8 }, ], 10: [ function (e, t, n) { function r() { if (!(this instanceof r)) return new r() if (arguments.length) throw new Error( 'The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.' ) ;((this.files = Object.create(null)), (this.comment = null), (this.root = ''), (this.clone = function () { var e = new r() for (var t in this) 'function' != typeof this[t] && (e[t] = this[t]) return e })) } ;(((r.prototype = e('./object')).loadAsync = e('./load')), (r.support = e('./support')), (r.defaults = e('./defaults')), (r.version = '3.10.1'), (r.loadAsync = function (e, t) { return new r().loadAsync(e, t) }), (r.external = e('./external')), (t.exports = r)) }, { './defaults': 5, './external': 6, './load': 11, './object': 15, './support': 30, }, ], 11: [ function (e, t, n) { var r = e('./utils'), i = e('./external'), a = e('./utf8'), o = e('./zipEntries'), s = e('./stream/Crc32Probe'), u = e('./nodejsUtils') function l(e) { return new i.Promise(function (t, n) { var r = e.decompressed.getContentWorker().pipe(new s()) r.on('error', function (e) { n(e) }) .on('end', function () { r.streamInfo.crc32 !== e.decompressed.crc32 ? n(new Error('Corrupted zip : CRC32 mismatch')) : t() }) .resume() }) } t.exports = function (e, t) { var n = this return ( (t = r.extend(t || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: a.utf8decode, })), u.isNode && u.isStream(e) ? i.Promise.reject( new Error( "JSZip can't accept a stream when loading a zip file." ) ) : r .prepareContent( 'the loaded zip file', e, !0, t.optimizedBinaryString, t.base64 ) .then(function (e) { var n = new o(t) return (n.load(e), n) }) .then(function (e) { var n = [i.Promise.resolve(e)], r = e.files if (t.checkCRC32) for (var a = 0; a < r.length; a++) n.push(l(r[a])) return i.Promise.all(n) }) .then(function (e) { for ( var i = e.shift(), a = i.files, o = 0; o < a.length; o++ ) { var s = a[o], u = s.fileNameStr, l = r.resolve(s.fileNameStr) ;(n.file(l, s.decompressed, { binary: !0, optimizedBinaryString: !0, date: s.date, dir: s.dir, comment: s.fileCommentStr.length ? s.fileCommentStr : null, unixPermissions: s.unixPermissions, dosPermissions: s.dosPermissions, createFolders: t.createFolders, }), s.dir || (n.file(l).unsafeOriginalName = u)) } return (i.zipComment.length && (n.comment = i.zipComment), n) }) ) } }, { './external': 6, './nodejsUtils': 14, './stream/Crc32Probe': 25, './utf8': 31, './utils': 32, './zipEntries': 33, }, ], 12: [ function (e, t, n) { var r = e('../utils'), i = e('../stream/GenericWorker') function a(e, t) { ;(i.call(this, 'Nodejs stream input adapter for ' + e), (this._upstreamEnded = !1), this._bindStream(t)) } ;(r.inherits(a, i), (a.prototype._bindStream = function (e) { var t = this ;((this._stream = e).pause(), e .on('data', function (e) { t.push({ data: e, meta: { percent: 0 } }) }) .on('error', function (e) { t.isPaused ? (this.generatedError = e) : t.error(e) }) .on('end', function () { t.isPaused ? (t._upstreamEnded = !0) : t.end() })) }), (a.prototype.pause = function () { return !!i.prototype.pause.call(this) && (this._stream.pause(), !0) }), (a.prototype.resume = function () { return ( !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0) ) }), (t.exports = a)) }, { '../stream/GenericWorker': 28, '../utils': 32 }, ], 13: [ function (e, t, n) { var r = e('readable-stream').Readable function i(e, t, n) { ;(r.call(this, t), (this._helper = e)) var i = this e.on('data', function (e, t) { ;(i.push(e) || i._helper.pause(), n && n(t)) }) .on('error', function (e) { i.emit('error', e) }) .on('end', function () { i.push(null) }) } ;(e('../utils').inherits(i, r), (i.prototype._read = function () { this._helper.resume() }), (t.exports = i)) }, { '../utils': 32, 'readable-stream': 16 }, ], 14: [ function (e, t, n) { t.exports = { isNode: 'undefined' != typeof Buffer, newBufferFrom: function (e, t) { if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e, t) if ('number' == typeof e) throw new Error('The "data" argument must not be a number') return new Buffer(e, t) }, allocBuffer: function (e) { if (Buffer.alloc) return Buffer.alloc(e) var t = new Buffer(e) return (t.fill(0), t) }, isBuffer: function (e) { return Buffer.isBuffer(e) }, isStream: function (e) { return ( e && 'function' == typeof e.on && 'function' == typeof e.pause && 'function' == typeof e.resume ) }, } }, {}, ], 15: [ function (e, t, n) { function r(e, t, n) { var r, i = a.getTypeOf(t), s = a.extend(n || {}, u) ;((s.date = s.date || new Date()), null !== s.compression && (s.compression = s.compression.toUpperCase()), 'string' == typeof s.unixPermissions && (s.unixPermissions = parseInt(s.unixPermissions, 8)), s.unixPermissions && 16384 & s.unixPermissions && (s.dir = !0), s.dosPermissions && 16 & s.dosPermissions && (s.dir = !0), s.dir && (e = v(e)), s.createFolders && (r = p(e)) && m.call(this, r, !0)) var h = 'string' === i && !1 === s.binary && !1 === s.base64 ;((n && void 0 !== n.binary) || (s.binary = !h), ((t instanceof l && 0 === t.uncompressedSize) || s.dir || !t || 0 === t.length) && ((s.base64 = !1), (s.binary = !0), (t = ''), (s.compression = 'STORE'), (i = 'string'))) var g = null g = t instanceof l || t instanceof o ? t : d.isNode && d.isStream(t) ? new f(e, t) : a.prepareContent( e, t, s.binary, s.optimizedBinaryString, s.base64 ) var y = new c(e, g, s) this.files[e] = y } var i = e('./utf8'), a = e('./utils'), o = e('./stream/GenericWorker'), s = e('./stream/StreamHelper'), u = e('./defaults'), l = e('./compressedObject'), c = e('./zipObject'), h = e('./generate'), d = e('./nodejsUtils'), f = e('./nodejs/NodejsStreamInputAdapter'), p = function (e) { '/' === e.slice(-1) && (e = e.substring(0, e.length - 1)) var t = e.lastIndexOf('/') return 0 < t ? e.substring(0, t) : '' }, v = function (e) { return ('/' !== e.slice(-1) && (e += '/'), e) }, m = function (e, t) { return ( (t = void 0 !== t ? t : u.createFolders), (e = v(e)), this.files[e] || r.call(this, e, null, { dir: !0, createFolders: t }), this.files[e] ) } function g(e) { return '[object RegExp]' === Object.prototype.toString.call(e) } var y = { load: function () { throw new Error( 'This method has been removed in JSZip 3.0, please check the upgrade guide.' ) }, forEach: function (e) { var t, n, r for (t in this.files) ((r = this.files[t]), (n = t.slice(this.root.length, t.length)) && t.slice(0, this.root.length) === this.root && e(n, r)) }, filter: function (e) { var t = [] return ( this.forEach(function (n, r) { e(n, r) && t.push(r) }), t ) }, file: function (e, t, n) { if (1 !== arguments.length) return ((e = this.root + e), r.call(this, e, t, n), this) if (g(e)) { var i = e return this.filter(function (e, t) { return !t.dir && i.test(e) }) } var a = this.files[this.root + e] return a && !a.dir ? a : null }, folder: function (e) { if (!e) return this if (g(e)) return this.filter(function (t, n) { return n.dir && e.test(t) }) var t = this.root + e, n = m.call(this, t), r = this.clone() return ((r.root = n.name), r) }, remove: function (e) { e = this.root + e var t = this.files[e] if ( (t || ('/' !== e.slice(-1) && (e += '/'), (t = this.files[e])), t && !t.dir) ) delete this.files[e] else for ( var n = this.filter(function (t, n) { return n.name.slice(0, e.length) === e }), r = 0; r < n.length; r++ ) delete this.files[n[r].name] return this }, generate: function () { throw new Error( 'This method has been removed in JSZip 3.0, please check the upgrade guide.' ) }, generateInternalStream: function (e) { var t, n = {} try { if ( (((n = a.extend(e || {}, { streamFiles: !1, compression: 'STORE', compressionOptions: null, type: '', platform: 'DOS', comment: null, mimeType: 'application/zip', encodeFileName: i.utf8encode, })).type = n.type.toLowerCase()), (n.compression = n.compression.toUpperCase()), 'binarystring' === n.type && (n.type = 'string'), !n.type) ) throw new Error('No output type specified.') ;(a.checkSupport(n.type), ('darwin' !== n.platform && 'freebsd' !== n.platform && 'linux' !== n.platform && 'sunos' !== n.platform) || (n.platform = 'UNIX'), 'win32' === n.platform && (n.platform = 'DOS')) var r = n.comment || this.comment || '' t = h.generateWorker(this, n, r) } catch (e) { ;(t = new o('error')).error(e) } return new s(t, n.type || 'string', n.mimeType) }, generateAsync: function (e, t) { return this.generateInternalStream(e).accumulate(t) }, generateNodeStream: function (e, t) { return ( (e = e || {}).type || (e.type = 'nodebuffer'), this.generateInternalStream(e).toNodejsStream(t) ) }, } t.exports = y }, { './compressedObject': 2, './defaults': 5, './generate': 9, './nodejs/NodejsStreamInputAdapter': 12, './nodejsUtils': 14, './stream/GenericWorker': 28, './stream/StreamHelper': 29, './utf8': 31, './utils': 32, './zipObject': 35, }, ], 16: [ function (e, t, n) { t.exports = e('stream') }, { stream: void 0 }, ], 17: [ function (e, t, n) { var r = e('./DataReader') function i(e) { r.call(this, e) for (var t = 0; t < this.data.length; t++) e[t] = 255 & e[t] } ;(e('../utils').inherits(i, r), (i.prototype.byteAt = function (e) { return this.data[this.zero + e] }), (i.prototype.lastIndexOfSignature = function (e) { for ( var t = e.charCodeAt(0), n = e.charCodeAt(1), r = e.charCodeAt(2), i = e.charCodeAt(3), a = this.length - 4; 0 <= a; --a ) if ( this.data[a] === t && this.data[a + 1] === n && this.data[a + 2] === r && this.data[a + 3] === i ) return a - this.zero return -1 }), (i.prototype.readAndCheckSignature = function (e) { var t = e.charCodeAt(0), n = e.charCodeAt(1), r = e.charCodeAt(2), i = e.charCodeAt(3), a = this.readData(4) return t === a[0] && n === a[1] && r === a[2] && i === a[3] }), (i.prototype.readData = function (e) { if ((this.checkOffset(e), 0 === e)) return [] var t = this.data.slice( this.zero + this.index, this.zero + this.index + e ) return ((this.index += e), t) }), (t.exports = i)) }, { '../utils': 32, './DataReader': 18 }, ], 18: [ function (e, t, n) { var r = e('../utils') function i(e) { ;((this.data = e), (this.length = e.length), (this.index = 0), (this.zero = 0)) } ;((i.prototype = { checkOffset: function (e) { this.checkIndex(this.index + e) }, checkIndex: function (e) { if (this.length < this.zero + e || e < 0) throw new Error( 'End of data reached (data length = ' + this.length + ', asked index = ' + e + '). Corrupted zip ?' ) }, setIndex: function (e) { ;(this.checkIndex(e), (this.index = e)) }, skip: function (e) { this.setIndex(this.index + e) }, byteAt: function () {}, readInt: function (e) { var t, n = 0 for ( this.checkOffset(e), t = this.index + e - 1; t >= this.index; t-- ) n = (n << 8) + this.byteAt(t) return ((this.index += e), n) }, readString: function (e) { return r.transformTo('string', this.readData(e)) }, readData: function () {}, lastIndexOfSignature: function () {}, readAndCheckSignature: function () {}, readDate: function () { var e = this.readInt(4) return new Date( Date.UTC( 1980 + ((e >> 25) & 127), ((e >> 21) & 15) - 1, (e >> 16) & 31, (e >> 11) & 31, (e >> 5) & 63, (31 & e) << 1 ) ) }, }), (t.exports = i)) }, { '../utils': 32 }, ], 19: [ function (e, t, n) { var r = e('./Uint8ArrayReader') function i(e) { r.call(this, e) } ;(e('../utils').inherits(i, r), (i.prototype.readData = function (e) { this.checkOffset(e) var t = this.data.slice( this.zero + this.index, this.zero + this.index + e ) return ((this.index += e), t) }), (t.exports = i)) }, { '../utils': 32, './Uint8ArrayReader': 21 }, ], 20: [ function (e, t, n) { var r = e('./DataReader') function i(e) { r.call(this, e) } ;(e('../utils').inherits(i, r), (i.prototype.byteAt = function (e) { return this.data.charCodeAt(this.zero + e) }), (i.prototype.lastIndexOfSignature = function (e) { return this.data.lastIndexOf(e) - this.zero }), (i.prototype.readAndCheckSignature = function (e) { return e === this.readData(4) }), (i.prototype.readData = function (e) { this.checkOffset(e) var t = this.data.slice( this.zero + this.index, this.zero + this.index + e ) return ((this.index += e), t) }), (t.exports = i)) }, { '../utils': 32, './DataReader': 18 }, ], 21: [ function (e, t, n) { var r = e('./ArrayReader') function i(e) { r.call(this, e) } ;(e('../utils').inherits(i, r), (i.prototype.readData = function (e) { if ((this.checkOffset(e), 0 === e)) return new Uint8Array(0) var t = this.data.subarray( this.zero + this.index, this.zero + this.index + e ) return ((this.index += e), t) }), (t.exports = i)) }, { '../utils': 32, './ArrayReader': 17 }, ], 22: [ function (e, t, n) { var r = e('../utils'), i = e('../support'), a = e('./ArrayReader'), o = e('./StringReader'), s = e('./NodeBufferReader'), u = e('./Uint8ArrayReader') t.exports = function (e) { var t = r.getTypeOf(e) return ( r.checkSupport(t), 'string' !== t || i.uint8array ? 'nodebuffer' === t ? new s(e) : i.uint8array ? new u(r.transformTo('uint8array', e)) : new a(r.transformTo('array', e)) : new o(e) ) } }, { '../support': 30, '../utils': 32, './ArrayReader': 17, './NodeBufferReader': 19, './StringReader': 20, './Uint8ArrayReader': 21, }, ], 23: [ function (e, t, n) { ;((n.LOCAL_FILE_HEADER = 'PK'), (n.CENTRAL_FILE_HEADER = 'PK'), (n.CENTRAL_DIRECTORY_END = 'PK'), (n.ZIP64_CENTRAL_DIRECTORY_LOCATOR = 'PK'), (n.ZIP64_CENTRAL_DIRECTORY_END = 'PK'), (n.DATA_DESCRIPTOR = 'PK\b')) }, {}, ], 24: [ function (e, t, n) { var r = e('./GenericWorker'), i = e('../utils') function a(e) { ;(r.call(this, 'ConvertWorker to ' + e), (this.destType = e)) } ;(i.inherits(a, r), (a.prototype.processChunk = function (e) { this.push({ data: i.transformTo(this.destType, e.data), meta: e.meta, }) }), (t.exports = a)) }, { '../utils': 32, './GenericWorker': 28 }, ], 25: [ function (e, t, n) { var r = e('./GenericWorker'), i = e('../crc32') function a() { ;(r.call(this, 'Crc32Probe'), this.withStreamInfo('crc32', 0)) } ;(e('../utils').inherits(a, r), (a.prototype.processChunk = function (e) { ;((this.streamInfo.crc32 = i(e.data, this.streamInfo.crc32 || 0)), this.push(e)) }), (t.exports = a)) }, { '../crc32': 4, '../utils': 32, './GenericWorker': 28 }, ], 26: [ function (e, t, n) { var r = e('../utils'), i = e('./GenericWorker') function a(e) { ;(i.call(this, 'DataLengthProbe for ' + e), (this.propName = e), this.withStreamInfo(e, 0)) } ;(r.inherits(a, i), (a.prototype.processChunk = function (e) { if (e) { var t = this.streamInfo[this.propName] || 0 this.streamInfo[this.propName] = t + e.data.length } i.prototype.processChunk.call(this, e) }), (t.exports = a)) }, { '../utils': 32, './GenericWorker': 28 }, ], 27: [ function (e, t, n) { var r = e('../utils'), i = e('./GenericWorker') function a(e) { i.call(this, 'DataWorker') var t = this ;((this.dataIsReady = !1), (this.index = 0), (this.max = 0), (this.data = null), (this.type = ''), (this._tickScheduled = !1), e.then( function (e) { ;((t.dataIsReady = !0), (t.data = e), (t.max = (e && e.length) || 0), (t.type = r.getTypeOf(e)), t.isPaused || t._tickAndRepeat()) }, function (e) { t.error(e) } )) } ;(r.inherits(a, i), (a.prototype.cleanUp = function () { ;(i.prototype.cleanUp.call(this), (this.data = null)) }), (a.prototype.resume = function () { return ( !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && ((this._tickScheduled = !0), r.delay(this._tickAndRepeat, [], this)), !0) ) }), (a.prototype._tickAndRepeat = function () { ;((this._tickScheduled = !1), this.isPaused || this.isFinished || (this._tick(), this.isFinished || (r.delay(this._tickAndRepeat, [], this), (this._tickScheduled = !0)))) }), (a.prototype._tick = function () { if (this.isPaused || this.isFinished) return !1 var e = null, t = Math.min(this.max, this.index + 16384) if (this.index >= this.max) return this.end() switch (this.type) { case 'string': e = this.data.substring(this.index, t) break case 'uint8array': e = this.data.subarray(this.index, t) break case 'array': case 'nodebuffer': e = this.data.slice(this.index, t) } return ( (this.index = t), this.push({ data: e, meta: { percent: this.max ? (this.index / this.max) * 100 : 0 }, }) ) }), (t.exports = a)) }, { '../utils': 32, './GenericWorker': 28 }, ], 28: [ function (e, t, n) { function r(e) { ;((this.name = e || 'default'), (this.streamInfo = {}), (this.generatedError = null), (this.extraStreamInfo = {}), (this.isPaused = !0), (this.isFinished = !1), (this.isLocked = !1), (this._listeners = { data: [], end: [], error: [] }), (this.previous = null)) } ;((r.prototype = { push: function (e) { this.emit('data', e) }, end: function () { if (this.isFinished) return !1 this.flush() try { ;(this.emit('end'), this.cleanUp(), (this.isFinished = !0)) } catch (e) { this.emit('error', e) } return !0 }, error: function (e) { return ( !this.isFinished && (this.isPaused ? (this.generatedError = e) : ((this.isFinished = !0), this.emit('error', e), this.previous && this.previous.error(e), this.cleanUp()), !0) ) }, on: function (e, t) { return (this._listeners[e].push(t), this) }, cleanUp: function () { ;((this.streamInfo = this.generatedError = this.extraStreamInfo = null), (this._listeners = [])) }, emit: function (e, t) { if (this._listeners[e]) for (var n = 0; n < this._listeners[e].length; n++) this._listeners[e][n].call(this, t) }, pipe: function (e) { return e.registerPrevious(this) }, registerPrevious: function (e) { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.") ;((this.streamInfo = e.streamInfo), this.mergeStreamInfo(), (this.previous = e)) var t = this return ( e.on('data', function (e) { t.processChunk(e) }), e.on('end', function () { t.end() }), e.on('error', function (e) { t.error(e) }), this ) }, pause: function () { return ( !this.isPaused && !this.isFinished && ((this.isPaused = !0), this.previous && this.previous.pause(), !0) ) }, resume: function () { if (!this.isPaused || this.isFinished) return !1 var e = (this.isPaused = !1) return ( this.generatedError && (this.error(this.generatedError), (e = !0)), this.previous && this.previous.resume(), !e ) }, flush: function () {}, processChunk: function (e) { this.push(e) }, withStreamInfo: function (e, t) { return ((this.extraStreamInfo[e] = t), this.mergeStreamInfo(), this) }, mergeStreamInfo: function () { for (var e in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e) && (this.streamInfo[e] = this.extraStreamInfo[e]) }, lock: function () { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.") ;((this.isLocked = !0), this.previous && this.previous.lock()) }, toString: function () { var e = 'Worker ' + this.name return this.previous ? this.previous + ' -> ' + e : e }, }), (t.exports = r)) }, {}, ], 29: [ function (e, t, n) { var r = e('../utils'), i = e('./ConvertWorker'), a = e('./GenericWorker'), o = e('../base64'), s = e('../support'), u = e('../external'), l = null if (s.nodestream) try { l = e('../nodejs/NodejsStreamOutputAdapter') } catch (e) {} function c(e, t) { return new u.Promise(function (n, i) { var a = [], s = e._internalType, u = e._outputType, l = e._mimeType e.on('data', function (e, n) { ;(a.push(e), t && t(n)) }) .on('error', function (e) { ;((a = []), i(e)) }) .on('end', function () { try { var e = (function (e, t, n) { switch (e) { case 'blob': return r.newBlob(r.transformTo('arraybuffer', t), n) case 'base64': return o.encode(t) default: return r.transformTo(e, t) } })( u, (function (e, t) { var n, r = 0, i = null, a = 0 for (n = 0; n < t.length; n++) a += t[n].length switch (e) { case 'string': return t.join('') case 'array': return Array.prototype.concat.apply([], t) case 'uint8array': for (i = new Uint8Array(a), n = 0; n < t.length; n++) (i.set(t[n], r), (r += t[n].length)) return i case 'nodebuffer': return Buffer.concat(t) default: throw new Error("concat : unsupported type '" + e + "'") } })(s, a), l ) n(e) } catch (e) { i(e) } a = [] }) .resume() }) } function h(e, t, n) { var o = t switch (t) { case 'blob': case 'arraybuffer': o = 'uint8array' break case 'base64': o = 'string' } try { ;((this._internalType = o), (this._outputType = t), (this._mimeType = n), r.checkSupport(o), (this._worker = e.pipe(new i(o))), e.lock()) } catch (e) { ;((this._worker = new a('error')), this._worker.error(e)) } } ;((h.prototype = { accumulate: function (e) { return c(this, e) }, on: function (e, t) { var n = this return ( 'data' === e ? this._worker.on(e, function (e) { t.call(n, e.data, e.meta) }) : this._worker.on(e, function () { r.delay(t, arguments, n) }), this ) }, resume: function () { return (r.delay(this._worker.resume, [], this._worker), this) }, pause: function () { return (this._worker.pause(), this) }, toNodejsStream: function (e) { if ((r.checkSupport('nodestream'), 'nodebuffer' !== this._outputType)) throw new Error( this._outputType + ' is not supported by this method' ) return new l( this, { objectMode: 'nodebuffer' !== this._outputType }, e ) }, }), (t.exports = h)) }, { '../base64': 1, '../external': 6, '../nodejs/NodejsStreamOutputAdapter': 13, '../support': 30, '../utils': 32, './ConvertWorker': 24, './GenericWorker': 28, }, ], 30: [ function (e, t, n) { if ( ((n.base64 = !0), (n.array = !0), (n.string = !0), (n.arraybuffer = 'undefined' != typeof ArrayBuffer && 'undefined' != typeof Uint8Array), (n.nodebuffer = 'undefined' != typeof Buffer), (n.uint8array = 'undefined' != typeof Uint8Array), 'undefined' == typeof ArrayBuffer) ) n.blob = !1 else { var r = new ArrayBuffer(0) try { n.blob = 0 === new Blob([r], { type: 'application/zip' }).size } catch (e) { try { var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)() ;(i.append(r), (n.blob = 0 === i.getBlob('application/zip').size)) } catch (e) { n.blob = !1 } } } try { n.nodestream = !!e('readable-stream').Readable } catch (e) { n.nodestream = !1 } }, { 'readable-stream': 16 }, ], 31: [ function (e, t, n) { for ( var r = e('./utils'), i = e('./support'), a = e('./nodejsUtils'), o = e('./stream/GenericWorker'), s = new Array(256), u = 0; u < 256; u++ ) s[u] = 252 <= u ? 6 : 248 <= u ? 5 : 240 <= u ? 4 : 224 <= u ? 3 : 192 <= u ? 2 : 1 function l() { ;(o.call(this, 'utf-8 decode'), (this.leftOver = null)) } function c() { o.call(this, 'utf-8 encode') } ;((s[254] = s[254] = 1), (n.utf8encode = function (e) { return i.nodebuffer ? a.newBufferFrom(e, 'utf-8') : (function (e) { var t, n, r, a, o, s = e.length, u = 0 for (a = 0; a < s; a++) (55296 == (64512 & (n = e.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (r = e.charCodeAt(a + 1))) && ((n = 65536 + ((n - 55296) << 10) + (r - 56320)), a++), (u += n < 128 ? 1 : n < 2048 ? 2 : n < 65536 ? 3 : 4)) for ( t = i.uint8array ? new Uint8Array(u) : new Array(u), a = o = 0; o < u; a++ ) (55296 == (64512 & (n = e.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (r = e.charCodeAt(a + 1))) && ((n = 65536 + ((n - 55296) << 10) + (r - 56320)), a++), n < 128 ? (t[o++] = n) : (n < 2048 ? (t[o++] = 192 | (n >>> 6)) : (n < 65536 ? (t[o++] = 224 | (n >>> 12)) : ((t[o++] = 240 | (n >>> 18)), (t[o++] = 128 | ((n >>> 12) & 63))), (t[o++] = 128 | ((n >>> 6) & 63))), (t[o++] = 128 | (63 & n)))) return t })(e) }), (n.utf8decode = function (e) { return i.nodebuffer ? r.transformTo('nodebuffer', e).toString('utf-8') : (function (e) { var t, n, i, a, o = e.length, u = new Array(2 * o) for (t = n = 0; t < o; ) if ((i = e[t++]) < 128) u[n++] = i else if (4 < (a = s[i])) ((u[n++] = 65533), (t += a - 1)) else { for (i &= 2 === a ? 31 : 3 === a ? 15 : 7; 1 < a && t < o; ) ((i = (i << 6) | (63 & e[t++])), a--) 1 < a ? (u[n++] = 65533) : i < 65536 ? (u[n++] = i) : ((i -= 65536), (u[n++] = 55296 | ((i >> 10) & 1023)), (u[n++] = 56320 | (1023 & i))) } return ( u.length !== n && (u.subarray ? (u = u.subarray(0, n)) : (u.length = n)), r.applyFromCharCode(u) ) })((e = r.transformTo(i.uint8array ? 'uint8array' : 'array', e))) }), r.inherits(l, o), (l.prototype.processChunk = function (e) { var t = r.transformTo(i.uint8array ? 'uint8array' : 'array', e.data) if (this.leftOver && this.leftOver.length) { if (i.uint8array) { var a = t ;((t = new Uint8Array(a.length + this.leftOver.length)).set( this.leftOver, 0 ), t.set(a, this.leftOver.length)) } else t = this.leftOver.concat(t) this.leftOver = null } var o = (function (e, t) { var n for ( (t = t || e.length) > e.length && (t = e.length), n = t - 1; 0 <= n && 128 == (192 & e[n]); ) n-- return n < 0 || 0 === n ? t : n + s[e[n]] > t ? n : t })(t), u = t ;(o !== t.length && (i.uint8array ? ((u = t.subarray(0, o)), (this.leftOver = t.subarray(o, t.length))) : ((u = t.slice(0, o)), (this.leftOver = t.slice(o, t.length)))), this.push({ data: n.utf8decode(u), meta: e.meta })) }), (l.prototype.flush = function () { this.leftOver && this.leftOver.length && (this.push({ data: n.utf8decode(this.leftOver), meta: {} }), (this.leftOver = null)) }), (n.Utf8DecodeWorker = l), r.inherits(c, o), (c.prototype.processChunk = function (e) { this.push({ data: n.utf8encode(e.data), meta: e.meta }) }), (n.Utf8EncodeWorker = c)) }, { './nodejsUtils': 14, './stream/GenericWorker': 28, './support': 30, './utils': 32, }, ], 32: [ function (e, t, n) { var r = e('./support'), i = e('./base64'), a = e('./nodejsUtils'), o = e('./external') function s(e) { return e } function u(e, t) { for (var n = 0; n < e.length; ++n) t[n] = 255 & e.charCodeAt(n) return t } ;(e('setimmediate'), (n.newBlob = function (t, r) { n.checkSupport('blob') try { return new Blob([t], { type: r }) } catch (e) { try { var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)() return (i.append(t), i.getBlob(r)) } catch (e) { throw new Error("Bug : can't construct the Blob.") } } })) var l = { stringifyByChunk: function (e, t, n) { var r = [], i = 0, a = e.length if (a <= n) return String.fromCharCode.apply(null, e) for (; i < a; ) ('array' === t || 'nodebuffer' === t ? r.push( String.fromCharCode.apply( null, e.slice(i, Math.min(i + n, a)) ) ) : r.push( String.fromCharCode.apply( null, e.subarray(i, Math.min(i + n, a)) ) ), (i += n)) return r.join('') }, stringifyByChar: function (e) { for (var t = '', n = 0; n < e.length; n++) t += String.fromCharCode(e[n]) return t }, applyCanBeUsed: { uint8array: (function () { try { return ( r.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length ) } catch (e) { return !1 } })(), nodebuffer: (function () { try { return ( r.nodebuffer && 1 === String.fromCharCode.apply(null, a.allocBuffer(1)).length ) } catch (e) { return !1 } })(), }, } function c(e) { var t = 65536, r = n.getTypeOf(e), i = !0 if ( ('uint8array' === r ? (i = l.applyCanBeUsed.uint8array) : 'nodebuffer' === r && (i = l.applyCanBeUsed.nodebuffer), i) ) for (; 1 < t; ) try { return l.stringifyByChunk(e, r, t) } catch (e) { t = Math.floor(t / 2) } return l.stringifyByChar(e) } function h(e, t) { for (var n = 0; n < e.length; n++) t[n] = e[n] return t } n.applyFromCharCode = c var d = {} ;((d.string = { string: s, array: function (e) { return u(e, new Array(e.length)) }, arraybuffer: function (e) { return d.string.uint8array(e).buffer }, uint8array: function (e) { return u(e, new Uint8Array(e.length)) }, nodebuffer: function (e) { return u(e, a.allocBuffer(e.length)) }, }), (d.array = { string: c, array: s, arraybuffer: function (e) { return new Uint8Array(e).buffer }, uint8array: function (e) { return new Uint8Array(e) }, nodebuffer: function (e) { return a.newBufferFrom(e) }, }), (d.arraybuffer = { string: function (e) { return c(new Uint8Array(e)) }, array: function (e) { return h(new Uint8Array(e), new Array(e.byteLength)) }, arraybuffer: s, uint8array: function (e) { return new Uint8Array(e) }, nodebuffer: function (e) { return a.newBufferFrom(new Uint8Array(e)) }, }), (d.uint8array = { string: c, array: function (e) { return h(e, new Array(e.length)) }, arraybuffer: function (e) { return e.buffer }, uint8array: s, nodebuffer: function (e) { return a.newBufferFrom(e) }, }), (d.nodebuffer = { string: c, array: function (e) { return h(e, new Array(e.length)) }, arraybuffer: function (e) { return d.nodebuffer.uint8array(e).buffer }, uint8array: function (e) { return h(e, new Uint8Array(e.length)) }, nodebuffer: s, }), (n.transformTo = function (e, t) { if (((t = t || ''), !e)) return t n.checkSupport(e) var r = n.getTypeOf(t) return d[r][e](t) }), (n.resolve = function (e) { for (var t = e.split('/'), n = [], r = 0; r < t.length; r++) { var i = t[r] '.' === i || ('' === i && 0 !== r && r !== t.length - 1) || ('..' === i ? n.pop() : n.push(i)) } return n.join('/') }), (n.getTypeOf = function (e) { return 'string' == typeof e ? 'string' : '[object Array]' === Object.prototype.toString.call(e) ? 'array' : r.nodebuffer && a.isBuffer(e) ? 'nodebuffer' : r.uint8array && e instanceof Uint8Array ? 'uint8array' : r.arraybuffer && e instanceof ArrayBuffer ? 'arraybuffer' : void 0 }), (n.checkSupport = function (e) { if (!r[e.toLowerCase()]) throw new Error(e + ' is not supported by this platform') }), (n.MAX_VALUE_16BITS = 65535), (n.MAX_VALUE_32BITS = -1), (n.pretty = function (e) { var t, n, r = '' for (n = 0; n < (e || '').length; n++) r += '\\x' + ((t = e.charCodeAt(n)) < 16 ? '0' : '') + t.toString(16).toUpperCase() return r }), (n.delay = function (e, t, n) { setImmediate(function () { e.apply(n || null, t || []) }) }), (n.inherits = function (e, t) { function n() {} ;((n.prototype = t.prototype), (e.prototype = new n())) }), (n.extend = function () { var e, t, n = {} for (e = 0; e < arguments.length; e++) for (t in arguments[e]) Object.prototype.hasOwnProperty.call(arguments[e], t) && void 0 === n[t] && (n[t] = arguments[e][t]) return n }), (n.prepareContent = function (e, t, a, s, l) { return o.Promise.resolve(t) .then(function (e) { return r.blob && (e instanceof Blob || -1 !== ['[object File]', '[object Blob]'].indexOf( Object.prototype.toString.call(e) )) && 'undefined' != typeof FileReader ? new o.Promise(function (t, n) { var r = new FileReader() ;((r.onload = function (e) { t(e.target.result) }), (r.onerror = function (e) { n(e.target.error) }), r.readAsArrayBuffer(e)) }) : e }) .then(function (t) { var c = n.getTypeOf(t) return c ? ('arraybuffer' === c ? (t = n.transformTo('uint8array', t)) : 'string' === c && (l ? (t = i.decode(t)) : a && !0 !== s && (t = (function (e) { return u( e, r.uint8array ? new Uint8Array(e.length) : new Array(e.length) ) })(t))), t) : o.Promise.reject( new Error( "Can't read the data of '" + e + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?" ) ) }) })) }, { './base64': 1, './external': 6, './nodejsUtils': 14, './support': 30, setimmediate: 54, }, ], 33: [ function (e, t, n) { var r = e('./reader/readerFor'), i = e('./utils'), a = e('./signature'), o = e('./zipEntry'), s = e('./support') function u(e) { ;((this.files = []), (this.loadOptions = e)) } ;((u.prototype = { checkSignature: function (e) { if (!this.reader.readAndCheckSignature(e)) { this.reader.index -= 4 var t = this.reader.readString(4) throw new Error( 'Corrupted zip or bug: unexpected signature (' + i.pretty(t) + ', expected ' + i.pretty(e) + ')' ) } }, isSignature: function (e, t) { var n = this.reader.index this.reader.setIndex(e) var r = this.reader.readString(4) === t return (this.reader.setIndex(n), r) }, readBlockEndOfCentral: function () { ;((this.diskNumber = this.reader.readInt(2)), (this.diskWithCentralDirStart = this.reader.readInt(2)), (this.centralDirRecordsOnThisDisk = this.reader.readInt(2)), (this.centralDirRecords = this.reader.readInt(2)), (this.centralDirSize = this.reader.readInt(4)), (this.centralDirOffset = this.reader.readInt(4)), (this.zipCommentLength = this.reader.readInt(2))) var e = this.reader.readData(this.zipCommentLength), t = s.uint8array ? 'uint8array' : 'array', n = i.transformTo(t, e) this.zipComment = this.loadOptions.decodeFileName(n) }, readBlockZip64EndOfCentral: function () { ;((this.zip64EndOfCentralSize = this.reader.readInt(8)), this.reader.skip(4), (this.diskNumber = this.reader.readInt(4)), (this.diskWithCentralDirStart = this.reader.readInt(4)), (this.centralDirRecordsOnThisDisk = this.reader.readInt(8)), (this.centralDirRecords = this.reader.readInt(8)), (this.centralDirSize = this.reader.readInt(8)), (this.centralDirOffset = this.reader.readInt(8)), (this.zip64ExtensibleData = {})) for (var e, t, n, r = this.zip64EndOfCentralSize - 44; 0 < r; ) ((e = this.reader.readInt(2)), (t = this.reader.readInt(4)), (n = this.reader.readData(t)), (this.zip64ExtensibleData[e] = { id: e, length: t, value: n })) }, readBlockZip64EndOfCentralLocator: function () { if ( ((this.diskWithZip64CentralDirStart = this.reader.readInt(4)), (this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8)), (this.disksCount = this.reader.readInt(4)), 1 < this.disksCount) ) throw new Error('Multi-volumes zip are not supported') }, readLocalFiles: function () { var e, t for (e = 0; e < this.files.length; e++) ((t = this.files[e]), this.reader.setIndex(t.localHeaderOffset), this.checkSignature(a.LOCAL_FILE_HEADER), t.readLocalPart(this.reader), t.handleUTF8(), t.processAttributes()) }, readCentralDir: function () { var e for ( this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER); ) ((e = new o( { zip64: this.zip64 }, this.loadOptions )).readCentralPart(this.reader), this.files.push(e)) if ( this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length ) throw new Error( 'Corrupted zip or bug: expected ' + this.centralDirRecords + ' records in central dir, got ' + this.files.length ) }, readEndOfCentral: function () { var e = this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END) if (e < 0) throw this.isSignature(0, a.LOCAL_FILE_HEADER) ? new Error("Corrupted zip: can't find end of central directory") : new Error( "Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html" ) this.reader.setIndex(e) var t = e if ( (this.checkSignature(a.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) ) { if ( ((this.zip64 = !0), (e = this.reader.lastIndexOfSignature( a.ZIP64_CENTRAL_DIRECTORY_LOCATOR )) < 0) ) throw new Error( "Corrupted zip: can't find the ZIP64 end of central directory locator" ) if ( (this.reader.setIndex(e), this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature( this.relativeOffsetEndOfZip64CentralDir, a.ZIP64_CENTRAL_DIRECTORY_END ) && ((this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature( a.ZIP64_CENTRAL_DIRECTORY_END )), this.relativeOffsetEndOfZip64CentralDir < 0)) ) throw new Error( "Corrupted zip: can't find the ZIP64 end of central directory" ) ;(this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral()) } var n = this.centralDirOffset + this.centralDirSize this.zip64 && ((n += 20), (n += 12 + this.zip64EndOfCentralSize)) var r = t - n if (0 < r) this.isSignature(t, a.CENTRAL_FILE_HEADER) || (this.reader.zero = r) else if (r < 0) throw new Error('Corrupted zip: missing ' + Math.abs(r) + ' bytes.') }, prepareReader: function (e) { this.reader = r(e) }, load: function (e) { ;(this.prepareReader(e), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles()) }, }), (t.exports = u)) }, { './reader/readerFor': 22, './signature': 23, './support': 30, './utils': 32, './zipEntry': 34, }, ], 34: [ function (e, t, n) { var r = e('./reader/readerFor'), i = e('./utils'), a = e('./compressedObject'), o = e('./crc32'), s = e('./utf8'), u = e('./compressions'), l = e('./support') function c(e, t) { ;((this.options = e), (this.loadOptions = t)) } ;((c.prototype = { isEncrypted: function () { return !(1 & ~this.bitFlag) }, useUTF8: function () { return !(2048 & ~this.bitFlag) }, readLocalPart: function (e) { var t, n if ( (e.skip(22), (this.fileNameLength = e.readInt(2)), (n = e.readInt(2)), (this.fileName = e.readData(this.fileNameLength)), e.skip(n), -1 === this.compressedSize || -1 === this.uncompressedSize) ) throw new Error( "Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)" ) if ( null === (t = (function (e) { for (var t in u) if ( Object.prototype.hasOwnProperty.call(u, t) && u[t].magic === e ) return u[t] return null })(this.compressionMethod)) ) throw new Error( 'Corrupted zip : compression ' + i.pretty(this.compressionMethod) + ' unknown (inner file : ' + i.transformTo('string', this.fileName) + ')' ) this.decompressed = new a( this.compressedSize, this.uncompressedSize, this.crc32, t, e.readData(this.compressedSize) ) }, readCentralPart: function (e) { ;((this.versionMadeBy = e.readInt(2)), e.skip(2), (this.bitFlag = e.readInt(2)), (this.compressionMethod = e.readString(2)), (this.date = e.readDate()), (this.crc32 = e.readInt(4)), (this.compressedSize = e.readInt(4)), (this.uncompressedSize = e.readInt(4))) var t = e.readInt(2) if ( ((this.extraFieldsLength = e.readInt(2)), (this.fileCommentLength = e.readInt(2)), (this.diskNumberStart = e.readInt(2)), (this.internalFileAttributes = e.readInt(2)), (this.externalFileAttributes = e.readInt(4)), (this.localHeaderOffset = e.readInt(4)), this.isEncrypted()) ) throw new Error('Encrypted zip are not supported') ;(e.skip(t), this.readExtraFields(e), this.parseZIP64ExtraField(e), (this.fileComment = e.readData(this.fileCommentLength))) }, processAttributes: function () { ;((this.unixPermissions = null), (this.dosPermissions = null)) var e = this.versionMadeBy >> 8 ;((this.dir = !!(16 & this.externalFileAttributes)), 0 == e && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e && (this.unixPermissions = (this.externalFileAttributes >> 16) & 65535), this.dir || '/' !== this.fileNameStr.slice(-1) || (this.dir = !0)) }, parseZIP64ExtraField: function () { if (this.extraFields[1]) { var e = r(this.extraFields[1].value) ;(this.uncompressedSize === i.MAX_VALUE_32BITS && (this.uncompressedSize = e.readInt(8)), this.compressedSize === i.MAX_VALUE_32BITS && (this.compressedSize = e.readInt(8)), this.localHeaderOffset === i.MAX_VALUE_32BITS && (this.localHeaderOffset = e.readInt(8)), this.diskNumberStart === i.MAX_VALUE_32BITS && (this.diskNumberStart = e.readInt(4))) } }, readExtraFields: function (e) { var t, n, r, i = e.index + this.extraFieldsLength for (this.extraFields || (this.extraFields = {}); e.index + 4 < i; ) ((t = e.readInt(2)), (n = e.readInt(2)), (r = e.readData(n)), (this.extraFields[t] = { id: t, length: n, value: r })) e.setIndex(i) }, handleUTF8: function () { var e = l.uint8array ? 'uint8array' : 'array' if (this.useUTF8()) ((this.fileNameStr = s.utf8decode(this.fileName)), (this.fileCommentStr = s.utf8decode(this.fileComment))) else { var t = this.findExtraFieldUnicodePath() if (null !== t) this.fileNameStr = t else { var n = i.transformTo(e, this.fileName) this.fileNameStr = this.loadOptions.decodeFileName(n) } var r = this.findExtraFieldUnicodeComment() if (null !== r) this.fileCommentStr = r else { var a = i.transformTo(e, this.fileComment) this.fileCommentStr = this.loadOptions.decodeFileName(a) } } }, findExtraFieldUnicodePath: function () { var e = this.extraFields[28789] if (e) { var t = r(e.value) return 1 !== t.readInt(1) || o(this.fileName) !== t.readInt(4) ? null : s.utf8decode(t.readData(e.length - 5)) } return null }, findExtraFieldUnicodeComment: function () { var e = this.extraFields[25461] if (e) { var t = r(e.value) return 1 !== t.readInt(1) || o(this.fileComment) !== t.readInt(4) ? null : s.utf8decode(t.readData(e.length - 5)) } return null }, }), (t.exports = c)) }, { './compressedObject': 2, './compressions': 3, './crc32': 4, './reader/readerFor': 22, './support': 30, './utf8': 31, './utils': 32, }, ], 35: [ function (e, t, n) { function r(e, t, n) { ;((this.name = e), (this.dir = n.dir), (this.date = n.date), (this.comment = n.comment), (this.unixPermissions = n.unixPermissions), (this.dosPermissions = n.dosPermissions), (this._data = t), (this._dataBinary = n.binary), (this.options = { compression: n.compression, compressionOptions: n.compressionOptions, })) } var i = e('./stream/StreamHelper'), a = e('./stream/DataWorker'), o = e('./utf8'), s = e('./compressedObject'), u = e('./stream/GenericWorker') r.prototype = { internalStream: function (e) { var t = null, n = 'string' try { if (!e) throw new Error('No output type specified.') var r = 'string' === (n = e.toLowerCase()) || 'text' === n ;(('binarystring' !== n && 'text' !== n) || (n = 'string'), (t = this._decompressWorker())) var a = !this._dataBinary ;(a && !r && (t = t.pipe(new o.Utf8EncodeWorker())), !a && r && (t = t.pipe(new o.Utf8DecodeWorker()))) } catch (e) { ;(t = new u('error')).error(e) } return new i(t, n, '') }, async: function (e, t) { return this.internalStream(e).accumulate(t) }, nodeStream: function (e, t) { return this.internalStream(e || 'nodebuffer').toNodejsStream(t) }, _compressWorker: function (e, t) { if ( this._data instanceof s && this._data.compression.magic === e.magic ) return this._data.getCompressedWorker() var n = this._decompressWorker() return ( this._dataBinary || (n = n.pipe(new o.Utf8EncodeWorker())), s.createWorkerFrom(n, e, t) ) }, _decompressWorker: function () { return this._data instanceof s ? this._data.getContentWorker() : this._data instanceof u ? this._data : new a(this._data) }, } for ( var l = [ 'asText', 'asBinary', 'asNodeBuffer', 'asUint8Array', 'asArrayBuffer', ], c = function () { throw new Error( 'This method has been removed in JSZip 3.0, please check the upgrade guide.' ) }, h = 0; h < l.length; h++ ) r.prototype[l[h]] = c t.exports = r }, { './compressedObject': 2, './stream/DataWorker': 27, './stream/GenericWorker': 28, './stream/StreamHelper': 29, './utf8': 31, }, ], 36: [ function (e, t, n) { ;(function (e) { var n, r, i = e.MutationObserver || e.WebKitMutationObserver if (i) { var a = 0, o = new i(c), s = e.document.createTextNode('') ;(o.observe(s, { characterData: !0 }), (n = function () { s.data = a = ++a % 2 })) } else if (e.setImmediate || void 0 === e.MessageChannel) n = 'document' in e && 'onreadystatechange' in e.document.createElement('script') ? function () { var t = e.document.createElement('script') ;((t.onreadystatechange = function () { ;(c(), (t.onreadystatechange = null), t.parentNode.removeChild(t), (t = null)) }), e.document.documentElement.appendChild(t)) } : function () { setTimeout(c, 0) } else { var u = new e.MessageChannel() ;((u.port1.onmessage = c), (n = function () { u.port2.postMessage(0) })) } var l = [] function c() { var e, t r = !0 for (var n = l.length; n; ) { for (t = l, l = [], e = -1; ++e < n; ) t[e]() n = l.length } r = !1 } t.exports = function (e) { 1 !== l.push(e) || r || n() } }).call( this, void 0 !== tU ? tU : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {} ) }, {}, ], 37: [ function (e, t, n) { var r = e('immediate') function i() {} var a = {}, o = ['REJECTED'], s = ['FULFILLED'], u = ['PENDING'] function l(e) { if ('function' != typeof e) throw new TypeError('resolver must be a function') ;((this.state = u), (this.queue = []), (this.outcome = void 0), e !== i && f(this, e)) } function c(e, t, n) { ;((this.promise = e), 'function' == typeof t && ((this.onFulfilled = t), (this.callFulfilled = this.otherCallFulfilled)), 'function' == typeof n && ((this.onRejected = n), (this.callRejected = this.otherCallRejected))) } function h(e, t, n) { r(function () { var r try { r = t(n) } catch (r) { return a.reject(e, r) } r === e ? a.reject(e, new TypeError('Cannot resolve promise with itself')) : a.resolve(e, r) }) } function d(e) { var t = e && e.then if ( e && ('object' == P(e) || 'function' == typeof e) && 'function' == typeof t ) return function () { t.apply(e, arguments) } } function f(e, t) { var n = !1 function r(t) { n || ((n = !0), a.reject(e, t)) } function i(t) { n || ((n = !0), a.resolve(e, t)) } var o = p(function () { t(i, r) }) 'error' === o.status && r(o.value) } function p(e, t) { var n = {} try { ;((n.value = e(t)), (n.status = 'success')) } catch (e) { ;((n.status = 'error'), (n.value = e)) } return n } ;(((t.exports = l).prototype.finally = function (e) { if ('function' != typeof e) return this var t = this.constructor return this.then( function (n) { return t.resolve(e()).then(function () { return n }) }, function (n) { return t.resolve(e()).then(function () { throw n }) } ) }), (l.prototype.catch = function (e) { return this.then(null, e) }), (l.prototype.then = function (e, t) { if ( ('function' != typeof e && this.state === s) || ('function' != typeof t && this.state === o) ) return this var n = new this.constructor(i) return ( this.state !== u ? h(n, this.state === s ? e : t, this.outcome) : this.queue.push(new c(n, e, t)), n ) }), (c.prototype.callFulfilled = function (e) { a.resolve(this.promise, e) }), (c.prototype.otherCallFulfilled = function (e) { h(this.promise, this.onFulfilled, e) }), (c.prototype.callRejected = function (e) { a.reject(this.promise, e) }), (c.prototype.otherCallRejected = function (e) { h(this.promise, this.onRejected, e) }), (a.resolve = function (e, t) { var n = p(d, t) if ('error' === n.status) return a.reject(e, n.value) var r = n.value if (r) f(e, r) else { ;((e.state = s), (e.outcome = t)) for (var i = -1, o = e.queue.length; ++i < o; ) e.queue[i].callFulfilled(t) } return e }), (a.reject = function (e, t) { ;((e.state = o), (e.outcome = t)) for (var n = -1, r = e.queue.length; ++n < r; ) e.queue[n].callRejected(t) return e }), (l.resolve = function (e) { return e instanceof this ? e : a.resolve(new this(i), e) }), (l.reject = function (e) { var t = new this(i) return a.reject(t, e) }), (l.all = function (e) { var t = this if ('[object Array]' !== Object.prototype.toString.call(e)) return this.reject(new TypeError('must be an array')) var n = e.length, r = !1 if (!n) return this.resolve([]) for (var o = new Array(n), s = 0, u = -1, l = new this(i); ++u < n; ) c(e[u], u) return l function c(e, i) { t.resolve(e).then( function (e) { ;((o[i] = e), ++s !== n || r || ((r = !0), a.resolve(l, o))) }, function (e) { r || ((r = !0), a.reject(l, e)) } ) } }), (l.race = function (e) { var t = this if ('[object Array]' !== Object.prototype.toString.call(e)) return this.reject(new TypeError('must be an array')) var n = e.length, r = !1 if (!n) return this.resolve([]) for (var o, s = -1, u = new this(i); ++s < n; ) ((o = e[s]), t.resolve(o).then( function (e) { r || ((r = !0), a.resolve(u, e)) }, function (e) { r || ((r = !0), a.reject(u, e)) } )) return u })) }, { immediate: 36 }, ], 38: [ function (e, t, n) { var r = {} ;((0, e('./lib/utils/common').assign)( r, e('./lib/deflate'), e('./lib/inflate'), e('./lib/zlib/constants') ), (t.exports = r)) }, { './lib/deflate': 39, './lib/inflate': 40, './lib/utils/common': 41, './lib/zlib/constants': 44, }, ], 39: [ function (e, t, n) { var r = e('./zlib/deflate'), i = e('./utils/common'), a = e('./utils/strings'), o = e('./zlib/messages'), s = e('./zlib/zstream'), u = Object.prototype.toString, l = 0, c = -1, h = 0, d = 8 function f(e) { if (!(this instanceof f)) return new f(e) this.options = i.assign( { level: c, method: d, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: h, to: '', }, e || {} ) var t = this.options ;(t.raw && 0 < t.windowBits ? (t.windowBits = -t.windowBits) : t.gzip && 0 < t.windowBits && t.windowBits < 16 && (t.windowBits += 16), (this.err = 0), (this.msg = ''), (this.ended = !1), (this.chunks = []), (this.strm = new s()), (this.strm.avail_out = 0)) var n = r.deflateInit2( this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy ) if (n !== l) throw new Error(o[n]) if ( (t.header && r.deflateSetHeader(this.strm, t.header), t.dictionary) ) { var p if ( ((p = 'string' == typeof t.dictionary ? a.string2buf(t.dictionary) : '[object ArrayBuffer]' === u.call(t.dictionary) ? new Uint8Array(t.dictionary) : t.dictionary), (n = r.deflateSetDictionary(this.strm, p)) !== l) ) throw new Error(o[n]) this._dict_set = !0 } } function p(e, t) { var n = new f(t) if ((n.push(e, !0), n.err)) throw n.msg || o[n.err] return n.result } ;((f.prototype.push = function (e, t) { var n, o, s = this.strm, c = this.options.chunkSize if (this.ended) return !1 ;((o = t === ~~t ? t : !0 === t ? 4 : 0), 'string' == typeof e ? (s.input = a.string2buf(e)) : '[object ArrayBuffer]' === u.call(e) ? (s.input = new Uint8Array(e)) : (s.input = e), (s.next_in = 0), (s.avail_in = s.input.length)) do { if ( (0 === s.avail_out && ((s.output = new i.Buf8(c)), (s.next_out = 0), (s.avail_out = c)), 1 !== (n = r.deflate(s, o)) && n !== l) ) return (this.onEnd(n), !(this.ended = !0)) ;(0 !== s.avail_out && (0 !== s.avail_in || (4 !== o && 2 !== o))) || ('string' === this.options.to ? this.onData(a.buf2binstring(i.shrinkBuf(s.output, s.next_out))) : this.onData(i.shrinkBuf(s.output, s.next_out))) } while ((0 < s.avail_in || 0 === s.avail_out) && 1 !== n) return 4 === o ? ((n = r.deflateEnd(this.strm)), this.onEnd(n), (this.ended = !0), n === l) : 2 !== o || (this.onEnd(l), !(s.avail_out = 0)) }), (f.prototype.onData = function (e) { this.chunks.push(e) }), (f.prototype.onEnd = function (e) { ;(e === l && ('string' === this.options.to ? (this.result = this.chunks.join('')) : (this.result = i.flattenChunks(this.chunks))), (this.chunks = []), (this.err = e), (this.msg = this.strm.msg)) }), (n.Deflate = f), (n.deflate = p), (n.deflateRaw = function (e, t) { return (((t = t || {}).raw = !0), p(e, t)) }), (n.gzip = function (e, t) { return (((t = t || {}).gzip = !0), p(e, t)) })) }, { './utils/common': 41, './utils/strings': 42, './zlib/deflate': 46, './zlib/messages': 51, './zlib/zstream': 53, }, ], 40: [ function (e, t, n) { var r = e('./zlib/inflate'), i = e('./utils/common'), a = e('./utils/strings'), o = e('./zlib/constants'), s = e('./zlib/messages'), u = e('./zlib/zstream'), l = e('./zlib/gzheader'), c = Object.prototype.toString function h(e) { if (!(this instanceof h)) return new h(e) this.options = i.assign( { chunkSize: 16384, windowBits: 0, to: '' }, e || {} ) var t = this.options ;(t.raw && 0 <= t.windowBits && t.windowBits < 16 && ((t.windowBits = -t.windowBits), 0 === t.windowBits && (t.windowBits = -15)), !(0 <= t.windowBits && t.windowBits < 16) || (e && e.windowBits) || (t.windowBits += 32), 15 < t.windowBits && t.windowBits < 48 && !(15 & t.windowBits) && (t.windowBits |= 15), (this.err = 0), (this.msg = ''), (this.ended = !1), (this.chunks = []), (this.strm = new u()), (this.strm.avail_out = 0)) var n = r.inflateInit2(this.strm, t.windowBits) if (n !== o.Z_OK) throw new Error(s[n]) ;((this.header = new l()), r.inflateGetHeader(this.strm, this.header)) } function d(e, t) { var n = new h(t) if ((n.push(e, !0), n.err)) throw n.msg || s[n.err] return n.result } ;((h.prototype.push = function (e, t) { var n, s, u, l, h, d, f = this.strm, p = this.options.chunkSize, v = this.options.dictionary, m = !1 if (this.ended) return !1 ;((s = t === ~~t ? t : !0 === t ? o.Z_FINISH : o.Z_NO_FLUSH), 'string' == typeof e ? (f.input = a.binstring2buf(e)) : '[object ArrayBuffer]' === c.call(e) ? (f.input = new Uint8Array(e)) : (f.input = e), (f.next_in = 0), (f.avail_in = f.input.length)) do { if ( (0 === f.avail_out && ((f.output = new i.Buf8(p)), (f.next_out = 0), (f.avail_out = p)), (n = r.inflate(f, o.Z_NO_FLUSH)) === o.Z_NEED_DICT && v && ((d = 'string' == typeof v ? a.string2buf(v) : '[object ArrayBuffer]' === c.call(v) ? new Uint8Array(v) : v), (n = r.inflateSetDictionary(this.strm, d))), n === o.Z_BUF_ERROR && !0 === m && ((n = o.Z_OK), (m = !1)), n !== o.Z_STREAM_END && n !== o.Z_OK) ) return (this.onEnd(n), !(this.ended = !0)) ;(f.next_out && ((0 !== f.avail_out && n !== o.Z_STREAM_END && (0 !== f.avail_in || (s !== o.Z_FINISH && s !== o.Z_SYNC_FLUSH))) || ('string' === this.options.to ? ((u = a.utf8border(f.output, f.next_out)), (l = f.next_out - u), (h = a.buf2string(f.output, u)), (f.next_out = l), (f.avail_out = p - l), l && i.arraySet(f.output, f.output, u, l, 0), this.onData(h)) : this.onData(i.shrinkBuf(f.output, f.next_out)))), 0 === f.avail_in && 0 === f.avail_out && (m = !0)) } while ((0 < f.avail_in || 0 === f.avail_out) && n !== o.Z_STREAM_END) return ( n === o.Z_STREAM_END && (s = o.Z_FINISH), s === o.Z_FINISH ? ((n = r.inflateEnd(this.strm)), this.onEnd(n), (this.ended = !0), n === o.Z_OK) : s !== o.Z_SYNC_FLUSH || (this.onEnd(o.Z_OK), !(f.avail_out = 0)) ) }), (h.prototype.onData = function (e) { this.chunks.push(e) }), (h.prototype.onEnd = function (e) { ;(e === o.Z_OK && ('string' === this.options.to ? (this.result = this.chunks.join('')) : (this.result = i.flattenChunks(this.chunks))), (this.chunks = []), (this.err = e), (this.msg = this.strm.msg)) }), (n.Inflate = h), (n.inflate = d), (n.inflateRaw = function (e, t) { return (((t = t || {}).raw = !0), d(e, t)) }), (n.ungzip = d)) }, { './utils/common': 41, './utils/strings': 42, './zlib/constants': 44, './zlib/gzheader': 47, './zlib/inflate': 49, './zlib/messages': 51, './zlib/zstream': 53, }, ], 41: [ function (e, t, n) { var r = 'undefined' != typeof Uint8Array && 'undefined' != typeof Uint16Array && 'undefined' != typeof Int32Array ;((n.assign = function (e) { for (var t = Array.prototype.slice.call(arguments, 1); t.length; ) { var n = t.shift() if (n) { if ('object' != P(n)) throw new TypeError(n + 'must be non-object') for (var r in n) n.hasOwnProperty(r) && (e[r] = n[r]) } } return e }), (n.shrinkBuf = function (e, t) { return e.length === t ? e : e.subarray ? e.subarray(0, t) : ((e.length = t), e) })) var i = { arraySet: function (e, t, n, r, i) { if (t.subarray && e.subarray) e.set(t.subarray(n, n + r), i) else for (var a = 0; a < r; a++) e[i + a] = t[n + a] }, flattenChunks: function (e) { var t, n, r, i, a, o for (t = r = 0, n = e.length; t < n; t++) r += e[t].length for (o = new Uint8Array(r), t = i = 0, n = e.length; t < n; t++) ((a = e[t]), o.set(a, i), (i += a.length)) return o }, }, a = { arraySet: function (e, t, n, r, i) { for (var a = 0; a < r; a++) e[i + a] = t[n + a] }, flattenChunks: function (e) { return [].concat.apply([], e) }, } ;((n.setTyped = function (e) { e ? ((n.Buf8 = Uint8Array), (n.Buf16 = Uint16Array), (n.Buf32 = Int32Array), n.assign(n, i)) : ((n.Buf8 = Array), (n.Buf16 = Array), (n.Buf32 = Array), n.assign(n, a)) }), n.setTyped(r)) }, {}, ], 42: [ function (e, t, n) { var r = e('./common'), i = !0, a = !0 try { String.fromCharCode.apply(null, [0]) } catch (e) { i = !1 } try { String.fromCharCode.apply(null, new Uint8Array(1)) } catch (e) { a = !1 } for (var o = new r.Buf8(256), s = 0; s < 256; s++) o[s] = 252 <= s ? 6 : 248 <= s ? 5 : 240 <= s ? 4 : 224 <= s ? 3 : 192 <= s ? 2 : 1 function u(e, t) { if (t < 65537 && ((e.subarray && a) || (!e.subarray && i))) return String.fromCharCode.apply(null, r.shrinkBuf(e, t)) for (var n = '', o = 0; o < t; o++) n += String.fromCharCode(e[o]) return n } ;((o[254] = o[254] = 1), (n.string2buf = function (e) { var t, n, i, a, o, s = e.length, u = 0 for (a = 0; a < s; a++) (55296 == (64512 & (n = e.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (i = e.charCodeAt(a + 1))) && ((n = 65536 + ((n - 55296) << 10) + (i - 56320)), a++), (u += n < 128 ? 1 : n < 2048 ? 2 : n < 65536 ? 3 : 4)) for (t = new r.Buf8(u), a = o = 0; o < u; a++) (55296 == (64512 & (n = e.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (i = e.charCodeAt(a + 1))) && ((n = 65536 + ((n - 55296) << 10) + (i - 56320)), a++), n < 128 ? (t[o++] = n) : (n < 2048 ? (t[o++] = 192 | (n >>> 6)) : (n < 65536 ? (t[o++] = 224 | (n >>> 12)) : ((t[o++] = 240 | (n >>> 18)), (t[o++] = 128 | ((n >>> 12) & 63))), (t[o++] = 128 | ((n >>> 6) & 63))), (t[o++] = 128 | (63 & n)))) return t }), (n.buf2binstring = function (e) { return u(e, e.length) }), (n.binstring2buf = function (e) { for (var t = new r.Buf8(e.length), n = 0, i = t.length; n < i; n++) t[n] = e.charCodeAt(n) return t }), (n.buf2string = function (e, t) { var n, r, i, a, s = t || e.length, l = new Array(2 * s) for (n = r = 0; n < s; ) if ((i = e[n++]) < 128) l[r++] = i else if (4 < (a = o[i])) ((l[r++] = 65533), (n += a - 1)) else { for (i &= 2 === a ? 31 : 3 === a ? 15 : 7; 1 < a && n < s; ) ((i = (i << 6) | (63 & e[n++])), a--) 1 < a ? (l[r++] = 65533) : i < 65536 ? (l[r++] = i) : ((i -= 65536), (l[r++] = 55296 | ((i >> 10) & 1023)), (l[r++] = 56320 | (1023 & i))) } return u(l, r) }), (n.utf8border = function (e, t) { var n for ( (t = t || e.length) > e.length && (t = e.length), n = t - 1; 0 <= n && 128 == (192 & e[n]); ) n-- return n < 0 || 0 === n ? t : n + o[e[n]] > t ? n : t })) }, { './common': 41 }, ], 43: [ function (e, t, n) { t.exports = function (e, t, n, r) { for (var i = 65535 & e, a = (e >>> 16) & 65535, o = 0; 0 !== n; ) { for ( n -= o = 2e3 < n ? 2e3 : n; (a = (a + (i = (i + t[r++]) | 0)) | 0), --o; ); ;((i %= 65521), (a %= 65521)) } return i | (a << 16) } }, {}, ], 44: [ function (e, t, n) { t.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8, } }, {}, ], 45: [ function (e, t, n) { var r = (function () { for (var e, t = [], n = 0; n < 256; n++) { e = n for (var r = 0; r < 8; r++) e = 1 & e ? 3988292384 ^ (e >>> 1) : e >>> 1 t[n] = e } return t })() t.exports = function (e, t, n, i) { var a = r, o = i + n e ^= -1 for (var s = i; s < o; s++) e = (e >>> 8) ^ a[255 & (e ^ t[s])] return -1 ^ e } }, {}, ], 46: [ function (e, t, n) { var r, i = e('../utils/common'), a = e('./trees'), o = e('./adler32'), s = e('./crc32'), u = e('./messages'), l = 0, c = 4, h = 0, d = -2, f = -1, p = 4, v = 2, m = 8, g = 9, y = 286, _ = 30, b = 19, x = 2 * y + 1, S = 15, A = 3, w = 258, T = w + A + 1, M = 42, E = 113, C = 1, k = 2, R = 3, I = 4 function N(e, t) { return ((e.msg = u[t]), t) } function P(e) { return (e << 1) - (4 < e ? 9 : 0) } function L(e) { for (var t = e.length; 0 <= --t; ) e[t] = 0 } function D(e) { var t = e.state, n = t.pending ;(n > e.avail_out && (n = e.avail_out), 0 !== n && (i.arraySet(e.output, t.pending_buf, t.pending_out, n, e.next_out), (e.next_out += n), (t.pending_out += n), (e.total_out += n), (e.avail_out -= n), (t.pending -= n), 0 === t.pending && (t.pending_out = 0))) } function O(e, t) { ;(a._tr_flush_block( e, 0 <= e.block_start ? e.block_start : -1, e.strstart - e.block_start, t ), (e.block_start = e.strstart), D(e.strm)) } function F(e, t) { e.pending_buf[e.pending++] = t } function B(e, t) { ;((e.pending_buf[e.pending++] = (t >>> 8) & 255), (e.pending_buf[e.pending++] = 255 & t)) } function U(e, t) { var n, r, i = e.max_chain_length, a = e.strstart, o = e.prev_length, s = e.nice_match, u = e.strstart > e.w_size - T ? e.strstart - (e.w_size - T) : 0, l = e.window, c = e.w_mask, h = e.prev, d = e.strstart + w, f = l[a + o - 1], p = l[a + o] ;(e.prev_length >= e.good_match && (i >>= 2), s > e.lookahead && (s = e.lookahead)) do { if ( l[(n = t) + o] === p && l[n + o - 1] === f && l[n] === l[a] && l[++n] === l[a + 1] ) { ;((a += 2), n++) do {} while ( l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && a < d ) if (((r = w - (d - a)), (a = d - w), o < r)) { if (((e.match_start = t), s <= (o = r))) break ;((f = l[a + o - 1]), (p = l[a + o])) } } } while ((t = h[t & c]) > u && 0 != --i) return o <= e.lookahead ? o : e.lookahead } function z(e) { var t, n, r, a, u, l, c, h, d, f, p = e.w_size do { if ( ((a = e.window_size - e.lookahead - e.strstart), e.strstart >= p + (p - T)) ) { for ( i.arraySet(e.window, e.window, p, p, 0), e.match_start -= p, e.strstart -= p, e.block_start -= p, t = n = e.hash_size; (r = e.head[--t]), (e.head[t] = p <= r ? r - p : 0), --n; ); for ( t = n = p; (r = e.prev[--t]), (e.prev[t] = p <= r ? r - p : 0), --n; ); a += p } if (0 === e.strm.avail_in) break if ( ((l = e.strm), (c = e.window), (h = e.strstart + e.lookahead), (f = void 0), (d = a) < (f = l.avail_in) && (f = d), (n = 0 === f ? 0 : ((l.avail_in -= f), i.arraySet(c, l.input, l.next_in, f, h), 1 === l.state.wrap ? (l.adler = o(l.adler, c, f, h)) : 2 === l.state.wrap && (l.adler = s(l.adler, c, f, h)), (l.next_in += f), (l.total_in += f), f)), (e.lookahead += n), e.lookahead + e.insert >= A) ) for ( u = e.strstart - e.insert, e.ins_h = e.window[u], e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[u + 1]) & e.hash_mask; e.insert && ((e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[u + A - 1]) & e.hash_mask), (e.prev[u & e.w_mask] = e.head[e.ins_h]), (e.head[e.ins_h] = u), u++, e.insert--, !(e.lookahead + e.insert < A)); ); } while (e.lookahead < T && 0 !== e.strm.avail_in) } function V(e, t) { for (var n, r; ; ) { if (e.lookahead < T) { if ((z(e), e.lookahead < T && t === l)) return C if (0 === e.lookahead) break } if ( ((n = 0), e.lookahead >= A && ((e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[e.strstart + A - 1]) & e.hash_mask), (n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h]), (e.head[e.ins_h] = e.strstart)), 0 !== n && e.strstart - n <= e.w_size - T && (e.match_length = U(e, n)), e.match_length >= A) ) if ( ((r = a._tr_tally( e, e.strstart - e.match_start, e.match_length - A )), (e.lookahead -= e.match_length), e.match_length <= e.max_lazy_match && e.lookahead >= A) ) { for ( e.match_length--; e.strstart++, (e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[e.strstart + A - 1]) & e.hash_mask), (n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h]), (e.head[e.ins_h] = e.strstart), 0 != --e.match_length; ); e.strstart++ } else ((e.strstart += e.match_length), (e.match_length = 0), (e.ins_h = e.window[e.strstart]), (e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[e.strstart + 1]) & e.hash_mask)) else ((r = a._tr_tally(e, 0, e.window[e.strstart])), e.lookahead--, e.strstart++) if (r && (O(e, !1), 0 === e.strm.avail_out)) return C } return ( (e.insert = e.strstart < A - 1 ? e.strstart : A - 1), t === c ? (O(e, !0), 0 === e.strm.avail_out ? R : I) : e.last_lit && (O(e, !1), 0 === e.strm.avail_out) ? C : k ) } function H(e, t) { for (var n, r, i; ; ) { if (e.lookahead < T) { if ((z(e), e.lookahead < T && t === l)) return C if (0 === e.lookahead) break } if ( ((n = 0), e.lookahead >= A && ((e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[e.strstart + A - 1]) & e.hash_mask), (n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h]), (e.head[e.ins_h] = e.strstart)), (e.prev_length = e.match_length), (e.prev_match = e.match_start), (e.match_length = A - 1), 0 !== n && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - T && ((e.match_length = U(e, n)), e.match_length <= 5 && (1 === e.strategy || (e.match_length === A && 4096 < e.strstart - e.match_start)) && (e.match_length = A - 1)), e.prev_length >= A && e.match_length <= e.prev_length) ) { for ( i = e.strstart + e.lookahead - A, r = a._tr_tally( e, e.strstart - 1 - e.prev_match, e.prev_length - A ), e.lookahead -= e.prev_length - 1, e.prev_length -= 2; ++e.strstart <= i && ((e.ins_h = ((e.ins_h << e.hash_shift) ^ e.window[e.strstart + A - 1]) & e.hash_mask), (n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h]), (e.head[e.ins_h] = e.strstart)), 0 != --e.prev_length; ); if ( ((e.match_available = 0), (e.match_length = A - 1), e.strstart++, r && (O(e, !1), 0 === e.strm.avail_out)) ) return C } else if (e.match_available) { if ( ((r = a._tr_tally(e, 0, e.window[e.strstart - 1])) && O(e, !1), e.strstart++, e.lookahead--, 0 === e.strm.avail_out) ) return C } else ((e.match_available = 1), e.strstart++, e.lookahead--) } return ( e.match_available && ((r = a._tr_tally(e, 0, e.window[e.strstart - 1])), (e.match_available = 0)), (e.insert = e.strstart < A - 1 ? e.strstart : A - 1), t === c ? (O(e, !0), 0 === e.strm.avail_out ? R : I) : e.last_lit && (O(e, !1), 0 === e.strm.avail_out) ? C : k ) } function W(e, t, n, r, i) { ;((this.good_length = e), (this.max_lazy = t), (this.nice_length = n), (this.max_chain = r), (this.func = i)) } function G() { ;((this.strm = null), (this.status = 0), (this.pending_buf = null), (this.pending_buf_size = 0), (this.pending_out = 0), (this.pending = 0), (this.wrap = 0), (this.gzhead = null), (this.gzindex = 0), (this.method = m), (this.last_flush = -1), (this.w_size = 0), (this.w_bits = 0), (this.w_mask = 0), (this.window = null), (this.window_size = 0), (this.prev = null), (this.head = null), (this.ins_h = 0), (this.hash_size = 0), (this.hash_bits = 0), (this.hash_mask = 0), (this.hash_shift = 0), (this.block_start = 0), (this.match_length = 0), (this.prev_match = 0), (this.match_available = 0), (this.strstart = 0), (this.match_start = 0), (this.lookahead = 0), (this.prev_length = 0), (this.max_chain_length = 0), (this.max_lazy_match = 0), (this.level = 0), (this.strategy = 0), (this.good_match = 0), (this.nice_match = 0), (this.dyn_ltree = new i.Buf16(2 * x)), (this.dyn_dtree = new i.Buf16(2 * (2 * _ + 1))), (this.bl_tree = new i.Buf16(2 * (2 * b + 1))), L(this.dyn_ltree), L(this.dyn_dtree), L(this.bl_tree), (this.l_desc = null), (this.d_desc = null), (this.bl_desc = null), (this.bl_count = new i.Buf16(S + 1)), (this.heap = new i.Buf16(2 * y + 1)), L(this.heap), (this.heap_len = 0), (this.heap_max = 0), (this.depth = new i.Buf16(2 * y + 1)), L(this.depth), (this.l_buf = 0), (this.lit_bufsize = 0), (this.last_lit = 0), (this.d_buf = 0), (this.opt_len = 0), (this.static_len = 0), (this.matches = 0), (this.insert = 0), (this.bi_buf = 0), (this.bi_valid = 0)) } function j(e) { var t return e && e.state ? ((e.total_in = e.total_out = 0), (e.data_type = v), ((t = e.state).pending = 0), (t.pending_out = 0), t.wrap < 0 && (t.wrap = -t.wrap), (t.status = t.wrap ? M : E), (e.adler = 2 === t.wrap ? 0 : 1), (t.last_flush = l), a._tr_init(t), h) : N(e, d) } function Q(e) { var t = j(e) return ( t === h && (function (e) { ;((e.window_size = 2 * e.w_size), L(e.head), (e.max_lazy_match = r[e.level].max_lazy), (e.good_match = r[e.level].good_length), (e.nice_match = r[e.level].nice_length), (e.max_chain_length = r[e.level].max_chain), (e.strstart = 0), (e.block_start = 0), (e.lookahead = 0), (e.insert = 0), (e.match_length = e.prev_length = A - 1), (e.match_available = 0), (e.ins_h = 0)) })(e.state), t ) } function q(e, t, n, r, a, o) { if (!e) return d var s = 1 if ( (t === f && (t = 6), r < 0 ? ((s = 0), (r = -r)) : 15 < r && ((s = 2), (r -= 16)), a < 1 || g < a || n !== m || r < 8 || 15 < r || t < 0 || 9 < t || o < 0 || p < o) ) return N(e, d) 8 === r && (r = 9) var u = new G() return ( ((e.state = u).strm = e), (u.wrap = s), (u.gzhead = null), (u.w_bits = r), (u.w_size = 1 << u.w_bits), (u.w_mask = u.w_size - 1), (u.hash_bits = a + 7), (u.hash_size = 1 << u.hash_bits), (u.hash_mask = u.hash_size - 1), (u.hash_shift = ~~((u.hash_bits + A - 1) / A)), (u.window = new i.Buf8(2 * u.w_size)), (u.head = new i.Buf16(u.hash_size)), (u.prev = new i.Buf16(u.w_size)), (u.lit_bufsize = 1 << (a + 6)), (u.pending_buf_size = 4 * u.lit_bufsize), (u.pending_buf = new i.Buf8(u.pending_buf_size)), (u.d_buf = 1 * u.lit_bufsize), (u.l_buf = 3 * u.lit_bufsize), (u.level = t), (u.strategy = o), (u.method = n), Q(e) ) } ;((r = [ new W(0, 0, 0, 0, function (e, t) { var n = 65535 for (n > e.pending_buf_size - 5 && (n = e.pending_buf_size - 5); ; ) { if (e.lookahead <= 1) { if ((z(e), 0 === e.lookahead && t === l)) return C if (0 === e.lookahead) break } ;((e.strstart += e.lookahead), (e.lookahead = 0)) var r = e.block_start + n if ( (0 === e.strstart || e.strstart >= r) && ((e.lookahead = e.strstart - r), (e.strstart = r), O(e, !1), 0 === e.strm.avail_out) ) return C if ( e.strstart - e.block_start >= e.w_size - T && (O(e, !1), 0 === e.strm.avail_out) ) return C } return ( (e.insert = 0), t === c ? (O(e, !0), 0 === e.strm.avail_out ? R : I) : (e.strstart > e.block_start && (O(e, !1), e.strm.avail_out), C) ) }), new W(4, 4, 8, 4, V), new W(4, 5, 16, 8, V), new W(4, 6, 32, 32, V), new W(4, 4, 16, 16, H), new W(8, 16, 32, 32, H), new W(8, 16, 128, 128, H), new W(8, 32, 128, 256, H), new W(32, 128, 258, 1024, H), new W(32, 258, 258, 4096, H), ]), (n.deflateInit = function (e, t) { return q(e, t, m, 15, 8, 0) }), (n.deflateInit2 = q), (n.deflateReset = Q), (n.deflateResetKeep = j), (n.deflateSetHeader = function (e, t) { return e && e.state ? 2 !== e.state.wrap ? d : ((e.state.gzhead = t), h) : d }), (n.deflate = function (e, t) { var n, i, o, u if (!e || !e.state || 5 < t || t < 0) return e ? N(e, d) : d if ( ((i = e.state), !e.output || (!e.input && 0 !== e.avail_in) || (666 === i.status && t !== c)) ) return N(e, 0 === e.avail_out ? -5 : d) if ( ((i.strm = e), (n = i.last_flush), (i.last_flush = t), i.status === M) ) if (2 === i.wrap) ((e.adler = 0), F(i, 31), F(i, 139), F(i, 8), i.gzhead ? (F( i, (i.gzhead.text ? 1 : 0) + (i.gzhead.hcrc ? 2 : 0) + (i.gzhead.extra ? 4 : 0) + (i.gzhead.name ? 8 : 0) + (i.gzhead.comment ? 16 : 0) ), F(i, 255 & i.gzhead.time), F(i, (i.gzhead.time >> 8) & 255), F(i, (i.gzhead.time >> 16) & 255), F(i, (i.gzhead.time >> 24) & 255), F( i, 9 === i.level ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0 ), F(i, 255 & i.gzhead.os), i.gzhead.extra && i.gzhead.extra.length && (F(i, 255 & i.gzhead.extra.length), F(i, (i.gzhead.extra.length >> 8) & 255)), i.gzhead.hcrc && (e.adler = s(e.adler, i.pending_buf, i.pending, 0)), (i.gzindex = 0), (i.status = 69)) : (F(i, 0), F(i, 0), F(i, 0), F(i, 0), F(i, 0), F( i, 9 === i.level ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0 ), F(i, 3), (i.status = E))) else { var f = (m + ((i.w_bits - 8) << 4)) << 8 ;((f |= (2 <= i.strategy || i.level < 2 ? 0 : i.level < 6 ? 1 : 6 === i.level ? 2 : 3) << 6), 0 !== i.strstart && (f |= 32), (f += 31 - (f % 31)), (i.status = E), B(i, f), 0 !== i.strstart && (B(i, e.adler >>> 16), B(i, 65535 & e.adler)), (e.adler = 1)) } if (69 === i.status) if (i.gzhead.extra) { for ( o = i.pending; i.gzindex < (65535 & i.gzhead.extra.length) && (i.pending !== i.pending_buf_size || (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), D(e), (o = i.pending), i.pending !== i.pending_buf_size)); ) (F(i, 255 & i.gzhead.extra[i.gzindex]), i.gzindex++) ;(i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), i.gzindex === i.gzhead.extra.length && ((i.gzindex = 0), (i.status = 73))) } else i.status = 73 if (73 === i.status) if (i.gzhead.name) { o = i.pending do { if ( i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), D(e), (o = i.pending), i.pending === i.pending_buf_size) ) { u = 1 break } ;((u = i.gzindex < i.gzhead.name.length ? 255 & i.gzhead.name.charCodeAt(i.gzindex++) : 0), F(i, u)) } while (0 !== u) ;(i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), 0 === u && ((i.gzindex = 0), (i.status = 91))) } else i.status = 91 if (91 === i.status) if (i.gzhead.comment) { o = i.pending do { if ( i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), D(e), (o = i.pending), i.pending === i.pending_buf_size) ) { u = 1 break } ;((u = i.gzindex < i.gzhead.comment.length ? 255 & i.gzhead.comment.charCodeAt(i.gzindex++) : 0), F(i, u)) } while (0 !== u) ;(i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), 0 === u && (i.status = 103)) } else i.status = 103 if ( (103 === i.status && (i.gzhead.hcrc ? (i.pending + 2 > i.pending_buf_size && D(e), i.pending + 2 <= i.pending_buf_size && (F(i, 255 & e.adler), F(i, (e.adler >> 8) & 255), (e.adler = 0), (i.status = E))) : (i.status = E)), 0 !== i.pending) ) { if ((D(e), 0 === e.avail_out)) return ((i.last_flush = -1), h) } else if (0 === e.avail_in && P(t) <= P(n) && t !== c) return N(e, -5) if (666 === i.status && 0 !== e.avail_in) return N(e, -5) if ( 0 !== e.avail_in || 0 !== i.lookahead || (t !== l && 666 !== i.status) ) { var p = 2 === i.strategy ? (function (e, t) { for (var n; ; ) { if (0 === e.lookahead && (z(e), 0 === e.lookahead)) { if (t === l) return C break } if ( ((e.match_length = 0), (n = a._tr_tally(e, 0, e.window[e.strstart])), e.lookahead--, e.strstart++, n && (O(e, !1), 0 === e.strm.avail_out)) ) return C } return ( (e.insert = 0), t === c ? (O(e, !0), 0 === e.strm.avail_out ? R : I) : e.last_lit && (O(e, !1), 0 === e.strm.avail_out) ? C : k ) })(i, t) : 3 === i.strategy ? (function (e, t) { for (var n, r, i, o, s = e.window; ; ) { if (e.lookahead <= w) { if ((z(e), e.lookahead <= w && t === l)) return C if (0 === e.lookahead) break } if ( ((e.match_length = 0), e.lookahead >= A && 0 < e.strstart && (r = s[(i = e.strstart - 1)]) === s[++i] && r === s[++i] && r === s[++i]) ) { o = e.strstart + w do {} while ( r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && i < o ) ;((e.match_length = w - (o - i)), e.match_length > e.lookahead && (e.match_length = e.lookahead)) } if ( (e.match_length >= A ? ((n = a._tr_tally(e, 1, e.match_length - A)), (e.lookahead -= e.match_length), (e.strstart += e.match_length), (e.match_length = 0)) : ((n = a._tr_tally(e, 0, e.window[e.strstart])), e.lookahead--, e.strstart++), n && (O(e, !1), 0 === e.strm.avail_out)) ) return C } return ( (e.insert = 0), t === c ? (O(e, !0), 0 === e.strm.avail_out ? R : I) : e.last_lit && (O(e, !1), 0 === e.strm.avail_out) ? C : k ) })(i, t) : r[i.level].func(i, t) if (((p !== R && p !== I) || (i.status = 666), p === C || p === R)) return (0 === e.avail_out && (i.last_flush = -1), h) if ( p === k && (1 === t ? a._tr_align(i) : 5 !== t && (a._tr_stored_block(i, 0, 0, !1), 3 === t && (L(i.head), 0 === i.lookahead && ((i.strstart = 0), (i.block_start = 0), (i.insert = 0)))), D(e), 0 === e.avail_out) ) return ((i.last_flush = -1), h) } return t !== c ? h : i.wrap <= 0 ? 1 : (2 === i.wrap ? (F(i, 255 & e.adler), F(i, (e.adler >> 8) & 255), F(i, (e.adler >> 16) & 255), F(i, (e.adler >> 24) & 255), F(i, 255 & e.total_in), F(i, (e.total_in >> 8) & 255), F(i, (e.total_in >> 16) & 255), F(i, (e.total_in >> 24) & 255)) : (B(i, e.adler >>> 16), B(i, 65535 & e.adler)), D(e), 0 < i.wrap && (i.wrap = -i.wrap), 0 !== i.pending ? h : 1) }), (n.deflateEnd = function (e) { var t return e && e.state ? (t = e.state.status) !== M && 69 !== t && 73 !== t && 91 !== t && 103 !== t && t !== E && 666 !== t ? N(e, d) : ((e.state = null), t === E ? N(e, -3) : h) : d }), (n.deflateSetDictionary = function (e, t) { var n, r, a, s, u, l, c, f, p = t.length if (!e || !e.state) return d if ( 2 === (s = (n = e.state).wrap) || (1 === s && n.status !== M) || n.lookahead ) return d for ( 1 === s && (e.adler = o(e.adler, t, p, 0)), n.wrap = 0, p >= n.w_size && (0 === s && (L(n.head), (n.strstart = 0), (n.block_start = 0), (n.insert = 0)), (f = new i.Buf8(n.w_size)), i.arraySet(f, t, p - n.w_size, n.w_size, 0), (t = f), (p = n.w_size)), u = e.avail_in, l = e.next_in, c = e.input, e.avail_in = p, e.next_in = 0, e.input = t, z(n); n.lookahead >= A; ) { for ( r = n.strstart, a = n.lookahead - (A - 1); (n.ins_h = ((n.ins_h << n.hash_shift) ^ n.window[r + A - 1]) & n.hash_mask), (n.prev[r & n.w_mask] = n.head[n.ins_h]), (n.head[n.ins_h] = r), r++, --a; ); ;((n.strstart = r), (n.lookahead = A - 1), z(n)) } return ( (n.strstart += n.lookahead), (n.block_start = n.strstart), (n.insert = n.lookahead), (n.lookahead = 0), (n.match_length = n.prev_length = A - 1), (n.match_available = 0), (e.next_in = l), (e.input = c), (e.avail_in = u), (n.wrap = s), h ) }), (n.deflateInfo = 'pako deflate (from Nodeca project)')) }, { '../utils/common': 41, './adler32': 43, './crc32': 45, './messages': 51, './trees': 52, }, ], 47: [ function (e, t, n) { t.exports = function () { ;((this.text = 0), (this.time = 0), (this.xflags = 0), (this.os = 0), (this.extra = null), (this.extra_len = 0), (this.name = ''), (this.comment = ''), (this.hcrc = 0), (this.done = !1)) } }, {}, ], 48: [ function (e, t, n) { t.exports = function (e, t) { var n, r, i, a, o, s, u, l, c, h, d, f, p, v, m, g, y, _, b, x, S, A, w, T, M ;((n = e.state), (r = e.next_in), (T = e.input), (i = r + (e.avail_in - 5)), (a = e.next_out), (M = e.output), (o = a - (t - e.avail_out)), (s = a + (e.avail_out - 257)), (u = n.dmax), (l = n.wsize), (c = n.whave), (h = n.wnext), (d = n.window), (f = n.hold), (p = n.bits), (v = n.lencode), (m = n.distcode), (g = (1 << n.lenbits) - 1), (y = (1 << n.distbits) - 1)) e: do { ;(p < 15 && ((f += T[r++] << p), (p += 8), (f += T[r++] << p), (p += 8)), (_ = v[f & g])) t: for (;;) { if (((f >>>= b = _ >>> 24), (p -= b), 0 == (b = (_ >>> 16) & 255))) M[a++] = 65535 & _ else { if (!(16 & b)) { if (!(64 & b)) { _ = v[(65535 & _) + (f & ((1 << b) - 1))] continue t } if (32 & b) { n.mode = 12 break e } ;((e.msg = 'invalid literal/length code'), (n.mode = 30)) break e } ;((x = 65535 & _), (b &= 15) && (p < b && ((f += T[r++] << p), (p += 8)), (x += f & ((1 << b) - 1)), (f >>>= b), (p -= b)), p < 15 && ((f += T[r++] << p), (p += 8), (f += T[r++] << p), (p += 8)), (_ = m[f & y])) n: for (;;) { if ( ((f >>>= b = _ >>> 24), (p -= b), !(16 & (b = (_ >>> 16) & 255))) ) { if (!(64 & b)) { _ = m[(65535 & _) + (f & ((1 << b) - 1))] continue n } ;((e.msg = 'invalid distance code'), (n.mode = 30)) break e } if ( ((S = 65535 & _), p < (b &= 15) && ((f += T[r++] << p), (p += 8) < b && ((f += T[r++] << p), (p += 8))), u < (S += f & ((1 << b) - 1))) ) { ;((e.msg = 'invalid distance too far back'), (n.mode = 30)) break e } if (((f >>>= b), (p -= b), (b = a - o) < S)) { if (c < (b = S - b) && n.sane) { ;((e.msg = 'invalid distance too far back'), (n.mode = 30)) break e } if (((w = d), (A = 0) === h)) { if (((A += l - b), b < x)) { for (x -= b; (M[a++] = d[A++]), --b; ); ;((A = a - S), (w = M)) } } else if (h < b) { if (((A += l + h - b), (b -= h) < x)) { for (x -= b; (M[a++] = d[A++]), --b; ); if (((A = 0), h < x)) { for (x -= b = h; (M[a++] = d[A++]), --b; ); ;((A = a - S), (w = M)) } } } else if (((A += h - b), b < x)) { for (x -= b; (M[a++] = d[A++]), --b; ); ;((A = a - S), (w = M)) } for (; 2 < x; ) ((M[a++] = w[A++]), (M[a++] = w[A++]), (M[a++] = w[A++]), (x -= 3)) x && ((M[a++] = w[A++]), 1 < x && (M[a++] = w[A++])) } else { for ( A = a - S; (M[a++] = M[A++]), (M[a++] = M[A++]), (M[a++] = M[A++]), 2 < (x -= 3); ); x && ((M[a++] = M[A++]), 1 < x && (M[a++] = M[A++])) } break } } break } } while (r < i && a < s) ;((r -= x = p >> 3), (f &= (1 << (p -= x << 3)) - 1), (e.next_in = r), (e.next_out = a), (e.avail_in = r < i ? i - r + 5 : 5 - (r - i)), (e.avail_out = a < s ? s - a + 257 : 257 - (a - s)), (n.hold = f), (n.bits = p)) } }, {}, ], 49: [ function (e, t, n) { var r = e('../utils/common'), i = e('./adler32'), a = e('./crc32'), o = e('./inffast'), s = e('./inftrees'), u = 1, l = 2, c = 0, h = -2, d = 1, f = 852, p = 592 function v(e) { return ( ((e >>> 24) & 255) + ((e >>> 8) & 65280) + ((65280 & e) << 8) + ((255 & e) << 24) ) } function m() { ;((this.mode = 0), (this.last = !1), (this.wrap = 0), (this.havedict = !1), (this.flags = 0), (this.dmax = 0), (this.check = 0), (this.total = 0), (this.head = null), (this.wbits = 0), (this.wsize = 0), (this.whave = 0), (this.wnext = 0), (this.window = null), (this.hold = 0), (this.bits = 0), (this.length = 0), (this.offset = 0), (this.extra = 0), (this.lencode = null), (this.distcode = null), (this.lenbits = 0), (this.distbits = 0), (this.ncode = 0), (this.nlen = 0), (this.ndist = 0), (this.have = 0), (this.next = null), (this.lens = new r.Buf16(320)), (this.work = new r.Buf16(288)), (this.lendyn = null), (this.distdyn = null), (this.sane = 0), (this.back = 0), (this.was = 0)) } function g(e) { var t return e && e.state ? ((t = e.state), (e.total_in = e.total_out = t.total = 0), (e.msg = ''), t.wrap && (e.adler = 1 & t.wrap), (t.mode = d), (t.last = 0), (t.havedict = 0), (t.dmax = 32768), (t.head = null), (t.hold = 0), (t.bits = 0), (t.lencode = t.lendyn = new r.Buf32(f)), (t.distcode = t.distdyn = new r.Buf32(p)), (t.sane = 1), (t.back = -1), c) : h } function y(e) { var t return e && e.state ? (((t = e.state).wsize = 0), (t.whave = 0), (t.wnext = 0), g(e)) : h } function _(e, t) { var n, r return e && e.state ? ((r = e.state), t < 0 ? ((n = 0), (t = -t)) : ((n = 1 + (t >> 4)), t < 48 && (t &= 15)), t && (t < 8 || 15 < t) ? h : (null !== r.window && r.wbits !== t && (r.window = null), (r.wrap = n), (r.wbits = t), y(e))) : h } function b(e, t) { var n, r return e ? ((r = new m()), ((e.state = r).window = null), (n = _(e, t)) !== c && (e.state = null), n) : h } var x, S, A = !0 function w(e) { if (A) { var t for (x = new r.Buf32(512), S = new r.Buf32(32), t = 0; t < 144; ) e.lens[t++] = 8 for (; t < 256; ) e.lens[t++] = 9 for (; t < 280; ) e.lens[t++] = 7 for (; t < 288; ) e.lens[t++] = 8 for (s(u, e.lens, 0, 288, x, 0, e.work, { bits: 9 }), t = 0; t < 32; ) e.lens[t++] = 5 ;(s(l, e.lens, 0, 32, S, 0, e.work, { bits: 5 }), (A = !1)) } ;((e.lencode = x), (e.lenbits = 9), (e.distcode = S), (e.distbits = 5)) } function T(e, t, n, i) { var a, o = e.state return ( null === o.window && ((o.wsize = 1 << o.wbits), (o.wnext = 0), (o.whave = 0), (o.window = new r.Buf8(o.wsize))), i >= o.wsize ? (r.arraySet(o.window, t, n - o.wsize, o.wsize, 0), (o.wnext = 0), (o.whave = o.wsize)) : (i < (a = o.wsize - o.wnext) && (a = i), r.arraySet(o.window, t, n - i, a, o.wnext), (i -= a) ? (r.arraySet(o.window, t, n - i, i, 0), (o.wnext = i), (o.whave = o.wsize)) : ((o.wnext += a), o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += a))), 0 ) } ;((n.inflateReset = y), (n.inflateReset2 = _), (n.inflateResetKeep = g), (n.inflateInit = function (e) { return b(e, 15) }), (n.inflateInit2 = b), (n.inflate = function (e, t) { var n, f, p, m, g, y, _, b, x, S, A, M, E, C, k, R, I, N, P, L, D, O, F, B, U = 0, z = new r.Buf8(4), V = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, ] if (!e || !e.state || !e.output || (!e.input && 0 !== e.avail_in)) return h ;(12 === (n = e.state).mode && (n.mode = 13), (g = e.next_out), (p = e.output), (_ = e.avail_out), (m = e.next_in), (f = e.input), (y = e.avail_in), (b = n.hold), (x = n.bits), (S = y), (A = _), (O = c)) e: for (;;) switch (n.mode) { case d: if (0 === n.wrap) { n.mode = 13 break } for (; x < 16; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (2 & n.wrap && 35615 === b) { ;((z[(n.check = 0)] = 255 & b), (z[1] = (b >>> 8) & 255), (n.check = a(n.check, z, 2, 0)), (x = b = 0), (n.mode = 2)) break } if ( ((n.flags = 0), n.head && (n.head.done = !1), !(1 & n.wrap) || (((255 & b) << 8) + (b >> 8)) % 31) ) { ;((e.msg = 'incorrect header check'), (n.mode = 30)) break } if (8 != (15 & b)) { ;((e.msg = 'unknown compression method'), (n.mode = 30)) break } if (((x -= 4), (D = 8 + (15 & (b >>>= 4))), 0 === n.wbits)) n.wbits = D else if (D > n.wbits) { ;((e.msg = 'invalid window size'), (n.mode = 30)) break } ;((n.dmax = 1 << D), (e.adler = n.check = 1), (n.mode = 512 & b ? 10 : 12), (x = b = 0)) break case 2: for (; x < 16; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (((n.flags = b), 8 != (255 & n.flags))) { ;((e.msg = 'unknown compression method'), (n.mode = 30)) break } if (57344 & n.flags) { ;((e.msg = 'unknown header flags set'), (n.mode = 30)) break } ;(n.head && (n.head.text = (b >> 8) & 1), 512 & n.flags && ((z[0] = 255 & b), (z[1] = (b >>> 8) & 255), (n.check = a(n.check, z, 2, 0))), (x = b = 0), (n.mode = 3)) case 3: for (; x < 32; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;(n.head && (n.head.time = b), 512 & n.flags && ((z[0] = 255 & b), (z[1] = (b >>> 8) & 255), (z[2] = (b >>> 16) & 255), (z[3] = (b >>> 24) & 255), (n.check = a(n.check, z, 4, 0))), (x = b = 0), (n.mode = 4)) case 4: for (; x < 16; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;(n.head && ((n.head.xflags = 255 & b), (n.head.os = b >> 8)), 512 & n.flags && ((z[0] = 255 & b), (z[1] = (b >>> 8) & 255), (n.check = a(n.check, z, 2, 0))), (x = b = 0), (n.mode = 5)) case 5: if (1024 & n.flags) { for (; x < 16; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((n.length = b), n.head && (n.head.extra_len = b), 512 & n.flags && ((z[0] = 255 & b), (z[1] = (b >>> 8) & 255), (n.check = a(n.check, z, 2, 0))), (x = b = 0)) } else n.head && (n.head.extra = null) n.mode = 6 case 6: if ( 1024 & n.flags && (y < (M = n.length) && (M = y), M && (n.head && ((D = n.head.extra_len - n.length), n.head.extra || (n.head.extra = new Array(n.head.extra_len)), r.arraySet(n.head.extra, f, m, M, D)), 512 & n.flags && (n.check = a(n.check, f, M, m)), (y -= M), (m += M), (n.length -= M)), n.length) ) break e ;((n.length = 0), (n.mode = 7)) case 7: if (2048 & n.flags) { if (0 === y) break e for ( M = 0; (D = f[m + M++]), n.head && D && n.length < 65536 && (n.head.name += String.fromCharCode(D)), D && M < y; ); if ( (512 & n.flags && (n.check = a(n.check, f, M, m)), (y -= M), (m += M), D) ) break e } else n.head && (n.head.name = null) ;((n.length = 0), (n.mode = 8)) case 8: if (4096 & n.flags) { if (0 === y) break e for ( M = 0; (D = f[m + M++]), n.head && D && n.length < 65536 && (n.head.comment += String.fromCharCode(D)), D && M < y; ); if ( (512 & n.flags && (n.check = a(n.check, f, M, m)), (y -= M), (m += M), D) ) break e } else n.head && (n.head.comment = null) n.mode = 9 case 9: if (512 & n.flags) { for (; x < 16; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (b !== (65535 & n.check)) { ;((e.msg = 'header crc mismatch'), (n.mode = 30)) break } x = b = 0 } ;(n.head && ((n.head.hcrc = (n.flags >> 9) & 1), (n.head.done = !0)), (e.adler = n.check = 0), (n.mode = 12)) break case 10: for (; x < 32; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((e.adler = n.check = v(b)), (x = b = 0), (n.mode = 11)) case 11: if (0 === n.havedict) return ( (e.next_out = g), (e.avail_out = _), (e.next_in = m), (e.avail_in = y), (n.hold = b), (n.bits = x), 2 ) ;((e.adler = n.check = 1), (n.mode = 12)) case 12: if (5 === t || 6 === t) break e case 13: if (n.last) { ;((b >>>= 7 & x), (x -= 7 & x), (n.mode = 27)) break } for (; x < 3; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } switch (((n.last = 1 & b), (x -= 1), 3 & (b >>>= 1))) { case 0: n.mode = 14 break case 1: if ((w(n), (n.mode = 20), 6 !== t)) break ;((b >>>= 2), (x -= 2)) break e case 2: n.mode = 17 break case 3: ;((e.msg = 'invalid block type'), (n.mode = 30)) } ;((b >>>= 2), (x -= 2)) break case 14: for (b >>>= 7 & x, x -= 7 & x; x < 32; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if ((65535 & b) != ((b >>> 16) ^ 65535)) { ;((e.msg = 'invalid stored block lengths'), (n.mode = 30)) break } if ( ((n.length = 65535 & b), (x = b = 0), (n.mode = 15), 6 === t) ) break e case 15: n.mode = 16 case 16: if ((M = n.length)) { if ((y < M && (M = y), _ < M && (M = _), 0 === M)) break e ;(r.arraySet(p, f, m, M, g), (y -= M), (m += M), (_ -= M), (g += M), (n.length -= M)) break } n.mode = 12 break case 17: for (; x < 14; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if ( ((n.nlen = 257 + (31 & b)), (b >>>= 5), (x -= 5), (n.ndist = 1 + (31 & b)), (b >>>= 5), (x -= 5), (n.ncode = 4 + (15 & b)), (b >>>= 4), (x -= 4), 286 < n.nlen || 30 < n.ndist) ) { ;((e.msg = 'too many length or distance symbols'), (n.mode = 30)) break } ;((n.have = 0), (n.mode = 18)) case 18: for (; n.have < n.ncode; ) { for (; x < 3; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((n.lens[V[n.have++]] = 7 & b), (b >>>= 3), (x -= 3)) } for (; n.have < 19; ) n.lens[V[n.have++]] = 0 if ( ((n.lencode = n.lendyn), (n.lenbits = 7), (F = { bits: n.lenbits }), (O = s(0, n.lens, 0, 19, n.lencode, 0, n.work, F)), (n.lenbits = F.bits), O) ) { ;((e.msg = 'invalid code lengths set'), (n.mode = 30)) break } ;((n.have = 0), (n.mode = 19)) case 19: for (; n.have < n.nlen + n.ndist; ) { for ( ; (R = ((U = n.lencode[b & ((1 << n.lenbits) - 1)]) >>> 16) & 255), (I = 65535 & U), !((k = U >>> 24) <= x); ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (I < 16) ((b >>>= k), (x -= k), (n.lens[n.have++] = I)) else { if (16 === I) { for (B = k + 2; x < B; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (((b >>>= k), (x -= k), 0 === n.have)) { ;((e.msg = 'invalid bit length repeat'), (n.mode = 30)) break } ;((D = n.lens[n.have - 1]), (M = 3 + (3 & b)), (b >>>= 2), (x -= 2)) } else if (17 === I) { for (B = k + 3; x < B; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((x -= k), (D = 0), (M = 3 + (7 & (b >>>= k))), (b >>>= 3), (x -= 3)) } else { for (B = k + 7; x < B; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((x -= k), (D = 0), (M = 11 + (127 & (b >>>= k))), (b >>>= 7), (x -= 7)) } if (n.have + M > n.nlen + n.ndist) { ;((e.msg = 'invalid bit length repeat'), (n.mode = 30)) break } for (; M--; ) n.lens[n.have++] = D } } if (30 === n.mode) break if (0 === n.lens[256]) { ;((e.msg = 'invalid code -- missing end-of-block'), (n.mode = 30)) break } if ( ((n.lenbits = 9), (F = { bits: n.lenbits }), (O = s(u, n.lens, 0, n.nlen, n.lencode, 0, n.work, F)), (n.lenbits = F.bits), O) ) { ;((e.msg = 'invalid literal/lengths set'), (n.mode = 30)) break } if ( ((n.distbits = 6), (n.distcode = n.distdyn), (F = { bits: n.distbits }), (O = s(l, n.lens, n.nlen, n.ndist, n.distcode, 0, n.work, F)), (n.distbits = F.bits), O) ) { ;((e.msg = 'invalid distances set'), (n.mode = 30)) break } if (((n.mode = 20), 6 === t)) break e case 20: n.mode = 21 case 21: if (6 <= y && 258 <= _) { ;((e.next_out = g), (e.avail_out = _), (e.next_in = m), (e.avail_in = y), (n.hold = b), (n.bits = x), o(e, A), (g = e.next_out), (p = e.output), (_ = e.avail_out), (m = e.next_in), (f = e.input), (y = e.avail_in), (b = n.hold), (x = n.bits), 12 === n.mode && (n.back = -1)) break } for ( n.back = 0; (R = ((U = n.lencode[b & ((1 << n.lenbits) - 1)]) >>> 16) & 255), (I = 65535 & U), !((k = U >>> 24) <= x); ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (R && !(240 & R)) { for ( N = k, P = R, L = I; (R = ((U = n.lencode[L + ((b & ((1 << (N + P)) - 1)) >> N)]) >>> 16) & 255), (I = 65535 & U), !(N + (k = U >>> 24) <= x); ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((b >>>= N), (x -= N), (n.back += N)) } if ( ((b >>>= k), (x -= k), (n.back += k), (n.length = I), 0 === R) ) { n.mode = 26 break } if (32 & R) { ;((n.back = -1), (n.mode = 12)) break } if (64 & R) { ;((e.msg = 'invalid literal/length code'), (n.mode = 30)) break } ;((n.extra = 15 & R), (n.mode = 22)) case 22: if (n.extra) { for (B = n.extra; x < B; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((n.length += b & ((1 << n.extra) - 1)), (b >>>= n.extra), (x -= n.extra), (n.back += n.extra)) } ;((n.was = n.length), (n.mode = 23)) case 23: for ( ; (R = ((U = n.distcode[b & ((1 << n.distbits) - 1)]) >>> 16) & 255), (I = 65535 & U), !((k = U >>> 24) <= x); ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (!(240 & R)) { for ( N = k, P = R, L = I; (R = ((U = n.distcode[L + ((b & ((1 << (N + P)) - 1)) >> N)]) >>> 16) & 255), (I = 65535 & U), !(N + (k = U >>> 24) <= x); ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((b >>>= N), (x -= N), (n.back += N)) } if (((b >>>= k), (x -= k), (n.back += k), 64 & R)) { ;((e.msg = 'invalid distance code'), (n.mode = 30)) break } ;((n.offset = I), (n.extra = 15 & R), (n.mode = 24)) case 24: if (n.extra) { for (B = n.extra; x < B; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } ;((n.offset += b & ((1 << n.extra) - 1)), (b >>>= n.extra), (x -= n.extra), (n.back += n.extra)) } if (n.offset > n.dmax) { ;((e.msg = 'invalid distance too far back'), (n.mode = 30)) break } n.mode = 25 case 25: if (0 === _) break e if (((M = A - _), n.offset > M)) { if ((M = n.offset - M) > n.whave && n.sane) { ;((e.msg = 'invalid distance too far back'), (n.mode = 30)) break } ;((E = M > n.wnext ? ((M -= n.wnext), n.wsize - M) : n.wnext - M), M > n.length && (M = n.length), (C = n.window)) } else ((C = p), (E = g - n.offset), (M = n.length)) for ( _ < M && (M = _), _ -= M, n.length -= M; (p[g++] = C[E++]), --M; ); 0 === n.length && (n.mode = 21) break case 26: if (0 === _) break e ;((p[g++] = n.length), _--, (n.mode = 21)) break case 27: if (n.wrap) { for (; x < 32; ) { if (0 === y) break e ;(y--, (b |= f[m++] << x), (x += 8)) } if ( ((A -= _), (e.total_out += A), (n.total += A), A && (e.adler = n.check = n.flags ? a(n.check, p, A, g - A) : i(n.check, p, A, g - A)), (A = _), (n.flags ? b : v(b)) !== n.check) ) { ;((e.msg = 'incorrect data check'), (n.mode = 30)) break } x = b = 0 } n.mode = 28 case 28: if (n.wrap && n.flags) { for (; x < 32; ) { if (0 === y) break e ;(y--, (b += f[m++] << x), (x += 8)) } if (b !== (4294967295 & n.total)) { ;((e.msg = 'incorrect length check'), (n.mode = 30)) break } x = b = 0 } n.mode = 29 case 29: O = 1 break e case 30: O = -3 break e case 31: return -4 default: return h } return ( (e.next_out = g), (e.avail_out = _), (e.next_in = m), (e.avail_in = y), (n.hold = b), (n.bits = x), (n.wsize || (A !== e.avail_out && n.mode < 30 && (n.mode < 27 || 4 !== t))) && T(e, e.output, e.next_out, A - e.avail_out) ? ((n.mode = 31), -4) : ((S -= e.avail_in), (A -= e.avail_out), (e.total_in += S), (e.total_out += A), (n.total += A), n.wrap && A && (e.adler = n.check = n.flags ? a(n.check, p, A, e.next_out - A) : i(n.check, p, A, e.next_out - A)), (e.data_type = n.bits + (n.last ? 64 : 0) + (12 === n.mode ? 128 : 0) + (20 === n.mode || 15 === n.mode ? 256 : 0)), ((0 == S && 0 === A) || 4 === t) && O === c && (O = -5), O) ) }), (n.inflateEnd = function (e) { if (!e || !e.state) return h var t = e.state return (t.window && (t.window = null), (e.state = null), c) }), (n.inflateGetHeader = function (e, t) { var n return e && e.state && 2 & (n = e.state).wrap ? (((n.head = t).done = !1), c) : h }), (n.inflateSetDictionary = function (e, t) { var n, r = t.length return e && e.state ? 0 !== (n = e.state).wrap && 11 !== n.mode ? h : 11 === n.mode && i(1, t, r, 0) !== n.check ? -3 : T(e, t, r, r) ? ((n.mode = 31), -4) : ((n.havedict = 1), c) : h }), (n.inflateInfo = 'pako inflate (from Nodeca project)')) }, { '../utils/common': 41, './adler32': 43, './crc32': 45, './inffast': 48, './inftrees': 50, }, ], 50: [ function (e, t, n) { var r = e('../utils/common'), i = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0, ], a = [ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78, ], o = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0, ], s = [ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64, ] t.exports = function (e, t, n, u, l, c, h, d) { var f, p, v, m, g, y, _, b, x, S = d.bits, A = 0, w = 0, T = 0, M = 0, E = 0, C = 0, k = 0, R = 0, I = 0, N = 0, P = null, L = 0, D = new r.Buf16(16), O = new r.Buf16(16), F = null, B = 0 for (A = 0; A <= 15; A++) D[A] = 0 for (w = 0; w < u; w++) D[t[n + w]]++ for (E = S, M = 15; 1 <= M && 0 === D[M]; M--); if ((M < E && (E = M), 0 === M)) return ((l[c++] = 20971520), (l[c++] = 20971520), (d.bits = 1), 0) for (T = 1; T < M && 0 === D[T]; T++); for (E < T && (E = T), A = R = 1; A <= 15; A++) if (((R <<= 1), (R -= D[A]) < 0)) return -1 if (0 < R && (0 === e || 1 !== M)) return -1 for (O[1] = 0, A = 1; A < 15; A++) O[A + 1] = O[A] + D[A] for (w = 0; w < u; w++) 0 !== t[n + w] && (h[O[t[n + w]]++] = w) if ( ((y = 0 === e ? ((P = F = h), 19) : 1 === e ? ((P = i), (L -= 257), (F = a), (B -= 257), 256) : ((P = o), (F = s), -1)), (A = T), (g = c), (k = w = N = 0), (v = -1), (m = (I = 1 << (C = E)) - 1), (1 === e && 852 < I) || (2 === e && 592 < I)) ) return 1 for (;;) { for ( _ = A - k, x = h[w] < y ? ((b = 0), h[w]) : h[w] > y ? ((b = F[B + h[w]]), P[L + h[w]]) : ((b = 96), 0), f = 1 << (A - k), T = p = 1 << C; (l[g + (N >> k) + (p -= f)] = (_ << 24) | (b << 16) | x), 0 !== p; ); for (f = 1 << (A - 1); N & f; ) f >>= 1 if ( (0 !== f ? ((N &= f - 1), (N += f)) : (N = 0), w++, 0 == --D[A]) ) { if (A === M) break A = t[n + h[w]] } if (E < A && (N & m) !== v) { for ( 0 === k && (k = E), g += T, R = 1 << (C = A - k); C + k < M && !((R -= D[C + k]) <= 0); ) (C++, (R <<= 1)) if (((I += 1 << C), (1 === e && 852 < I) || (2 === e && 592 < I))) return 1 l[(v = N & m)] = (E << 24) | (C << 16) | (g - c) } } return ( 0 !== N && (l[g + N] = ((A - k) << 24) | (64 << 16)), (d.bits = E), 0 ) } }, { '../utils/common': 41 }, ], 51: [ function (e, t, n) { t.exports = { 2: 'need dictionary', 1: 'stream end', 0: '', '-1': 'file error', '-2': 'stream error', '-3': 'data error', '-4': 'insufficient memory', '-5': 'buffer error', '-6': 'incompatible version', } }, {}, ], 52: [ function (e, t, n) { var r = e('../utils/common'), i = 0, a = 1 function o(e) { for (var t = e.length; 0 <= --t; ) e[t] = 0 } var s = 0, u = 29, l = 256, c = l + 1 + u, h = 30, d = 19, f = 2 * c + 1, p = 15, v = 16, m = 7, g = 256, y = 16, _ = 17, b = 18, x = [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, ], S = [ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, ], A = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], w = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], T = new Array(2 * (c + 2)) o(T) var M = new Array(2 * h) o(M) var E = new Array(512) o(E) var C = new Array(256) o(C) var k = new Array(u) o(k) var R, I, N, P = new Array(h) function L(e, t, n, r, i) { ;((this.static_tree = e), (this.extra_bits = t), (this.extra_base = n), (this.elems = r), (this.max_length = i), (this.has_stree = e && e.length)) } function D(e, t) { ;((this.dyn_tree = e), (this.max_code = 0), (this.stat_desc = t)) } function O(e) { return e < 256 ? E[e] : E[256 + (e >>> 7)] } function F(e, t) { ;((e.pending_buf[e.pending++] = 255 & t), (e.pending_buf[e.pending++] = (t >>> 8) & 255)) } function B(e, t, n) { e.bi_valid > v - n ? ((e.bi_buf |= (t << e.bi_valid) & 65535), F(e, e.bi_buf), (e.bi_buf = t >> (v - e.bi_valid)), (e.bi_valid += n - v)) : ((e.bi_buf |= (t << e.bi_valid) & 65535), (e.bi_valid += n)) } function U(e, t, n) { B(e, n[2 * t], n[2 * t + 1]) } function z(e, t) { for (var n = 0; (n |= 1 & e), (e >>>= 1), (n <<= 1), 0 < --t; ); return n >>> 1 } function V(e, t, n) { var r, i, a = new Array(p + 1), o = 0 for (r = 1; r <= p; r++) a[r] = o = (o + n[r - 1]) << 1 for (i = 0; i <= t; i++) { var s = e[2 * i + 1] 0 !== s && (e[2 * i] = z(a[s]++, s)) } } function H(e) { var t for (t = 0; t < c; t++) e.dyn_ltree[2 * t] = 0 for (t = 0; t < h; t++) e.dyn_dtree[2 * t] = 0 for (t = 0; t < d; t++) e.bl_tree[2 * t] = 0 ;((e.dyn_ltree[2 * g] = 1), (e.opt_len = e.static_len = 0), (e.last_lit = e.matches = 0)) } function W(e) { ;(8 < e.bi_valid ? F(e, e.bi_buf) : 0 < e.bi_valid && (e.pending_buf[e.pending++] = e.bi_buf), (e.bi_buf = 0), (e.bi_valid = 0)) } function G(e, t, n, r) { var i = 2 * t, a = 2 * n return e[i] < e[a] || (e[i] === e[a] && r[t] <= r[n]) } function j(e, t, n) { for ( var r = e.heap[n], i = n << 1; i <= e.heap_len && (i < e.heap_len && G(t, e.heap[i + 1], e.heap[i], e.depth) && i++, !G(t, r, e.heap[i], e.depth)); ) ((e.heap[n] = e.heap[i]), (n = i), (i <<= 1)) e.heap[n] = r } function Q(e, t, n) { var r, i, a, o, s = 0 if (0 !== e.last_lit) for ( ; (r = (e.pending_buf[e.d_buf + 2 * s] << 8) | e.pending_buf[e.d_buf + 2 * s + 1]), (i = e.pending_buf[e.l_buf + s]), s++, 0 === r ? U(e, i, t) : (U(e, (a = C[i]) + l + 1, t), 0 !== (o = x[a]) && B(e, (i -= k[a]), o), U(e, (a = O(--r)), n), 0 !== (o = S[a]) && B(e, (r -= P[a]), o)), s < e.last_lit; ); U(e, g, t) } function q(e, t) { var n, r, i, a = t.dyn_tree, o = t.stat_desc.static_tree, s = t.stat_desc.has_stree, u = t.stat_desc.elems, l = -1 for (e.heap_len = 0, e.heap_max = f, n = 0; n < u; n++) 0 !== a[2 * n] ? ((e.heap[++e.heap_len] = l = n), (e.depth[n] = 0)) : (a[2 * n + 1] = 0) for (; e.heap_len < 2; ) ((a[2 * (i = e.heap[++e.heap_len] = l < 2 ? ++l : 0)] = 1), (e.depth[i] = 0), e.opt_len--, s && (e.static_len -= o[2 * i + 1])) for (t.max_code = l, n = e.heap_len >> 1; 1 <= n; n--) j(e, a, n) for ( i = u; (n = e.heap[1]), (e.heap[1] = e.heap[e.heap_len--]), j(e, a, 1), (r = e.heap[1]), (e.heap[--e.heap_max] = n), (e.heap[--e.heap_max] = r), (a[2 * i] = a[2 * n] + a[2 * r]), (e.depth[i] = (e.depth[n] >= e.depth[r] ? e.depth[n] : e.depth[r]) + 1), (a[2 * n + 1] = a[2 * r + 1] = i), (e.heap[1] = i++), j(e, a, 1), 2 <= e.heap_len; ); ;((e.heap[--e.heap_max] = e.heap[1]), (function (e, t) { var n, r, i, a, o, s, u = t.dyn_tree, l = t.max_code, c = t.stat_desc.static_tree, h = t.stat_desc.has_stree, d = t.stat_desc.extra_bits, v = t.stat_desc.extra_base, m = t.stat_desc.max_length, g = 0 for (a = 0; a <= p; a++) e.bl_count[a] = 0 for ( u[2 * e.heap[e.heap_max] + 1] = 0, n = e.heap_max + 1; n < f; n++ ) (m < (a = u[2 * u[2 * (r = e.heap[n]) + 1] + 1] + 1) && ((a = m), g++), (u[2 * r + 1] = a), l < r || (e.bl_count[a]++, (o = 0), v <= r && (o = d[r - v]), (s = u[2 * r]), (e.opt_len += s * (a + o)), h && (e.static_len += s * (c[2 * r + 1] + o)))) if (0 !== g) { do { for (a = m - 1; 0 === e.bl_count[a]; ) a-- ;(e.bl_count[a]--, (e.bl_count[a + 1] += 2), e.bl_count[m]--, (g -= 2)) } while (0 < g) for (a = m; 0 !== a; a--) for (r = e.bl_count[a]; 0 !== r; ) l < (i = e.heap[--n]) || (u[2 * i + 1] !== a && ((e.opt_len += (a - u[2 * i + 1]) * u[2 * i]), (u[2 * i + 1] = a)), r--) } })(e, t), V(a, l, e.bl_count)) } function X(e, t, n) { var r, i, a = -1, o = t[1], s = 0, u = 7, l = 4 for ( 0 === o && ((u = 138), (l = 3)), t[2 * (n + 1) + 1] = 65535, r = 0; r <= n; r++ ) ((i = o), (o = t[2 * (r + 1) + 1]), (++s < u && i === o) || (s < l ? (e.bl_tree[2 * i] += s) : 0 !== i ? (i !== a && e.bl_tree[2 * i]++, e.bl_tree[2 * y]++) : s <= 10 ? e.bl_tree[2 * _]++ : e.bl_tree[2 * b]++, (a = i), (l = (s = 0) === o ? ((u = 138), 3) : i === o ? ((u = 6), 3) : ((u = 7), 4)))) } function Y(e, t, n) { var r, i, a = -1, o = t[1], s = 0, u = 7, l = 4 for (0 === o && ((u = 138), (l = 3)), r = 0; r <= n; r++) if (((i = o), (o = t[2 * (r + 1) + 1]), !(++s < u && i === o))) { if (s < l) for (; U(e, i, e.bl_tree), 0 != --s; ); else 0 !== i ? (i !== a && (U(e, i, e.bl_tree), s--), U(e, y, e.bl_tree), B(e, s - 3, 2)) : s <= 10 ? (U(e, _, e.bl_tree), B(e, s - 3, 3)) : (U(e, b, e.bl_tree), B(e, s - 11, 7)) ;((a = i), (l = (s = 0) === o ? ((u = 138), 3) : i === o ? ((u = 6), 3) : ((u = 7), 4))) } } o(P) var K = !1 function Z(e, t, n, i) { ;(B(e, (s << 1) + (i ? 1 : 0), 3), (function (e, t, n) { ;(W(e), F(e, n), F(e, ~n), r.arraySet(e.pending_buf, e.window, t, n, e.pending), (e.pending += n)) })(e, t, n)) } ;((n._tr_init = function (e) { ;(K || ((function () { var e, t, n, r, i, a = new Array(p + 1) for (r = n = 0; r < u - 1; r++) for (k[r] = n, e = 0; e < 1 << x[r]; e++) C[n++] = r for (C[n - 1] = r, r = i = 0; r < 16; r++) for (P[r] = i, e = 0; e < 1 << S[r]; e++) E[i++] = r for (i >>= 7; r < h; r++) for (P[r] = i << 7, e = 0; e < 1 << (S[r] - 7); e++) E[256 + i++] = r for (t = 0; t <= p; t++) a[t] = 0 for (e = 0; e <= 143; ) ((T[2 * e + 1] = 8), e++, a[8]++) for (; e <= 255; ) ((T[2 * e + 1] = 9), e++, a[9]++) for (; e <= 279; ) ((T[2 * e + 1] = 7), e++, a[7]++) for (; e <= 287; ) ((T[2 * e + 1] = 8), e++, a[8]++) for (V(T, c + 1, a), e = 0; e < h; e++) ((M[2 * e + 1] = 5), (M[2 * e] = z(e, 5))) ;((R = new L(T, x, l + 1, c, p)), (I = new L(M, S, 0, h, p)), (N = new L(new Array(0), A, 0, d, m))) })(), (K = !0)), (e.l_desc = new D(e.dyn_ltree, R)), (e.d_desc = new D(e.dyn_dtree, I)), (e.bl_desc = new D(e.bl_tree, N)), (e.bi_buf = 0), (e.bi_valid = 0), H(e)) }), (n._tr_stored_block = Z), (n._tr_flush_block = function (e, t, n, r) { var o, s, u = 0 ;(0 < e.level ? (2 === e.strm.data_type && (e.strm.data_type = (function (e) { var t, n = 4093624447 for (t = 0; t <= 31; t++, n >>>= 1) if (1 & n && 0 !== e.dyn_ltree[2 * t]) return i if ( 0 !== e.dyn_ltree[18] || 0 !== e.dyn_ltree[20] || 0 !== e.dyn_ltree[26] ) return a for (t = 32; t < l; t++) if (0 !== e.dyn_ltree[2 * t]) return a return i })(e)), q(e, e.l_desc), q(e, e.d_desc), (u = (function (e) { var t for ( X(e, e.dyn_ltree, e.l_desc.max_code), X(e, e.dyn_dtree, e.d_desc.max_code), q(e, e.bl_desc), t = d - 1; 3 <= t && 0 === e.bl_tree[2 * w[t] + 1]; t-- ); return ((e.opt_len += 3 * (t + 1) + 5 + 5 + 4), t) })(e)), (o = (e.opt_len + 3 + 7) >>> 3), (s = (e.static_len + 3 + 7) >>> 3) <= o && (o = s)) : (o = s = n + 5), n + 4 <= o && -1 !== t ? Z(e, t, n, r) : 4 === e.strategy || s === o ? (B(e, 2 + (r ? 1 : 0), 3), Q(e, T, M)) : (B(e, 4 + (r ? 1 : 0), 3), (function (e, t, n, r) { var i for ( B(e, t - 257, 5), B(e, n - 1, 5), B(e, r - 4, 4), i = 0; i < r; i++ ) B(e, e.bl_tree[2 * w[i] + 1], 3) ;(Y(e, e.dyn_ltree, t - 1), Y(e, e.dyn_dtree, n - 1)) })(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, u + 1), Q(e, e.dyn_ltree, e.dyn_dtree)), H(e), r && W(e)) }), (n._tr_tally = function (e, t, n) { return ( (e.pending_buf[e.d_buf + 2 * e.last_lit] = (t >>> 8) & 255), (e.pending_buf[e.d_buf + 2 * e.last_lit + 1] = 255 & t), (e.pending_buf[e.l_buf + e.last_lit] = 255 & n), e.last_lit++, 0 === t ? e.dyn_ltree[2 * n]++ : (e.matches++, t--, e.dyn_ltree[2 * (C[n] + l + 1)]++, e.dyn_dtree[2 * O(t)]++), e.last_lit === e.lit_bufsize - 1 ) }), (n._tr_align = function (e) { ;(B(e, 2, 3), U(e, g, T), (function (e) { 16 === e.bi_valid ? (F(e, e.bi_buf), (e.bi_buf = 0), (e.bi_valid = 0)) : 8 <= e.bi_valid && ((e.pending_buf[e.pending++] = 255 & e.bi_buf), (e.bi_buf >>= 8), (e.bi_valid -= 8)) })(e)) })) }, { '../utils/common': 41 }, ], 53: [ function (e, t, n) { t.exports = function () { ;((this.input = null), (this.next_in = 0), (this.avail_in = 0), (this.total_in = 0), (this.output = null), (this.next_out = 0), (this.avail_out = 0), (this.total_out = 0), (this.msg = ''), (this.state = null), (this.data_type = 2), (this.adler = 0)) } }, {}, ], 54: [ function (e, t, n) { ;(function (e) { !(function (e, t) { if (!e.setImmediate) { var n, r, i, a, o = 1, s = {}, u = !1, l = e.document, c = Object.getPrototypeOf && Object.getPrototypeOf(e) ;((c = c && c.setTimeout ? c : e), (n = '[object process]' === {}.toString.call(e.process) ? function (e) { process.nextTick(function () { d(e) }) } : (function () { if (e.postMessage && !e.importScripts) { var t = !0, n = e.onmessage return ( (e.onmessage = function () { t = !1 }), e.postMessage('', '*'), (e.onmessage = n), t ) } })() ? ((a = 'setImmediate$' + Math.random() + '$'), e.addEventListener ? e.addEventListener('message', f, !1) : e.attachEvent('onmessage', f), function (t) { e.postMessage(a + t, '*') }) : e.MessageChannel ? (((i = new MessageChannel()).port1.onmessage = function (e) { d(e.data) }), function (e) { i.port2.postMessage(e) }) : l && 'onreadystatechange' in l.createElement('script') ? ((r = l.documentElement), function (e) { var t = l.createElement('script') ;((t.onreadystatechange = function () { ;(d(e), (t.onreadystatechange = null), r.removeChild(t), (t = null)) }), r.appendChild(t)) }) : function (e) { setTimeout(d, 0, e) }), (c.setImmediate = function (e) { 'function' != typeof e && (e = new Function('' + e)) for ( var t = new Array(arguments.length - 1), r = 0; r < t.length; r++ ) t[r] = arguments[r + 1] var i = { callback: e, args: t } return ((s[o] = i), n(o), o++) }), (c.clearImmediate = h)) } function h(e) { delete s[e] } function d(e) { if (u) setTimeout(d, 0, e) else { var n = s[e] if (n) { u = !0 try { !(function (e) { var n = e.callback, r = e.args switch (r.length) { case 0: n() break case 1: n(r[0]) break case 2: n(r[0], r[1]) break case 3: n(r[0], r[1], r[2]) break default: n.apply(t, r) } })(n) } finally { ;(h(e), (u = !1)) } } } } function f(t) { t.source === e && 'string' == typeof t.data && 0 === t.data.indexOf(a) && d(+t.data.slice(a.length)) } })('undefined' == typeof self ? (void 0 === e ? this : e) : self) }).call( this, void 0 !== tU ? tU : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {} ) }, {}, ], }, {}, [10] )(10) })(aU)), aU.exports) var lU, cU, hU, dU = {} var fU, pU = (function () { if (hU) return cU hU = 1 var e = sU ? oU : ((sU = 1), (oU = function (e, t) { if (((t = t.split(':')[0]), !(e = +e))) return !1 switch (t) { case 'http': case 'ws': return 80 !== e case 'https': case 'wss': return 443 !== e case 'ftp': return 21 !== e case 'gopher': return 70 !== e case 'file': return !1 } return 0 !== e })), t = (function () { if (lU) return dU lU = 1 var e = Object.prototype.hasOwnProperty function t(e) { try { return decodeURIComponent(e.replace(/\+/g, ' ')) } catch (ZJ) { return null } } function n(e) { try { return encodeURIComponent(e) } catch (ZJ) { return null } } return ( (dU.stringify = function (t, r) { r = r || '' var i, a, o = [] for (a in ('string' != typeof r && (r = '?'), t)) if (e.call(t, a)) { if ( ((i = t[a]) || (null != i && !isNaN(i)) || (i = ''), (a = n(a)), (i = n(i)), null === a || null === i) ) continue o.push(a + '=' + i) } return o.length ? r + o.join('&') : '' }), (dU.parse = function (e) { for (var n, r = /([^=?#&]+)=?([^&]*)/g, i = {}; (n = r.exec(e)); ) { var a = t(n[1]), o = t(n[2]) null === a || null === o || a in i || (i[a] = o) } return i }), dU ) })(), n = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, r = /[\n\r\t]/g, i = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, a = /:\d+$/, o = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, s = /^[a-zA-Z]:/ function u(e) { return (e || '').toString().replace(n, '') } var l = [ ['#', 'hash'], ['?', 'query'], function (e, t) { return d(t.protocol) ? e.replace(/\\/g, '/') : e }, ['/', 'pathname'], ['@', 'auth', 1], [NaN, 'host', void 0, 1, 1], [/:(\d*)$/, 'port', void 0, 1], [NaN, 'hostname', void 0, 1, 1], ], c = { hash: 1, query: 1 } function h(e) { var t, n = ('undefined' != typeof window ? window : void 0 !== tU ? tU : 'undefined' != typeof self ? self : {} ).location || {}, r = {}, a = P((e = e || n)) if ('blob:' === e.protocol) r = new p(unescape(e.pathname), {}) else if ('string' === a) for (t in ((r = new p(e, {})), c)) delete r[t] else if ('object' === a) { for (t in e) t in c || (r[t] = e[t]) void 0 === r.slashes && (r.slashes = i.test(e.href)) } return r } function d(e) { return ( 'file:' === e || 'ftp:' === e || 'http:' === e || 'https:' === e || 'ws:' === e || 'wss:' === e ) } function f(e, t) { ;((e = (e = u(e)).replace(r, '')), (t = t || {})) var n, i = o.exec(e), a = i[1] ? i[1].toLowerCase() : '', s = !!i[2], l = !!i[3], c = 0 return ( s ? l ? ((n = i[2] + i[3] + i[4]), (c = i[2].length + i[3].length)) : ((n = i[2] + i[4]), (c = i[2].length)) : l ? ((n = i[3] + i[4]), (c = i[3].length)) : (n = i[4]), 'file:' === a ? c >= 2 && (n = n.slice(2)) : d(a) ? (n = i[4]) : a ? s && (n = n.slice(2)) : c >= 2 && d(t.protocol) && (n = i[4]), { protocol: a, slashes: s || d(a), slashesCount: c, rest: n } ) } function p(n, i, a) { if (((n = (n = u(n)).replace(r, '')), !(this instanceof p))) return new p(n, i, a) var o, c, v, m, g, y, _ = l.slice(), b = P(i), x = this, S = 0 for ( 'object' !== b && 'string' !== b && ((a = i), (i = null)), a && 'function' != typeof a && (a = t.parse), o = !(c = f(n || '', (i = h(i)))).protocol && !c.slashes, x.slashes = c.slashes || (o && i.slashes), x.protocol = c.protocol || i.protocol || '', n = c.rest, (('file:' === c.protocol && (2 !== c.slashesCount || s.test(n))) || (!c.slashes && (c.protocol || c.slashesCount < 2 || !d(x.protocol)))) && (_[3] = [/(.*)/, 'pathname']); S < _.length; S++ ) 'function' != typeof (m = _[S]) ? ((v = m[0]), (y = m[1]), v != v ? (x[y] = n) : 'string' == typeof v ? ~(g = '@' === v ? n.lastIndexOf(v) : n.indexOf(v)) && ('number' == typeof m[2] ? ((x[y] = n.slice(0, g)), (n = n.slice(g + m[2]))) : ((x[y] = n.slice(g)), (n = n.slice(0, g)))) : (g = v.exec(n)) && ((x[y] = g[1]), (n = n.slice(0, g.index))), (x[y] = x[y] || (o && m[3] && i[y]) || ''), m[4] && (x[y] = x[y].toLowerCase())) : (n = m(n, x)) ;(a && (x.query = a(x.query)), o && i.slashes && '/' !== x.pathname.charAt(0) && ('' !== x.pathname || '' !== i.pathname) && (x.pathname = (function (e, t) { if ('' === e) return t for ( var n = (t || '/').split('/').slice(0, -1).concat(e.split('/')), r = n.length, i = n[r - 1], a = !1, o = 0; r--; ) '.' === n[r] ? n.splice(r, 1) : '..' === n[r] ? (n.splice(r, 1), o++) : o && (0 === r && (a = !0), n.splice(r, 1), o--) return ( a && n.unshift(''), ('.' !== i && '..' !== i) || n.push(''), n.join('/') ) })(x.pathname, i.pathname)), '/' !== x.pathname.charAt(0) && d(x.protocol) && (x.pathname = '/' + x.pathname), e(x.port, x.protocol) || ((x.host = x.hostname), (x.port = '')), (x.username = x.password = ''), x.auth && (~(g = x.auth.indexOf(':')) ? ((x.username = x.auth.slice(0, g)), (x.username = encodeURIComponent(decodeURIComponent(x.username))), (x.password = x.auth.slice(g + 1)), (x.password = encodeURIComponent(decodeURIComponent(x.password)))) : (x.username = encodeURIComponent(decodeURIComponent(x.auth))), (x.auth = x.password ? x.username + ':' + x.password : x.username)), (x.origin = 'file:' !== x.protocol && d(x.protocol) && x.host ? x.protocol + '//' + x.host : 'null'), (x.href = x.toString())) } return ( (p.prototype = { set: function (n, r, i) { var o = this switch (n) { case 'query': ;('string' == typeof r && r.length && (r = (i || t.parse)(r)), (o[n] = r)) break case 'port': ;((o[n] = r), e(r, o.protocol) ? r && (o.host = o.hostname + ':' + r) : ((o.host = o.hostname), (o[n] = ''))) break case 'hostname': ;((o[n] = r), o.port && (r += ':' + o.port), (o.host = r)) break case 'host': ;((o[n] = r), a.test(r) ? ((r = r.split(':')), (o.port = r.pop()), (o.hostname = r.join(':'))) : ((o.hostname = r), (o.port = ''))) break case 'protocol': ;((o.protocol = r.toLowerCase()), (o.slashes = !i)) break case 'pathname': case 'hash': if (r) { var s = 'pathname' === n ? '/' : '#' o[n] = r.charAt(0) !== s ? s + r : r } else o[n] = r break case 'username': case 'password': o[n] = encodeURIComponent(r) break case 'auth': var u = r.indexOf(':') ~u ? ((o.username = r.slice(0, u)), (o.username = encodeURIComponent(decodeURIComponent(o.username))), (o.password = r.slice(u + 1)), (o.password = encodeURIComponent(decodeURIComponent(o.password)))) : (o.username = encodeURIComponent(decodeURIComponent(r))) } for (var c = 0; c < l.length; c++) { var h = l[c] h[4] && (o[h[1]] = o[h[1]].toLowerCase()) } return ( (o.auth = o.password ? o.username + ':' + o.password : o.username), (o.origin = 'file:' !== o.protocol && d(o.protocol) && o.host ? o.protocol + '//' + o.host : 'null'), (o.href = o.toString()), o ) }, toString: function (e) { ;(e && 'function' == typeof e) || (e = t.stringify) var n, r = this, i = r.host, o = r.protocol o && ':' !== o.charAt(o.length - 1) && (o += ':') var s = o + ((r.protocol && r.slashes) || d(r.protocol) ? '//' : '') return ( r.username ? ((s += r.username), r.password && (s += ':' + r.password), (s += '@')) : r.password ? ((s += ':' + r.password), (s += '@')) : 'file:' !== r.protocol && d(r.protocol) && !i && '/' !== r.pathname && (s += '@'), (':' === i[i.length - 1] || (a.test(r.hostname) && !r.port)) && (i += ':'), (s += i + r.pathname), (n = 'object' === P(r.query) ? e(r.query) : r.query) && (s += '?' !== n.charAt(0) ? '?' + n : n), r.hash && (s += r.hash), s ) }, }), (p.extractProtocol = f), (p.location = h), (p.trimLeft = u), (p.qs = t), (cU = p) ) })(), vU = nU(pU), mU = { exports: {} } var gU, yU, _U, bU, xU, SU = (fU || ((fU = 1), (function (e) { e.exports = (function () { var e, t, n = { version: '0.2.0' }, r = (n.settings = { minimum: 0.08, easing: 'ease', positionUsing: '', speed: 200, trickle: !0, trickleRate: 0.02, trickleSpeed: 800, showSpinner: !0, barSelector: '[role="bar"]', spinnerSelector: '[role="spinner"]', parent: 'body', template: '
', }) function i(e, t, n) { return e < t ? t : e > n ? n : e } function a(e) { return 100 * (-1 + e) } function o(e, t, n) { var i return ( ((i = 'translate3d' === r.positionUsing ? { transform: 'translate3d(' + a(e) + '%,0,0)' } : 'translate' === r.positionUsing ? { transform: 'translate(' + a(e) + '%,0)' } : { 'margin-left': a(e) + '%' }).transition = 'all ' + t + 'ms ' + n), i ) } ;((n.configure = function (e) { var t, n for (t in e) void 0 !== (n = e[t]) && e.hasOwnProperty(t) && (r[t] = n) return this }), (n.status = null), (n.set = function (e) { var t = n.isStarted() ;((e = i(e, r.minimum, 1)), (n.status = 1 === e ? null : e)) var a = n.render(!t), l = a.querySelector(r.barSelector), c = r.speed, h = r.easing return ( a.offsetWidth, s(function (t) { ;('' === r.positionUsing && (r.positionUsing = n.getPositioningCSS()), u(l, o(e, c, h)), 1 === e ? (u(a, { transition: 'none', opacity: 1 }), a.offsetWidth, setTimeout(function () { ;(u(a, { transition: 'all ' + c + 'ms linear', opacity: 0 }), setTimeout(function () { ;(n.remove(), t()) }, c)) }, c)) : setTimeout(t, c)) }), this ) }), (n.isStarted = function () { return 'number' == typeof n.status }), (n.start = function () { n.status || n.set(0) var e = function () { setTimeout(function () { n.status && (n.trickle(), e()) }, r.trickleSpeed) } return (r.trickle && e(), this) }), (n.done = function (e) { return e || n.status ? n.inc(0.3 + 0.5 * Math.random()).set(1) : this }), (n.inc = function (e) { var t = n.status return t ? ('number' != typeof e && (e = (1 - t) * i(Math.random() * t, 0.1, 0.95)), (t = i(t + e, 0, 0.994)), n.set(t)) : n.start() }), (n.trickle = function () { return n.inc(Math.random() * r.trickleRate) }), (e = 0), (t = 0), (n.promise = function (r) { return r && 'resolved' !== r.state() ? (0 === t && n.start(), e++, t++, r.always(function () { 0 === --t ? ((e = 0), n.done()) : n.set((e - t) / e) }), this) : this }), (n.render = function (e) { if (n.isRendered()) return document.getElementById('nprogress') c(document.documentElement, 'nprogress-busy') var t = document.createElement('div') ;((t.id = 'nprogress'), (t.innerHTML = r.template)) var i, o = t.querySelector(r.barSelector), s = e ? '-100' : a(n.status || 0), l = document.querySelector(r.parent) return ( u(o, { transition: 'all 0 linear', transform: 'translate3d(' + s + '%,0,0)', }), r.showSpinner || ((i = t.querySelector(r.spinnerSelector)) && f(i)), l != document.body && c(l, 'nprogress-custom-parent'), l.appendChild(t), t ) }), (n.remove = function () { ;(h(document.documentElement, 'nprogress-busy'), h(document.querySelector(r.parent), 'nprogress-custom-parent')) var e = document.getElementById('nprogress') e && f(e) }), (n.isRendered = function () { return !!document.getElementById('nprogress') }), (n.getPositioningCSS = function () { var e = document.body.style, t = 'WebkitTransform' in e ? 'Webkit' : 'MozTransform' in e ? 'Moz' : 'msTransform' in e ? 'ms' : 'OTransform' in e ? 'O' : '' return t + 'Perspective' in e ? 'translate3d' : t + 'Transform' in e ? 'translate' : 'margin' })) var s = (function () { var e = [] function t() { var n = e.shift() n && n(t) } return function (n) { ;(e.push(n), 1 == e.length && t()) } })(), u = (function () { var e = ['Webkit', 'O', 'Moz', 'ms'], t = {} function n(e) { return e.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function (e, t) { return t.toUpperCase() }) } function r(t) { var n = document.body.style if (t in n) return t for ( var r, i = e.length, a = t.charAt(0).toUpperCase() + t.slice(1); i--; ) if ((r = e[i] + a) in n) return r return t } function i(e) { return ((e = n(e)), t[e] || (t[e] = r(e))) } function a(e, t, n) { ;((t = i(t)), (e.style[t] = n)) } return function (e, t) { var n, r, i = arguments if (2 == i.length) for (n in t) void 0 !== (r = t[n]) && t.hasOwnProperty(n) && a(e, n, r) else a(e, i[1], i[2]) } })() function l(e, t) { return ('string' == typeof e ? e : d(e)).indexOf(' ' + t + ' ') >= 0 } function c(e, t) { var n = d(e), r = n + t l(n, t) || (e.className = r.substring(1)) } function h(e, t) { var n, r = d(e) l(e, t) && ((n = r.replace(' ' + t + ' ', ' ')), (e.className = n.substring(1, n.length - 1))) } function d(e) { return (' ' + (e.className || '') + ' ').replace(/\s+/gi, ' ') } function f(e) { e && e.parentNode && e.parentNode.removeChild(e) } return n })() })(mU)), mU.exports), AU = nU(SU) ;(!(function (e) { ;((e.Idle = 'Idle'), (e.Listening = 'Listening'), (e.Responding = 'Responding'), (e.Thinking = 'Thinking')) })(gU || (gU = {})), (function (e) { ;((e.cpu = 'cpu'), (e.gpu = 'gpu')) })(yU || (yU = {})), (function (e) { ;((e.High = 'High'), (e.Low = 'Low'), (e.Standard = 'Standard')) })(_U || (_U = {})), (function (e) { ;((e.GAUSSIAN_SPLATTING_3D = 'GAUSSIAN_SPLATTING_3D'), (e.REALTIME_AVATAR_3D = 'REALTIME_AVATAR_3D'), (e.REALTIME_AVATAR_LIVE2D = 'REALTIME_AVATAR_LIVE2D'), (e.REALTIME_AVATAR_MOBILE2D = 'REALTIME_AVATAR_MOBILE2D')) })(bU || (bU = {})), (function (e) { ;((e.Idle = 'idle'), (e.Listening = 'listen'), (e.Responding = 'speak'), (e.Thinking = 'think')) })(xU || (xU = {}))) var wU = (function () { function e(t, n, r) { A(this, e) var i = [], a = [], o = [], s = [], u = [] this.mixer = t for ( var l = r.hello.size, c = r.idle.size + l, h = r.listen.size + c, d = r.speak.size + h, f = r.think.size + d, p = 0; p < n.length; p++ ) { var v = n[p], m = t.clipAction(v) if (p < l) i.push(m) else if (p < c) { if ((a.push(m), h == c)) { var g = t.clipAction(v.clone()) o.push(g) } if (s == o) { var y = t.clipAction(v.clone()) s.push(y) } if (f == d) { var _ = t.clipAction(v.clone()) u.push(_) } } else p < h ? o.push(m) : p < d ? s.push(m) : p < f && u.push(m) ;(e.actions.push(m), e.SetWeight(m, 0)) } ;((this.hello = new MU(i, r.hello.isGroup)), (this.idle = new EU(a, r.idle.isGroup)), (this.listen = new CU(o, r.listen.isGroup)), (this.think = new kU(u, r.think.isGroup)), (this.speak = new RU(s, r.speak.isGroup))) } return T( e, [ { key: 'curPlaying', value: function () { return this.hello.isPlaying || this.idle.isPlaying ? gU.Idle : this.listen.isPlaying ? gU.Listening : this.think.isPlaying ? gU.Thinking : this.speak.isPlaying ? gU.Responding : void 0 }, }, { key: 'dispose', value: function () { ;(this.hello.dispose(), this.idle.dispose(), this.listen.dispose(), this.think.dispose(), this.speak.dispose()) }, }, { key: 'resetAllActions', value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0] switch (this.curPlaying()) { case gU.Idle: e.LastAction = this.hello.actions[this.hello.stage] break case gU.Listening: e.LastAction = this.listen.actions[this.listen.stage] break case gU.Thinking: e.LastAction = this.think.actions[this.think.stage] break case gU.Responding: e.LastAction = this.speak.actions[this.speak.stage] break default: e.LastAction = void 0 } ;(e.LastAction && ((e.LastAction.loop = lc), (e.LastAction.clampWhenFinished = !0), e.SetWeight(e.LastAction, 1)), t && (e.PauseAllActions(), e.actions.forEach(function (t) { ;((t.time = 0), e.SetWeight(t, 0)) }), (e.LastAction = void 0)), (this.hello.isPlaying = !1), (this.idle.isPlaying = !1), (this.listen.isPlaying = !1), (this.think.isPlaying = !1), (this.speak.isPlaying = !1)) }, }, { key: 'update', value: function (t) { if (!e.IsBlending) if (((e.CurPlaying = this.curPlaying()), null == e.CurPlaying)) switch (t) { case gU.Idle: this.idle.update(t) break case gU.Listening: this.listen.update(t) break case gU.Thinking: this.think.update(t) break case gU.Responding: this.speak.update(t) break default: this.idle.update(t) } else switch (e.CurPlaying) { case gU.Idle: this.idle.update(t) break case gU.Listening: this.listen.update(t) break case gU.Thinking: this.think.update(t) break case gU.Responding: this.speak.update(t) break default: this.idle.update(t) } }, }, { key: 'updateBS', value: function (e) { var t = { browDownLeft: 0, browDownRight: 0, browInnerUp: 0, browOuterUpLeft: 0, browOuterUpRight: 0, mouthCheekPuff: 0, cheekSquintLeft: 0, cheekSquintRight: 0, eyeBlinkLeft: 0, eyeBlinkRight: 0, eyeLookDownLeft: 0, eyeLookDownRight: 0, eyeLookInLeft: 0, eyeLookInRight: 0, eyeLookOutLeft: 0, eyeLookOutRight: 0, eyeLookUpLeft: 0, eyeLookUpRight: 0, eyeSquintLeft: 0, eyeSquintRight: 0, eyeWideLeft: 0, eyeWideRight: 0, jawForward: 0, jawLeft: 0, jawOpen: 0, jawRight: 0, mouthClose: 0, mouthDimpleLeft: 0, mouthDimpleRight: 0, mouthFrownLeft: 0, mouthFrownRight: 0, mouthFunnel: 0, mouthLeft: 0, mouthLowerDownLeft: 0, mouthLowerDownRight: 0, mouthPressLeft: 0, mouthPressRight: 0, mouthPucker: 0, mouthRight: 0, mouthRollLower: 0, mouthRollUpper: 0, mouthShrugLower: 0, mouthShrugUpper: 0, mouthSmileLeft: 0, mouthSmileRight: 0, mouthStretchLeft: 0, mouthStretchRight: 0, mouthUpperUpLeft: 0, mouthUpperUpRight: 0, noseSneerLeft: 0, noseSneerRight: 0, tongueOut: 0, } return (null != e && (t = e), t) }, }, ], [ { key: 'SetWeight', value: function (e, t) { ;((e.enabled = !0), e.setEffectiveTimeScale(1), e.setEffectiveWeight(t)) }, }, { key: 'PrepareCrossFade', value: function (t, n, r) { var i = r ;(e.UnPauseAllActions(), e.ExecuteCrossFade(t, n, i), (e.IsBlending = !0), setTimeout(function () { e.IsBlending = !1 }, r + 0.1)) }, }, { key: 'PauseAllActions', value: function () { e.actions.forEach(function (e) { e.paused = !0 }) }, }, { key: 'UnPauseAllActions', value: function () { e.actions.forEach(function (e) { e.paused = !1 }) }, }, { key: 'ExecuteCrossFade', value: function (t, n, r) { ;(e.SetWeight(n, 1), (n.time = 0), t.crossFadeTo(n, r, !0)) }, }, ] ) })() ;((wU.IsBlending = !1), (wU.actions = []), (wU.NeedReset = !1), (wU.NeedFullReset = !1)) var TU = (function () { return T( function e(t, n) { ;(A(this, e), (this.isPlaying = !1), (this.stage = 0), (this.actions = []), (this.blendingTime = 0.5), (this.isGroup = !1), (this.actions = t), (this.isGroup = n)) }, [ { key: 'dispose', value: function () { this.actions = [] }, }, { key: 'update', value: function (e) {} }, ] ) })(), MU = (function (e) { function t(e, n) { return (A(this, t), y(this, t, [e, n])) } return ( x(t, e), T(t, [ { key: 'update', value: function (e) { if ( (null == wU.CurPlaying && e == gU.Idle && 0 == this.isPlaying && ((this.stage = 0), (this.actions[this.stage].time = 0), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = cc), (this.actions[this.stage].clampWhenFinished = !1), (this.actions[this.stage].paused = !1), this.actions[this.stage].play(), null != wU.LastAction && wU.PrepareCrossFade( wU.LastAction, this.actions[this.stage], this.blendingTime ), (this.isPlaying = !0)), wU.CurPlaying == gU.Idle && e == gU.Idle && 1 == this.isPlaying && this.actions[this.stage].time > this.actions[this.stage].getClip().duration - this.blendingTime) ) { var t = this.stage + 1 ;(t >= this.actions.length && (t = 0), (this.actions[t].time = 0), wU.SetWeight(this.actions[t], 1), (this.actions[t].loop = cc), this.actions[t].play(), wU.PrepareCrossFade( this.actions[this.stage], this.actions[t], this.blendingTime ), (this.stage = t)) } }, }, ]) ) })(TU), EU = (function (e) { function t(e, n) { return (A(this, t), y(this, t, [e, n])) } return ( x(t, e), T(t, [ { key: 'update', value: function (e) { ;(null == wU.CurPlaying && e == gU.Idle && 0 == this.isPlaying && ((this.stage = 0), (this.actions[this.stage].time = 0), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = cc), (this.actions[this.stage].clampWhenFinished = !1), (this.actions[this.stage].paused = !1), this.actions[this.stage].play(), null != wU.LastAction && wU.PrepareCrossFade( wU.LastAction, this.actions[this.stage], this.blendingTime ), (this.isPlaying = !0)), wU.CurPlaying == gU.Idle && e != gU.Idle && 1 == this.isPlaying && 0 == this.stage && ((this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), (this.isPlaying = !1), (wU.LastAction = this.actions[this.stage]))) }, }, ]) ) })(TU), CU = (function (e) { function t(e, n) { return (A(this, t), y(this, t, [e, n])) } return ( x(t, e), T(t, [ { key: 'update', value: function (e) { ;(null == wU.CurPlaying && e == gU.Listening && 0 == this.isPlaying && ((this.stage = 0), (this.actions[this.stage].time = 0), this.actions[this.stage].play(), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = this.isGroup ? lc : cc), (this.actions[this.stage].clampWhenFinished = !!this.isGroup), null != wU.LastAction && wU.PrepareCrossFade( wU.LastAction, this.actions[this.stage], this.blendingTime ), (this.isPlaying = !0)), this.isGroup && (wU.CurPlaying == gU.Listening && e == gU.Listening && 1 == this.isPlaying && 0 == this.stage && this.actions[this.stage].time > this.actions[this.stage].getClip().duration - this.blendingTime && ((this.actions[this.stage + 1].time = 0), wU.SetWeight(this.actions[this.stage + 1], 1), (this.actions[this.stage + 1].loop = cc), this.actions[this.stage + 1].play(), wU.PrepareCrossFade( this.actions[this.stage], this.actions[this.stage + 1], this.blendingTime ), (this.stage = 1)), wU.CurPlaying != gU.Listening || e == gU.Listening || 1 != this.isPlaying || (0 != this.stage && 1 != this.stage) || ((this.actions[2].time = 0), this.actions[2].play(), wU.SetWeight(this.actions[2], 1), (this.actions[2].loop = lc), wU.PrepareCrossFade( this.actions[this.stage], this.actions[2], this.blendingTime ), (this.stage = 2))), wU.CurPlaying == gU.Listening && e != gU.Listening && 1 == this.isPlaying && this.stage == (this.isGroup ? this.actions.length - 1 : 0) && ((this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), (this.isPlaying = !1), (wU.LastAction = this.actions[this.stage]))) }, }, ]) ) })(TU), kU = (function (e) { function t(e, n) { return (A(this, t), y(this, t, [e, n])) } return ( x(t, e), T(t, [ { key: 'update', value: function (e) { ;(null == wU.CurPlaying && e == gU.Thinking && 0 == this.isPlaying && ((this.stage = 0), (this.actions[this.stage].time = 0), this.actions[this.stage].play(), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = lc), null != wU.LastAction && wU.PrepareCrossFade( wU.LastAction, this.actions[this.stage], this.blendingTime ), (this.isPlaying = !0)), this.isGroup && (wU.CurPlaying == gU.Thinking && e == gU.Thinking && 1 == this.isPlaying && 0 == this.stage && this.actions[this.stage].time > this.actions[this.stage].getClip().duration - this.blendingTime && ((this.actions[this.stage + 1].time = 0), this.actions[this.stage + 1].play(), wU.SetWeight(this.actions[this.stage + 1], 1), (this.actions[this.stage + 1].loop = cc), wU.PrepareCrossFade( this.actions[this.stage], this.actions[this.stage + 1], this.blendingTime ), (this.stage = 1)), wU.CurPlaying != gU.Thinking || e == gU.Thinking || 1 != this.isPlaying || (0 != this.stage && 1 != this.stage) || ((this.actions[2].time = 0), this.actions[2].play(), wU.SetWeight(this.actions[2], 1), (this.actions[2].loop = lc), wU.PrepareCrossFade( this.actions[this.stage], this.actions[2], this.blendingTime ), (this.stage = 2))), wU.CurPlaying == gU.Thinking && e != gU.Thinking && 1 == this.isPlaying && this.stage == (this.isGroup ? this.actions.length - 1 : 0) && ((this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), this.actions[this.stage].time > this.actions[this.stage].getClip().duration - 0.3 && ((this.isPlaying = !1), (wU.LastAction = this.actions[this.stage])))) }, }, ]) ) })(TU), RU = (function (e) { function t(e, n) { return (A(this, t), y(this, t, [e, n])) } return ( x(t, e), T(t, [ { key: 'getRandonNumber', value: function (e, t) { var n = e - t return t + Math.round(Math.random() * n) }, }, { key: 'update', value: function (e) { if ( (null == wU.CurPlaying && e == gU.Responding && 0 == this.isPlaying && ((this.stage = Math.ceil( this.getRandonNumber(0, this.actions.length - 1) )), (this.actions[this.stage].time = 0), this.actions[this.stage].play(), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), null != wU.LastAction && wU.PrepareCrossFade( wU.LastAction, this.actions[this.stage], this.blendingTime ), (this.isPlaying = !0)), wU.CurPlaying == gU.Responding && e == gU.Responding && 1 == this.isPlaying && this.actions[this.stage].time >= this.actions[this.stage].getClip().duration - this.blendingTime) ) { var t = this.actions[this.stage] ;((this.stage = (this.stage + Math.ceil(this.getRandonNumber(1, this.actions.length - 1))) % this.actions.length), (this.actions[this.stage].time = 0), this.actions[this.stage].play(), wU.SetWeight(this.actions[this.stage], 1), (this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), wU.PrepareCrossFade(t, this.actions[this.stage], this.blendingTime)) } wU.CurPlaying == gU.Responding && e != gU.Responding && 1 == this.isPlaying && ((this.actions[this.stage].loop = lc), (this.actions[this.stage].clampWhenFinished = !0), (this.isPlaying = !1), (wU.LastAction = this.actions[this.stage])) }, }, ]) ) })(TU) function IU(e, t) { if (0 === t) return ( console.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.' ), e ) if (2 === t || 1 === t) { var n = e.getIndex() if (null === n) { var r = [], i = e.getAttribute('position') if (void 0 === i) return ( console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' ), e ) for (var a = 0; a < i.count; a++) r.push(a) ;(e.setIndex(r), (n = e.getIndex())) } var o = n.count - 2, s = [] if (2 === t) for (var u = 1; u <= o; u++) (s.push(n.getX(0)), s.push(n.getX(u)), s.push(n.getX(u + 1))) else for (var l = 0; l < o; l++) l % 2 == 0 ? (s.push(n.getX(l)), s.push(n.getX(l + 1)), s.push(n.getX(l + 2))) : (s.push(n.getX(l + 2)), s.push(n.getX(l + 1)), s.push(n.getX(l))) s.length / 3 !== o && console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' ) var c = e.clone() return (c.setIndex(s), c.clearGroups(), c) } return ( console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', t ), e ) } var NU = (function (e) { function t(e) { var n return ( A(this, t), ((n = y(this, t, [e])).dracoLoader = null), (n.ktx2Loader = null), (n.meshoptDecoder = null), (n.pluginCallbacks = []), n.register(function (e) { return new BU(e) }), n.register(function (e) { return new UU(e) }), n.register(function (e) { return new XU(e) }), n.register(function (e) { return new YU(e) }), n.register(function (e) { return new KU(e) }), n.register(function (e) { return new VU(e) }), n.register(function (e) { return new HU(e) }), n.register(function (e) { return new WU(e) }), n.register(function (e) { return new GU(e) }), n.register(function (e) { return new FU(e) }), n.register(function (e) { return new jU(e) }), n.register(function (e) { return new zU(e) }), n.register(function (e) { return new qU(e) }), n.register(function (e) { return new QU(e) }), n.register(function (e) { return new DU(e) }), n.register(function (e) { return new ZU(e) }), n.register(function (e) { return new JU(e) }), n ) } return ( x(t, e), T(t, [ { key: 'load', value: function (e, t, n, r) { var i, a = this if ('' !== this.resourcePath) i = this.resourcePath else if ('' !== this.path) { var o = Fv.extractUrlBase(e) i = Fv.resolveURL(o, this.path) } else i = Fv.extractUrlBase(e) this.manager.itemStart(e) var s = function (t) { ;(r ? r(t) : console.error(t), a.manager.itemError(e), a.manager.itemEnd(e)) }, u = new _v(this.manager) ;(u.setPath(this.path), u.setResponseType('arraybuffer'), u.setRequestHeader(this.requestHeader), u.setWithCredentials(this.withCredentials), u.load( e, function (n) { try { a.parse( n, i, function (n) { ;(t(n), a.manager.itemEnd(e)) }, s ) } catch (ZJ) { s(ZJ) } }, n, s )) }, }, { key: 'setDRACOLoader', value: function (e) { return ((this.dracoLoader = e), this) }, }, { key: 'setKTX2Loader', value: function (e) { return ((this.ktx2Loader = e), this) }, }, { key: 'setMeshoptDecoder', value: function (e) { return ((this.meshoptDecoder = e), this) }, }, { key: 'register', value: function (e) { return ( -1 === this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.push(e), this ) }, }, { key: 'unregister', value: function (e) { return ( -1 !== this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this ) }, }, { key: 'parse', value: function (e, t, n, r) { var i, a = {}, o = {}, s = new TextDecoder() if ('string' == typeof e) i = JSON.parse(e) else if (e instanceof ArrayBuffer) { if (s.decode(new Uint8Array(e, 0, 4)) === $U) { try { a[LU.KHR_BINARY_GLTF] = new nz(e) } catch (p) { return void (r && r(p)) } i = JSON.parse(a[LU.KHR_BINARY_GLTF].content) } else i = JSON.parse(s.decode(e)) } else i = e if (void 0 === i.asset || i.asset.version[0] < 2) r && r( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) ) else { var u = new Cz(i, { path: t || this.resourcePath || '', crossOrigin: this.crossOrigin, requestHeader: this.requestHeader, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder, }) u.fileLoader.setRequestHeader(this.requestHeader) for (var l = 0; l < this.pluginCallbacks.length; l++) { var c = this.pluginCallbacks[l](u) ;(c.name || console.error('THREE.GLTFLoader: Invalid plugin found: missing name'), (o[c.name] = c), (a[c.name] = !0)) } if (i.extensionsUsed) for (var h = 0; h < i.extensionsUsed.length; ++h) { var d = i.extensionsUsed[h], f = i.extensionsRequired || [] switch (d) { case LU.KHR_MATERIALS_UNLIT: a[d] = new OU() break case LU.KHR_DRACO_MESH_COMPRESSION: a[d] = new rz(i, this.dracoLoader) break case LU.KHR_TEXTURE_TRANSFORM: a[d] = new iz() break case LU.KHR_MESH_QUANTIZATION: a[d] = new az() break default: f.indexOf(d) >= 0 && void 0 === o[d] && console.warn('THREE.GLTFLoader: Unknown extension "' + d + '".') } } ;(u.setExtensions(a), u.setPlugins(o), u.parse(n, r)) } }, }, { key: 'parseAsync', value: function (e, t) { var n = this return new Promise(function (r, i) { n.parse(e, t, r, i) }) }, }, ]) ) })(mv) function PU() { var e = {} return { get: function (t) { return e[t] }, add: function (t, n) { e[t] = n }, remove: function (t) { delete e[t] }, removeAll: function () { e = {} }, } } var LU = { KHR_BINARY_GLTF: 'KHR_binary_glTF', KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', KHR_MATERIALS_DISPERSION: 'KHR_materials_dispersion', KHR_MATERIALS_IOR: 'KHR_materials_ior', KHR_MATERIALS_SHEEN: 'KHR_materials_sheen', KHR_MATERIALS_SPECULAR: 'KHR_materials_specular', KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', KHR_MATERIALS_IRIDESCENCE: 'KHR_materials_iridescence', KHR_MATERIALS_ANISOTROPY: 'KHR_materials_anisotropy', KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', KHR_MATERIALS_VOLUME: 'KHR_materials_volume', KHR_TEXTURE_BASISU: 'KHR_texture_basisu', KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', KHR_MATERIALS_EMISSIVE_STRENGTH: 'KHR_materials_emissive_strength', EXT_MATERIALS_BUMP: 'EXT_materials_bump', EXT_TEXTURE_WEBP: 'EXT_texture_webp', EXT_TEXTURE_AVIF: 'EXT_texture_avif', EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression', EXT_MESH_GPU_INSTANCING: 'EXT_mesh_gpu_instancing', }, DU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_LIGHTS_PUNCTUAL), (this.cache = { refs: {}, uses: {} })) }, [ { key: '_markDefs', value: function () { for ( var e = this.parser, t = this.parser.json.nodes || [], n = 0, r = t.length; n < r; n++ ) { var i = t[n] i.extensions && i.extensions[this.name] && void 0 !== i.extensions[this.name].light && e._addNodeRef(this.cache, i.extensions[this.name].light) } }, }, { key: '_loadLight', value: function (e) { var t = this.parser, n = 'light:' + e, r = t.cache.get(n) if (r) return r var i, a = t.json, o = (((a.extensions && a.extensions[this.name]) || {}).lights || [])[e], s = new Od(16777215) void 0 !== o.color && s.setRGB(o.color[0], o.color[1], o.color[2], bc) var u = void 0 !== o.range ? o.range : 0 switch (o.type) { case 'directional': ;((i = new Ov(s)).target.position.set(0, 0, -1), i.add(i.target)) break case 'point': ;(i = new Pv(s)).distance = u break case 'spot': ;(((i = new Cv(s)).distance = u), (o.spot = o.spot || {}), (o.spot.innerConeAngle = void 0 !== o.spot.innerConeAngle ? o.spot.innerConeAngle : 0), (o.spot.outerConeAngle = void 0 !== o.spot.outerConeAngle ? o.spot.outerConeAngle : Math.PI / 4), (i.angle = o.spot.outerConeAngle), (i.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle), i.target.position.set(0, 0, -1), i.add(i.target)) break default: throw new Error('THREE.GLTFLoader: Unexpected light type: ' + o.type) } return ( i.position.set(0, 0, 0), Sz(i, o), void 0 !== o.intensity && (i.intensity = o.intensity), (i.name = t.createUniqueName(o.name || 'light_' + e)), (r = Promise.resolve(i)), t.cache.add(n, r), r ) }, }, { key: 'getDependency', value: function (e, t) { if ('light' === e) return this._loadLight(t) }, }, { key: 'createNodeAttachment', value: function (e) { var t = this, n = this.parser, r = n.json.nodes[e], i = ((r.extensions && r.extensions[this.name]) || {}).light return void 0 === i ? null : this._loadLight(i).then(function (e) { return n._getNodeRef(t.cache, i, e) }) }, }, ] ) })(), OU = (function () { return T( function e() { ;(A(this, e), (this.name = LU.KHR_MATERIALS_UNLIT)) }, [ { key: 'getMaterialType', value: function () { return zd }, }, { key: 'extendParams', value: function (e, t, n) { var r = [] ;((e.color = new Od(1, 1, 1)), (e.opacity = 1)) var i = t.pbrMetallicRoughness if (i) { if (Array.isArray(i.baseColorFactor)) { var a = i.baseColorFactor ;(e.color.setRGB(a[0], a[1], a[2], bc), (e.opacity = a[3])) } void 0 !== i.baseColorTexture && r.push(n.assignTexture(e, 'map', i.baseColorTexture, _c)) } return Promise.all(r) }, }, ] ) })(), FU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_EMISSIVE_STRENGTH)) }, [ { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser.json.materials[e] if (!n.extensions || !n.extensions[this.name]) return Promise.resolve() var r = n.extensions[this.name].emissiveStrength return (void 0 !== r && (t.emissiveIntensity = r), Promise.resolve()) }, }, ] ) })(), BU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_CLEARCOAT)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] if ( (void 0 !== a.clearcoatFactor && (t.clearcoat = a.clearcoatFactor), void 0 !== a.clearcoatTexture && i.push(n.assignTexture(t, 'clearcoatMap', a.clearcoatTexture)), void 0 !== a.clearcoatRoughnessFactor && (t.clearcoatRoughness = a.clearcoatRoughnessFactor), void 0 !== a.clearcoatRoughnessTexture && i.push( n.assignTexture(t, 'clearcoatRoughnessMap', a.clearcoatRoughnessTexture) ), void 0 !== a.clearcoatNormalTexture && (i.push( n.assignTexture(t, 'clearcoatNormalMap', a.clearcoatNormalTexture) ), void 0 !== a.clearcoatNormalTexture.scale)) ) { var o = a.clearcoatNormalTexture.scale t.clearcoatNormalScale = new Vc(o, o) } return Promise.all(i) }, }, ] ) })(), UU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_DISPERSION)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser.json.materials[e] if (!n.extensions || !n.extensions[this.name]) return Promise.resolve() var r = n.extensions[this.name] return ( (t.dispersion = void 0 !== r.dispersion ? r.dispersion : 0), Promise.resolve() ) }, }, ] ) })(), zU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_IRIDESCENCE)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] return ( void 0 !== a.iridescenceFactor && (t.iridescence = a.iridescenceFactor), void 0 !== a.iridescenceTexture && i.push(n.assignTexture(t, 'iridescenceMap', a.iridescenceTexture)), void 0 !== a.iridescenceIor && (t.iridescenceIOR = a.iridescenceIor), void 0 === t.iridescenceThicknessRange && (t.iridescenceThicknessRange = [100, 400]), void 0 !== a.iridescenceThicknessMinimum && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum), void 0 !== a.iridescenceThicknessMaximum && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum), void 0 !== a.iridescenceThicknessTexture && i.push( n.assignTexture( t, 'iridescenceThicknessMap', a.iridescenceThicknessTexture ) ), Promise.all(i) ) }, }, ] ) })(), VU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_SHEEN)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [] ;((t.sheenColor = new Od(0, 0, 0)), (t.sheenRoughness = 0), (t.sheen = 1)) var a = r.extensions[this.name] if (void 0 !== a.sheenColorFactor) { var o = a.sheenColorFactor t.sheenColor.setRGB(o[0], o[1], o[2], bc) } return ( void 0 !== a.sheenRoughnessFactor && (t.sheenRoughness = a.sheenRoughnessFactor), void 0 !== a.sheenColorTexture && i.push(n.assignTexture(t, 'sheenColorMap', a.sheenColorTexture, _c)), void 0 !== a.sheenRoughnessTexture && i.push(n.assignTexture(t, 'sheenRoughnessMap', a.sheenRoughnessTexture)), Promise.all(i) ) }, }, ] ) })(), HU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_TRANSMISSION)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] return ( void 0 !== a.transmissionFactor && (t.transmission = a.transmissionFactor), void 0 !== a.transmissionTexture && i.push(n.assignTexture(t, 'transmissionMap', a.transmissionTexture)), Promise.all(i) ) }, }, ] ) })(), WU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_VOLUME)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] ;((t.thickness = void 0 !== a.thicknessFactor ? a.thicknessFactor : 0), void 0 !== a.thicknessTexture && i.push(n.assignTexture(t, 'thicknessMap', a.thicknessTexture)), (t.attenuationDistance = a.attenuationDistance || 1 / 0)) var o = a.attenuationColor || [1, 1, 1] return ( (t.attenuationColor = new Od().setRGB(o[0], o[1], o[2], bc)), Promise.all(i) ) }, }, ] ) })(), GU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_IOR)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser.json.materials[e] if (!n.extensions || !n.extensions[this.name]) return Promise.resolve() var r = n.extensions[this.name] return ((t.ior = void 0 !== r.ior ? r.ior : 1.5), Promise.resolve()) }, }, ] ) })(), jU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_SPECULAR)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] ;((t.specularIntensity = void 0 !== a.specularFactor ? a.specularFactor : 1), void 0 !== a.specularTexture && i.push(n.assignTexture(t, 'specularIntensityMap', a.specularTexture))) var o = a.specularColorFactor || [1, 1, 1] return ( (t.specularColor = new Od().setRGB(o[0], o[1], o[2], bc)), void 0 !== a.specularColorTexture && i.push( n.assignTexture(t, 'specularColorMap', a.specularColorTexture, _c) ), Promise.all(i) ) }, }, ] ) })(), QU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.EXT_MATERIALS_BUMP)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] return ( (t.bumpScale = void 0 !== a.bumpFactor ? a.bumpFactor : 1), void 0 !== a.bumpTexture && i.push(n.assignTexture(t, 'bumpMap', a.bumpTexture)), Promise.all(i) ) }, }, ] ) })(), qU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_MATERIALS_ANISOTROPY)) }, [ { key: 'getMaterialType', value: function (e) { var t = this.parser.json.materials[e] return t.extensions && t.extensions[this.name] ? Qp : null }, }, { key: 'extendMaterialParams', value: function (e, t) { var n = this.parser, r = n.json.materials[e] if (!r.extensions || !r.extensions[this.name]) return Promise.resolve() var i = [], a = r.extensions[this.name] return ( void 0 !== a.anisotropyStrength && (t.anisotropy = a.anisotropyStrength), void 0 !== a.anisotropyRotation && (t.anisotropyRotation = a.anisotropyRotation), void 0 !== a.anisotropyTexture && i.push(n.assignTexture(t, 'anisotropyMap', a.anisotropyTexture)), Promise.all(i) ) }, }, ] ) })(), XU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.KHR_TEXTURE_BASISU)) }, [ { key: 'loadTexture', value: function (e) { var t = this.parser, n = t.json, r = n.textures[e] if (!r.extensions || !r.extensions[this.name]) return null var i = r.extensions[this.name], a = t.options.ktx2Loader if (!a) { if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0) throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' ) return null } return t.loadTextureImage(e, i.source, a) }, }, ] ) })(), YU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.EXT_TEXTURE_WEBP), (this.isSupported = null)) }, [ { key: 'loadTexture', value: function (e) { var t = this.name, n = this.parser, r = n.json, i = r.textures[e] if (!i.extensions || !i.extensions[t]) return null var a = i.extensions[t], o = r.images[a.source], s = n.textureLoader if (o.uri) { var u = n.options.manager.getHandler(o.uri) null !== u && (s = u) } return this.detectSupport().then(function (i) { if (i) return n.loadTextureImage(e, a.source, s) if (r.extensionsRequired && r.extensionsRequired.indexOf(t) >= 0) throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' ) return n.loadTexture(e) }) }, }, { key: 'detectSupport', value: function () { return ( this.isSupported || (this.isSupported = new Promise(function (e) { var t = new Image() ;((t.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'), (t.onload = t.onerror = function () { e(1 === t.height) })) })), this.isSupported ) }, }, ] ) })(), KU = (function () { return T( function e(t) { ;(A(this, e), (this.parser = t), (this.name = LU.EXT_TEXTURE_AVIF), (this.isSupported = null)) }, [ { key: 'loadTexture', value: function (e) { var t = this.name, n = this.parser, r = n.json, i = r.textures[e] if (!i.extensions || !i.extensions[t]) return null var a = i.extensions[t], o = r.images[a.source], s = n.textureLoader if (o.uri) { var u = n.options.manager.getHandler(o.uri) null !== u && (s = u) } return this.detectSupport().then(function (i) { if (i) return n.loadTextureImage(e, a.source, s) if (r.extensionsRequired && r.extensionsRequired.indexOf(t) >= 0) throw new Error( 'THREE.GLTFLoader: AVIF required by asset but unsupported.' ) return n.loadTexture(e) }) }, }, { key: 'detectSupport', value: function () { return ( this.isSupported || (this.isSupported = new Promise(function (e) { var t = new Image() ;((t.src = 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI='), (t.onload = t.onerror = function () { e(1 === t.height) })) })), this.isSupported ) }, }, ] ) })(), ZU = (function () { return T( function e(t) { ;(A(this, e), (this.name = LU.EXT_MESHOPT_COMPRESSION), (this.parser = t)) }, [ { key: 'loadBufferView', value: function (e) { var t = this.parser.json, n = t.bufferViews[e] if (n.extensions && n.extensions[this.name]) { var r = n.extensions[this.name], i = this.parser.getDependency('buffer', r.buffer), a = this.parser.options.meshoptDecoder if (!a || !a.supported) { if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0) throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' ) return null } return i.then(function (e) { var t = r.byteOffset || 0, n = r.byteLength || 0, i = r.count, o = r.byteStride, s = new Uint8Array(e, t, n) return a.decodeGltfBufferAsync ? a.decodeGltfBufferAsync(i, o, s, r.mode, r.filter).then(function (e) { return e.buffer }) : a.ready.then(function () { var e = new ArrayBuffer(i * o) return ( a.decodeGltfBuffer(new Uint8Array(e), i, o, s, r.mode, r.filter), e ) }) }) } return null }, }, ] ) })(), JU = (function () { return T( function e(t) { ;(A(this, e), (this.name = LU.EXT_MESH_GPU_INSTANCING), (this.parser = t)) }, [ { key: 'createNodeMesh', value: function (e) { var t = this, n = this.parser.json, r = n.nodes[e] if (!r.extensions || !r.extensions[this.name] || void 0 === r.mesh) return null var i, a = L(n.meshes[r.mesh].primitives) try { for (a.s(); !(i = a.n()).done; ) { var o = i.value if ( o.mode !== lz.TRIANGLES && o.mode !== lz.TRIANGLE_STRIP && o.mode !== lz.TRIANGLE_FAN && void 0 !== o.mode ) return null } } catch (d) { a.e(d) } finally { a.f() } var s = r.extensions[this.name].attributes, u = [], l = {}, c = function (e) { u.push( t.parser.getDependency('accessor', s[e]).then(function (t) { return ((l[e] = t), l[e]) }) ) } for (var h in s) c(h) return u.length < 1 ? null : (u.push(this.parser.createNodeMesh(e)), Promise.all(u).then(function (e) { var n, r = e.pop(), i = r.isGroup ? r.children : [r], a = e[0].count, o = [], s = L(i) try { for (s.s(); !(n = s.n()).done; ) { for ( var u = n.value, c = new Gh(), h = new ph(), f = new fh(), p = new ph(1, 1, 1), v = new cp(u.geometry, u.material, a), m = 0; m < a; m++ ) (l.TRANSLATION && h.fromBufferAttribute(l.TRANSLATION, m), l.ROTATION && f.fromBufferAttribute(l.ROTATION, m), l.SCALE && p.fromBufferAttribute(l.SCALE, m), v.setMatrixAt(m, c.compose(h, f, p))) for (var g in l) if ('_COLOR_0' === g) { var y = l[g] v.instanceColor = new np(y.array, y.itemSize, y.normalized) } else 'TRANSLATION' !== g && 'ROTATION' !== g && 'SCALE' !== g && u.geometry.setAttribute(g, l[g]) ;(gd.prototype.copy.call(v, u), t.parser.assignFinalMaterial(v), o.push(v)) } } catch (d) { s.e(d) } finally { s.f() } return r.isGroup ? (r.clear(), r.add.apply(r, o), r) : o[0] })) }, }, ] ) })(), $U = 'glTF', ez = 1313821514, tz = 5130562, nz = T(function e(t) { ;(A(this, e), (this.name = LU.KHR_BINARY_GLTF), (this.content = null), (this.body = null)) var n = new DataView(t, 0, 12), r = new TextDecoder() if ( ((this.header = { magic: r.decode(new Uint8Array(t.slice(0, 4))), version: n.getUint32(4, !0), length: n.getUint32(8, !0), }), this.header.magic !== $U) ) throw new Error('THREE.GLTFLoader: Unsupported glTF-Binary header.') if (this.header.version < 2) throw new Error('THREE.GLTFLoader: Legacy binary file detected.') for (var i = this.header.length - 12, a = new DataView(t, 12), o = 0; o < i; ) { var s = a.getUint32(o, !0) o += 4 var u = a.getUint32(o, !0) if (((o += 4), u === ez)) { var l = new Uint8Array(t, 12 + o, s) this.content = r.decode(l) } else if (u === tz) { var c = 12 + o this.body = t.slice(c, c + s) } o += s } if (null === this.content) throw new Error('THREE.GLTFLoader: JSON content not found.') }), rz = (function () { return T( function e(t, n) { if ((A(this, e), !n)) throw new Error('THREE.GLTFLoader: No DRACOLoader instance provided.') ;((this.name = LU.KHR_DRACO_MESH_COMPRESSION), (this.json = t), (this.dracoLoader = n), this.dracoLoader.preload()) }, [ { key: 'decodePrimitive', value: function (e, t) { var n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, u = {} for (var l in a) { var c = pz[l] || l.toLowerCase() o[c] = a[l] } for (var h in e.attributes) { var d = pz[h] || h.toLowerCase() if (void 0 !== a[h]) { var f = n.accessors[e.attributes[h]], p = cz[f.componentType] ;((u[d] = p.name), (s[d] = !0 === f.normalized)) } } return t.getDependency('bufferView', i).then(function (e) { return new Promise(function (t, n) { r.decodeDracoFile( e, function (e) { for (var n in e.attributes) { var r = e.attributes[n], i = s[n] void 0 !== i && (r.normalized = i) } t(e) }, o, u, bc, n ) }) }) }, }, ] ) })(), iz = (function () { return T( function e() { ;(A(this, e), (this.name = LU.KHR_TEXTURE_TRANSFORM)) }, [ { key: 'extendTexture', value: function (e, t) { return (void 0 !== t.texCoord && t.texCoord !== e.channel) || void 0 !== t.offset || void 0 !== t.rotation || void 0 !== t.scale ? ((e = e.clone()), void 0 !== t.texCoord && (e.channel = t.texCoord), void 0 !== t.offset && e.offset.fromArray(t.offset), void 0 !== t.rotation && (e.rotation = t.rotation), void 0 !== t.scale && e.repeat.fromArray(t.scale), (e.needsUpdate = !0), e) : e }, }, ] ) })(), az = T(function e() { ;(A(this, e), (this.name = LU.KHR_MESH_QUANTIZATION)) }), oz = (function (e) { function t(e, n, r, i) { return (A(this, t), y(this, t, [e, n, r, i])) } return ( x(t, e), T(t, [ { key: 'copySampleValue_', value: function (e) { for ( var t = this.resultBuffer, n = this.sampleValues, r = this.valueSize, i = e * r * 3 + r, a = 0; a !== r; a++ ) t[a] = n[i + a] return t }, }, { key: 'interpolate_', value: function (e, t, n, r) { for ( var i = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = 2 * o, u = 3 * o, l = r - t, c = (n - t) / l, h = c * c, d = h * c, f = e * u, p = f - u, v = -2 * d + 3 * h, m = d - h, g = 1 - v, y = m - h + c, _ = 0; _ !== o; _++ ) { var b = a[p + _ + o], x = a[p + _ + s] * l, S = a[f + _ + o], A = a[f + _] * l i[_] = g * b + y * x + v * S + m * A } return i }, }, ]) ) })($p), sz = new fh(), uz = (function (e) { function t() { return (A(this, t), y(this, t, arguments)) } return ( x(t, e), T(t, [ { key: 'interpolate_', value: function (e, r, i, a) { var o = n(t, 'interpolate_', this, 3)([e, r, i, a]) return (sz.fromArray(o).normalize().toArray(o), o) }, }, ]) ) })(oz), lz = { POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, }, cz = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array, }, hz = { 9728: sl, 9729: ll, 9984: 1004, 9985: cl, 9986: ul, 9987: hl }, dz = { 33071: al, 33648: ol, 10497: il }, fz = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, pz = { POSITION: 'position', NORMAL: 'normal', TANGENT: 'tangent', TEXCOORD_0: 'uv', TEXCOORD_1: 'uv1', TEXCOORD_2: 'uv2', TEXCOORD_3: 'uv3', COLOR_0: 'color', WEIGHTS_0: 'skinWeight', JOINTS_0: 'skinIndex', }, vz = { scale: 'scale', translation: 'position', rotation: 'quaternion', weights: 'morphTargetInfluences', }, mz = { CUBICSPLINE: void 0, LINEAR: dc, STEP: hc }, gz = 'OPAQUE', yz = 'MASK', _z = 'BLEND' function bz(e) { return ( void 0 === e.DefaultMaterial && (e.DefaultMaterial = new jp({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: !1, depthTest: !0, side: 0, })), e.DefaultMaterial ) } function xz(e, t, n) { for (var r in n.extensions) void 0 === e[r] && ((t.userData.gltfExtensions = t.userData.gltfExtensions || {}), (t.userData.gltfExtensions[r] = n.extensions[r])) } function Sz(e, t) { void 0 !== t.extras && ('object' === P(t.extras) ? Object.assign(e.userData, t.extras) : console.warn('THREE.GLTFLoader: Ignoring primitive type .extras, ' + t.extras)) } function Az(e, t) { if ((e.updateMorphTargets(), void 0 !== t.weights)) for (var n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n] if (t.extras && Array.isArray(t.extras.targetNames)) { var i = t.extras.targetNames if (e.morphTargetInfluences.length === i.length) { e.morphTargetDictionary = {} for (var a = 0, o = i.length; a < o; a++) e.morphTargetDictionary[i[a]] = a } else console.warn('THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.') } } function wz(e) { var t, n = e.extensions && e.extensions[LU.KHR_DRACO_MESH_COMPRESSION] if ( ((t = n ? 'draco:' + n.bufferView + ':' + n.indices + ':' + Tz(n.attributes) : e.indices + ':' + Tz(e.attributes) + ':' + e.mode), void 0 !== e.targets) ) for (var r = 0, i = e.targets.length; r < i; r++) t += ':' + Tz(e.targets[r]) return t } function Tz(e) { for (var t = '', n = Object.keys(e).sort(), r = 0, i = n.length; r < i; r++) t += n[r] + ':' + e[n[r]] + ';' return t } function Mz(e) { switch (e) { case Int8Array: return 1 / 127 case Uint8Array: return 1 / 255 case Int16Array: return 1 / 32767 case Uint16Array: return 1 / 65535 default: throw new Error('THREE.GLTFLoader: Unsupported normalized accessor component type.') } } var Ez = new Gh(), Cz = (function () { return T( function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} ;(A(this, e), (this.json = t), (this.extensions = {}), (this.plugins = {}), (this.options = n), (this.cache = new PU()), (this.associations = new Map()), (this.primitiveCache = {}), (this.nodeCache = {}), (this.meshCache = { refs: {}, uses: {} }), (this.cameraCache = { refs: {}, uses: {} }), (this.lightCache = { refs: {}, uses: {} }), (this.sourceCache = {}), (this.textureCache = {}), (this.nodeNamesUsed = {})) var r = !1, i = -1, a = !1, o = -1 if ('undefined' != typeof navigator) { var s = navigator.userAgent r = !0 === /^((?!chrome|android).)*safari/i.test(s) var u = s.match(/Version\/(\d+)/) ;((i = r && u ? parseInt(u[1], 10) : -1), (o = (a = s.indexOf('Firefox') > -1) ? s.match(/Firefox\/([0-9]+)\./)[1] : -1)) } ;('undefined' == typeof createImageBitmap || (r && i < 17) || (a && o < 98) ? (this.textureLoader = new xv(this.options.manager)) : (this.textureLoader = new Uv(this.options.manager)), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), (this.fileLoader = new _v(this.options.manager)), this.fileLoader.setResponseType('arraybuffer'), 'use-credentials' === this.options.crossOrigin && this.fileLoader.setWithCredentials(!0)) }, [ { key: 'setExtensions', value: function (e) { this.extensions = e }, }, { key: 'setPlugins', value: function (e) { this.plugins = e }, }, { key: 'parse', value: function (e, t) { var n = this, r = this.json, i = this.extensions ;(this.cache.removeAll(), (this.nodeCache = {}), this._invokeAll(function (e) { return e._markDefs && e._markDefs() }), Promise.all( this._invokeAll(function (e) { return e.beforeRoot && e.beforeRoot() }) ) .then(function () { return Promise.all([ n.getDependencies('scene'), n.getDependencies('animation'), n.getDependencies('camera'), ]) }) .then(function (t) { var a = { scene: t[0][r.scene || 0], scenes: t[0], animations: t[1], cameras: t[2], asset: r.asset, parser: n, userData: {}, } return ( xz(i, a, r), Sz(a, r), Promise.all( n._invokeAll(function (e) { return e.afterRoot && e.afterRoot(a) }) ).then(function () { var t, n = L(a.scenes) try { for (n.s(); !(t = n.n()).done; ) { t.value.updateMatrixWorld() } } catch (r) { n.e(r) } finally { n.f() } e(a) }) ) }) .catch(t)) }, }, { key: '_markDefs', value: function () { for ( var e = this.json.nodes || [], t = this.json.skins || [], n = this.json.meshes || [], r = 0, i = t.length; r < i; r++ ) for (var a = t[r].joints, o = 0, s = a.length; o < s; o++) e[a[o]].isBone = !0 for (var u = 0, l = e.length; u < l; u++) { var c = e[u] ;(void 0 !== c.mesh && (this._addNodeRef(this.meshCache, c.mesh), void 0 !== c.skin && (n[c.mesh].isSkinnedMesh = !0)), void 0 !== c.camera && this._addNodeRef(this.cameraCache, c.camera)) } }, }, { key: '_addNodeRef', value: function (e, t) { void 0 !== t && (void 0 === e.refs[t] && (e.refs[t] = e.uses[t] = 0), e.refs[t]++) }, }, { key: '_getNodeRef', value: function (e, t, n) { var r = this if (e.refs[t] <= 1) return n var i = n.clone(), a = function (e, t) { var n = r.associations.get(e) null != n && r.associations.set(t, n) var i, o = L(e.children.entries()) try { for (o.s(); !(i = o.n()).done; ) { var s = C(i.value, 2), u = s[0], l = s[1] a(l, t.children[u]) } } catch (c) { o.e(c) } finally { o.f() } } return (a(n, i), (i.name += '_instance_' + e.uses[t]++), i) }, }, { key: '_invokeOne', value: function (e) { var t = Object.values(this.plugins) t.push(this) for (var n = 0; n < t.length; n++) { var r = e(t[n]) if (r) return r } return null }, }, { key: '_invokeAll', value: function (e) { var t = Object.values(this.plugins) t.unshift(this) for (var n = [], r = 0; r < t.length; r++) { var i = e(t[r]) i && n.push(i) } return n }, }, { key: 'getDependency', value: function (e, t) { var n = e + ':' + t, r = this.cache.get(n) if (!r) { switch (e) { case 'scene': r = this.loadScene(t) break case 'node': r = this._invokeOne(function (e) { return e.loadNode && e.loadNode(t) }) break case 'mesh': r = this._invokeOne(function (e) { return e.loadMesh && e.loadMesh(t) }) break case 'accessor': r = this.loadAccessor(t) break case 'bufferView': r = this._invokeOne(function (e) { return e.loadBufferView && e.loadBufferView(t) }) break case 'buffer': r = this.loadBuffer(t) break case 'material': r = this._invokeOne(function (e) { return e.loadMaterial && e.loadMaterial(t) }) break case 'texture': r = this._invokeOne(function (e) { return e.loadTexture && e.loadTexture(t) }) break case 'skin': r = this.loadSkin(t) break case 'animation': r = this._invokeOne(function (e) { return e.loadAnimation && e.loadAnimation(t) }) break case 'camera': r = this.loadCamera(t) break default: if ( !(r = this._invokeOne(function (n) { return n != this && n.getDependency && n.getDependency(e, t) })) ) throw new Error('Unknown type: ' + e) } this.cache.add(n, r) } return r }, }, { key: 'getDependencies', value: function (e) { var t = this.cache.get(e) if (!t) { var n = this, r = this.json[e + ('mesh' === e ? 'es' : 's')] || [] ;((t = Promise.all( r.map(function (t, r) { return n.getDependency(e, r) }) )), this.cache.add(e, t)) } return t }, }, { key: 'loadBuffer', value: function (e) { var t = this.json.buffers[e], n = this.fileLoader if (t.type && 'arraybuffer' !== t.type) throw new Error( 'THREE.GLTFLoader: ' + t.type + ' buffer type is not supported.' ) if (void 0 === t.uri && 0 === e) return Promise.resolve(this.extensions[LU.KHR_BINARY_GLTF].body) var r = this.options return new Promise(function (e, i) { n.load(Fv.resolveURL(t.uri, r.path), e, void 0, function () { i(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".')) }) }) }, }, { key: 'loadBufferView', value: function (e) { var t = this.json.bufferViews[e] return this.getDependency('buffer', t.buffer).then(function (e) { var n = t.byteLength || 0, r = t.byteOffset || 0 return e.slice(r, r + n) }) }, }, { key: 'loadAccessor', value: function (e) { var t = this, n = this.json, r = this.json.accessors[e] if (void 0 === r.bufferView && void 0 === r.sparse) { var i = fz[r.type], a = cz[r.componentType], o = !0 === r.normalized, s = new a(r.count * i) return Promise.resolve(new qd(s, i, o)) } var u = [] return ( void 0 !== r.bufferView ? u.push(this.getDependency('bufferView', r.bufferView)) : u.push(null), void 0 !== r.sparse && (u.push(this.getDependency('bufferView', r.sparse.indices.bufferView)), u.push(this.getDependency('bufferView', r.sparse.values.bufferView))), Promise.all(u).then(function (e) { var i, a, o = e[0], s = fz[r.type], u = cz[r.componentType], l = u.BYTES_PER_ELEMENT, c = l * s, h = r.byteOffset || 0, d = void 0 !== r.bufferView ? n.bufferViews[r.bufferView].byteStride : void 0, f = !0 === r.normalized if (d && d !== c) { var p = Math.floor(h / d), v = 'InterleavedBuffer:' + r.bufferView + ':' + r.componentType + ':' + p + ':' + r.count, m = t.cache.get(v) ;(m || ((i = new u(o, p * d, (r.count * d) / l)), (m = new Bf(i, d / l)), t.cache.add(v, m)), (a = new zf(m, s, (h % d) / l, f))) } else ((i = null === o ? new u(r.count * s) : new u(o, h, r.count * s)), (a = new qd(i, s, f))) if (void 0 !== r.sparse) { var g = fz.SCALAR, y = cz[r.sparse.indices.componentType], _ = r.sparse.indices.byteOffset || 0, b = r.sparse.values.byteOffset || 0, x = new y(e[1], _, r.sparse.count * g), S = new u(e[2], b, r.sparse.count * s) ;(null !== o && (a = new qd(a.array.slice(), a.itemSize, a.normalized)), (a.normalized = !1)) for (var A = 0, w = x.length; A < w; A++) { var T = x[A] if ( (a.setX(T, S[A * s]), s >= 2 && a.setY(T, S[A * s + 1]), s >= 3 && a.setZ(T, S[A * s + 2]), s >= 4 && a.setW(T, S[A * s + 3]), s >= 5) ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.' ) } a.normalized = f } return a }) ) }, }, { key: 'loadTexture', value: function (e) { var t = this.json, n = this.options, r = t.textures[e].source, i = t.images[r], a = this.textureLoader if (i.uri) { var o = n.manager.getHandler(i.uri) null !== o && (a = o) } return this.loadTextureImage(e, r, a) }, }, { key: 'loadTextureImage', value: function (e, t, n) { var r = this, i = this.json, a = i.textures[e], o = i.images[t], s = (o.uri || o.bufferView) + ':' + a.sampler if (this.textureCache[s]) return this.textureCache[s] var u = this.loadImageSource(t, n) .then(function (t) { ;((t.flipY = !1), (t.name = a.name || o.name || ''), '' === t.name && 'string' == typeof o.uri && !1 === o.uri.startsWith('data:image/') && (t.name = o.uri)) var n = (i.samplers || {})[a.sampler] || {} return ( (t.magFilter = hz[n.magFilter] || ll), (t.minFilter = hz[n.minFilter] || hl), (t.wrapS = dz[n.wrapS] || il), (t.wrapT = dz[n.wrapT] || il), (t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== sl && t.minFilter !== ll), r.associations.set(t, { textures: e }), t ) }) .catch(function () { return null }) return ((this.textureCache[s] = u), u) }, }, { key: 'loadImageSource', value: function (e, t) { var n = this.json, r = this.options if (void 0 !== this.sourceCache[e]) return this.sourceCache[e].then(function (e) { return e.clone() }) var i = n.images[e], a = self.URL || self.webkitURL, o = i.uri || '', s = !1 if (void 0 !== i.bufferView) o = this.getDependency('bufferView', i.bufferView).then(function (e) { s = !0 var t = new Blob([e], { type: i.mimeType }) return (o = a.createObjectURL(t)) }) else if (void 0 === i.uri) throw new Error( 'THREE.GLTFLoader: Image ' + e + ' is missing URI and bufferView' ) var u = Promise.resolve(o) .then(function (e) { return new Promise(function (n, i) { var a = n ;(!0 === t.isImageBitmapLoader && (a = function (e) { var t = new sh(e) ;((t.needsUpdate = !0), n(t)) }), t.load(Fv.resolveURL(e, r.path), a, void 0, i)) }) }) .then(function (e) { var t return ( !0 === s && a.revokeObjectURL(o), Sz(e, i), (e.userData.mimeType = i.mimeType || ((t = i.uri).search(/\.jpe?g($|\?)/i) > 0 || 0 === t.search(/^data\:image\/jpeg/) ? 'image/jpeg' : t.search(/\.webp($|\?)/i) > 0 || 0 === t.search(/^data\:image\/webp/) ? 'image/webp' : t.search(/\.ktx2($|\?)/i) > 0 || 0 === t.search(/^data\:image\/ktx2/) ? 'image/ktx2' : 'image/png')), e ) }) .catch(function (e) { throw (console.error("THREE.GLTFLoader: Couldn't load texture", o), e) }) return ((this.sourceCache[e] = u), u) }, }, { key: 'assignTexture', value: function (e, t, n, r) { var i = this return this.getDependency('texture', n.index).then(function (a) { if (!a) return null if ( (void 0 !== n.texCoord && n.texCoord > 0 && ((a = a.clone()).channel = n.texCoord), i.extensions[LU.KHR_TEXTURE_TRANSFORM]) ) { var o = void 0 !== n.extensions ? n.extensions[LU.KHR_TEXTURE_TRANSFORM] : void 0 if (o) { var s = i.associations.get(a) ;((a = i.extensions[LU.KHR_TEXTURE_TRANSFORM].extendTexture(a, o)), i.associations.set(a, s)) } } return (void 0 !== r && (a.colorSpace = r), (e[t] = a), a) }) }, }, { key: 'assignFinalMaterial', value: function (e) { var t = e.geometry, n = e.material, r = void 0 === t.attributes.tangent, i = void 0 !== t.attributes.color, a = void 0 === t.attributes.normal if (e.isPoints) { var o = 'PointsMaterial:' + n.uuid, s = this.cache.get(o) ;(s || ((s = new Np()), Ud.prototype.copy.call(s, n), s.color.copy(n.color), (s.map = n.map), (s.sizeAttenuation = !1), this.cache.add(o, s)), (n = s)) } else if (e.isLine) { var u = 'LineBasicMaterial:' + n.uuid, l = this.cache.get(u) ;(l || ((l = new yp()), Ud.prototype.copy.call(l, n), l.color.copy(n.color), (l.map = n.map), this.cache.add(u, l)), (n = l)) } if (r || i || a) { var c = 'ClonedMaterial:' + n.uuid + ':' ;(r && (c += 'derivative-tangents:'), i && (c += 'vertex-colors:'), a && (c += 'flat-shading:')) var h = this.cache.get(c) ;(h || ((h = n.clone()), i && (h.vertexColors = !0), a && (h.flatShading = !0), r && (h.normalScale && (h.normalScale.y *= -1), h.clearcoatNormalScale && (h.clearcoatNormalScale.y *= -1)), this.cache.add(c, h), this.associations.set(h, this.associations.get(n))), (n = h)) } e.material = n }, }, { key: 'getMaterialType', value: function () { return jp }, }, { key: 'loadMaterial', value: function (e) { var t, n = this, r = this.json, i = this.extensions, a = r.materials[e], o = {}, s = [] if ((a.extensions || {})[LU.KHR_MATERIALS_UNLIT]) { var u = i[LU.KHR_MATERIALS_UNLIT] ;((t = u.getMaterialType()), s.push(u.extendParams(o, a, n))) } else { var l = a.pbrMetallicRoughness || {} if ( ((o.color = new Od(1, 1, 1)), (o.opacity = 1), Array.isArray(l.baseColorFactor)) ) { var c = l.baseColorFactor ;(o.color.setRGB(c[0], c[1], c[2], bc), (o.opacity = c[3])) } ;(void 0 !== l.baseColorTexture && s.push(n.assignTexture(o, 'map', l.baseColorTexture, _c)), (o.metalness = void 0 !== l.metallicFactor ? l.metallicFactor : 1), (o.roughness = void 0 !== l.roughnessFactor ? l.roughnessFactor : 1), void 0 !== l.metallicRoughnessTexture && (s.push(n.assignTexture(o, 'metalnessMap', l.metallicRoughnessTexture)), s.push(n.assignTexture(o, 'roughnessMap', l.metallicRoughnessTexture))), (t = this._invokeOne(function (t) { return t.getMaterialType && t.getMaterialType(e) })), s.push( Promise.all( this._invokeAll(function (t) { return t.extendMaterialParams && t.extendMaterialParams(e, o) }) ) )) } !0 === a.doubleSided && (o.side = 2) var h = a.alphaMode || gz if ( (h === _z ? ((o.transparent = !0), (o.depthWrite = !1)) : ((o.transparent = !1), h === yz && (o.alphaTest = void 0 !== a.alphaCutoff ? a.alphaCutoff : 0.5)), void 0 !== a.normalTexture && t !== zd && (s.push(n.assignTexture(o, 'normalMap', a.normalTexture)), (o.normalScale = new Vc(1, 1)), void 0 !== a.normalTexture.scale)) ) { var d = a.normalTexture.scale o.normalScale.set(d, d) } if ( (void 0 !== a.occlusionTexture && t !== zd && (s.push(n.assignTexture(o, 'aoMap', a.occlusionTexture)), void 0 !== a.occlusionTexture.strength && (o.aoMapIntensity = a.occlusionTexture.strength)), void 0 !== a.emissiveFactor && t !== zd) ) { var f = a.emissiveFactor o.emissive = new Od().setRGB(f[0], f[1], f[2], bc) } return ( void 0 !== a.emissiveTexture && t !== zd && s.push(n.assignTexture(o, 'emissiveMap', a.emissiveTexture, _c)), Promise.all(s).then(function () { var r = new t(o) return ( a.name && (r.name = a.name), Sz(r, a), n.associations.set(r, { materials: e }), a.extensions && xz(i, r, a), r ) }) ) }, }, { key: 'createUniqueName', value: function (e) { var t = Zv.sanitizeNodeName(e || '') return t in this.nodeNamesUsed ? t + '_' + ++this.nodeNamesUsed[t] : ((this.nodeNamesUsed[t] = 0), t) }, }, { key: 'loadGeometries', value: function (e) { var t = this, n = this.extensions, r = this.primitiveCache function i(e) { return n[LU.KHR_DRACO_MESH_COMPRESSION] .decodePrimitive(e, t) .then(function (n) { return kz(n, e, t) }) } for (var a = [], o = 0, s = e.length; o < s; o++) { var u = e[o], l = wz(u), c = r[l] if (c) a.push(c.promise) else { var h = void 0 ;((h = u.extensions && u.extensions[LU.KHR_DRACO_MESH_COMPRESSION] ? i(u) : kz(new af(), u, t)), (r[l] = { primitive: u, promise: h }), a.push(h)) } } return Promise.all(a) }, }, { key: 'loadMesh', value: function (e) { for ( var t = this, n = this.json, r = this.extensions, i = n.meshes[e], a = i.primitives, o = [], s = 0, u = a.length; s < u; s++ ) { var l = void 0 === a[s].material ? bz(this.cache) : this.getDependency('material', a[s].material) o.push(l) } return ( o.push(t.loadGeometries(a)), Promise.all(o).then(function (n) { for ( var o = n.slice(0, n.length - 1), s = n[n.length - 1], u = [], l = 0, c = s.length; l < c; l++ ) { var h = s[l], d = a[l], f = void 0, p = o[l] if ( d.mode === lz.TRIANGLES || d.mode === lz.TRIANGLE_STRIP || d.mode === lz.TRIANGLE_FAN || void 0 === d.mode ) (!0 === (f = !0 === i.isSkinnedMesh ? new Kf(h, p) : new gf(h, p)) .isSkinnedMesh && f.normalizeSkinWeights(), d.mode === lz.TRIANGLE_STRIP ? (f.geometry = IU(f.geometry, 1)) : d.mode === lz.TRIANGLE_FAN && (f.geometry = IU(f.geometry, 2))) else if (d.mode === lz.LINES) f = new Rp(h, p) else if (d.mode === lz.LINE_STRIP) f = new Mp(h, p) else if (d.mode === lz.LINE_LOOP) f = new Ip(h, p) else { if (d.mode !== lz.POINTS) throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + d.mode ) f = new Fp(h, p) } ;(Object.keys(f.geometry.morphAttributes).length > 0 && Az(f, i), (f.name = t.createUniqueName(i.name || 'mesh_' + e)), Sz(f, i), d.extensions && xz(r, f, d), t.assignFinalMaterial(f), u.push(f)) } for (var v = 0, m = u.length; v < m; v++) t.associations.set(u[v], { meshes: e, primitives: v }) if (1 === u.length) return (i.extensions && xz(r, u[0], i), u[0]) var g = new Lf() ;(i.extensions && xz(r, g, i), t.associations.set(g, { meshes: e })) for (var y = 0, _ = u.length; y < _; y++) g.add(u[y]) return g }) ) }, }, { key: 'loadCamera', value: function (e) { var t, n = this.json.cameras[e], r = n[n.type] if (r) return ( 'perspective' === n.type ? (t = new kf( zc.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6 )) : 'orthographic' === n.type && (t = new Lv(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Sz(t, n), Promise.resolve(t) ) console.warn('THREE.GLTFLoader: Missing camera parameters.') }, }, { key: 'loadSkin', value: function (e) { for ( var t = this.json.skins[e], n = [], r = 0, i = t.joints.length; r < i; r++ ) n.push(this._loadNodeShallow(t.joints[r])) return ( void 0 !== t.inverseBindMatrices ? n.push(this.getDependency('accessor', t.inverseBindMatrices)) : n.push(null), Promise.all(n).then(function (e) { for ( var n = e.pop(), r = e, i = [], a = [], o = 0, s = r.length; o < s; o++ ) { var u = r[o] if (u) { i.push(u) var l = new Gh() ;(null !== n && l.fromArray(n.array, 16 * o), a.push(l)) } else console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[o] ) } return new tp(i, a) }) ) }, }, { key: 'loadAnimation', value: function (e) { for ( var t = this.json, n = this, r = t.animations[e], i = r.name ? r.name : 'animation_' + e, a = [], o = [], s = [], u = [], l = [], c = 0, h = r.channels.length; c < h; c++ ) { var d = r.channels[c], f = r.samplers[d.sampler], p = d.target, v = p.node, m = void 0 !== r.parameters ? r.parameters[f.input] : f.input, g = void 0 !== r.parameters ? r.parameters[f.output] : f.output void 0 !== p.node && (a.push(this.getDependency('node', v)), o.push(this.getDependency('accessor', m)), s.push(this.getDependency('accessor', g)), u.push(f), l.push(p)) } return Promise.all([ Promise.all(a), Promise.all(o), Promise.all(s), Promise.all(u), Promise.all(l), ]).then(function (e) { for ( var t = e[0], r = e[1], a = e[2], o = e[3], s = e[4], u = [], l = 0, c = t.length; l < c; l++ ) { var h = t[l], d = r[l], f = a[l], p = o[l], v = s[l] if (void 0 !== h) { h.updateMatrix && h.updateMatrix() var m = n._createAnimationTracks(h, d, f, p, v) if (m) for (var g = 0; g < m.length; g++) u.push(m[g]) } } return new hv(i, void 0, u) }) }, }, { key: 'createNodeMesh', value: function (e) { var t = this.json, n = this, r = t.nodes[e] return void 0 === r.mesh ? null : n.getDependency('mesh', r.mesh).then(function (e) { var t = n._getNodeRef(n.meshCache, r.mesh, e) return ( void 0 !== r.weights && t.traverse(function (e) { if (e.isMesh) for (var t = 0, n = r.weights.length; t < n; t++) e.morphTargetInfluences[t] = r.weights[t] }), t ) }) }, }, { key: 'loadNode', value: function (e) { for ( var t = this, n = this.json.nodes[e], r = t._loadNodeShallow(e), i = [], a = n.children || [], o = 0, s = a.length; o < s; o++ ) i.push(t.getDependency('node', a[o])) var u = void 0 === n.skin ? Promise.resolve(null) : t.getDependency('skin', n.skin) return Promise.all([r, Promise.all(i), u]).then(function (e) { var t = e[0], n = e[1], r = e[2] null !== r && t.traverse(function (e) { e.isSkinnedMesh && e.bind(r, Ez) }) for (var i = 0, a = n.length; i < a; i++) t.add(n[i]) return t }) }, }, { key: '_loadNodeShallow', value: function (e) { var t = this.json, n = this.extensions, r = this if (void 0 !== this.nodeCache[e]) return this.nodeCache[e] var i = t.nodes[e], a = i.name ? r.createUniqueName(i.name) : '', o = [], s = r._invokeOne(function (t) { return t.createNodeMesh && t.createNodeMesh(e) }) return ( s && o.push(s), void 0 !== i.camera && o.push( r.getDependency('camera', i.camera).then(function (e) { return r._getNodeRef(r.cameraCache, i.camera, e) }) ), r ._invokeAll(function (t) { return t.createNodeAttachment && t.createNodeAttachment(e) }) .forEach(function (e) { o.push(e) }), (this.nodeCache[e] = Promise.all(o).then(function (t) { var o if ( (o = !0 === i.isBone ? new Zf() : t.length > 1 ? new Lf() : 1 === t.length ? t[0] : new gd()) !== t[0] ) for (var s = 0, u = t.length; s < u; s++) o.add(t[s]) if ( (i.name && ((o.userData.name = i.name), (o.name = a)), Sz(o, i), i.extensions && xz(n, o, i), void 0 !== i.matrix) ) { var l = new Gh() ;(l.fromArray(i.matrix), o.applyMatrix4(l)) } else (void 0 !== i.translation && o.position.fromArray(i.translation), void 0 !== i.rotation && o.quaternion.fromArray(i.rotation), void 0 !== i.scale && o.scale.fromArray(i.scale)) return ( r.associations.has(o) || r.associations.set(o, {}), (r.associations.get(o).nodes = e), o ) })), this.nodeCache[e] ) }, }, { key: 'loadScene', value: function (e) { var t = this.extensions, n = this.json.scenes[e], r = this, i = new Lf() ;(n.name && (i.name = r.createUniqueName(n.name)), Sz(i, n), n.extensions && xz(t, i, n)) for (var a = n.nodes || [], o = [], s = 0, u = a.length; s < u; s++) o.push(r.getDependency('node', a[s])) return Promise.all(o).then(function (e) { for (var t = 0, n = e.length; t < n; t++) i.add(e[t]) return ( (r.associations = (function (e) { var t, n = new Map(), i = L(r.associations) try { for (i.s(); !(t = i.n()).done; ) { var a = C(t.value, 2), o = a[0], s = a[1] ;(o instanceof Ud || o instanceof sh) && n.set(o, s) } } catch (u) { i.e(u) } finally { i.f() } return ( e.traverse(function (e) { var t = r.associations.get(e) null != t && n.set(e, t) }), n ) })(i)), i ) }) }, }, { key: '_createAnimationTracks', value: function (e, t, n, r, i) { var a, o = [], s = e.name ? e.name : e.uuid, u = [] switch ( (vz[i.path] === vz.weights ? e.traverse(function (e) { e.morphTargetInfluences && u.push(e.name ? e.name : e.uuid) }) : u.push(s), vz[i.path]) ) { case vz.weights: a = ov break case vz.rotation: a = uv break case vz.position: case vz.scale: a = cv break default: if (1 === n.itemSize) a = ov else a = cv } for ( var l = void 0 !== r.interpolation ? mz[r.interpolation] : dc, c = this._getArrayFromAccessor(n), h = 0, d = u.length; h < d; h++ ) { var f = new a(u[h] + '.' + vz[i.path], t.array, c, l) ;('CUBICSPLINE' === r.interpolation && this._createCubicSplineTrackInterpolant(f), o.push(f)) } return o }, }, { key: '_getArrayFromAccessor', value: function (e) { var t = e.array if (e.normalized) { for ( var n = Mz(t.constructor), r = new Float32Array(t.length), i = 0, a = t.length; i < a; i++ ) r[i] = t[i] * n t = r } return t }, }, { key: '_createCubicSplineTrackInterpolant', value: function (e) { ;((e.createInterpolant = function (e) { return new (this instanceof uv ? uz : oz)( this.times, this.values, this.getValueSize() / 3, e ) }), (e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0)) }, }, ] ) })() function kz(e, t, n) { var r = t.attributes, i = [] function a(t, r) { return n.getDependency('accessor', t).then(function (t) { e.setAttribute(r, t) }) } for (var o in r) { var s = pz[o] || o.toLowerCase() s in e.attributes || i.push(a(r[o], s)) } if (void 0 !== t.indices && !e.index) { var u = n.getDependency('accessor', t.indices).then(function (t) { e.setIndex(t) }) i.push(u) } return ( $c.workingColorSpace !== bc && 'COLOR_0' in r && console.warn( 'THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat( $c.workingColorSpace, '" not supported.' ) ), Sz(e, t), (function (e, t, n) { var r = t.attributes, i = new gh() if (void 0 !== r.POSITION) { var a = n.json.accessors[r.POSITION], o = a.min, s = a.max if (void 0 !== o && void 0 !== s) { if ((i.set(new ph(o[0], o[1], o[2]), new ph(s[0], s[1], s[2])), a.normalized)) { var u = Mz(cz[a.componentType]) ;(i.min.multiplyScalar(u), i.max.multiplyScalar(u)) } var l = t.targets if (void 0 !== l) { for (var c = new ph(), h = new ph(), d = 0, f = l.length; d < f; d++) { var p = l[d] if (void 0 !== p.POSITION) { var v = n.json.accessors[p.POSITION], m = v.min, g = v.max if (void 0 !== m && void 0 !== g) { if ( (h.setX(Math.max(Math.abs(m[0]), Math.abs(g[0]))), h.setY(Math.max(Math.abs(m[1]), Math.abs(g[1]))), h.setZ(Math.max(Math.abs(m[2]), Math.abs(g[2]))), v.normalized) ) { var y = Mz(cz[v.componentType]) h.multiplyScalar(y) } c.max(h) } else console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ) } } i.expandByVector(c) } e.boundingBox = i var _ = new Dh() ;(i.getCenter(_.center), (_.radius = i.min.distanceTo(i.max) / 2), (e.boundingSphere = _)) } else console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ) } })(e, t, n), Promise.all(i).then(function () { return void 0 !== t.targets ? (function (e, t, n) { for (var r = !1, i = !1, a = !1, o = 0, s = t.length; o < s; o++) { var u = t[o] if ( (void 0 !== u.POSITION && (r = !0), void 0 !== u.NORMAL && (i = !0), void 0 !== u.COLOR_0 && (a = !0), r && i && a) ) break } if (!r && !i && !a) return Promise.resolve(e) for (var l = [], c = [], h = [], d = 0, f = t.length; d < f; d++) { var p = t[d] if (r) { var v = void 0 !== p.POSITION ? n.getDependency('accessor', p.POSITION) : e.attributes.position l.push(v) } if (i) { var m = void 0 !== p.NORMAL ? n.getDependency('accessor', p.NORMAL) : e.attributes.normal c.push(m) } if (a) { var g = void 0 !== p.COLOR_0 ? n.getDependency('accessor', p.COLOR_0) : e.attributes.color h.push(g) } } return Promise.all([Promise.all(l), Promise.all(c), Promise.all(h)]).then( function (t) { var n = t[0], o = t[1], s = t[2] return ( r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), (e.morphTargetsRelative = !0), e ) } ) })(e, t.targets, n) : e }) ) } var Rz = { offset: { browDownLeft: 0, browDownRight: 0, browInnerUp: 0, browOuterUpLeft: 0, browOuterUpRight: 0, cheekPuff: 0, cheekSquintLeft: 0, cheekSquintRight: 0, eyeBlinkLeft: 0, eyeBlinkRight: 0, eyeLookDownLeft: 0, eyeLookDownRight: 0, eyeLookInLeft: 0, eyeLookInRight: 0, eyeLookOutLeft: 0, eyeLookOutRight: 0, eyeLookUpLeft: 0, eyeLookUpRight: 0, eyeSquintLeft: 0, eyeSquintRight: 0, eyeWideLeft: 0, eyeWideRight: 0, jawForward: 0, jawLeft: 0, jawOpen: 0, jawRight: 0, mouthClose: 0, mouthDimpleLeft: 0, mouthDimpleRight: 0, mouthFrownLeft: 0, mouthFrownRight: 0, mouthFunnel: 0, mouthLeft: 0, mouthLowerDownLeft: 0, mouthLowerDownRight: 0, mouthPressLeft: 0, mouthPressRight: 0, mouthPucker: 0, mouthRight: 0, mouthRollLower: 0, mouthRollUpper: 0, mouthShrugLower: 0, mouthShrugUpper: 0, mouthSmileLeft: 0, mouthSmileRight: 0, mouthStretchLeft: 0, mouthStretchRight: 0, mouthUpperUpLeft: 0, mouthUpperUpRight: 0, noseSneerLeft: 0, noseSneerRight: 0, tongueOut: 0, }, scale: { browDownLeft: 1, browDownRight: 1, browInnerUp: 1, browOuterUpLeft: 1, browOuterUpRight: 1, cheekPuff: 1, cheekSquintLeft: 1, cheekSquintRight: 1, eyeBlinkLeft: 1, eyeBlinkRight: 1, eyeLookDownLeft: 1, eyeLookDownRight: 1, eyeLookInLeft: 1, eyeLookInRight: 1, eyeLookOutLeft: 1, eyeLookOutRight: 1, eyeLookUpLeft: 1, eyeLookUpRight: 1, eyeSquintLeft: 1, eyeSquintRight: 1, eyeWideLeft: 1, eyeWideRight: 1, jawForward: 1, jawLeft: 1, jawOpen: 1.2, jawRight: 1, mouthClose: 0.2, mouthDimpleLeft: 1.3, mouthDimpleRight: 1.3, mouthFrownLeft: 1.3, mouthFrownRight: 1.3, mouthFunnel: 1.3, mouthLeft: 1.3, mouthLowerDownLeft: 0.7, mouthLowerDownRight: 0.7, mouthPressLeft: 1.3, mouthPressRight: 1.3, mouthPucker: 1, mouthRight: 1.3, mouthRollLower: 1.3, mouthRollUpper: 1.3, mouthShrugLower: 1.3, mouthShrugUpper: 0.1, mouthSmileLeft: 1, mouthSmileRight: 1, mouthStretchLeft: 1.3, mouthStretchRight: 1.3, mouthUpperUpLeft: 1.3, mouthUpperUpRight: 1.3, noseSneerLeft: 1, noseSneerRight: 1, tongueOut: 1, }, }, Iz = { hello: { size: 2, isGroup: !1 }, idle: { size: 1, isGroup: !1 }, listen: { size: 0, isGroup: !1 }, speak: { size: 6, isGroup: !1 }, think: { size: 3, isGroup: !0 }, other: [], }, Nz = { x: 0, y: 1.8, z: 1 }, Pz = { x: -10, y: 0, z: 0 }, Lz = '0xffffff', Dz = 'false', Oz = (function () { function e(t, n) { ;(A(this, e), (this.zipUrls = { urls: new Map() }), (this.useFlame = !1), (this.lastTime = 0), (this.startTime = 0), (this.expressionData = {}), (this.chatState = gU.Idle), Object.assign(this.zipUrls, { zip: n })) var r = t.getBoundingClientRect(), i = r.width, a = r.height ;((e._canvas.style.visibility = 'visible'), (e._canvas.width = i), (e._canvas.height = a), t.appendChild(e._canvas), (this.clock = new Vv()), (this.startTime = performance.now() / 1e3)) } return T( e, [ { key: 'dispose', value: function () { ;((e._canvas.style.visibility = 'hidden'), this.disposeModel(), this.zipUrls.urls.forEach(function (e) { URL.revokeObjectURL(e) })) }, }, { key: 'disposeModel', value: function () { var e, t ;(this.mixer && (this.mixer.stopAllAction(), this.viewer && this.viewer.avatarMesh && this.mixer.uncacheRoot(this.viewer.avatarMesh), (this.mixer = void 0), null === (e = this.animManager) || void 0 === e || e.dispose()), null === (t = this.viewer) || void 0 === t || t.dispose()) }, }, { key: 'getCamera', value: function () { var e return null === (e = this.viewer) || void 0 === e ? void 0 : e.camera }, }, { key: 'updateBS', value: function (e) { var t = { browDownLeft: 0, browDownRight: 0, browInnerUp: 0, browOuterUpLeft: 0, browOuterUpRight: 0, mouthCheekPuff: 0, cheekSquintLeft: 0, cheekSquintRight: 0, eyeBlinkLeft: 0, eyeBlinkRight: 0, eyeLookDownLeft: 0, eyeLookDownRight: 0, eyeLookInLeft: 0, eyeLookInRight: 0, eyeLookOutLeft: 0, eyeLookOutRight: 0, eyeLookUpLeft: 0, eyeLookUpRight: 0, eyeSquintLeft: 0, eyeSquintRight: 0, eyeWideLeft: 0, eyeWideRight: 0, jawForward: 0, jawLeft: 0, jawOpen: 0, jawRight: 0, mouthClose: 0, mouthDimpleLeft: 0, mouthDimpleRight: 0, mouthFrownLeft: 0, mouthFrownRight: 0, mouthFunnel: 0, mouthLeft: 0, mouthLowerDownLeft: 0, mouthLowerDownRight: 0, mouthPressLeft: 0, mouthPressRight: 0, mouthPucker: 0, mouthRight: 0, mouthRollLower: 0, mouthRollUpper: 0, mouthShrugLower: 0, mouthShrugUpper: 0, mouthSmileLeft: 0, mouthSmileRight: 0, mouthStretchLeft: 0, mouthStretchRight: 0, mouthUpperUpLeft: 0, mouthUpperUpRight: 0, noseSneerLeft: 0, noseSneerRight: 0, tongueOut: 0, } return (null != e && (t = e), t) }, }, { key: 'render', value: function () { var e, t = this if (!this.viewer || !this.viewer.selfDrivenMode) throw new Error('Cannot start viewer unless it is in self driven mode.') if (this.viewer.webXRMode) this.viewer.renderer.setAnimationLoop(this.viewer.selfDrivenUpdateFunc) else { this.viewer.requestFrameId = requestAnimationFrame(function () { return t.render() }) var n = 1 / 30, r = (performance.now() / 1e3 - this.startTime) % (this.viewer.totalFrames * n), i = Math.floor(r / n) if ( ((this.viewer.frame = i), this.getChatState && ((this.chatState = this.getChatState()), null === (e = this.animManager) || void 0 === e || e.update(this.chatState)), this.getExpressionData && (this.expressionData = this.updateBS(this.getExpressionData())), 0 == this.viewer.useFlame) ) { if (!this.mixer || !this.animManager) return var a = this.clock.getDelta() if ((this.mixer.update(a), this.motioncfg)) for (var o in this.expressionData) { var s = this.motioncfg.offset[o], u = this.motioncfg.scale[o] void 0 !== s && void 0 !== u && (this.expressionData[o] = this.expressionData[o] * u + s) } this.setExpression() } ;(this.viewer.update(this.viewer.renderer, this.viewer.camera), this.viewer.shouldRender() ? (this.viewer.render(), this.viewer.consecutiveRenderFrames++) : (this.viewer.consecutiveRenderFrames = 0), (this.viewer.renderNextFrame = !1)) } this.viewer.selfDrivenModeRunning = !0 }, }, { key: 'isHexColorStrict', value: function (e) { if ('string' != typeof e) return !1 return /^(#|0x)[0-9A-Fa-f]{6}$/i.test(e) }, }, { key: 'setExpression', value: function () { var e = this ;(this.viewer && this.viewer.splatMesh && (this.viewer.splatMesh.bsWeight = this.expressionData), this.model && this.model.traverse(function (t) { if (t.isMesh || t.isSkinnedMesh) { var n = t.geometry.morphAttributes if (!0 === Object.keys(n).length > 0) { var r = t.morphTargetDictionary for (var i in r) { var a = r[i], o = e.expressionData[i] void 0 !== o && (t.morphTargetInfluences[a] = Math.max(0, Math.min(1, o))) } } } })) }, }, { key: 'loadFlameModel', value: function (e, t) { return QO( this, void 0, void 0, d().m(function n() { var r, i, a, o, s, u, l, c, h return d().w( function (n) { for (;;) switch (n.n) { case 0: return ( (n.n = 1), Promise.all([ this.unpackAndLoadGlb(e + '/skin.glb'), this.unpackAndLoadJson(e + '/lbs_weight_20k.json'), this.unpackAndLoadJson(e + '/flame_params.json'), this.unpackAndLoadJson(e + '/vertex_order.json'), this.unpackAndLoadJson(e + '/bone_tree.json'), ]) ) case 1: if ( ((r = n.v), (i = C(r, 5)), (a = i[0]), (o = i[1]), (s = i[2]), (u = i[3]), (l = i[4]), this.viewer) ) { n.n = 2 break } throw new Error('render viewer is not initialized') case 2: ;(a.traverse(function (e) { ;(e.isSkinnedMesh && (c = e), e instanceof Zf && 'hip' == e.name && (h = e)) }), (this.viewer.sortedIndexes = u), (this.viewer.flame_params = s), (this.viewer.lbs_weight_80k = o), (this.viewer.bone_tree = l), (this.viewer.totalFrames = s.expr.length), null != c && (this.viewer.gaussianSplatCount = c.geometry.attributes.position.count), (this.viewer.avatarMesh = a), (this.viewer.skinModel = c), (this.viewer.boneRoot = h), (this.motioncfg = t), null != c && this.viewer.updateMorphTarget(c), this.viewer.threeScene.add(a), (a.visible = !1), null != c && c.skeleton.computeBoneTexture()) case 3: return n.a(2) } }, n, this ) }) ) }, }, { key: 'loadModel', value: function (e, t, n) { return QO( this, void 0, void 0, d().m(function r() { var i, a, o, s, u, l, c return d().w( function (r) { for (;;) switch (r.n) { case 0: return ( (r.n = 1), Promise.all([ this.unpackAndLoadGlb(e + '/skin.glb'), this.unpackAndLoadGlb(e + '/animation.glb'), this.unpackAndLoadJson(e + '/vertex_order.json'), ]) ) case 1: if ( ((i = r.v), (a = C(i, 3)), (o = a[0]), (s = a[1]), (u = a[2]), this.viewer) ) { r.n = 2 break } throw new Error('render viewer is not initialized') case 2: ;(o.traverse(function (e) { ;(e.isSkinnedMesh && (l = e), e instanceof Zf && 'hip' == e.name && (c = e)) }), (this.viewer.sortedIndexes = u), null != l && (this.viewer.gaussianSplatCount = l.geometry.attributes.position.count), (this.viewer.avatarMesh = o), (this.viewer.skinModel = l), (this.viewer.boneRoot = c), (this.mixer = new em(o)), (this.animManager = new wU(this.mixer, s, t)), (this.motioncfg = n), null != l && this.viewer.updateMorphTarget(l), this.viewer.threeScene.add(o), (o.visible = !1), null != l && l.skeleton.computeBoneTexture()) case 3: return r.a(2) } }, r, this ) }) ) }, }, { key: 'unpackFileAsBlob', value: function (e) { var t, n return QO( this, void 0, void 0, d().m(function r() { var i, a return d().w( function (r) { for (;;) switch (r.n) { case 0: if (this.zipUrls.urls.has(e)) { r.n = 2 break } return ( (r.n = 1), null === (n = null === (t = this.zipUrls.zip) || void 0 === t ? void 0 : t.file(e)) || void 0 === n ? void 0 : n.async('blob') ) case 1: ;((i = r.v), (a = URL.createObjectURL(i)), this.zipUrls.urls.set(e, a)) case 2: return r.a(2, this.zipUrls.urls.get(e)) } }, r, this ) }) ) }, }, { key: 'unpackAndLoadGlb', value: function (e) { var t, n return QO( this, void 0, void 0, d().m(function r() { var i, a, o return d().w( function (r) { for (;;) switch (r.n) { case 0: if (this.zipUrls.urls.has(e)) { r.n = 2 break } return ( (r.n = 1), null === (n = null === (t = this.zipUrls.zip) || void 0 === t ? void 0 : t.file(e)) || void 0 === n ? void 0 : n.async('arraybuffer') ) case 1: ;((i = r.v), (a = new Blob([i], { type: 'model/gltf-binary' })), (o = URL.createObjectURL(a)), this.zipUrls.urls.set(e, o)) case 2: return r.a(2, this.LoadGLTF(this.zipUrls.urls.get(e))) } }, r, this ) }) ) }, }, { key: 'unpackAndLoadJson', value: function (e) { var t, n return QO( this, void 0, void 0, d().m(function r() { var i return d().w( function (r) { for (;;) switch (r.n) { case 0: return ( (r.n = 1), null === (n = null === (t = this.zipUrls.zip) || void 0 === t ? void 0 : t.file(e)) || void 0 === n ? void 0 : n.async('string') ) case 1: return ((i = r.v), r.a(2, JSON.parse(i))) } }, r, this ) }) ) }, }, { key: 'LoadGLTF', value: function (e) { return QO( this, void 0, void 0, d().m(function t() { return d().w(function (t) { for (;;) if (0 === t.n) return t.a( 2, new Promise(function (t, n) { new NU(void 0).load( e, function (e) { e.animations.length > 0 ? t(e.animations) : t(e.scene) }, void 0, function (e) { n(e) } ) }) ) }, t) }) ) }, }, ], [ { key: 'getInstance', value: function (t, n, r) { var i, a, o, s, u, l return QO( this, void 0, void 0, d().m(function c() { var h, f, p, v, m, g, y, _, b, x, S, A, w, T return d().w( function (c) { for (;;) switch (c.n) { case 0: if (null == this.instance) { c.n = 1 break } return c.a(2, this.instance) case 1: if ( ((c.p = 1), (f = vU((h = n))), (p = f.pathname), (v = p.match(/\/([^/]+?)\.zip/)), v && v[1]) ) { c.n = 2 break } throw new Error('character model is not found') case 2: return ( AU.start(), (c.n = 3), eU.get(h, { responseType: 'arraybuffer', timeout: 1e5, onDownloadProgress: function (e) { if (e.lengthComputable && e && e.total) { var t = e.loaded / e.total ;(AU.set(t), (null == r ? void 0 : r.downloadProgress) && (null == r || r.downloadProgress(t))) } }, }) ) case 3: return ( (m = c.v), (null == r ? void 0 : r.loadProgress) && (null == r || r.loadProgress(0.1)), AU.done(), console.log('download completed:', m.data), (g = m.data), (c.n = 4), uU.loadAsync(g) ) case 4: if ( ((y = c.v), (_ = ''), Object.values(y.files).forEach(function (e) { var t, n e.dir && (_ = null === (t = e.name) || void 0 === t ? void 0 : t.slice( 0, (null === (n = e.name) || void 0 === n ? void 0 : n.length) - 1 )) }), _) ) { c.n = 5 break } throw new Error('file fold is not found') case 5: if ( ((b = new e(t, y)), ((x = new ph()).x = (null === (i = Nz) || void 0 === i ? void 0 : i.x) || 0), (x.y = (null === (a = Nz) || void 0 === a ? void 0 : a.y) || 0), (x.z = (null === (o = Nz) || void 0 === o ? void 0 : o.z) || 1), ((S = new ph()).x = (null === (s = Pz) || void 0 === s ? void 0 : s.x) || 0), (S.y = (null === (u = Pz) || void 0 === u ? void 0 : u.y) || 0), (S.z = (null === (l = Pz) || void 0 === l ? void 0 : l.z) || 0), (A = 16777215), Lz && (A = parseInt(Lz, 16)), r && r.backgroundColor && b.isHexColorStrict(r.backgroundColor) && (A = parseInt(r.backgroundColor, 16)), (b.getChatState = null == r ? void 0 : r.getChatState), (b.getExpressionData = null == r ? void 0 : r.getExpressionData), Dz && (b.useFlame = 'false' != Dz), console.log(x, A), (b.viewer = new jO({ rootElement: t, threejsCanvas: e._canvas, cameraUp: [0, 1, 0], initialCameraPosition: [x.x, x.y, x.z], initialCameraRotation: [S.x, S.y, S.z], sphericalHarmonicsDegree: 0, backgroundColor: A, })), (b.viewer.useFlame = b.useFlame), 1 != b.viewer.useFlame) ) { c.n = 7 break } return ((c.n = 6), b.loadFlameModel(_, Rz)) case 6: c.n = 8 break case 7: return ((c.n = 8), b.loadModel(_, Iz, Rz)) case 8: return ( (null == r ? void 0 : r.loadProgress) && (null == r || r.loadProgress(0.2)), (c.n = 9), b.unpackFileAsBlob(_ + '/offset.ply') ) case 9: return ( (w = c.v), (null == r ? void 0 : r.loadProgress) && (null == r || r.loadProgress(0.3)), b.viewer .addSplatScene(w, { progressiveLoad: !0, sharedMemoryForWorkers: !1, showLoadingUI: !1, format: ax, }) .then(function () { ;(b.render(), (null == r ? void 0 : r.loadProgress) && (null == r || r.loadProgress(1))) }), c.a(2, b) ) case 10: ;((c.p = 10), (T = c.v), console.error(T)) case 11: return c.a(2) } }, c, this, [[1, 10]] ) }) ) }, }, ] ) })() Oz._canvas = document.createElement('canvas') var Fz = (function (e) { function t(e) { var n A(this, t) var r = e.container, i = e.assetsPath, a = e.ws, o = e.downloadProgress, s = e.loadProgress return ( M((n = y(this, t)), '_avatarDivEle', void 0), M(n, '_assetsPath', ''), M(n, '_ws', void 0), M(n, '_downloadProgress', void 0), M(n, '_loadProgress', void 0), M(n, '_loadPercent', 0), M(n, '_downloadPercent', 0), M(n, '_processor', void 0), M(n, '_renderer', void 0), M(n, '_audioMute', !1), M(n, 'curState', vs.Idle), (n._avatarDivEle = r), (n._assetsPath = i), (n._ws = a), (n._downloadProgress = o ? function (e) { ;((n._downloadPercent = e), o(e)) } : function (e) { n._downloadPercent = e }), (n._loadProgress = s ? function (e) { ;((n._loadPercent = e), s(e)) } : function (e) { n._loadPercent = e }), n._init(), n ) } return ( x(t, e), T(t, [ { key: '_init', value: function () { if (!this._avatarDivEle || !this._assetsPath || !this._ws) throw new Error( 'Lack of necessary initialization parameters for gaussian render' ) ;((this._processor = new Tu(this)), this._bindEventTypes()) }, }, { key: 'start', value: function () { ;(this.getData(), this.render()) }, }, { key: 'getData', value: ((r = v( d().m(function e() { var t = this return d().w( function (e) { for (;;) switch (e.n) { case 0: this._ws.on(hs.WS_MESSAGE, function (e) { t._downloadPercent < 1 || t._loadPercent < 1 || (t.emit(cs.MessageReceived, t.curState), t._processor.add({ avatar_motion_data: { first_package: !0, segment_num: 1, binary_size: e.size, use_binary_frame: !1, }, }), t._processor.add({ avatar_motion_data: { first_package: !1, motion_data_slice: e, is_audio_mute: t._audioMute, }, })) }) case 1: return e.a(2) } }, e, this ) }) )), function () { return r.apply(this, arguments) }), }, { key: 'render', value: ((n = v( d().m(function e() { return d().w( function (e) { for (;;) switch (e.n) { case 0: return ( (e.n = 1), Oz.getInstance(this._avatarDivEle, this._assetsPath, { getChatState: this.getChatState.bind(this), getExpressionData: this.getArkitFaceFrame.bind(this), downloadProgress: this._downloadProgress.bind(this), loadProgress: this._loadProgress.bind(this), }) ) case 1: this._renderer = e.v case 2: return e.a(2) } }, e, this ) }) )), function () { return n.apply(this, arguments) }), }, { key: 'setAvatarMute', value: function (e) { ;(this._processor.setMute(e), (this._audioMute = e)) }, }, { key: 'getChatState', value: function () { return this.curState }, }, { key: 'getArkitFaceFrame', value: function () { var e return null === (e = this._processor) || void 0 === e ? void 0 : e.getArkitFaceFrame().arkitFace }, }, { key: 'interrupt', value: function () { var e ;(this._ws.send('%interrupt%'), null === (e = this._processor) || void 0 === e || e.interrupt(), (this.curState = vs.Idle), this.emit(cs.StateChanged, this.curState)) }, }, { key: 'sendSpeech', value: function (e) { var t ;(this._ws.send(e), (this.curState = vs.Listening), this.emit(cs.StateChanged, this.curState), null === (t = this._processor) || void 0 === t || t.clear()) }, }, { key: 'exit', value: function () { var e, t ;(null === (e = this._renderer) || void 0 === e || e.dispose(), (this.curState = vs.Idle), (this._downloadPercent = 0), (this._loadPercent = 0), null === (t = this._processor) || void 0 === t || t.clear(), this.removeAllListeners()) }, }, { key: '_bindEventTypes', value: function () { var e = this ;(this.on(ds.Player_StartSpeaking, function (t) { ;(console.log('startSpeach'), (e.curState = vs.Responding), e.emit(cs.StateChanged, e.curState), e._ws.send( JSON.stringify({ header: { name: cs.StartSpeech }, payload: {} }) )) }), this.on(ds.Player_EndSpeaking, function (t) { ;(console.log('endSpeach'), (e.curState = vs.Idle), e.emit(cs.StateChanged, e.curState), e._ws.send( JSON.stringify({ header: { name: cs.EndSpeech }, payload: {} }) )) }), this.on(cs.ErrorReceived, function (t) { ;(console.log('ErrorReceived', t), (e.curState = vs.Idle), e.emit(cs.StateChanged, e.curState), e._ws.send( JSON.stringify({ header: { name: cs.ErrorReceived }, payload: s({}, t), }) )) }), this._ws.on(hs.WS_CLOSE, function () { e.exit() })) }, }, ]) ) var n, r })(ls) function Bz() { return navigator.mediaDevices.enumerateDevices() } function Uz(e, t, n) { return zz.apply(this, arguments) } function zz() { return ( (zz = v( d().m(function e(t, n, r) { var i, a, o return d().w(function (e) { for (;;) if (0 === e.n) return ( (i = (null == r ? void 0 : r.video) || r || { width: { ideal: 500 }, height: { ideal: 500 } }), (a = (null == r ? void 0 : r.audio) || r || { echoCancellation: !0, noiseSuppression: !0, autoGainControl: !0, }), (o = { video: 'object' === P(n) ? s(s({}, n), i) : n, audio: 'object' === P(t) ? s(s({}, t), a) : t, }), console.log(o, 'constraints'), e.a( 2, navigator.mediaDevices.getUserMedia(o).then(function (e) { return (console.log(e), e) }) ) ) }, e) }) )), zz.apply(this, arguments) ) } function Vz(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'videoinput' return e.filter(function (e) { return e.kind === t }) } var Hz = null, Wz = null function Gz() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = document.createElement('canvas') ;(document.body.appendChild(n), (n.width = e || 500), (n.height = t || 500), (n.style.width = '1px'), (n.style.height = '1px'), (n.style.position = 'fixed'), (n.style.visibility = 'hidden')) var r = n.getContext('2d') ;((r.fillStyle = 'hsl(0,0, 0, 1)'), r.fillRect(0, 0, n.width, n.height), (function e() { ;((r.fillStyle = 'rgb(255, 255, 255)'), r.fillRect(0, 0, n.width, n.height), requestAnimationFrame(e)) })()) var i = n.captureStream(30) return ( ((Hz = i.getVideoTracks()[0]).stop = function () { n.remove() }), (Hz.onended = function () { var e null === (e = Hz) || void 0 === e || e.stop() }), Hz ) } function jz() { if (Wz) return Wz var e = new (window.AudioContext || window.webkitAudioContext)(), t = e.createOscillator() t.frequency.setValueAtTime(0, e.currentTime) var n = e.createGain() n.gain.setValueAtTime(0, e.currentTime) var r = e.createMediaStreamDestination() return ( t.connect(n), n.connect(r), t.start(), ((Wz = r.stream.getAudioTracks()[0]).stop = function () { e.close() }), (Wz.onended = function () { var e null === (e = Wz) || void 0 === e || e.stop() }), Wz ) } function Qz(e) { ;(console.debug('Stopping peer connection'), e.getTransceivers && e.getTransceivers().forEach(function (e) { e.stop && e.stop() }), e.getSenders() && e.getSenders().forEach(function (e) { ;(console.log('sender', e), e.track && e.track.stop && e.track.stop()) }), setTimeout(function () { e.close() }, 500)) } function qz(e, t, n) { return Xz.apply(this, arguments) } function Xz() { return ( (Xz = v( d().m(function e(t, n, r) { var i, a, o, s, u return d().w(function (e) { for (;;) switch (e.n) { case 0: return ( t.getTracks().forEach( (function () { var e = v( d().m(function e(r) { return d().w(function (e) { for (;;) switch (e.n) { case 0: n.addTrack(r, t) case 1: return e.a(2) } }, e) }) ) return function (t) { return e.apply(this, arguments) } })() ), n.addEventListener('track', function (e) { r && r.srcObject !== e.streams[0] && (r.srcObject = e.streams[0]) }), (i = n.createDataChannel('text')), (e.n = 1), n.createOffer() ) case 1: return ((a = e.v), (e.n = 2), n.setLocalDescription(a)) case 2: return ( (o = Math.random().toString(36).substring(7)), (n.onicecandidate = function (e) { var t = e.candidate t && (console.debug('Sending ICE candidate', t), fetch('/webrtc/offer', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ candidate: t.toJSON(), webrtc_id: o, type: 'ice-candidate', }), })) }), (e.n = 3), fetch('/webrtc/offer', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sdp: a.sdp, type: a.type, webrtc_id: o }), }) ) case 3: return ((s = e.v), (e.n = 4), s.json()) case 4: return ((u = e.v), (e.n = 5), n.setRemoteDescription(u)) case 5: return e.a(2, [i, o]) } }, e) }) )), Xz.apply(this, arguments) ) } function Yz(e) { return ( (Yz = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e }), Yz(e) ) } function Kz(e) { var t = (function (e, t) { if ('object' != Yz(e) || !e) return e var n = e[Symbol.toPrimitive] if (void 0 !== n) { var r = n.call(e, t) if ('object' != Yz(r)) return r throw new TypeError('@@toPrimitive must return a primitive value.') } return ('string' === t ? String : Number)(e) })(e, 'string') return 'symbol' == Yz(t) ? t : t + '' } function Zz(e, t, n) { return ( (t = Kz(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } function Jz(e, t) { var n = Object.keys(e) if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e) ;(t && (r = r.filter(function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable })), n.push.apply(n, r)) } return n } function $z(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {} t % 2 ? Jz(Object(n), !0).forEach(function (t) { Zz(e, t, n[t]) }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Jz(Object(n)).forEach(function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)) }) } return e } function eV() { return ( (eV = Object.assign ? Object.assign.bind() : function (e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]) } return e }), eV.apply(null, arguments) ) } var tV = Array.isArray, nV = function (e) { return 'string' == typeof e }, rV = function (e) { return null !== e && 'object' === P(e) } function iV(e) { var t = arguments.length > 2 ? arguments[2] : void 0 return 'function' == typeof e ? e(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}) : null != e ? e : t } function aV() { for (var e = [], t = 0; t < arguments.length; t++) { var n = t < 0 || arguments.length <= t ? void 0 : arguments[t] if (n) if (nV(n)) e.push(n) else if (tV(n)) for (var r = 0; r < n.length; r++) { var i = aV(n[r]) i && e.push(i) } else if (rV(n)) for (var a in n) n[a] && e.push(a) } return e.join(' ') } function oV() { var e = [] return ( (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []).forEach( function (t) { Array.isArray(t) ? e.push.apply(e, I(t)) : (null == t ? void 0 : t.type) === Bi ? e.push.apply(e, I(oV(t.children))) : e.push(t) } ), e.filter(function (e) { return !(function (e) { return ( e && (e.type === zi || (e.type === Bi && 0 === e.children.length) || (e.type === Ui && '' === e.children.trim())) ) })(e) }) ) } var sV = function (e) { var t = e return ( (t.install = function (n) { n.component(t.displayName || t.name, e) }), e ) } function uV(e) { return { type: Object, default: e } } function lV(e) { return { type: Boolean, default: e } } function cV(e, t) { var n = { validator: function () { return !0 }, default: e, } return n } function hV(e) { return { type: Array, default: e } } function dV(e) { return { type: String, default: e } } var fV = 'anticon', pV = Symbol('GlobalFormContextKey'), vV = Symbol('configProvider'), mV = { getPrefixCls: function (e, t) { return t || (e ? 'ant-'.concat(e) : 'ant') }, iconPrefixCls: Ea(function () { return fV }), getPopupContainer: Ea(function () { return function () { return document.body } }), direction: Ea(function () { return 'ltr' }), }, gV = function () { return ei(vV, mV) }, yV = Symbol('DisabledContextKey'), _V = function () { return ei(yV, tn(void 0)) }, bV = { placeholder: 'Select time', rangePlaceholder: ['Start time', 'End time'] }, xV = { lang: eV( { 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'], }, { 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', } ), timePickerLocale: eV({}, bV), }, SV = '${label} is not a valid ${type}', AV = { locale: 'en', Pagination: { items_per_page: '/ page', jump_to: 'Go to', jump_to_confirm: 'confirm', 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', }, DatePicker: xV, TimePicker: bV, Calendar: xV, 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', }, Tour: { Next: 'Next', Previous: 'Previous', Finish: 'Finish' }, 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: SV, method: SV, array: SV, object: SV, number: SV, date: SV, boolean: SV, integer: SV, float: SV, regexp: SV, email: SV, url: SV, hex: SV, }, 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' }, QRCode: { expired: 'QR code expired', refresh: 'Refresh', scanned: 'Scanned' }, }, wV = ar({ compatConfig: { MODE: 3 }, name: 'LocaleReceiver', props: { componentName: String, defaultLocale: { type: [Object, Function] }, children: { type: Function }, }, setup: function (e, t) { var n = t.slots, r = ei('localeData', {}), i = Ea(function () { var t = e.componentName, n = void 0 === t ? 'global' : t, i = e.defaultLocale || AV[n || 'global'], a = r.antLocale, o = n && a ? a[n] : {} return eV(eV({}, 'function' == typeof i ? i() : i), o || {}) }), a = Ea(function () { var e = r.antLocale, t = e && e.locale return e && e.exist && !t ? AV.locale : t }) return function () { var t = e.children || n.default, o = r.antLocale return null == t ? void 0 : t(i.value, a.value, o) } }, }) function TV(e) { for (var t, n = 0, r = 0, i = e.length; i >= 4; ++r, i -= 4) ((t = 1540483477 * (65535 & (t = (255 & e.charCodeAt(r)) | ((255 & e.charCodeAt(++r)) << 8) | ((255 & e.charCodeAt(++r)) << 16) | ((255 & e.charCodeAt(++r)) << 24))) + ((59797 * (t >>> 16)) << 16)), (n = (1540483477 * (65535 & (t ^= t >>> 24)) + ((59797 * (t >>> 16)) << 16)) ^ (1540483477 * (65535 & n) + ((59797 * (n >>> 16)) << 16)))) switch (i) { case 3: n ^= (255 & e.charCodeAt(r + 2)) << 16 case 2: n ^= (255 & e.charCodeAt(r + 1)) << 8 case 1: n = 1540483477 * (65535 & (n ^= 255 & e.charCodeAt(r))) + ((59797 * (n >>> 16)) << 16) } return ( ((n = 1540483477 * (65535 & (n ^= n >>> 13)) + ((59797 * (n >>> 16)) << 16)) ^ (n >>> 15)) >>> 0 ).toString(36) } var MV = (function () { return T( function e(t) { ;(A(this, e), (this.cache = new Map()), (this.instanceId = t)) }, [ { key: 'get', value: function (e) { return this.cache.get(Array.isArray(e) ? e.join('%') : e) || null }, }, { key: 'update', value: function (e, t) { var n = Array.isArray(e) ? e.join('%') : e, r = t(this.cache.get(n)) null === r ? this.cache.delete(n) : this.cache.set(n, r) }, }, ] ) })(), EV = 'data-token-hash', CV = 'data-css-hash', kV = '__cssinjs_instance__' function RV() { var e = Math.random().toString(12).slice(2) if ('undefined' != typeof document && document.head && document.body) { var t = document.body.querySelectorAll('style['.concat(CV, ']')) || [], n = document.head.firstChild Array.from(t).forEach(function (t) { ;((t[kV] = t[kV] || e), t[kV] === e && document.head.insertBefore(t, n)) }) var r = {} Array.from(document.querySelectorAll('style['.concat(CV, ']'))).forEach(function (t) { var n, i = t.getAttribute(CV) r[i] ? t[kV] === e && (null === (n = t.parentNode) || void 0 === n || n.removeChild(t)) : (r[i] = !0) }) } return new MV(e) } var IV, NV, PV = Symbol('StyleContextKey'), LV = { cache: RV(), defaultCache: !0, hashPriority: 'low' }, DV = function () { var e = (function () { var e, t, n, r, i = va() if (i && i.appContext) { var a = null === (n = null === (t = null === (e = i.appContext) || void 0 === e ? void 0 : e.config) || void 0 === t ? void 0 : t.globalProperties) || void 0 === n ? void 0 : n.__ANTDV_CSSINJS_CACHE__ a ? (r = a) : ((r = RV()), i.appContext.config.globalProperties && (i.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = r)) } else r = RV() return r })() return ei(PV, nn(eV(eV({}, LV), { cache: e }))) } function OV(e, t, n, r) { var i = DV(), a = nn(''), o = nn() wi(function () { a.value = [e].concat(I(t.value)).join('%') }) var s = function (e) { i.value.cache.update(e, function (e) { var t = C(e || [], 2), n = t[0], i = void 0 === n ? 0 : n, a = t[1] return 0 === i - 1 ? (null == r || r(a, !1), null) : [i - 1, a] }) } return ( Ti( a, function (e, t) { ;(t && s(t), i.value.cache.update(e, function (e) { var t = C(e || [], 2), r = t[0] return [(void 0 === r ? 0 : r) + 1, t[1] || n()] }), (o.value = i.value.cache.get(a.value)[1])) }, { immediate: !0 } ), xr(function () { s(a.value) }), o ) } function FV() { return !( 'undefined' == typeof window || !window.document || !window.document.createElement ) } sV( ar({ name: 'AStyleProvider', inheritAttrs: !1, props: { autoClear: lV(), mock: dV(), cache: uV(), defaultCache: lV(), hashPriority: dV(), container: IV ? { type: IV, default: NV } : cV(NV), ssrInline: lV(), transformers: hV(), linters: hV(), }, setup: function (e, t) { var n = t.slots return ( (function (e) { var t = DV(), n = nn(eV(eV({}, LV), { cache: RV() })) ;(Ti( [ function () { return on(e) }, t, ], function () { var r = eV({}, t.value), i = on(e) Object.keys(i).forEach(function (e) { var t = i[e] void 0 !== i[e] && (r[e] = t) }) var a = i.cache ;((r.cache = r.cache || RV()), (r.defaultCache = !a && t.value.defaultCache), (n.value = r)) }, { immediate: !0 } ), $r(PV, n)) })(e), function () { var e return null === (e = n.default) || void 0 === e ? void 0 : e.call(n) } ) }, }) ) var BV = 'data-vc-order', UV = new Map() function zV() { var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).mark return e ? (e.startsWith('data-') ? e : 'data-'.concat(e)) : 'vc-util-key' } function VV(e) { return e.attachTo ? e.attachTo : document.querySelector('head') || document.body } function HV(e) { return Array.from((UV.get(e) || e).children).filter(function (e) { return 'STYLE' === e.tagName }) } function WV(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} if (!FV()) return null var n = t.csp, r = t.prepend, i = document.createElement('style') ;(i.setAttribute( BV, (function (e) { return 'queue' === e ? 'prependQueue' : e ? 'prepend' : 'append' })(r) ), (null == n ? void 0 : n.nonce) && (i.nonce = null == n ? void 0 : n.nonce), (i.innerHTML = e)) var a = VV(t), o = a.firstChild if (r) { if ('queue' === r) { var s = HV(a).filter(function (e) { return ['prepend', 'prependQueue'].includes(e.getAttribute(BV)) }) if (s.length) return (a.insertBefore(i, s[s.length - 1].nextSibling), i) } a.insertBefore(i, o) } else a.appendChild(i) return i } function GV(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return HV(VV(t)).find(function (n) { return n.getAttribute(zV(t)) === e }) } function jV(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = GV(e, t) n && VV(t).removeChild(n) } function QV(e, t) { var n, r, i, a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} !(function (e, t) { var n = UV.get(e) if ( !n || !(function (e, t) { return !!e && !!e.contains && e.contains(t) })(document, n) ) { var r = WV('', t), i = r.parentNode ;(UV.set(e, i), e.removeChild(r)) } })(VV(a), a) var o = GV(t, a) if (o) return ( (null === (n = a.csp) || void 0 === n ? void 0 : n.nonce) && o.nonce !== (null === (r = a.csp) || void 0 === r ? void 0 : r.nonce) && (o.nonce = null === (i = a.csp) || void 0 === i ? void 0 : i.nonce), o.innerHTML !== e && (o.innerHTML = e), o ) var s = WV(e, a) return (s.setAttribute(zV(a), t), s) } var qV = (function () { function e() { ;(A(this, e), (this.cache = new Map()), (this.keys = []), (this.cacheCallTimes = 0)) } return T(e, [ { key: 'size', value: function () { return this.keys.length }, }, { key: 'internalGet', value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = { map: this.cache } return ( e.forEach(function (e) { var t n = n ? null === (t = null == n ? void 0 : n.map) || void 0 === t ? void 0 : t.get(e) : void 0 }), (null == n ? void 0 : n.value) && t && (n.value[1] = this.cacheCallTimes++), null == n ? void 0 : n.value ) }, }, { key: 'get', value: function (e) { var t return null === (t = this.internalGet(e, !0)) || void 0 === t ? void 0 : t[0] }, }, { key: 'has', value: function (e) { return !!this.internalGet(e) }, }, { key: 'set', value: function (t, n) { var r = this if (!this.has(t)) { if (this.size() + 1 > e.MAX_CACHE_SIZE + e.MAX_CACHE_OFFSET) { var i = this.keys.reduce( function (e, t) { var n = C(e, 2)[1] return r.internalGet(t)[1] < n ? [t, r.internalGet(t)[1]] : e }, [this.keys[0], this.cacheCallTimes] ), a = C(i, 1)[0] this.delete(a) } this.keys.push(t) } var o = this.cache t.forEach(function (e, i) { if (i === t.length - 1) o.set(e, { value: [n, r.cacheCallTimes++] }) else { var a = o.get(e) ;(a ? a.map || (a.map = new Map()) : o.set(e, { map: new Map() }), (o = o.get(e).map)) } }) }, }, { key: 'deleteByPath', value: function (e, t) { var n, r = e.get(t[0]) if (1 === t.length) return ( r.map ? e.set(t[0], { map: r.map }) : e.delete(t[0]), null === (n = r.value) || void 0 === n ? void 0 : n[0] ) var i = this.deleteByPath(r.map, t.slice(1)) return ((r.map && 0 !== r.map.size) || r.value || e.delete(t[0]), i) }, }, { key: 'delete', value: function (e) { if (this.has(e)) return ( (this.keys = this.keys.filter(function (t) { return !(function (e, t) { if (e.length !== t.length) return !1 for (var n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1 return !0 })(t, e) })), this.deleteByPath(this.cache, e) ) }, }, ]) })() ;((qV.MAX_CACHE_SIZE = 20), (qV.MAX_CACHE_OFFSET = 5)) var XV = function () {}, YV = 0, KV = (function () { return T( function e(t) { ;(A(this, e), (this.derivatives = Array.isArray(t) ? t : [t]), (this.id = YV), 0 === t.length && XV(t.length > 0), (YV += 1)) }, [ { key: 'getDerivativeToken', value: function (e) { return this.derivatives.reduce( function (t, n) { return n(e, t) }, void 0 ) }, }, ] ) })(), ZV = new qV() function JV(e) { var t = Array.isArray(e) ? e : [e] return (ZV.has(t) || ZV.set(t, new KV(t)), ZV.get(t)) } var $V = new WeakMap() function eH(e) { var t = $V.get(e) || '' return ( t || (Object.keys(e).forEach(function (n) { var r = e[n] ;((t += n), r instanceof KV ? (t += r.id) : r && 'object' === P(r) ? (t += eH(r)) : (t += r)) }), $V.set(e, t)), t ) } var tH = 'random-'.concat(Date.now(), '-').concat(Math.random()).replace(/\./g, ''), nH = '_bAmBoO_' var rH = void 0 function iH() { return ( void 0 === rH && (rH = (function (e, t, n) { var r, i if (FV()) { QV(e, tH) var a = document.createElement('div') ;((a.style.position = 'fixed'), (a.style.left = '0'), (a.style.top = '0'), null == t || t(a), document.body.appendChild(a)) var o = n ? n(a) : null === (r = getComputedStyle(a).content) || void 0 === r ? void 0 : r.includes(nH) return ( null === (i = a.parentNode) || void 0 === i || i.removeChild(a), jV(tH), o ) } return !1 })( '@layer ' .concat(tH, ' { .') .concat(tH, ' { content: "') .concat(nH, '"!important; } }'), function (e) { e.className = tH } )), rH ) } var aH = {}, oH = new Map() function sH(e, t) { oH.set(e, (oH.get(e) || 0) - 1) var n = Array.from(oH.keys()), r = n.filter(function (e) { return (oH.get(e) || 0) <= 0 }) n.length - r.length > 0 && r.forEach(function (e) { ;(!(function (e, t) { 'undefined' != typeof document && document .querySelectorAll('style['.concat(EV, '="').concat(e, '"]')) .forEach(function (e) { var n e[kV] === t && (null === (n = e.parentNode) || void 0 === n || n.removeChild(e)) }) })(e, t), oH.delete(e)) }) } function uH(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : tn({}), r = DV(), i = Ea(function () { return eV.apply(void 0, [{}].concat(I(t.value))) }), a = Ea(function () { return eH(i.value) }), o = Ea(function () { return eH(n.value.override || aH) }), s = OV( 'token', Ea(function () { return [n.value.salt || '', e.value.id, a.value, o.value] }), function () { var t = n.value, r = t.salt, a = void 0 === r ? '' : r, o = t.override, s = void 0 === o ? aH : o, u = t.formatToken, l = t.getComputedToken, c = l ? l(i.value, s, e.value) : (function (e, t, n, r) { var i = eV(eV({}, n.getDerivativeToken(e)), t) return (r && (i = r(i)), i) })(i.value, s, e.value, u), h = (function (e, t) { return TV(''.concat(t, '_').concat(eH(e))) })(c, a) ;((c._tokenKey = h), (function (e) { oH.set(e, (oH.get(e) || 0) + 1) })(h)) var d = ''.concat('css', '-').concat(TV(h)) return ((c._hashId = d), [c, d]) }, function (e) { var t sH( e[0]._tokenKey, null === (t = r.value) || void 0 === t ? void 0 : t.cache.instanceId ) } ) return s } var lH = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1, }, cH = 'comm', hH = 'rule', dH = 'decl', fH = Math.abs, pH = String.fromCharCode function vH(e) { return e.trim() } function mH(e, t, n) { return e.replace(t, n) } function gH(e, t, n) { return e.indexOf(t, n) } function yH(e, t) { return 0 | e.charCodeAt(t) } function _H(e, t, n) { return e.slice(t, n) } function bH(e) { return e.length } function xH(e, t) { return (t.push(e), e) } var SH = 1, AH = 1, wH = 0, TH = 0, MH = 0, EH = '' function CH(e, t, n, r, i, a, o, s) { return { value: e, root: t, parent: n, type: r, props: i, children: a, line: SH, column: AH, length: o, return: '', siblings: s, } } function kH() { return ((MH = TH > 0 ? yH(EH, --TH) : 0), AH--, 10 === MH && ((AH = 1), SH--), MH) } function RH() { return ((MH = TH < wH ? yH(EH, TH++) : 0), AH++, 10 === MH && ((AH = 1), SH++), MH) } function IH() { return yH(EH, TH) } function NH() { return TH } function PH(e, t) { return _H(EH, e, t) } function LH(e) { switch (e) { case 0: case 9: case 10: case 13: case 32: return 5 case 33: case 43: case 44: case 47: case 62: case 64: case 126: case 59: case 123: case 125: return 4 case 58: return 3 case 34: case 39: case 40: case 91: return 2 case 41: case 93: return 1 } return 0 } function DH(e) { return vH(PH(TH - 1, BH(91 === e ? e + 2 : 40 === e ? e + 1 : e))) } function OH(e) { for (; (MH = IH()) && MH < 33; ) RH() return LH(e) > 2 || LH(MH) > 3 ? '' : ' ' } function FH(e, t) { for ( ; --t && RH() && !(MH < 48 || MH > 102 || (MH > 57 && MH < 65) || (MH > 70 && MH < 97)); ); return PH(e, NH() + (t < 6 && 32 == IH() && 32 == RH())) } function BH(e) { for (; RH(); ) switch (MH) { case e: return TH case 34: case 39: 34 !== e && 39 !== e && BH(MH) break case 40: 41 === e && BH(e) break case 92: RH() } return TH } function UH(e, t) { for (; RH() && e + MH !== 57 && (e + MH !== 84 || 47 !== IH()); ); return '/*' + PH(t, TH - 1) + '*' + pH(47 === e ? e : RH()) } function zH(e) { for (; !LH(IH()); ) RH() return PH(e, TH) } function VH(e) { return (function (e) { return ((EH = ''), e) })( HH( '', null, null, null, [''], (e = (function (e) { return ((SH = AH = 1), (wH = bH((EH = e))), (TH = 0), []) })(e)), 0, [0], e ) ) } function HH(e, t, n, r, i, a, o, s, u) { for ( var l = 0, c = 0, h = o, d = 0, f = 0, p = 0, v = 1, m = 1, g = 1, y = 0, _ = '', b = i, x = a, S = r, A = _; m; ) switch (((p = y), (y = RH()))) { case 40: if (108 != p && 58 == yH(A, h - 1)) { ;-1 != gH((A += mH(DH(y), '&', '&\f')), '&\f', fH(l ? s[l - 1] : 0)) && (g = -1) break } case 34: case 39: case 91: A += DH(y) break case 9: case 10: case 13: case 32: A += OH(p) break case 92: A += FH(NH() - 1, 7) continue case 47: switch (IH()) { case 42: case 47: ;(xH(GH(UH(RH(), NH()), t, n, u), u), (5 != LH(p || 1) && 5 != LH(IH() || 1)) || !bH(A) || ' ' === _H(A, -1, void 0) || (A += ' ')) break default: A += '/' } break case 123 * v: s[l++] = bH(A) * g case 125 * v: case 59: case 0: switch (y) { case 0: case 125: m = 0 case 59 + c: ;(-1 == g && (A = mH(A, /\f/g, '')), f > 0 && (bH(A) - h || (0 === v && 47 === p)) && xH( f > 32 ? jH(A + ';', r, n, h - 1, u) : jH(mH(A, ' ', '') + ';', r, n, h - 2, u), u )) break case 59: A += ';' default: if ( (xH((S = WH(A, t, n, l, c, i, s, _, (b = []), (x = []), h, a)), a), 123 === y) ) if (0 === c) HH(A, t, S, S, b, a, h, s, x) else { switch (d) { case 99: if (110 === yH(A, 3)) break case 108: if (97 === yH(A, 2)) break default: c = 0 case 100: case 109: case 115: } c ? HH( e, S, S, r && xH(WH(e, S, S, 0, 0, i, s, _, i, (b = []), h, x), x), i, x, h, s, r ? b : x ) : HH(A, S, S, S, [''], x, 0, s, x) } } ;((l = c = f = 0), (v = g = 1), (_ = A = ''), (h = o)) break case 58: ;((h = 1 + bH(A)), (f = p)) default: if (v < 1) if (123 == y) --v else if (125 == y && 0 == v++ && 125 == kH()) continue switch (((A += pH(y)), y * v)) { case 38: g = c > 0 ? 1 : ((A += '\f'), -1) break case 44: ;((s[l++] = (bH(A) - 1) * g), (g = 1)) break case 64: ;(45 === IH() && (A += DH(RH())), (d = IH()), (c = h = bH((_ = A += zH(NH())))), y++) break case 45: 45 === p && 2 == bH(A) && (v = 0) } } return a } function WH(e, t, n, r, i, a, o, s, u, l, c, h) { for ( var d = i - 1, f = 0 === i ? a : [''], p = (function (e) { return e.length })(f), v = 0, m = 0, g = 0; v < r; ++v ) for (var y = 0, _ = _H(e, d + 1, (d = fH((m = o[v])))), b = e; y < p; ++y) (b = vH(m > 0 ? f[y] + ' ' + _ : mH(_, /&\f/g, f[y]))) && (u[g++] = b) return CH(e, t, n, 0 === i ? hH : s, u, l, c, h) } function GH(e, t, n, r) { return CH(e, t, n, cH, pH(MH), _H(e, 2, -2), 0, r) } function jH(e, t, n, r, i) { return CH(e, t, n, dH, _H(e, 0, r), _H(e, r + 1, -1), r, i) } function QH(e, t) { for (var n = '', r = 0; r < e.length; r++) n += t(e[r], r, e, t) || '' return n } function qH(e, t, n, r) { switch (e.type) { case '@layer': if (e.children.length) break case '@import': case '@namespace': case dH: return (e.return = e.return || e.value) case cH: return '' case '@keyframes': return (e.return = e.value + '{' + QH(e.children, r) + '}') case hH: if (!bH((e.value = e.props.join(',')))) return '' } return bH((n = QH(e.children, r))) ? (e.return = e.value + '{' + n + '}') : '' } var XH, YH = 'data-ant-cssinjs-cache-path', KH = !0 function ZH(e) { return ( (function () { var e if (!XH && ((XH = {}), FV())) { var t = document.createElement('div') ;((t.className = YH), (t.style.position = 'fixed'), (t.style.visibility = 'hidden'), (t.style.top = '-9999px'), document.body.appendChild(t)) var n = getComputedStyle(t).content || '' ;(n = n.replace(/^"/, '').replace(/"$/, '')).split(';').forEach(function (e) { var t = C(e.split(':'), 2), n = t[0], r = t[1] XH[n] = r }) var r = document.querySelector('style['.concat(YH, ']')) ;(r && ((KH = !1), null === (e = r.parentNode) || void 0 === e || e.removeChild(r)), document.body.removeChild(t)) } })(), !!XH[e] ) } var JH = FV(), $H = '_multi_value_' function eW(e) { return QH(VH(e), qH).replace(/\{%%%\:[^;];}/g, ';') } var tW = new Set(), nW = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { root: !0, parentSelectors: [] }, r = n.root, i = n.injectHash, a = n.parentSelectors, o = t.hashId, s = t.layer, u = (t.path, t.hashPriority), l = t.transformers, c = void 0 === l ? [] : l, h = (t.linters, ''), d = {} function f(e) { var n = e.getName(o) if (!d[n]) { var r = C(nW(e.style, t, { root: !1, parentSelectors: a }), 1)[0] d[n] = '@keyframes '.concat(e.getName(o)).concat(r) } } var p = (function e(t) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [] return ( t.forEach(function (t) { Array.isArray(t) ? e(t, n) : t && n.push(t) }), n ) })(Array.isArray(e) ? e : [e]) if ( (p.forEach(function (e) { var n = 'string' != typeof e || r ? e : {} if ('string' == typeof n) h += ''.concat(n, '\n') else if (n._keyframe) f(n) else { var s = c.reduce(function (e, t) { var n return ( (null === (n = null == t ? void 0 : t.visit) || void 0 === n ? void 0 : n.call(t, e)) || e ) }, n) Object.keys(s).forEach(function (e) { var n, l = s[e] if ( 'object' !== P(l) || !l || ('animationName' === e && l._keyframe) || (function (e) { return 'object' === P(e) && e && ('_skip_check_' in e || $H in e) })(l) ) { var c = function (e, t) { var n = e.replace(/[A-Z]/g, function (e) { return '-'.concat(e.toLowerCase()) }), r = t ;(lH[e] || 'number' != typeof r || 0 === r || (r = ''.concat(r, 'px')), 'animationName' === e && (null == t ? void 0 : t._keyframe) && (f(t), (r = t.getName(o))), (h += ''.concat(n, ':').concat(r, ';'))) }, p = null !== (n = null == l ? void 0 : l.value) && void 0 !== n ? n : l 'object' === P(l) && (null == l ? void 0 : l[$H]) && Array.isArray(p) ? p.forEach(function (t) { c(e, t) }) : c(e, p) } else { var v = !1, m = e.trim(), g = !1 ;(r || i) && o ? m.startsWith('@') ? (v = !0) : (m = (function (e, t, n) { if (!t) return e var r = '.'.concat(t), i = 'low' === n ? ':where('.concat(r, ')') : r, a = e.split(',').map(function (e) { var t, n = e.trim().split(/\s+/), r = n[0] || '', a = (null === (t = r.match(/^\w+/)) || void 0 === t ? void 0 : t[0]) || '' return [(r = ''.concat(a).concat(i).concat(r.slice(a.length)))] .concat(I(n.slice(1))) .join(' ') }) return a.join(',') })(e, o, u)) : !r || o || ('&' !== m && '' !== m) || ((m = ''), (g = !0)) var y = C( nW(l, t, { root: g, injectHash: v, parentSelectors: [].concat(I(a), [m]), }), 2 ), _ = y[0], b = y[1] ;((d = eV(eV({}, d), b)), (h += ''.concat(m).concat(_))) } }) } }), r) ) { if (s && iH()) { var v = s.split(','), m = v[v.length - 1].trim() ;((h = '@layer '.concat(m, ' {').concat(h, '}')), v.length > 1 && (h = '@layer '.concat(s, '{%%%:%}').concat(h))) } } else h = '{'.concat(h, '}') return [h, d] } function rW(e, t) { var n = DV(), r = Ea(function () { return e.value.token._tokenKey }), i = Ea(function () { return [r.value].concat(I(e.value.path)) }), a = JH return ( OV( 'style', i, function () { var o = e.value, s = o.path, u = o.hashId, l = o.layer, c = o.nonce, h = o.clientOnly, d = o.order, f = void 0 === d ? 0 : d, p = i.value.join('|') if (ZH(p)) { var v = (function (e) { var t = XH[e], n = null if (t && FV()) if (KH) n = '_FILE_STYLE__' else { var r = document.querySelector( 'style['.concat(CV, '="').concat(XH[e], '"]') ) r ? (n = r.innerHTML) : delete XH[e] } return [n, t] })(p), m = C(v, 2), g = m[0], y = m[1] if (g) return [g, r.value, y, {}, h, f] } var _ = t(), b = n.value, x = b.hashPriority, S = b.container, A = b.transformers, w = b.linters, T = b.cache, M = C( nW(_, { hashId: u, hashPriority: x, layer: l, path: s.join('-'), transformers: A, linters: w, }), 2 ), E = M[0], k = M[1], R = eW(E), I = (function (e, t) { return TV(''.concat(e.join('%')).concat(t)) })(i.value, R) if (a) { var N = { mark: CV, prepend: 'queue', attachTo: S, priority: f }, P = 'function' == typeof c ? c() : c P && (N.csp = { nonce: P }) var L = QV(R, I, N) ;((L[kV] = T.instanceId), L.setAttribute(EV, r.value), Object.keys(k).forEach(function (e) { tW.has(e) || (tW.add(e), QV(eW(k[e]), '_effect-'.concat(e), { mark: CV, prepend: 'queue', attachTo: S, })) })) } return [R, r.value, I, k, h, f] }, function (e, t) { var r = C(e, 3)[2] ;(t || n.value.autoClear) && JH && jV(r, { mark: CV }) } ), function (e) { return e } ) } var iW = (function () { return T( function e(t, n) { ;(A(this, e), (this._keyframe = !0), (this.name = t), (this.style = n)) }, [ { key: 'getName', value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '' return e ? ''.concat(e, '-').concat(this.name) : this.name }, }, ] ) })() function aW(e, t) { ;(function (e) { return 'string' == typeof e && -1 !== e.indexOf('.') && 1 === parseFloat(e) })(e) && (e = '100%') var n = (function (e) { return 'string' == typeof e && -1 !== e.indexOf('%') })(e) return ( (e = 360 === t ? e : Math.min(t, Math.max(0, parseFloat(e)))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = 360 === t ? (e < 0 ? (e % t) + t : e % t) / parseFloat(String(t)) : (e % t) / parseFloat(String(t))) ) } function oW(e) { return Math.min(1, Math.max(0, e)) } function sW(e) { return ((e = parseFloat(e)), (isNaN(e) || e < 0 || e > 1) && (e = 1), e) } function uW(e) { return e <= 1 ? ''.concat(100 * Number(e), '%') : e } function lW(e) { return 1 === e.length ? '0' + e : String(e) } function cW(e, t, n) { ;((e = aW(e, 255)), (t = aW(t, 255)), (n = aW(n, 255))) var r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = 0, s = (r + i) / 2 if (r === i) ((o = 0), (a = 0)) else { var u = r - i switch (((o = s > 0.5 ? u / (2 - r - i) : u / (r + i)), r)) { case e: a = (t - n) / u + (t < n ? 6 : 0) break case t: a = (n - e) / u + 2 break case n: a = (e - t) / u + 4 } a /= 6 } return { h: a, s: o, l: s } } function hW(e, t, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + 6 * n * (t - e) : n < 0.5 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e ) } function dW(e, t, n) { ;((e = aW(e, 255)), (t = aW(t, 255)), (n = aW(n, 255))) var r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r, s = r - i, u = 0 === r ? 0 : s / r if (r === i) a = 0 else { switch (r) { case e: a = (t - n) / s + (t < n ? 6 : 0) break case t: a = (n - e) / s + 2 break case n: a = (e - t) / s + 4 } a /= 6 } return { h: a, s: u, v: o } } function fW(e, t, n, r) { var i = [ lW(Math.round(e).toString(16)), lW(Math.round(t).toString(16)), lW(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 pW(e) { return Math.round(255 * parseFloat(e)).toString(16) } function vW(e) { return mW(e) / 255 } function mW(e) { return parseInt(e, 16) } var gW = { 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 yW(e) { var t = { r: 0, g: 0, b: 0 }, n = 1, r = null, i = null, a = null, o = !1, s = !1 return ( 'string' == typeof e && (e = (function (e) { if (((e = e.trim().toLowerCase()), 0 === e.length)) return !1 var t = !1 if (gW[e]) ((e = gW[e]), (t = !0)) else if ('transparent' === e) return { r: 0, g: 0, b: 0, a: 0, format: 'name' } var n = SW.rgb.exec(e) if (n) return { r: n[1], g: n[2], b: n[3] } if (((n = SW.rgba.exec(e)), n)) return { r: n[1], g: n[2], b: n[3], a: n[4] } if (((n = SW.hsl.exec(e)), n)) return { h: n[1], s: n[2], l: n[3] } if (((n = SW.hsla.exec(e)), n)) return { h: n[1], s: n[2], l: n[3], a: n[4] } if (((n = SW.hsv.exec(e)), n)) return { h: n[1], s: n[2], v: n[3] } if (((n = SW.hsva.exec(e)), n)) return { h: n[1], s: n[2], v: n[3], a: n[4] } if (((n = SW.hex8.exec(e)), n)) return { r: mW(n[1]), g: mW(n[2]), b: mW(n[3]), a: vW(n[4]), format: t ? 'name' : 'hex8', } if (((n = SW.hex6.exec(e)), n)) return { r: mW(n[1]), g: mW(n[2]), b: mW(n[3]), format: t ? 'name' : 'hex' } if (((n = SW.hex4.exec(e)), n)) return { r: mW(n[1] + n[1]), g: mW(n[2] + n[2]), b: mW(n[3] + n[3]), a: vW(n[4] + n[4]), format: t ? 'name' : 'hex8', } if (((n = SW.hex3.exec(e)), n)) return { r: mW(n[1] + n[1]), g: mW(n[2] + n[2]), b: mW(n[3] + n[3]), format: t ? 'name' : 'hex', } return !1 })(e)), 'object' === P(e) && (AW(e.r) && AW(e.g) && AW(e.b) ? ((t = (function (e, t, n) { return { r: 255 * aW(e, 255), g: 255 * aW(t, 255), b: 255 * aW(n, 255) } })(e.r, e.g, e.b)), (o = !0), (s = '%' === String(e.r).substr(-1) ? 'prgb' : 'rgb')) : AW(e.h) && AW(e.s) && AW(e.v) ? ((r = uW(e.s)), (i = uW(e.v)), (t = (function (e, t, n) { ;((e = 6 * aW(e, 360)), (t = aW(t, 100)), (n = aW(n, 100))) var r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), u = r % 6 return { r: 255 * [n, o, a, a, s, n][u], g: 255 * [s, n, n, o, a, a][u], b: 255 * [a, a, s, n, n, o][u], } })(e.h, r, i)), (o = !0), (s = 'hsv')) : AW(e.h) && AW(e.s) && AW(e.l) && ((r = uW(e.s)), (a = uW(e.l)), (t = (function (e, t, n) { var r, i, a if (((e = aW(e, 360)), (t = aW(t, 100)), (n = aW(n, 100)), 0 === t)) ((i = n), (a = n), (r = n)) else { var o = n < 0.5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o ;((r = hW(s, o, e + 1 / 3)), (i = hW(s, o, e)), (a = hW(s, o, e - 1 / 3))) } return { r: 255 * r, g: 255 * i, b: 255 * a } })(e.h, r, a)), (o = !0), (s = 'hsl')), Object.prototype.hasOwnProperty.call(e, 'a') && (n = e.a)), (n = sW(n)), { ok: o, format: e.format || s, 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 _W = '(?:'.concat('[-\\+]?\\d*\\.\\d+%?', ')|(?:').concat('[-\\+]?\\d+%?', ')'), bW = '[\\s|\\(]+(' .concat(_W, ')[,|\\s]+(') .concat(_W, ')[,|\\s]+(') .concat(_W, ')\\s*\\)?'), xW = '[\\s|\\(]+(' .concat(_W, ')[,|\\s]+(') .concat(_W, ')[,|\\s]+(') .concat(_W, ')[,|\\s]+(') .concat(_W, ')\\s*\\)?'), SW = { CSS_UNIT: new RegExp(_W), rgb: new RegExp('rgb' + bW), rgba: new RegExp('rgba' + xW), hsl: new RegExp('hsl' + bW), hsla: new RegExp('hsla' + xW), hsv: new RegExp('hsv' + bW), hsva: new RegExp('hsva' + xW), 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 AW(e) { return Boolean(SW.CSS_UNIT.exec(String(e))) } var wW = (function () { function e(t, n) { var r if ((void 0 === t && (t = ''), void 0 === n && (n = {}), t instanceof e)) return t ;('number' == typeof t && (t = (function (e) { return { r: e >> 16, g: (65280 & e) >> 8, b: 255 & e } })(t)), (this.originalInput = t)) var i = yW(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 = null !== (r = n.format) && void 0 !== r ? 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 e = this.toRgb() return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 }), (e.prototype.getLuminance = function () { var e = this.toRgb(), t = e.r / 255, n = e.g / 255, r = e.b / 255 return ( 0.2126 * (t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4)) + 0.7152 * (n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4)) + 0.0722 * (r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)) ) }), (e.prototype.getAlpha = function () { return this.a }), (e.prototype.setAlpha = function (e) { return ((this.a = sW(e)), (this.roundA = Math.round(100 * this.a) / 100), this) }), (e.prototype.isMonochrome = function () { return 0 === this.toHsl().s }), (e.prototype.toHsv = function () { var e = dW(this.r, this.g, this.b) return { h: 360 * e.h, s: e.s, v: e.v, a: this.a } }), (e.prototype.toHsvString = function () { var e = dW(this.r, this.g, this.b), t = Math.round(360 * e.h), n = Math.round(100 * e.s), r = Math.round(100 * e.v) return 1 === this.a ? 'hsv('.concat(t, ', ').concat(n, '%, ').concat(r, '%)') : 'hsva(' .concat(t, ', ') .concat(n, '%, ') .concat(r, '%, ') .concat(this.roundA, ')') }), (e.prototype.toHsl = function () { var e = cW(this.r, this.g, this.b) return { h: 360 * e.h, s: e.s, l: e.l, a: this.a } }), (e.prototype.toHslString = function () { var e = cW(this.r, this.g, this.b), t = Math.round(360 * e.h), n = Math.round(100 * e.s), r = Math.round(100 * e.l) return 1 === this.a ? 'hsl('.concat(t, ', ').concat(n, '%, ').concat(r, '%)') : 'hsla(' .concat(t, ', ') .concat(n, '%, ') .concat(r, '%, ') .concat(this.roundA, ')') }), (e.prototype.toHex = function (e) { return (void 0 === e && (e = !1), fW(this.r, this.g, this.b, e)) }), (e.prototype.toHexString = function (e) { return (void 0 === e && (e = !1), '#' + this.toHex(e)) }), (e.prototype.toHex8 = function (e) { return ( void 0 === e && (e = !1), (function (e, t, n, r, i) { var a = [ lW(Math.round(e).toString(16)), lW(Math.round(t).toString(16)), lW(Math.round(n).toString(16)), lW(pW(r)), ] return i && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join('') })(this.r, this.g, this.b, this.a, e) ) }), (e.prototype.toHex8String = function (e) { return (void 0 === e && (e = !1), '#' + this.toHex8(e)) }), (e.prototype.toHexShortString = function (e) { return ( void 0 === e && (e = !1), 1 === this.a ? this.toHexString(e) : this.toHex8String(e) ) }), (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 e = Math.round(this.r), t = Math.round(this.g), n = Math.round(this.b) return 1 === this.a ? 'rgb('.concat(e, ', ').concat(t, ', ').concat(n, ')') : 'rgba(' .concat(e, ', ') .concat(t, ', ') .concat(n, ', ') .concat(this.roundA, ')') }), (e.prototype.toPercentageRgb = function () { var e = function (e) { return ''.concat(Math.round(100 * aW(e, 255)), '%') } return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a } }), (e.prototype.toPercentageRgbString = function () { var e = function (e) { return Math.round(100 * aW(e, 255)) } return 1 === this.a ? 'rgb(' .concat(e(this.r), '%, ') .concat(e(this.g), '%, ') .concat(e(this.b), '%)') : 'rgba(' .concat(e(this.r), '%, ') .concat(e(this.g), '%, ') .concat(e(this.b), '%, ') .concat(this.roundA, ')') }), (e.prototype.toName = function () { if (0 === this.a) return 'transparent' if (this.a < 1) return !1 for ( var e = '#' + fW(this.r, this.g, this.b, !1), t = 0, n = Object.entries(gW); t < n.length; t++ ) { var r = n[t], i = r[0] if (e === r[1]) return i } return !1 }), (e.prototype.toString = function (e) { var t = Boolean(e) e = null != e ? e : this.format var n = !1, r = this.a < 1 && this.a >= 0 return t || !r || (!e.startsWith('hex') && 'name' !== e) ? ('rgb' === e && (n = this.toRgbString()), 'prgb' === e && (n = this.toPercentageRgbString()), ('hex' !== e && 'hex6' !== e) || (n = this.toHexString()), 'hex3' === e && (n = this.toHexString(!0)), 'hex4' === e && (n = this.toHex8String(!0)), 'hex8' === e && (n = this.toHex8String()), 'name' === e && (n = this.toName()), 'hsl' === e && (n = this.toHslString()), 'hsv' === e && (n = this.toHsvString()), n || this.toHexString()) : 'name' === e && 0 === this.a ? this.toName() : this.toRgbString() }), (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) { void 0 === t && (t = 10) var n = this.toHsl() return ((n.l += t / 100), (n.l = oW(n.l)), new e(n)) }), (e.prototype.brighten = function (t) { void 0 === t && (t = 10) var n = this.toRgb() return ( (n.r = Math.max(0, Math.min(255, n.r - Math.round((-t / 100) * 255)))), (n.g = Math.max(0, Math.min(255, n.g - Math.round((-t / 100) * 255)))), (n.b = Math.max(0, Math.min(255, n.b - Math.round((-t / 100) * 255)))), new e(n) ) }), (e.prototype.darken = function (t) { void 0 === t && (t = 10) var n = this.toHsl() return ((n.l -= t / 100), (n.l = oW(n.l)), new e(n)) }), (e.prototype.tint = function (e) { return (void 0 === e && (e = 10), this.mix('white', e)) }), (e.prototype.shade = function (e) { return (void 0 === e && (e = 10), this.mix('black', e)) }), (e.prototype.desaturate = function (t) { void 0 === t && (t = 10) var n = this.toHsl() return ((n.s -= t / 100), (n.s = oW(n.s)), new e(n)) }), (e.prototype.saturate = function (t) { void 0 === t && (t = 10) var n = this.toHsl() return ((n.s += t / 100), (n.s = oW(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) { void 0 === n && (n = 50) var r = this.toRgb(), i = new e(t).toRgb(), a = n / 100 return new e({ r: (i.r - r.r) * a + r.r, g: (i.g - r.g) * a + r.g, b: (i.b - r.b) * a + r.b, a: (i.a - r.a) * a + r.a, }) }), (e.prototype.analogous = function (t, n) { ;(void 0 === t && (t = 6), void 0 === n && (n = 30)) var r = this.toHsl(), i = 360 / n, a = [this] for (r.h = (r.h - ((i * t) >> 1) + 720) % 360; --t; ) ((r.h = (r.h + i) % 360), a.push(new e(r))) return a }), (e.prototype.complement = function () { var t = this.toHsl() return ((t.h = (t.h + 180) % 360), new e(t)) }), (e.prototype.monochromatic = function (t) { void 0 === t && (t = 6) for (var n = this.toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--; ) (o.push(new e({ h: r, s: i, v: a })), (a = (a + s) % 1)) return o }), (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], a = 360 / t, o = 1; o < t; o++) i.push(new e({ h: (r + o * a) % 360, s: n.s, l: n.l })) return i }), (e.prototype.equals = function (t) { return this.toRgbString() === new e(t).toRgbString() }), e ) })(), TW = [ { index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }, ] function MW(e) { var t = dW(e.r, e.g, e.b) return { h: 360 * t.h, s: t.s, v: t.v } } function EW(e) { var t = e.r, n = e.g, r = e.b return '#'.concat(fW(t, n, r, !1)) } function CW(e, t, n) { var r return ( (r = Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? n ? Math.round(e.h) - 2 * t : Math.round(e.h) + 2 * t : n ? Math.round(e.h) + 2 * t : Math.round(e.h) - 2 * t) < 0 ? (r += 360) : r >= 360 && (r -= 360), r ) } function kW(e, t, n) { return 0 === e.h && 0 === e.s ? e.s : ((r = n ? e.s - 0.16 * t : 4 === t ? e.s + 0.16 : e.s + 0.05 * t) > 1 && (r = 1), n && 5 === t && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Number(r.toFixed(2))) var r } function RW(e, t, n) { var r return ((r = n ? e.v + 0.05 * t : e.v - 0.15 * t) > 1 && (r = 1), Number(r.toFixed(2))) } function IW(e) { for ( var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = [], r = yW(e), i = 5; i > 0; i -= 1 ) { var a = MW(r), o = EW(yW({ h: CW(a, i, !0), s: kW(a, i, !0), v: RW(a, i, !0) })) n.push(o) } n.push(EW(r)) for (var s = 1; s <= 4; s += 1) { var u = MW(r), l = EW(yW({ h: CW(u, s), s: kW(u, s), v: RW(u, s) })) n.push(l) } return 'dark' === t.theme ? TW.map(function (e) { var r = e.index, i = e.opacity, a = EW( (function (e, t, n) { var r = n / 100 return { r: (t.r - e.r) * r + e.r, g: (t.g - e.g) * r + e.g, b: (t.b - e.b) * r + e.b, } })(yW(t.backgroundColor || '#141414'), yW(n[r]), 100 * i) ) return a }) : n } var NW = { 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', }, PW = {}, LW = {} Object.keys(NW).forEach(function (e) { ;((PW[e] = IW(NW[e])), (PW[e].primary = PW[e][5]), (LW[e] = IW(NW[e], { theme: 'dark', backgroundColor: '#141414' })), (LW[e].primary = LW[e][5])) }) var DW = PW.blue var OW = { blue: '#1677ff', purple: '#722ED1', cyan: '#13C2C2', green: '#52C41A', magenta: '#EB2F96', pink: '#eb2f96', red: '#F5222D', orange: '#FA8C16', yellow: '#FADB14', volcano: '#FA541C', geekblue: '#2F54EB', gold: '#FAAD14', lime: '#A0D911', }, FW = eV(eV({}, OW), { colorPrimary: '#1677ff', colorSuccess: '#52c41a', colorWarning: '#faad14', colorError: '#ff4d4f', colorInfo: '#1677ff', colorTextBase: '', colorBgBase: '', fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'", fontSize: 14, lineWidth: 1, lineType: 'solid', motionUnit: 0.1, motionBase: 0, motionEaseOutCirc: 'cubic-bezier(0.08, 0.82, 0.17, 1)', motionEaseInOutCirc: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)', motionEaseOut: 'cubic-bezier(0.215, 0.61, 0.355, 1)', motionEaseInOut: 'cubic-bezier(0.645, 0.045, 0.355, 1)', motionEaseOutBack: 'cubic-bezier(0.12, 0.4, 0.29, 1.46)', motionEaseInBack: 'cubic-bezier(0.71, -0.46, 0.88, 0.6)', motionEaseInQuint: 'cubic-bezier(0.755, 0.05, 0.855, 0.06)', motionEaseOutQuint: 'cubic-bezier(0.23, 1, 0.32, 1)', borderRadius: 6, sizeUnit: 4, sizeStep: 4, sizePopupArrow: 16, controlHeight: 32, zIndexBase: 0, zIndexPopupBase: 1e3, opacityImage: 1, wireframe: !1, }) var BW = function (e, t) { return new wW(e).setAlpha(t).toRgbString() }, UW = function (e, t) { return new wW(e).darken(t).toHexString() }, zW = function (e) { var t = IW(e) return { 1: t[0], 2: t[1], 3: t[2], 4: t[3], 5: t[4], 6: t[5], 7: t[6], 8: t[4], 9: t[5], 10: t[6], } }, VW = function (e, t) { var n = e || '#fff', r = t || '#000' return { colorBgBase: n, colorTextBase: r, colorText: BW(r, 0.88), colorTextSecondary: BW(r, 0.65), colorTextTertiary: BW(r, 0.45), colorTextQuaternary: BW(r, 0.25), colorFill: BW(r, 0.15), colorFillSecondary: BW(r, 0.06), colorFillTertiary: BW(r, 0.04), colorFillQuaternary: BW(r, 0.02), colorBgLayout: UW(n, 4), colorBgContainer: UW(n, 0), colorBgElevated: UW(n, 0), colorBgSpotlight: BW(r, 0.85), colorBorder: UW(n, 15), colorBorderSecondary: UW(n, 6), } } var HW = function (e) { var t = (function (e) { var t = new Array(10).fill(null).map(function (t, n) { var r = n - 1, i = e * Math.pow(2.71828, r / 5), a = n > 1 ? Math.floor(i) : Math.ceil(i) return 2 * Math.floor(a / 2) }) return ( (t[1] = e), t.map(function (e) { return { size: e, lineHeight: (e + 8) / e } }) ) })(e), n = t.map(function (e) { return e.size }), r = t.map(function (e) { return e.lineHeight }) return { fontSizeSM: n[0], fontSize: n[1], fontSizeLG: n[2], fontSizeXL: n[3], fontSizeHeading1: n[6], fontSizeHeading2: n[5], fontSizeHeading3: n[4], fontSizeHeading4: n[3], fontSizeHeading5: n[2], lineHeight: r[1], lineHeightLG: r[2], lineHeightSM: r[0], lineHeightHeading1: r[6], lineHeightHeading2: r[5], lineHeightHeading3: r[4], lineHeightHeading4: r[3], lineHeightHeading5: r[2], } } function WW(e) { return e >= 0 && e <= 255 } function GW(e, t) { var n = new wW(e).toRgb(), r = n.r, i = n.g, a = n.b if (n.a < 1) return e for ( var o = new wW(t).toRgb(), s = o.r, u = o.g, l = o.b, c = 0.01; c <= 1; c += 0.01 ) { var h = Math.round((r - s * (1 - c)) / c), d = Math.round((i - u * (1 - c)) / c), f = Math.round((a - l * (1 - c)) / c) if (WW(h) && WW(d) && WW(f)) return new wW({ r: h, g: d, b: f, a: Math.round(100 * c) / 100 }).toRgbString() } return new wW({ r: r, g: i, b: a, a: 1 }).toRgbString() } var jW = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 QW(e) { var t = e.override, n = jW(e, ['override']), r = eV({}, t) Object.keys(FW).forEach(function (e) { delete r[e] }) var i = eV(eV({}, n), r), a = 1200, o = 1600, s = 2e3 return eV( eV(eV({}, i), { colorLink: i.colorInfoText, colorLinkHover: i.colorInfoHover, colorLinkActive: i.colorInfoActive, colorFillContent: i.colorFillSecondary, colorFillContentHover: i.colorFill, colorFillAlter: i.colorFillQuaternary, colorBgContainerDisabled: i.colorFillTertiary, colorBorderBg: i.colorBgContainer, colorSplit: GW(i.colorBorderSecondary, i.colorBgContainer), colorTextPlaceholder: i.colorTextQuaternary, colorTextDisabled: i.colorTextQuaternary, colorTextHeading: i.colorText, colorTextLabel: i.colorTextSecondary, colorTextDescription: i.colorTextTertiary, colorTextLightSolid: i.colorWhite, colorHighlight: i.colorError, colorBgTextHover: i.colorFillSecondary, colorBgTextActive: i.colorFill, colorIcon: i.colorTextTertiary, colorIconHover: i.colorText, colorErrorOutline: GW(i.colorErrorBg, i.colorBgContainer), colorWarningOutline: GW(i.colorWarningBg, i.colorBgContainer), fontSizeIcon: i.fontSizeSM, lineWidth: i.lineWidth, controlOutlineWidth: 2 * i.lineWidth, controlInteractiveSize: i.controlHeight / 2, controlItemBgHover: i.colorFillTertiary, controlItemBgActive: i.colorPrimaryBg, controlItemBgActiveHover: i.colorPrimaryBgHover, controlItemBgActiveDisabled: i.colorFill, controlTmpOutline: i.colorFillQuaternary, controlOutline: GW(i.colorPrimaryBg, i.colorBgContainer), lineType: i.lineType, borderRadius: i.borderRadius, borderRadiusXS: i.borderRadiusXS, borderRadiusSM: i.borderRadiusSM, borderRadiusLG: i.borderRadiusLG, fontWeightStrong: 600, opacityLoading: 0.65, linkDecoration: 'none', linkHoverDecoration: 'none', linkFocusDecoration: 'none', controlPaddingHorizontal: 12, controlPaddingHorizontalSM: 8, paddingXXS: i.sizeXXS, paddingXS: i.sizeXS, paddingSM: i.sizeSM, padding: i.size, paddingMD: i.sizeMD, paddingLG: i.sizeLG, paddingXL: i.sizeXL, paddingContentHorizontalLG: i.sizeLG, paddingContentVerticalLG: i.sizeMS, paddingContentHorizontal: i.sizeMS, paddingContentVertical: i.sizeSM, paddingContentHorizontalSM: i.size, paddingContentVerticalSM: i.sizeXS, marginXXS: i.sizeXXS, marginXS: i.sizeXS, marginSM: i.sizeSM, margin: i.size, marginMD: i.sizeMD, marginLG: i.sizeLG, marginXL: i.sizeXL, marginXXL: i.sizeXXL, boxShadow: '\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ', boxShadowSecondary: '\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ', boxShadowTertiary: '\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ', screenXS: 480, screenXSMin: 480, screenXSMax: 575, screenSM: 576, screenSMMin: 576, screenSMMax: 767, screenMD: 768, screenMDMin: 768, screenMDMax: 991, screenLG: 992, screenLGMin: 992, screenLGMax: 1199, screenXL: a, screenXLMin: a, screenXLMax: 1599, screenXXL: o, screenXXLMin: o, screenXXLMax: 1999, screenXXXL: s, screenXXXLMin: s, boxShadowPopoverArrow: '3px 3px 7px rgba(0, 0, 0, 0.1)', boxShadowCard: '\n 0 1px 2px -2px ' .concat(new wW('rgba(0, 0, 0, 0.16)').toRgbString(), ',\n 0 3px 6px 0 ') .concat(new wW('rgba(0, 0, 0, 0.12)').toRgbString(), ',\n 0 5px 12px 4px ') .concat(new wW('rgba(0, 0, 0, 0.09)').toRgbString(), '\n '), boxShadowDrawerRight: '\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ', boxShadowDrawerLeft: '\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ', boxShadowDrawerUp: '\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ', boxShadowDrawerDown: '\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ', boxShadowTabsOverflowLeft: 'inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)', boxShadowTabsOverflowRight: 'inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)', boxShadowTabsOverflowTop: 'inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)', boxShadowTabsOverflowBottom: 'inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)', }), r ) } var qW = function (e) { return { boxSizing: 'border-box', margin: 0, padding: 0, color: e.colorText, fontSize: e.fontSize, lineHeight: e.lineHeight, listStyle: 'none', fontFamily: e.fontFamily, } }, XW = function (e) { return { a: M( M( M( { color: e.colorLink, textDecoration: e.linkDecoration, backgroundColor: 'transparent', outline: 'none', cursor: 'pointer', transition: 'color '.concat(e.motionDurationSlow), '-webkit-text-decoration-skip': 'objects', '&:hover': { color: e.colorLinkHover }, '&:active': { color: e.colorLinkActive }, }, '&:active,\n &:hover', { textDecoration: e.linkHoverDecoration, outline: 0 } ), '&:focus', { textDecoration: e.linkFocusDecoration, outline: 0 } ), '&[disabled]', { color: e.colorTextDisabled, cursor: 'not-allowed' } ), } }, YW = function (e, t) { var n = e.fontFamily, r = e.fontSize, i = '[class^="'.concat(t, '"], [class*=" ').concat(t, '"]') return M( {}, i, M( { fontFamily: n, fontSize: r, boxSizing: 'border-box', '&::before, &::after': { boxSizing: 'border-box' }, }, i, { boxSizing: 'border-box', '&::before, &::after': { boxSizing: 'border-box' } } ) ) } function KW(e, t, n) { return function (r) { var i = Ea(function () { return null == r ? void 0 : r.value }), a = C(oG(), 3), o = a[0], s = a[1], u = a[2], l = gV(), c = l.getPrefixCls, h = l.iconPrefixCls, d = Ea(function () { return c() }) return ( rW( Ea(function () { return { theme: o.value, token: s.value, hashId: u.value, path: ['Shared', d.value], } }), function () { return [{ '&': XW(s.value) }] } ), [ rW( Ea(function () { return { theme: o.value, token: s.value, hashId: u.value, path: [e, i.value, h.value], } }), function () { var r = (function (e) { var t, n = e, r = eG ZW && ((t = new Set()), (n = new Proxy(e, { get: function (e, n) { return (JW && t.add(n), e[n]) }, })), (r = function (e, n) { Array.from(t) })) return { token: n, keys: t, flush: r } })(s.value), a = r.token, o = r.flush, l = eV(eV({}, 'function' == typeof n ? n(a) : n), s.value[e]), c = $W( a, { componentCls: '.'.concat(i.value), prefixCls: i.value, iconCls: '.'.concat(h.value), antCls: '.'.concat(d.value), }, l ), f = t(c, { hashId: u.value, prefixCls: i.value, rootPrefixCls: d.value, iconPrefixCls: h.value, overrideComponentToken: s.value[e], }) return (o(e, l), [YW(s.value, i.value), f]) } ), u, ] ) } } var ZW = 'undefined' != typeof CSSINJS_STATISTIC, JW = !0 function $W() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] if (!ZW) return eV.apply(void 0, [{}].concat(t)) JW = !1 var r = {} return ( t.forEach(function (e) { Object.keys(e).forEach(function (t) { Object.defineProperty(r, t, { configurable: !0, enumerable: !0, get: function () { return e[t] }, }) }) }), (JW = !0), r ) } function eG() {} var tG = JV(function (e) { var t = Object.keys(OW) .map(function (t) { var n = IW(e[t]) return new Array(10).fill(1).reduce(function (e, r, i) { return ((e[''.concat(t, '-').concat(i + 1)] = n[i]), e) }, {}) }) .reduce(function (e, t) { return (e = eV(eV({}, e), t)) }, {}) return eV( eV( eV( eV( eV( eV(eV({}, e), t), (function (e, t) { var n = t.generateColorPalettes, r = t.generateNeutralColorPalettes, i = e.colorSuccess, a = e.colorWarning, o = e.colorError, s = e.colorInfo, u = e.colorPrimary, l = e.colorBgBase, c = e.colorTextBase, h = n(u), d = n(i), f = n(a), p = n(o), v = n(s) return eV(eV({}, r(l, c)), { colorPrimaryBg: h[1], colorPrimaryBgHover: h[2], colorPrimaryBorder: h[3], colorPrimaryBorderHover: h[4], colorPrimaryHover: h[5], colorPrimary: h[6], colorPrimaryActive: h[7], colorPrimaryTextHover: h[8], colorPrimaryText: h[9], colorPrimaryTextActive: h[10], colorSuccessBg: d[1], colorSuccessBgHover: d[2], colorSuccessBorder: d[3], colorSuccessBorderHover: d[4], colorSuccessHover: d[4], colorSuccess: d[6], colorSuccessActive: d[7], colorSuccessTextHover: d[8], colorSuccessText: d[9], colorSuccessTextActive: d[10], colorErrorBg: p[1], colorErrorBgHover: p[2], colorErrorBorder: p[3], colorErrorBorderHover: p[4], colorErrorHover: p[5], colorError: p[6], colorErrorActive: p[7], colorErrorTextHover: p[8], colorErrorText: p[9], colorErrorTextActive: p[10], colorWarningBg: f[1], colorWarningBgHover: f[2], colorWarningBorder: f[3], colorWarningBorderHover: f[4], colorWarningHover: f[4], colorWarning: f[6], colorWarningActive: f[7], colorWarningTextHover: f[8], colorWarningText: f[9], colorWarningTextActive: f[10], colorInfoBg: v[1], colorInfoBgHover: v[2], colorInfoBorder: v[3], colorInfoBorderHover: v[4], colorInfoHover: v[4], colorInfo: v[6], colorInfoActive: v[7], colorInfoTextHover: v[8], colorInfoText: v[9], colorInfoTextActive: v[10], colorBgMask: new wW('#000').setAlpha(0.45).toRgbString(), colorWhite: '#fff', }) })(e, { generateColorPalettes: zW, generateNeutralColorPalettes: VW }) ), HW(e.fontSize) ), (function (e) { var t = e.sizeUnit, n = e.sizeStep return { sizeXXL: t * (n + 8), sizeXL: t * (n + 4), sizeLG: t * (n + 2), sizeMD: t * (n + 1), sizeMS: t * n, size: t * n, sizeSM: t * (n - 1), sizeXS: t * (n - 2), sizeXXS: t * (n - 3), } })(e) ), (function (e) { var t = e.controlHeight return { controlHeightSM: 0.75 * t, controlHeightXS: 0.5 * t, controlHeightLG: 1.25 * t, } })(e) ), (function (e) { var t, n, r, i, a, o = e.motionUnit, s = e.motionBase, u = e.borderRadius, l = e.lineWidth return eV( { motionDurationFast: ''.concat((s + o).toFixed(1), 's'), motionDurationMid: ''.concat((s + 2 * o).toFixed(1), 's'), motionDurationSlow: ''.concat((s + 3 * o).toFixed(1), 's'), lineWidthBold: l + 1, }, ((n = t = u), (r = t), (i = t), (a = t), t < 6 && t >= 5 ? (n = t + 1) : t < 16 && t >= 6 ? (n = t + 2) : t >= 16 && (n = 16), t < 7 && t >= 5 ? (r = 4) : t < 8 && t >= 7 ? (r = 5) : t < 14 && t >= 8 ? (r = 6) : t < 16 && t >= 14 ? (r = 7) : t >= 16 && (r = 8), t < 6 && t >= 2 ? (i = 1) : t >= 6 && (i = 2), t > 4 && t < 8 ? (a = 4) : t >= 8 && (a = 6), { borderRadius: t > 16 ? 16 : t, borderRadiusXS: i, borderRadiusSM: r, borderRadiusLG: n, borderRadiusOuter: a, }) ) })(e) ) }), nG = { token: FW, hashed: !0 }, rG = Symbol('DesignTokenContext'), iG = nn(), aG = ar({ props: { value: uV() }, setup: function (e, t) { var n, r = t.slots return ( (n = Ea(function () { return e.value })), $r(rG, n), Ti( n, function () { var e ;((iG.value = on(n)), (e = iG).dep && e.dep.trigger()) }, { immediate: !0, deep: !0 } ), function () { var e return null === (e = r.default) || void 0 === e ? void 0 : e.call(r) } ) }, }) function oG() { var e = ei( rG, Ea(function () { return iG.value || nG }) ), t = Ea(function () { return ''.concat('4.2.6', '-').concat(e.value.hashed || '') }), n = Ea(function () { return e.value.theme || tG }), r = uH( n, Ea(function () { return [FW, e.value.token] }), Ea(function () { return { salt: t.value, override: eV({ override: e.value.token }, e.value.components), formatToken: QW, } }) ) return [ n, Ea(function () { return r.value[0] }), Ea(function () { return e.value.hashed ? r.value[1] : '' }), ] } var sG = ar({ compatConfig: { MODE: 3 }, setup: function () { var e = C(oG(), 2)[1], t = Ea(function () { return new wW(e.value.colorBgBase).toHsl().l < 0.5 ? { opacity: 0.65 } : {} }) return function () { return ta( 'svg', { style: t.value, width: '184', height: '152', viewBox: '0 0 184 152', xmlns: 'http://www.w3.org/2000/svg', }, [ ta('g', { fill: 'none', 'fill-rule': 'evenodd' }, [ ta('g', { transform: 'translate(24 31.67)' }, [ ta( 'ellipse', { 'fill-opacity': '.8', fill: '#F5F5F7', cx: '67.797', cy: '106.89', rx: '67.797', ry: '12.668', }, null ), ta( 'path', { 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', fill: '#AEB8C2', }, null ), ta( 'path', { 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', fill: 'url(#linearGradient-1)', transform: 'translate(13.56)', }, null ), ta( 'path', { 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', fill: '#F5F5F7', }, null ), ta( 'path', { 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', fill: '#DCE0E6', }, null ), ]), ta( 'path', { 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', fill: '#DCE0E6', }, null ), ta('g', { transform: 'translate(149.65 15.383)', fill: '#FFF' }, [ ta( 'ellipse', { cx: '20.654', cy: '3.167', rx: '2.849', ry: '2.815' }, null ), ta( 'path', { d: 'M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z' }, null ), ]), ]), ] ) } }, }) sG.PRESENTED_IMAGE_DEFAULT = !0 var uG = ar({ compatConfig: { MODE: 3 }, setup: function () { var e = C(oG(), 2)[1], t = Ea(function () { var t = e.value, n = t.colorFill, r = t.colorFillTertiary, i = t.colorFillQuaternary, a = t.colorBgContainer return { borderColor: new wW(n).onBackground(a).toHexString(), shadowColor: new wW(r).onBackground(a).toHexString(), contentColor: new wW(i).onBackground(a).toHexString(), } }) return function () { return ta( 'svg', { width: '64', height: '41', viewBox: '0 0 64 41', xmlns: 'http://www.w3.org/2000/svg', }, [ ta('g', { transform: 'translate(0 1)', fill: 'none', 'fill-rule': 'evenodd' }, [ ta( 'ellipse', { fill: t.value.shadowColor, cx: '32', cy: '33', rx: '32', ry: '7' }, null ), ta('g', { 'fill-rule': 'nonzero', stroke: t.value.borderColor }, [ ta( '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', }, null ), ta( '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', fill: t.value.contentColor, }, null ), ]), ]), ] ) } }, }) uG.PRESENTED_IMAGE_SIMPLE = !0 var lG = function (e) { var t = e.componentCls, n = e.margin, r = e.marginXS, i = e.marginXL return M( {}, t, M( M( M( M( { marginInline: r, fontSize: e.fontSize, lineHeight: e.lineHeight, textAlign: 'center', }, ''.concat(t, '-image'), { height: e.emptyImgHeight, marginBottom: r, opacity: e.opacityImage, img: { height: '100%' }, svg: { height: '100%', margin: 'auto' }, } ), ''.concat(t, '-footer'), { marginTop: n } ), '&-normal', M({ marginBlock: i, color: e.colorTextDisabled }, ''.concat(t, '-image'), { height: e.emptyImgHeightMD, }) ), '&-small', M({ marginBlock: r, color: e.colorTextDisabled }, ''.concat(t, '-image'), { height: e.emptyImgHeightSM, }) ) ) }, cG = KW('Empty', function (e) { var t = e.componentCls, n = e.controlHeightLG, r = $W(e, { emptyImgCls: ''.concat(t, '-img'), emptyImgHeight: 2.5 * n, emptyImgHeightMD: n, emptyImgHeightSM: 0.875 * n, }) return [lG(r)] }), hG = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 }, dG = ar({ name: 'AEmpty', compatConfig: { MODE: 3 }, inheritAttrs: !1, props: { prefixCls: String, imageStyle: uV(), image: cV(), description: cV() }, setup: function (e, t) { var n = t.slots, r = void 0 === n ? {} : n, i = t.attrs, a = yG('empty', e), o = a.direction, s = a.prefixCls, u = C(cG(s), 2), l = u[0], c = u[1] return function () { var t, n, a = s.value, u = eV(eV({}, e), i), h = u.image, d = void 0 === h ? (null === (t = r.image) || void 0 === t ? void 0 : t.call(r)) || Ca(sG) : h, f = u.description, p = void 0 === f ? (null === (n = r.description) || void 0 === n ? void 0 : n.call(r)) || void 0 : f, v = u.imageStyle, m = u.class, g = void 0 === m ? '' : m, y = hG(u, ['image', 'description', 'imageStyle', 'class']), _ = 'function' == typeof d ? d() : d, b = 'object' === P(_) && 'type' in _ && _.type.PRESENTED_IMAGE_SIMPLE return l( ta( wV, { componentName: 'Empty', children: function (e) { var t = void 0 !== p ? p : e.description, n = null return ( (n = 'string' == typeof _ ? ta( 'img', { alt: 'string' == typeof t ? t : 'empty', src: _ }, null ) : _), ta( 'div', $z( { class: aV( a, g, c.value, M( M({}, ''.concat(a, '-normal'), b), ''.concat(a, '-rtl'), 'rtl' === o.value ) ), }, y ), [ ta('div', { class: ''.concat(a, '-image'), style: v }, [n]), t && ta('p', { class: ''.concat(a, '-description') }, [t]), r.default && ta('div', { class: ''.concat(a, '-footer') }, [oV(r.default())]), ] ) ) }, }, null ) ) } }, }) ;((dG.PRESENTED_IMAGE_DEFAULT = function () { return Ca(sG) }), (dG.PRESENTED_IMAGE_SIMPLE = function () { return Ca(uG) })) var fG = sV(dG), pG = function (e) { var t = yG('empty', e).prefixCls return (function (e) { switch (e) { case 'Table': case 'List': return ta(fG, { image: fG.PRESENTED_IMAGE_SIMPLE }, null) case 'Select': case 'TreeSelect': case 'Cascader': case 'Transfer': case 'Mentions': return ta( fG, { image: fG.PRESENTED_IMAGE_SIMPLE, class: ''.concat(t.value, '-small') }, null ) default: return ta(fG, null, null) } })(e.componentName) } function vG(e) { return ta(pG, { componentName: e }, null) } var mG = Symbol('SizeContextKey'), gG = function () { return ei(mG, tn(void 0)) }, yG = function (e, t) { var n = gG(), r = _V(), i = ei( vV, eV(eV({}, mV), { renderEmpty: function (e) { return Ca(pG, { componentName: e }) }, }) ), a = Ea(function () { return i.getPrefixCls(e, t.prefixCls) }), o = Ea(function () { var e, n return null !== (e = t.direction) && void 0 !== e ? e : null === (n = i.direction) || void 0 === n ? void 0 : n.value }), s = Ea(function () { var e return null !== (e = t.iconPrefixCls) && void 0 !== e ? e : i.iconPrefixCls.value }), u = Ea(function () { return i.getPrefixCls() }), l = Ea(function () { var e return null === (e = i.autoInsertSpaceInButton) || void 0 === e ? void 0 : e.value }), c = i.renderEmpty, h = i.space, d = i.pageHeader, f = i.form, p = Ea(function () { var e, n return null !== (e = t.getTargetContainer) && void 0 !== e ? e : null === (n = i.getTargetContainer) || void 0 === n ? void 0 : n.value }), v = Ea(function () { var e, n, r return null !== (n = null !== (e = t.getContainer) && void 0 !== e ? e : t.getPopupContainer) && void 0 !== n ? n : null === (r = i.getPopupContainer) || void 0 === r ? void 0 : r.value }), m = Ea(function () { var e, n return null !== (e = t.dropdownMatchSelectWidth) && void 0 !== e ? e : null === (n = i.dropdownMatchSelectWidth) || void 0 === n ? void 0 : n.value }), g = Ea(function () { var e return ( (void 0 === t.virtual ? !1 !== (null === (e = i.virtual) || void 0 === e ? void 0 : e.value) : !1 !== t.virtual) && !1 !== m.value ) }), y = Ea(function () { return t.size || n.value }), _ = Ea(function () { var e, n, r return null !== (e = t.autocomplete) && void 0 !== e ? e : null === (r = null === (n = i.input) || void 0 === n ? void 0 : n.value) || void 0 === r ? void 0 : r.autocomplete }), b = Ea(function () { var e return null !== (e = t.disabled) && void 0 !== e ? e : r.value }), x = Ea(function () { var e return null !== (e = t.csp) && void 0 !== e ? e : i.csp }), S = Ea(function () { var e, n return null !== (e = t.wave) && void 0 !== e ? e : null === (n = i.wave) || void 0 === n ? void 0 : n.value }) return { configProvider: i, prefixCls: a, direction: o, size: y, getTargetContainer: p, getPopupContainer: v, space: h, pageHeader: d, form: f, autoInsertSpaceInButton: l, renderEmpty: c, virtual: g, dropdownMatchSelectWidth: m, rootPrefixCls: u, getPrefixCls: i.getPrefixCls, autocomplete: _, csp: x, iconPrefixCls: s, disabled: b, select: i.select, wave: S, } } function _G(e, t, n) { return ( n && (function (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, r.key, r)) } })(e, n), e ) } function bG() { return (bG = Object.assign || 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 }).apply(this, arguments) } function xG(e, t) { ;((e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), (e.__proto__ = t)) } function SG(e, t) { if (null == e) return {} var n, r, i = {}, a = Object.keys(e) for (r = 0; r < a.length; r++) t.indexOf((n = a[r])) >= 0 || (i[n] = e[n]) return i } function AG(e) { return ( 1 == (null != (t = e) && 'object' == P(t) && !1 === Array.isArray(t)) && '[object Object]' === Object.prototype.toString.call(e) ) var t } var wG = Object.prototype, TG = wG.toString, MG = wG.hasOwnProperty, EG = /^\s*function (\w+)/ function CG(e) { var t, n = null !== (t = null == e ? void 0 : e.type) && void 0 !== t ? t : e if (n) { var r = n.toString().match(EG) return r ? r[1] : '' } return '' } var kG = function (e) { var t, n return ( !1 !== AG(e) && 'function' == typeof (t = e.constructor) && !1 !== AG((n = t.prototype)) && !1 !== n.hasOwnProperty('isPrototypeOf') ) }, RG = function (e) { return e }, IG = function (e, t) { return MG.call(e, t) }, NG = Number.isInteger || function (e) { return 'number' == typeof e && isFinite(e) && Math.floor(e) === e }, PG = Array.isArray || function (e) { return '[object Array]' === TG.call(e) }, LG = function (e) { return '[object Function]' === TG.call(e) }, DG = function (e) { return kG(e) && IG(e, '_vueTypes_name') }, OG = function (e) { return ( kG(e) && (IG(e, 'type') || ['_vueTypes_name', 'validator', 'default', 'required'].some(function (t) { return IG(e, t) })) ) } function FG(e, t) { return Object.defineProperty(e.bind(t), '__original', { value: e }) } function BG(e, t, n) { var r, i = !0, a = '' r = kG(e) ? e : { type: e } var o = DG(r) ? r._vueTypes_name + ' - ' : '' if (OG(r) && null !== r.type) { if (void 0 === r.type || !0 === r.type) return i if (!r.required && void 0 === t) return i PG(r.type) ? ((i = r.type.some(function (e) { return !0 === BG(e, t) })), (a = r.type .map(function (e) { return CG(e) }) .join(' or '))) : (i = 'Array' === (a = CG(r)) ? PG(t) : 'Object' === a ? kG(t) : 'String' === a || 'Number' === a || 'Boolean' === a || 'Function' === a ? (function (e) { if (null == e) return '' var t = e.constructor.toString().match(EG) return t ? t[1] : '' })(t) === a : t instanceof r.type) } if (!i) return o + 'value "' + t + '" should be of type "' + a + '"' if (IG(r, 'validator') && LG(r.validator)) { var s = RG, u = [] if ( ((RG = function (e) { u.push(e) }), (i = r.validator(t)), (RG = s), !i) ) { var l = (u.length > 1 ? '* ' : '') + u.join('\n* ') return ((u.length = 0), l) } } return i } function UG(e, t) { var n = Object.defineProperties(t, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get: function () { return ((this.required = !0), this) }, }, def: { value: function (e) { return void 0 !== e || this.default ? LG(e) || !0 === BG(this, e) ? ((this.default = PG(e) ? function () { return [].concat(e) } : kG(e) ? function () { return Object.assign({}, e) } : e), this) : (RG(this._vueTypes_name + ' - invalid default value: "' + e + '"'), this) : this }, }, }), r = n.validator return (LG(r) && (n.validator = FG(r, n)), n) } function zG(e, t) { var n = UG(e, t) return Object.defineProperty(n, 'validate', { value: function (e) { return ( LG(this.validator) && RG( this._vueTypes_name + ' - calling .validate() will overwrite the current custom validator function. Validator info:\n' + JSON.stringify(this) ), (this.validator = FG(e, this)), this ) }, }) } function VG(e, t, n) { var r, i, a = ((r = t), (i = {}), Object.getOwnPropertyNames(r).forEach(function (e) { i[e] = Object.getOwnPropertyDescriptor(r, e) }), Object.defineProperties({}, i)) if (((a._vueTypes_name = e), !kG(n))) return a var o, s, u = n.validator, l = SG(n, ['validator']) if (LG(u)) { var c = a.validator ;(c && (c = null !== (s = (o = c).__original) && void 0 !== s ? s : o), (a.validator = FG( c ? function (e) { return c.call(this, e) && u.call(this, e) } : u, a ))) } return Object.assign(a, l) } function HG(e) { return e.replace(/^(?!\s*$)/gm, ' ') } var WG = (function () { function e() {} return ( (e.extend = function (e) { var t = this if (PG(e)) return ( e.forEach(function (e) { return t.extend(e) }), this ) var n = e.name, r = e.validate, i = void 0 !== r && r, a = e.getter, o = void 0 !== a && a, s = SG(e, ['name', 'validate', 'getter']) if (IG(this, n)) throw new TypeError('[VueTypes error]: Type "' + n + '" already defined') var u, l = s.type return DG(l) ? (delete s.type, Object.defineProperty( this, n, o ? { get: function () { return VG(n, l, s) }, } : { value: function () { var e, t = VG(n, l, s) return ( t.validator && (t.validator = (e = t.validator).bind.apply( e, [t].concat([].slice.call(arguments)) )), t ) }, } )) : ((u = o ? { get: function () { var e = Object.assign({}, s) return i ? zG(n, e) : UG(n, e) }, enumerable: !0, } : { value: function () { var e, t, r = Object.assign({}, s) return ( (e = i ? zG(n, r) : UG(n, r)), r.validator && (e.validator = (t = r.validator).bind.apply( t, [e].concat([].slice.call(arguments)) )), e ) }, enumerable: !0, }), Object.defineProperty(this, n, u)) }), _G(e, 0, [ { key: 'any', get: function () { return zG('any', {}) }, }, { key: 'func', get: function () { return zG('function', { type: Function }).def(this.defaults.func) }, }, { key: 'bool', get: function () { return zG('boolean', { type: Boolean }).def(this.defaults.bool) }, }, { key: 'string', get: function () { return zG('string', { type: String }).def(this.defaults.string) }, }, { key: 'number', get: function () { return zG('number', { type: Number }).def(this.defaults.number) }, }, { key: 'array', get: function () { return zG('array', { type: Array }).def(this.defaults.array) }, }, { key: 'object', get: function () { return zG('object', { type: Object }).def(this.defaults.object) }, }, { key: 'integer', get: function () { return UG('integer', { type: Number, validator: function (e) { return NG(e) }, }).def(this.defaults.integer) }, }, { key: 'symbol', get: function () { return UG('symbol', { validator: function (e) { return 'symbol' == P(e) }, }) }, }, ]), e ) })() function GG(e) { var t return ( void 0 === e && (e = { func: function () {}, bool: !0, string: '', number: 0, array: function () { return [] }, object: function () { return {} }, integer: 0, }), ((t = (function (t) { function n() { return t.apply(this, arguments) || this } return ( xG(n, t), _G(n, 0, [ { key: 'sensibleDefaults', get: function () { return bG({}, this.defaults) }, set: function (t) { this.defaults = !1 !== t ? bG({}, !0 !== t ? t : e) : {} }, }, ]), n ) })(WG)).defaults = bG({}, e)), t ) } ;((WG.defaults = {}), (WG.custom = function (e, t) { if ((void 0 === t && (t = 'custom validation failed'), 'function' != typeof e)) throw new TypeError('[VueTypes error]: You must provide a function as argument') return UG(e.name || '<>', { validator: function (n) { var r = e(n) return (r || RG(this._vueTypes_name + ' - ' + t), r) }, }) }), (WG.oneOf = function (e) { if (!PG(e)) throw new TypeError('[VueTypes error]: You must provide an array as argument.') var t = 'oneOf - value should be one of "' + e.join('", "') + '".', n = e.reduce(function (e, t) { if (null != t) { var n = t.constructor ;-1 === e.indexOf(n) && e.push(n) } return e }, []) return UG('oneOf', { type: n.length > 0 ? n : void 0, validator: function (n) { var r = -1 !== e.indexOf(n) return (r || RG(t), r) }, }) }), (WG.instanceOf = function (e) { return UG('instanceOf', { type: e }) }), (WG.oneOfType = function (e) { if (!PG(e)) throw new TypeError('[VueTypes error]: You must provide an array as argument') for (var t = !1, n = [], r = 0; r < e.length; r += 1) { var i = e[r] if (OG(i)) { if (DG(i) && 'oneOf' === i._vueTypes_name) { n = n.concat(i.type) continue } if ((LG(i.validator) && (t = !0), !0 !== i.type && i.type)) { n = n.concat(i.type) continue } } n.push(i) } return ( (n = n.filter(function (e, t) { return n.indexOf(e) === t })), UG( 'oneOfType', t ? { type: n, validator: function (t) { var n = [], r = e.some(function (e) { var r = BG( DG(e) && 'oneOf' === e._vueTypes_name ? e.type || null : e, t ) return ('string' == typeof r && n.push(r), !0 === r) }) return ( r || RG( 'oneOfType - provided value does not match any of the ' + n.length + ' passed-in validators:\n' + HG(n.join('\n')) ), r ) }, } : { type: n } ) ) }), (WG.arrayOf = function (e) { return UG('arrayOf', { type: Array, validator: function (t) { var n, r = t.every(function (t) { return !0 === (n = BG(e, t)) }) return (r || RG('arrayOf - value validation error:\n' + HG(n)), r) }, }) }), (WG.objectOf = function (e) { return UG('objectOf', { type: Object, validator: function (t) { var n, r = Object.keys(t).every(function (r) { return !0 === (n = BG(e, t[r])) }) return (r || RG('objectOf - value validation error:\n' + HG(n)), r) }, }) }), (WG.shape = function (e) { var t = Object.keys(e), n = t.filter(function (t) { var n return !!(null === (n = e[t]) || void 0 === n ? void 0 : n.required) }), r = UG('shape', { type: Object, validator: function (r) { var i = this if (!kG(r)) return !1 var a = Object.keys(r) if ( n.length > 0 && n.some(function (e) { return -1 === a.indexOf(e) }) ) { var o = n.filter(function (e) { return -1 === a.indexOf(e) }) return ( RG( 1 === o.length ? 'shape - required property "' + o[0] + '" is not defined.' : 'shape - required properties "' + o.join('", "') + '" are not defined.' ), !1 ) } return a.every(function (n) { if (-1 === t.indexOf(n)) return ( !0 === i._vueTypes_isLoose || (RG( 'shape - shape definition does not include a "' + n + '" property. Allowed keys: "' + t.join('", "') + '".' ), !1) ) var a = BG(e[n], r[n]) return ( 'string' == typeof a && RG('shape - "' + n + '" property validation error:\n ' + HG(a)), !0 === a ) }) }, }) return ( Object.defineProperty(r, '_vueTypes_isLoose', { writable: !0, value: !1 }), Object.defineProperty(r, 'loose', { get: function () { return ((this._vueTypes_isLoose = !0), this) }, }), r ) }), (WG.utils = { validate: function (e, t) { return !0 === BG(t, e) }, toType: function (e, t, n) { return (void 0 === n && (n = !1), n ? zG(e, t) : UG(e, t)) }, }), (function (e) { function t() { return e.apply(this, arguments) || this } xG(t, e) })(GG())) var jG = GG({ func: void 0, bool: void 0, string: void 0, number: void 0, array: void 0, object: void 0, integer: void 0, }) ;(jG.extend([ { name: 'looseBool', getter: !0, type: Boolean, default: void 0 }, { name: 'style', getter: !0, type: [String, Object], default: void 0 }, { name: 'VueNode', getter: !0, type: null }, ]), (function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] })('bottomLeft', 'bottomRight', 'topLeft', 'topRight')) var QG = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return eV( e ? { name: e, appear: !0, appearActiveClass: ''.concat(e), appearToClass: ''.concat(e, '-appear ').concat(e, '-appear-active'), enterFromClass: '' .concat(e, '-appear ') .concat(e, '-enter ') .concat(e, '-appear-prepare ') .concat(e, '-enter-prepare'), enterActiveClass: ''.concat(e), enterToClass: '' .concat(e, '-enter ') .concat(e, '-appear ') .concat(e, '-appear-active ') .concat(e, '-enter-active'), leaveActiveClass: ''.concat(e, ' ').concat(e, '-leave'), leaveToClass: ''.concat(e, '-leave-active'), } : { css: !1 }, t ) }, qG = Symbol('PortalContextKey'), XG = function () { !(function (e) { $r(qG, { inTriggerContext: (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { inTriggerContext: !0 } ).inTriggerContext, shouldRender: Ea(function () { var t = e || {}, n = t.sPopupVisible, r = t.popupRef, i = t.forceRender, a = t.autoDestroy, o = !1 return ((n || r || i) && (o = !0), !n && a && (o = !1), o) }), }) })({}, { inTriggerContext: !1 }) var e = ei(qG, { shouldRender: Ea(function () { return !1 }), inTriggerContext: !1, }) return { shouldRender: Ea(function () { return e.shouldRender.value || !1 === e.inTriggerContext }), } }, YG = ar({ compatConfig: { MODE: 3 }, name: 'Portal', inheritAttrs: !1, props: { getContainer: jG.func.isRequired, didUpdate: Function }, setup: function (e, t) { var n, r = t.slots, i = !0, a = XG().shouldRender function o() { a.value && (n = e.getContainer()) } ;(gr(function () { ;((i = !1), o()) }), yr(function () { n || o() })) var s = Ti(a, function () { ;(a.value && !n && (n = e.getContainer()), n && s()) }) return ( br(function () { Cn(function () { var t a.value && (null === (t = e.didUpdate) || void 0 === t || t.call(e, e)) }) }), function () { var e return a.value ? i ? null === (e = r.default) || void 0 === e ? void 0 : e.call(r) : n ? ta(Yn, { to: n }, r) : null : null } ) }, }), KG = Symbol('iconContext'), ZG = function () { return ei(KG, { prefixCls: tn('anticon'), rootClassName: tn(''), csp: tn() }) } function JG() { return !( 'undefined' == typeof window || !window.document || !window.document.createElement ) } var $G = 'data-vc-order', ej = new Map() function tj() { var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).mark return e ? (e.startsWith('data-') ? e : 'data-'.concat(e)) : 'vc-icon-key' } function nj(e) { return e.attachTo ? e.attachTo : document.querySelector('head') || document.body } function rj(e) { return Array.from((ej.get(e) || e).children).filter(function (e) { return 'STYLE' === e.tagName }) } function ij(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} if (!JG()) return null var n = t.csp, r = t.prepend, i = document.createElement('style') ;(i.setAttribute( $G, (function (e) { return 'queue' === e ? 'prependQueue' : e ? 'prepend' : 'append' })(r) ), n && n.nonce && (i.nonce = n.nonce), (i.innerHTML = e)) var a = nj(t), o = a.firstChild if (r) { if ('queue' === r) { var s = rj(a).filter(function (e) { return ['prepend', 'prependQueue'].includes(e.getAttribute($G)) }) if (s.length) return (a.insertBefore(i, s[s.length - 1].nextSibling), i) } a.insertBefore(i, o) } else a.appendChild(i) return i } function aj(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} !(function (e, t) { var n = ej.get(e) if ( !n || !(function (e, t) { return !!e && !!e.contains && e.contains(t) })(document, n) ) { var r = ij('', t), i = r.parentNode ;(ej.set(e, i), e.removeChild(r)) } })(nj(n), n) var r = (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {} return rj(nj(t)).find(function (n) { return n.getAttribute(tj(t)) === e }) })(t, n) if (r) return ( n.csp && n.csp.nonce && r.nonce !== n.csp.nonce && (r.nonce = n.csp.nonce), r.innerHTML !== e && (r.innerHTML = e), r ) var i = ij(e, n) return (i.setAttribute(tj(n), t), i) } function oj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { sj(e, t, n[t]) })) } return e } function sj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } function uj(e) { return ( 'object' === P(e) && 'string' == typeof e.name && 'string' == typeof e.theme && ('object' === P(e.icon) || 'function' == typeof e.icon) ) } function lj(e, t, n) { return Ca( e.tag, n ? oj({ key: t }, n, e.attrs) : oj({ key: t }, e.attrs), (e.children || []).map(function (n, r) { return lj(n, ''.concat(t, '-').concat(e.tag, '-').concat(r)) }) ) } function cj(e) { return IW(e)[0] } function hj(e) { return e ? (Array.isArray(e) ? e : [e]) : [] } function dj(e) { return e && e.getRootNode && e.getRootNode() } function fj(e) { return (function (e) { return !!JG() && dj(e) instanceof ShadowRoot })(e) ? dj(e) : null } var pj = ['icon', 'primaryColor', 'secondaryColor'] function vj(e, t) { if (null == e) return {} var n, r, i = (function (e, t) { if (null == e) return {} var n, r, i = {}, a = Object.keys(e) for (r = 0; r < a.length; r++) ((n = a[r]), t.indexOf(n) >= 0 || (i[n] = e[n])) return i })(e, t) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(e) for (r = 0; r < a.length; r++) ((n = a[r]), t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (i[n] = e[n]))) } return i } function mj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { gj(e, t, n[t]) })) } return e } function gj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var yj = Wt({ primaryColor: '#333', secondaryColor: '#E6E6E6', calculated: !1 }) var _j = function (e, t) { var n = mj({}, e, t.attrs), r = n.icon, i = n.primaryColor, a = n.secondaryColor, o = vj(n, pj), s = yj if ((i && (s = { primaryColor: i, secondaryColor: a || cj(i) }), uj(r), !uj(r))) return null var u = r return ( u && 'function' == typeof u.icon && (u = mj({}, u, { icon: u.icon(s.primaryColor, s.secondaryColor) })), lj( u.icon, 'svg-'.concat(u.name), mj({}, o, { 'data-icon': u.name, width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true', }) ) ) } function bj(e, t) { return ( (function (e) { if (Array.isArray(e)) return e })(e) || (function (e, t) { var n = null == e ? null : ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator'] if (null == n) return var r, i, a = [], o = !0, s = !1 try { for ( n = n.call(e); !(o = (r = n.next()).done) && (a.push(r.value), !t || a.length !== t); o = !0 ); } catch (u) { ;((s = !0), (i = u)) } finally { try { o || null == n.return || n.return() } finally { if (s) throw i } } return a })(e, t) || (function (e, t) { if (!e) return if ('string' == typeof e) return xj(e, t) var n = Object.prototype.toString.call(e).slice(8, -1) 'Object' === n && e.constructor && (n = e.constructor.name) if ('Map' === n || 'Set' === n) return Array.from(e) if ('Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return xj(e, t) })(e, t) || (function () { throw new TypeError( 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ) })() ) } function xj(e, t) { ;(null == t || t > e.length) && (t = e.length) for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n] return r } function Sj(e) { var t = bj(hj(e), 2), n = t[0], r = t[1] return _j.setTwoToneColors({ primaryColor: n, secondaryColor: r }) } ;((_j.props = { icon: Object, primaryColor: String, secondaryColor: String, focusable: String, }), (_j.inheritAttrs = !1), (_j.displayName = 'IconBase'), (_j.getTwoToneColors = function () { return mj({}, yj) }), (_j.setTwoToneColors = function (e) { var t = e.primaryColor, n = e.secondaryColor ;((yj.primaryColor = t), (yj.secondaryColor = n || cj(t)), (yj.calculated = !!n)) })) var Aj = ar({ name: 'InsertStyles', setup: function () { var e, t, n, r, i return ( (e = ZG()), (t = e.prefixCls), (n = e.csp), (r = va()), (i = '\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n'), t && (i = i.replace(/anticon/g, t.value)), Cn(function () { if (JG()) { var e = fj(r.vnode.el) aj(i, '@ant-design-vue-icons', { prepend: !0, csp: n.value, attachTo: e }) } }), function () { return null } ) }, }), wj = ['class', 'icon', 'spin', 'rotate', 'tabindex', 'twoToneColor', 'onClick'] function Tj(e, t) { return ( (function (e) { if (Array.isArray(e)) return e })(e) || (function (e, t) { var n = null == e ? null : ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator'] if (null == n) return var r, i, a = [], o = !0, s = !1 try { for ( n = n.call(e); !(o = (r = n.next()).done) && (a.push(r.value), !t || a.length !== t); o = !0 ); } catch (u) { ;((s = !0), (i = u)) } finally { try { o || null == n.return || n.return() } finally { if (s) throw i } } return a })(e, t) || (function (e, t) { if (!e) return if ('string' == typeof e) return Mj(e, t) var n = Object.prototype.toString.call(e).slice(8, -1) 'Object' === n && e.constructor && (n = e.constructor.name) if ('Map' === n || 'Set' === n) return Array.from(e) if ('Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Mj(e, t) })(e, t) || (function () { throw new TypeError( 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' ) })() ) } function Mj(e, t) { ;(null == t || t > e.length) && (t = e.length) for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n] return r } function Ej(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Cj(e, t, n[t]) })) } return e } function Cj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } function kj(e, t) { if (null == e) return {} var n, r, i = (function (e, t) { if (null == e) return {} var n, r, i = {}, a = Object.keys(e) for (r = 0; r < a.length; r++) ((n = a[r]), t.indexOf(n) >= 0 || (i[n] = e[n])) return i })(e, t) if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(e) for (r = 0; r < a.length; r++) ((n = a[r]), t.indexOf(n) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, n) && (i[n] = e[n]))) } return i } Sj(DW.primary) var Rj = function (e, t) { var n, r = Ej({}, e, t.attrs), i = r.class, a = r.icon, o = r.spin, s = r.rotate, u = r.tabindex, l = r.twoToneColor, c = r.onClick, h = kj(r, wj), d = ZG(), f = d.prefixCls, p = d.rootClassName, v = (Cj((n = {}), p.value, !!p.value), Cj(n, f.value, !0), Cj(n, ''.concat(f.value, '-').concat(a.name), Boolean(a.name)), Cj(n, ''.concat(f.value, '-spin'), !!o || 'loading' === a.name), n), m = u void 0 === m && c && (m = -1) var g = s ? { msTransform: 'rotate('.concat(s, 'deg)'), transform: 'rotate('.concat(s, 'deg)'), } : void 0, y = Tj(hj(l), 2), _ = y[0], b = y[1] return ta( 'span', Ej({ role: 'img', 'aria-label': a.name }, h, { onClick: c, class: [v, i], tabindex: m, }), [ ta(_j, { icon: a, primaryColor: _, secondaryColor: b, style: g }, null), ta(Aj, null, null), ] ) } ;((Rj.props = { spin: Boolean, rotate: Number, icon: Object, twoToneColor: [String, Array], }), (Rj.displayName = 'AntdIcon'), (Rj.inheritAttrs = !1), (Rj.getTwoToneColor = function () { var e = _j.getTwoToneColors() return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor }), (Rj.setTwoToneColor = Sj)) var Ij = { 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', } function Nj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Pj(e, t, n[t]) })) } return e } function Pj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var Lj = function (e, t) { var n = Nj({}, e, t.attrs) return ta(Rj, Nj({}, n, { icon: Ij }), null) } ;((Lj.displayName = 'LoadingOutlined'), (Lj.inheritAttrs = !1)) var Dj = { icon: { tag: 'svg', attrs: { 'fill-rule': 'evenodd', viewBox: '64 64 896 896', focusable: 'false' }, children: [ { tag: 'path', attrs: { d: 'M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z', }, }, ], }, name: 'close', theme: 'outlined', } function Oj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Fj(e, t, n[t]) })) } return e } function Fj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var Bj = function (e, t) { var n = Oj({}, e, t.attrs) return ta(Rj, Oj({}, n, { icon: Dj }), null) } ;((Bj.displayName = 'CloseOutlined'), (Bj.inheritAttrs = !1)) var Uj = { icon: { tag: 'svg', attrs: { 'fill-rule': 'evenodd', viewBox: '64 64 896 896', focusable: 'false' }, children: [ { tag: 'path', attrs: { d: 'M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z', }, }, ], }, name: 'close-circle', theme: 'filled', } function zj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Vj(e, t, n[t]) })) } return e } function Vj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var Hj = function (e, t) { var n = zj({}, e, t.attrs) return ta(Rj, zj({}, n, { icon: Uj }), null) } ;((Hj.displayName = 'CloseCircleFilled'), (Hj.inheritAttrs = !1)) var Wj = { 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', } function Gj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { jj(e, t, n[t]) })) } return e } function jj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var Qj = function (e, t) { var n = Gj({}, e, t.attrs) return ta(Rj, Gj({}, n, { icon: Wj }), null) } ;((Qj.displayName = 'CheckCircleOutlined'), (Qj.inheritAttrs = !1)) var qj = { 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', } function Xj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Yj(e, t, n[t]) })) } return e } function Yj(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var Kj = function (e, t) { var n = Xj({}, e, t.attrs) return ta(Rj, Xj({}, n, { icon: qj }), null) } ;((Kj.displayName = 'ExclamationCircleOutlined'), (Kj.inheritAttrs = !1)) var Zj = { 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', } function Jj(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { $j(e, t, n[t]) })) } return e } function $j(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var eQ = function (e, t) { var n = Jj({}, e, t.attrs) return ta(Rj, Jj({}, n, { icon: Zj }), null) } ;((eQ.displayName = 'InfoCircleOutlined'), (eQ.inheritAttrs = !1)) var tQ = { icon: { tag: 'svg', attrs: { 'fill-rule': 'evenodd', viewBox: '64 64 896 896', focusable: 'false' }, children: [ { tag: 'path', attrs: { d: 'M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z', }, }, ], }, name: 'close-circle', theme: 'outlined', } function nQ(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { rQ(e, t, n[t]) })) } return e } function rQ(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var iQ = function (e, t) { var n = nQ({}, e, t.attrs) return ta(Rj, nQ({}, n, { icon: tQ }), null) } ;((iQ.displayName = 'CloseCircleOutlined'), (iQ.inheritAttrs = !1)) var aQ = { 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', } function oQ(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { sQ(e, t, n[t]) })) } return e } function sQ(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var uQ = function (e, t) { var n = oQ({}, e, t.attrs) return ta(Rj, oQ({}, n, { icon: aQ }), null) } ;((uQ.displayName = 'CheckCircleFilled'), (uQ.inheritAttrs = !1)) var lQ = { 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', } function cQ(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { hQ(e, t, n[t]) })) } return e } function hQ(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var dQ = function (e, t) { var n = cQ({}, e, t.attrs) return ta(Rj, cQ({}, n, { icon: lQ }), null) } ;((dQ.displayName = 'ExclamationCircleFilled'), (dQ.inheritAttrs = !1)) var fQ = { 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', } function pQ(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { vQ(e, t, n[t]) })) } return e } function vQ(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var mQ = function (e, t) { var n = pQ({}, e, t.attrs) return ta(Rj, pQ({}, n, { icon: fQ }), null) } ;((mQ.displayName = 'InfoCircleFilled'), (mQ.inheritAttrs = !1)) var gQ = eV({}, AV.Modal) var yQ = 'internalMark', _Q = ar({ compatConfig: { MODE: 3 }, name: 'ALocaleProvider', props: { locale: { type: Object }, ANT_MARK__: String }, setup: function (e, t) { var n = t.slots XV(e.ANT_MARK__ === yQ) var r = Wt({ antLocale: eV(eV({}, e.locale), { exist: !0 }), ANT_MARK__: yQ }) return ( $r('localeData', r), Ti( function () { return e.locale }, function (e) { var t ;((t = e && e.Modal), (gQ = t ? eV(eV({}, gQ), t) : eV({}, AV.Modal)), (r.antLocale = eV(eV({}, e), { exist: !0 }))) }, { immediate: !0 } ), function () { var e return null === (e = n.default) || void 0 === e ? void 0 : e.call(n) } ) }, }) _Q.install = function (e) { return (e.component(_Q.name, _Q), e) } var bQ = sV(_Q), xQ = ar({ name: 'Notice', inheritAttrs: !1, props: [ 'prefixCls', 'duration', 'updateMark', 'noticeKey', 'closeIcon', 'closable', 'props', 'onClick', 'onClose', 'holder', 'visible', ], setup: function (e, t) { var n, r = t.attrs, i = t.slots, a = !1, o = Ea(function () { return void 0 === e.duration ? 4.5 : e.duration }), s = function () { o.value && !a && (n = setTimeout(function () { l() }, 1e3 * o.value)) }, u = function () { n && (clearTimeout(n), (n = null)) }, l = function (t) { ;(t && t.stopPropagation(), u()) var n = e.onClose, r = e.noticeKey n && n(r) } return ( yr(function () { s() }), Sr(function () { ;((a = !0), u()) }), Ti( [ o, function () { return e.updateMark }, function () { return e.visible }, ], function (e, t) { var n = C(e, 3), r = n[0], i = n[1], a = n[2], o = C(t, 3), l = o[0], c = o[1], h = o[2] ;(r !== l || i !== c || (a !== h && h)) && (u(), s()) }, { flush: 'post' } ), function () { var t, n, a = e.prefixCls, o = e.closable, c = e.closeIcon, h = void 0 === c ? null === (t = i.closeIcon) || void 0 === t ? void 0 : t.call(i) : c, d = e.onClick, f = e.holder, p = r.class, v = r.style, m = ''.concat(a, '-notice'), g = Object.keys(r).reduce(function (e, t) { return ( (t.startsWith('data-') || t.startsWith('aria-') || 'role' === t) && (e[t] = r[t]), e ) }, {}), y = ta( 'div', $z( { class: aV(m, p, M({}, ''.concat(m, '-closable'), o)), style: v, onMouseenter: u, onMouseleave: s, onClick: d, }, g ), [ ta('div', { class: ''.concat(m, '-content') }, [ null === (n = i.default) || void 0 === n ? void 0 : n.call(i), ]), o ? ta('a', { tabindex: 0, onClick: l, class: ''.concat(m, '-close') }, [ h || ta('span', { class: ''.concat(m, '-close-x') }, null), ]) : null, ] ) return f ? ta( Yn, { to: f }, { default: function () { return y }, } ) : y } ) }, }), SQ = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 = 0, wQ = Date.now() function TQ() { var e = AQ return ((AQ += 1), 'rcNotification_'.concat(wQ, '_').concat(e)) } var MQ = ar({ name: 'Notification', inheritAttrs: !1, props: ['prefixCls', 'transitionName', 'animation', 'maxCount', 'closeIcon', 'hashId'], setup: function (e, t) { var n = t.attrs, r = t.expose, i = t.slots, a = new Map(), o = tn([]), s = Ea(function () { var t = e.prefixCls, n = e.animation, r = void 0 === n ? 'fade' : n, i = e.transitionName return (!i && r && (i = ''.concat(t, '-').concat(r)), QG(i)) }), u = function (e) { o.value = Kt(o.value).filter(function (t) { var n = t.notice, r = n.key return (n.userPassKey || r) !== e }) } return ( r({ add: function (t, n) { var r = t.key || TQ(), i = eV(eV({}, t), { key: r }), a = e.maxCount, s = o.value .map(function (e) { return e.notice.key }) .indexOf(r), u = o.value.concat() ;(-1 !== s ? u.splice(s, 1, { notice: i, holderCallback: n }) : (a && o.value.length >= a && ((i.key = u[0].notice.key), (i.updateMark = TQ()), (i.userPassKey = r), u.shift()), u.push({ notice: i, holderCallback: n })), (o.value = u)) }, remove: u, notices: o, }), function () { var t, r = e.prefixCls, l = e.closeIcon, c = void 0 === l ? null === (t = i.closeIcon) || void 0 === t ? void 0 : t.call(i, { prefixCls: r }) : l, h = o.value.map(function (t, n) { var i = t.notice, s = t.holderCallback, l = n === o.value.length - 1 ? i.updateMark : void 0, h = i.key, d = i.userPassKey, f = i.content, p = eV( eV( eV( { prefixCls: r, closeIcon: 'function' == typeof c ? c({ prefixCls: r }) : c, }, i ), i.props ), { key: h, noticeKey: d || h, updateMark: l, onClose: function (e) { var t ;(u(e), null === (t = i.onClose) || void 0 === t || t.call(i)) }, onClick: i.onClick, } ) return s ? ta( 'div', { key: h, class: ''.concat(r, '-hook-holder'), ref: function (e) { void 0 !== h && (e ? (a.set(h, e), s(e, p)) : a.delete(h)) }, }, null ) : ta(xQ, $z($z({}, p), {}, { class: aV(p.class, e.hashId) }), { default: function () { return ['function' == typeof f ? f({ prefixCls: r }) : f] }, }) }), d = M(M(M({}, r, 1), n.class, !!n.class), e.hashId, !0) return ta('div', { class: d, style: n.style || { top: '65px', left: '50%' } }, [ ta(Eo, $z({ tag: 'div' }, s.value), { default: function () { return [h] }, }), ]) } ) }, }) MQ.newInstance = function (e, t) { var n = e || {}, r = n.name, i = void 0 === r ? 'notification' : r, a = n.getContainer, o = n.appContext, s = n.prefixCls, u = n.rootPrefixCls, l = n.transitionName, c = n.hasTransitionName, h = n.useStyle, d = SQ(n, [ 'name', 'getContainer', 'appContext', 'prefixCls', 'rootPrefixCls', 'transitionName', 'hasTransitionName', 'useStyle', ]), f = document.createElement('div') a ? a().appendChild(f) : document.body.appendChild(f) var p = ar({ compatConfig: { MODE: 3 }, name: 'NotificationWrapper', setup: function (e, n) { var r = n.attrs, a = nn(), o = Ea(function () { return Iq.getPrefixCls(i, s) }), d = C(h(o), 2)[1] return ( yr(function () { t({ notice: function (e) { var t null === (t = a.value) || void 0 === t || t.add(e) }, removeNotice: function (e) { var t null === (t = a.value) || void 0 === t || t.remove(e) }, destroy: function () { ;(Bo(null, f), f.parentNode && f.parentNode.removeChild(f)) }, component: a, }) }), function () { var e = Iq, t = e.getRootPrefixCls(u, o.value), n = c ? l : ''.concat(o.value, '-').concat(l) return ta(Pq, $z($z({}, e), {}, { prefixCls: t }), { default: function () { return [ ta( MQ, $z( $z({ ref: a }, r), {}, { prefixCls: o.value, transitionName: n, hashId: d.value } ), null ), ] }, }) } ) }, }), v = ta(p, d) ;((v.appContext = o || v.appContext), Bo(v, f)) } var EQ = 0, CQ = Date.now() function kQ() { var e = EQ return ((EQ += 1), 'rcNotification_'.concat(CQ, '_').concat(e)) } var RQ = ar({ name: 'HookNotification', inheritAttrs: !1, props: [ 'prefixCls', 'transitionName', 'animation', 'maxCount', 'closeIcon', 'hashId', 'remove', 'notices', 'getStyles', 'getClassName', 'onAllRemoved', 'getContainer', ], setup: function (e, t) { var n = t.attrs, r = t.slots, i = new Map(), a = Ea(function () { return e.notices }), o = Ea(function () { var t = e.transitionName if (!t && e.animation) switch (P(e.animation)) { case 'string': t = e.animation break case 'function': t = e.animation().name break case 'object': t = e.animation.name break default: t = ''.concat(e.prefixCls, '-fade') } return QG(t) }), s = tn({}) Ti(a, function () { var t = {} ;(Object.keys(s.value).forEach(function (e) { t[e] = [] }), e.notices.forEach(function (e) { var n = e.notice.placement, r = void 0 === n ? 'topRight' : n r && ((t[r] = t[r] || []), t[r].push(e)) }), (s.value = t)) }) var u = Ea(function () { return Object.keys(s.value) }) return function () { var t, l = e.prefixCls, c = e.closeIcon, h = void 0 === c ? null === (t = r.closeIcon) || void 0 === t ? void 0 : t.call(r, { prefixCls: l }) : c, d = u.value.map(function (t) { var r, u, c = s.value[t], d = null === (r = e.getClassName) || void 0 === r ? void 0 : r.call(e, t), f = null === (u = e.getStyles) || void 0 === u ? void 0 : u.call(e, t), p = c.map(function (t, n) { var r = t.notice, o = t.holderCallback, s = n === a.value.length - 1 ? r.updateMark : void 0, u = r.key, c = r.userPassKey, d = r.content, f = eV( eV( eV( { prefixCls: l, closeIcon: 'function' == typeof h ? h({ prefixCls: l }) : h, }, r ), r.props ), { key: u, noticeKey: c || u, updateMark: s, onClose: function (t) { var n ;(!(function (t) { e.remove(t) })(t), null === (n = r.onClose) || void 0 === n || n.call(r)) }, onClick: r.onClick, } ) return o ? ta( 'div', { key: u, class: ''.concat(l, '-hook-holder'), ref: function (e) { void 0 !== u && (e ? (i.set(u, e), o(e, f)) : i.delete(u)) }, }, null ) : ta(xQ, $z($z({}, f), {}, { class: aV(f.class, e.hashId) }), { default: function () { return ['function' == typeof d ? d({ prefixCls: l }) : d] }, }) }), v = M( M( M(M(M({}, l, 1), ''.concat(l, '-').concat(t), 1), n.class, !!n.class), e.hashId, !0 ), d, !!d ) return ta( 'div', { key: t, class: v, style: n.style || f || { top: '65px', left: '50%' } }, [ ta( Eo, $z( $z({ tag: 'div' }, o.value), {}, { onAfterLeave: function () { var n c.length > 0 || (Reflect.deleteProperty(s.value, t), null === (n = e.onAllRemoved) || void 0 === n || n.call(e)) }, } ), { default: function () { return [p] }, } ), ] ) }) return ta( YG, { getContainer: e.getContainer }, { default: function () { return [d] }, } ) } }, }), IQ = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 }, NQ = function () { return document.body }, PQ = 0 function LQ() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.getContainer, n = void 0 === t ? NQ : t, r = e.motion, i = e.prefixCls, a = e.maxCount, o = e.getClassName, s = e.getStyles, u = e.onAllRemoved, l = IQ(e, [ 'getContainer', 'motion', 'prefixCls', 'maxCount', 'getClassName', 'getStyles', 'onAllRemoved', ]), c = nn([]), h = nn(), d = function (e) { c.value = c.value.filter(function (t) { var n = t.notice, r = n.key return (n.userPassKey || r) !== e }) }, f = nn([]), p = { open: function (e) { var t = (function () { for (var e = {}, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r] return ( n.forEach(function (t) { t && Object.keys(t).forEach(function (n) { var r = t[n] void 0 !== r && (e[n] = r) }) }), e ) })(l, e) ;((null !== t.key && void 0 !== t.key) || ((t.key = 'vc-notification-'.concat(PQ)), (PQ += 1)), (f.value = [].concat(I(f.value), [{ type: 'open', config: t }]))) }, close: function (e) { f.value = [].concat(I(f.value), [{ type: 'close', key: e }]) }, destroy: function () { f.value = [].concat(I(f.value), [{ type: 'destroy' }]) }, } return ( Ti(f, function () { f.value.length && (f.value.forEach(function (e) { switch (e.type) { case 'open': !(function (e, t) { var n = e.key || kQ(), r = eV(eV({}, e), { key: n }), i = c.value .map(function (e) { return e.notice.key }) .indexOf(n), o = c.value.concat() ;(-1 !== i ? o.splice(i, 1, { notice: r, holderCallback: t }) : (a && c.value.length >= a && ((r.key = o[0].notice.key), (r.updateMark = kQ()), (r.userPassKey = n), o.shift()), o.push({ notice: r, holderCallback: t })), (c.value = o)) })(e.config) break case 'close': d(e.key) break case 'destroy': c.value = [] } }), (f.value = [])) }), [ p, function () { return ta( RQ, { ref: h, prefixCls: i, maxCount: a, notices: c.value, remove: d, getClassName: o, getStyles: s, animation: r, hashId: e.hashId, onAllRemoved: u, getContainer: n, }, null ) }, ] ) } var DQ = function (e) { var t = e.componentCls, n = e.iconCls, r = e.boxShadowSecondary, i = e.colorBgElevated, a = e.colorSuccess, o = e.colorError, s = e.colorWarning, u = e.colorInfo, l = e.fontSizeLG, c = e.motionEaseInOutCirc, h = e.motionDurationSlow, d = e.marginXS, f = e.paddingXS, p = e.borderRadiusLG, v = e.zIndexPopup, m = e.messageNoticeContentPadding, g = new iW('MessageMoveIn', { '0%': { padding: 0, transform: 'translateY(-100%)', opacity: 0 }, '100%': { padding: f, transform: 'translateY(0)', opacity: 1 }, }), y = new iW('MessageMoveOut', { '0%': { maxHeight: e.height, padding: f, opacity: 1 }, '100%': { maxHeight: 0, padding: 0, opacity: 0 }, }) return [ M( {}, t, eV( eV({}, qW(e)), M( M( M( M( M( M( { position: 'fixed', top: d, left: '50%', transform: 'translateX(-50%)', width: '100%', pointerEvents: 'none', zIndex: v, }, ''.concat(t, '-move-up'), { animationFillMode: 'forwards' } ), '\n ' .concat(t, '-move-up-appear,\n ') .concat(t, '-move-up-enter\n '), { animationName: g, animationDuration: h, animationPlayState: 'paused', animationTimingFunction: c, } ), '\n ' .concat(t, '-move-up-appear') .concat(t, '-move-up-appear-active,\n ') .concat(t, '-move-up-enter') .concat(t, '-move-up-enter-active\n '), { animationPlayState: 'running' } ), ''.concat(t, '-move-up-leave'), { animationName: y, animationDuration: h, animationPlayState: 'paused', animationTimingFunction: c, } ), ''.concat(t, '-move-up-leave').concat(t, '-move-up-leave-active'), { animationPlayState: 'running' } ), '&-rtl', { direction: 'rtl', span: { direction: 'rtl' } } ) ) ), M( {}, ''.concat(t, '-notice'), M( M( M( M( M( M({ padding: f, textAlign: 'center' }, n, { verticalAlign: 'text-bottom', marginInlineEnd: d, fontSize: l, }), ''.concat(t, '-notice-content'), { display: 'inline-block', padding: m, background: i, borderRadius: p, boxShadow: r, pointerEvents: 'all', } ), ''.concat(t, '-success ').concat(n), { color: a } ), ''.concat(t, '-error ').concat(n), { color: o } ), ''.concat(t, '-warning ').concat(n), { color: s } ), '\n ' .concat(t, '-info ') .concat(n, ',\n ') .concat(t, '-loading ') .concat(n), { color: u } ) ), M({}, ''.concat(t, '-notice-pure-panel'), { padding: 0, textAlign: 'start' }), ] }, OQ = KW( 'Message', function (e) { var t = $W(e, { messageNoticeContentPadding: '' .concat((e.controlHeightLG - e.fontSize * e.lineHeight) / 2, 'px ') .concat(e.paddingSM, 'px'), }) return [DQ(t)] }, function (e) { return { height: 150, zIndexPopup: e.zIndexPopupBase + 10 } } ), FQ = { info: ta(mQ, null, null), success: ta(uQ, null, null), error: ta(Hj, null, null), warning: ta(dQ, null, null), loading: ta(Lj, null, null), }, BQ = ar({ name: 'PureContent', inheritAttrs: !1, props: ['prefixCls', 'type', 'icon'], setup: function (e, t) { var n = t.slots return function () { var t return ta( 'div', { class: aV( ''.concat(e.prefixCls, '-custom-content'), ''.concat(e.prefixCls, '-').concat(e.type) ), }, [ e.icon || FQ[e.type], ta('span', null, [ null === (t = n.default) || void 0 === t ? void 0 : t.call(n), ]), ] ) } }, }), UQ = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 }, zQ = ar({ name: 'Holder', inheritAttrs: !1, props: [ 'top', 'prefixCls', 'getContainer', 'maxCount', 'duration', 'rtl', 'transitionName', 'onAllRemoved', 'animation', 'staticGetContainer', ], setup: function (e, t) { var n, r, i = t.expose, a = yG('message', e), o = a.getPrefixCls, s = a.getPopupContainer, u = Ea(function () { return o('message', e.prefixCls) }), l = C(OQ(u), 2)[1], c = ta('span', { class: ''.concat(u.value, '-close-x') }, [ ta(Bj, { class: ''.concat(u.value, '-close-icon') }, null), ]), h = LQ({ getStyles: function () { var t, n = null !== (t = e.top) && void 0 !== t ? t : 8 return { left: '50%', transform: 'translateX(-50%)', top: 'number' == typeof n ? ''.concat(n, 'px') : n, } }, prefixCls: u.value, getClassName: function () { return aV(l.value, e.rtl ? ''.concat(u.value, '-rtl') : '') }, motion: function () { var t return (function (e) { var t = e.prefixCls, n = e.animation, r = e.transitionName return n ? { name: ''.concat(t, '-').concat(n) } : r ? { name: r } : {} })({ prefixCls: u.value, animation: null !== (t = e.animation) && void 0 !== t ? t : 'move-up', transitionName: e.transitionName, }) }, closable: !1, closeIcon: c, duration: null !== (n = e.duration) && void 0 !== n ? n : 3, getContainer: null !== (r = e.staticGetContainer) && void 0 !== r ? r : s.value, maxCount: e.maxCount, onAllRemoved: e.onAllRemoved, }), d = C(h, 2), f = d[0], p = d[1] return (i(eV(eV({}, f), { prefixCls: u, hashId: l })), p) }, }), VQ = 0 function HQ(e) { var t = nn(null), n = Symbol('messageHolderKey'), r = function (e) { var n null === (n = t.value) || void 0 === n || n.close(e) }, i = function (e) { if (!t.value) { var n = function () {} return ((n.then = function () {}), n) } var i, a, o, s, u = t.value, l = u.open, c = u.prefixCls, h = u.hashId, d = ''.concat(c, '-notice'), f = e.content, p = e.icon, v = e.type, m = e.key, g = e.class, y = e.onClose, _ = UQ(e, ['content', 'icon', 'type', 'key', 'class', 'onClose']), b = m return ( null == b && (b = 'antd-message-'.concat((VQ += 1))), (i = function (e) { return ( l( eV(eV({}, _), { key: b, content: function () { return ta( BQ, { prefixCls: c, type: v, icon: 'function' == typeof p ? p() : p }, { default: function () { return ['function' == typeof f ? f() : f] }, } ) }, placement: 'top', class: aV(v && ''.concat(d, '-').concat(v), h, g), onClose: function () { ;(null == y || y(), e()) }, }) ), function () { r(b) } ) }), (o = new Promise(function (e) { a = i(function () { e(!0) }) })), ((s = function () { null == a || a() }).then = function (e, t) { return o.then(e, t) }), (s.promise = o), s ) }, a = { open: i, destroy: function (e) { var n void 0 !== e ? r(e) : null === (n = t.value) || void 0 === n || n.destroy() }, } return ( ['info', 'success', 'warning', 'error', 'loading'].forEach(function (e) { a[e] = function (t, n, r) { var a, o 'function' == typeof n ? (o = n) : ((a = n), (o = r)) var s = eV( eV( { onClose: o, duration: a }, t && 'object' === P(t) && 'content' in t ? t : { content: t } ), { type: e } ) return i(s) } }), [ a, function () { return ta(zQ, $z($z({ key: n }, e), {}, { ref: t }), null) }, ] ) } var WQ, GQ, jQ, QQ = 3, qQ = 1, XQ = '', YQ = 'move-up', KQ = !1, ZQ = function () { return document.body }, JQ = !1 var $Q = { info: mQ, success: uQ, error: Hj, warning: dQ, loading: Lj }, eq = Object.keys($Q) var tq = { open: function (e) { var t = void 0 !== e.duration ? e.duration : QQ, n = e.key || qQ++, r = new Promise(function (r) { var i = function () { return ('function' == typeof e.onClose && e.onClose(), r(!0)) } !(function (e, t) { GQ ? t(GQ) : MQ.newInstance( { appContext: e.appContext, prefixCls: e.prefixCls || XQ, rootPrefixCls: e.rootPrefixCls, transitionName: YQ, hasTransitionName: KQ, style: { top: WQ }, getContainer: ZQ || e.getPopupContainer, maxCount: jQ, name: 'message', useStyle: OQ, }, function (e) { GQ ? t(GQ) : ((GQ = e), t(e)) } ) })(e, function (r) { r.notice({ key: n, duration: t, style: e.style || {}, class: e.class, content: function (t) { var n = t.prefixCls, r = $Q[e.type], i = r ? ta(r, null, null) : '', a = aV( ''.concat(n, '-custom-content'), M( M({}, ''.concat(n, '-').concat(e.type), e.type), ''.concat(n, '-rtl'), !0 === JQ ) ) return ta('div', { class: a }, [ 'function' == typeof e.icon ? e.icon() : e.icon || i, ta('span', null, [ 'function' == typeof e.content ? e.content() : e.content, ]), ]) }, onClose: i, onClick: e.onClick, }) }) }), i = function () { GQ && GQ.removeNotice(n) } return ( (i.then = function (e, t) { return r.then(e, t) }), (i.promise = r), i ) }, config: function (e) { ;(void 0 !== e.top && ((WQ = e.top), (GQ = null)), void 0 !== e.duration && (QQ = e.duration), void 0 !== e.prefixCls && (XQ = e.prefixCls), void 0 !== e.getContainer && ((ZQ = e.getContainer), (GQ = null)), void 0 !== e.transitionName && ((YQ = e.transitionName), (GQ = null), (KQ = !0)), void 0 !== e.maxCount && ((jQ = e.maxCount), (GQ = null)), void 0 !== e.rtl && (JQ = e.rtl)) }, destroy: function (e) { if (GQ) if (e) { ;(0, GQ.removeNotice)(e) } else { var t = GQ.destroy ;(t(), (GQ = null)) } }, } function nq(e, t) { e[t] = function (n, r, i) { return (function (e) { return '[object Object]' === Object.prototype.toString.call(e) && !!e.content })(n) ? e.open(eV(eV({}, n), { type: t })) : ('function' == typeof r && ((i = r), (r = void 0)), e.open({ content: n, duration: r, type: t, onClose: i })) } } ;(eq.forEach(function (e) { return nq(tq, e) }), (tq.warn = tq.warning), (tq.useMessage = function (e) { return HQ(e) })) var rq = function (e) { var t = e.componentCls, n = e.width, r = e.notificationMarginEdge, i = new iW('antNotificationTopFadeIn', { '0%': { marginTop: '-100%', opacity: 0 }, '100%': { marginTop: 0, opacity: 1 }, }), a = new iW('antNotificationBottomFadeIn', { '0%': { marginBottom: '-100%', opacity: 0 }, '100%': { marginBottom: 0, opacity: 1 }, }), o = new iW('antNotificationLeftFadeIn', { '0%': { right: { _skip_check_: !0, value: n }, opacity: 0 }, '100%': { right: { _skip_check_: !0, value: 0 }, opacity: 1 }, }) return M( M( M( M({}, '&'.concat(t, '-top, &').concat(t, '-bottom'), { marginInline: 0 }), '&'.concat(t, '-top'), M( {}, '' .concat(t, '-fade-enter') .concat(t, '-fade-enter-active, ') .concat(t, '-fade-appear') .concat(t, '-fade-appear-active'), { animationName: i } ) ), '&'.concat(t, '-bottom'), M( {}, '' .concat(t, '-fade-enter') .concat(t, '-fade-enter-active, ') .concat(t, '-fade-appear') .concat(t, '-fade-appear-active'), { animationName: a } ) ), '&'.concat(t, '-topLeft, &').concat(t, '-bottomLeft'), M( { marginInlineEnd: 0, marginInlineStart: r }, '' .concat(t, '-fade-enter') .concat(t, '-fade-enter-active, ') .concat(t, '-fade-appear') .concat(t, '-fade-appear-active'), { animationName: o } ) ) }, iq = function (e) { var t = e.iconCls, n = e.componentCls, r = e.boxShadowSecondary, i = e.fontSizeLG, a = e.notificationMarginBottom, o = e.borderRadiusLG, s = e.colorSuccess, u = e.colorInfo, l = e.colorWarning, c = e.colorError, h = e.colorTextHeading, d = e.notificationBg, f = e.notificationPadding, p = e.notificationMarginEdge, v = e.motionDurationMid, m = e.motionEaseInOut, g = e.fontSize, y = e.lineHeight, _ = e.width, b = e.notificationIconSize, x = ''.concat(n, '-notice'), S = new iW('antNotificationFadeIn', { '0%': { left: { _skip_check_: !0, value: _ }, opacity: 0 }, '100%': { left: { _skip_check_: !0, value: 0 }, opacity: 1 }, }), A = new iW('antNotificationFadeOut', { '0%': { maxHeight: e.animationMaxHeight, marginBottom: a, opacity: 1 }, '100%': { maxHeight: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, }, }) return [ M( {}, n, eV( eV( eV( eV({}, qW(e)), M( M( M( M( M( M( M( { position: 'fixed', zIndex: e.zIndexPopup, marginInlineEnd: p, }, ''.concat(n, '-hook-holder'), { position: 'relative' } ), '&'.concat(n, '-top, &').concat(n, '-bottom'), M({}, ''.concat(n, '-notice'), { marginInline: 'auto auto' }) ), '&'.concat(n, '-topLeft, &').concat(n, '-bottomLeft'), M({}, ''.concat(n, '-notice'), { marginInlineEnd: 'auto', marginInlineStart: 0, }) ), ''.concat(n, '-fade-enter, ').concat(n, '-fade-appear'), { animationDuration: e.motionDurationMid, animationTimingFunction: m, animationFillMode: 'both', opacity: 0, animationPlayState: 'paused', } ), ''.concat(n, '-fade-leave'), { animationTimingFunction: m, animationFillMode: 'both', animationDuration: v, animationPlayState: 'paused', } ), '' .concat(n, '-fade-enter') .concat(n, '-fade-enter-active, ') .concat(n, '-fade-appear') .concat(n, '-fade-appear-active'), { animationName: S, animationPlayState: 'running' } ), ''.concat(n, '-fade-leave').concat(n, '-fade-leave-active'), { animationName: A, animationPlayState: 'running' } ) ), rq(e) ), { '&-rtl': M({ direction: 'rtl' }, ''.concat(n, '-notice-btn'), { float: 'left', }), } ) ), M( {}, x, M( M( M( M( M( M( M( M( M( { position: 'relative', width: _, maxWidth: 'calc(100vw - '.concat(2 * p, 'px)'), marginBottom: a, marginInlineStart: 'auto', padding: f, overflow: 'hidden', lineHeight: y, wordWrap: 'break-word', background: d, borderRadius: o, boxShadow: r, }, ''.concat(n, '-close-icon'), { fontSize: g, cursor: 'pointer' } ), ''.concat(x, '-message'), { marginBottom: e.marginXS, color: h, fontSize: i, lineHeight: e.lineHeightLG, } ), ''.concat(x, '-description'), { fontSize: g } ), '&'.concat(x, '-closable ').concat(x, '-message'), { paddingInlineEnd: e.paddingLG } ), ''.concat(x, '-with-icon ').concat(x, '-message'), { marginBottom: e.marginXS, marginInlineStart: e.marginSM + b, fontSize: i, } ), ''.concat(x, '-with-icon ').concat(x, '-description'), { marginInlineStart: e.marginSM + b, fontSize: g } ), ''.concat(x, '-icon'), M( M( M( M( { position: 'absolute', fontSize: b, lineHeight: 0 }, '&-success'.concat(t), { color: s } ), '&-info'.concat(t), { color: u } ), '&-warning'.concat(t), { color: l } ), '&-error'.concat(t), { color: c } ) ), ''.concat(x, '-close'), { position: 'absolute', top: e.notificationPaddingVertical, insetInlineEnd: e.notificationPaddingHorizontal, color: e.colorIcon, outline: 'none', width: e.notificationCloseButtonSize, height: e.notificationCloseButtonSize, borderRadius: e.borderRadiusSM, transition: 'background-color ' .concat(e.motionDurationMid, ', color ') .concat(e.motionDurationMid), display: 'flex', alignItems: 'center', justifyContent: 'center', '&:hover': { color: e.colorIconHover, backgroundColor: e.wireframe ? 'transparent' : e.colorFillContent, }, } ), ''.concat(x, '-btn'), { float: 'right', marginTop: e.marginSM } ) ), M({}, ''.concat(x, '-pure-panel'), { margin: 0 }), ] }, aq = KW( 'Notification', function (e) { var t = e.paddingMD, n = e.paddingLG, r = $W(e, { notificationBg: e.colorBgElevated, notificationPaddingVertical: t, notificationPaddingHorizontal: n, notificationPadding: '' .concat(e.paddingMD, 'px ') .concat(e.paddingContentHorizontalLG, 'px'), notificationMarginBottom: e.margin, notificationMarginEdge: e.marginLG, animationMaxHeight: 150, notificationIconSize: e.fontSizeLG * e.lineHeightLG, notificationCloseButtonSize: 0.55 * e.controlHeightLG, }) return [iq(r)] }, function (e) { return { zIndexPopup: e.zIndexPopupBase + 50, width: 384 } } ) function oq(e, t) { return ( t || ta('span', { class: ''.concat(e, '-close-x') }, [ ta(Bj, { class: ''.concat(e, '-close-icon') }, null), ]) ) } ;(ta(mQ, null, null), ta(uQ, null, null), ta(Hj, null, null), ta(dQ, null, null), ta(Lj, null, null)) var sq = { success: uQ, info: mQ, error: Hj, warning: dQ } function uq(e) { var t = e.prefixCls, n = e.icon, r = e.type, i = e.message, a = e.description, o = e.btn, s = null if (n) s = ta('span', { class: ''.concat(t, '-icon') }, [iV(n)]) else if (r) { s = ta(sq[r], { class: ''.concat(t, '-icon ').concat(t, '-icon-').concat(r) }, null) } return ta('div', { class: aV(M({}, ''.concat(t, '-with-icon'), s)), role: 'alert' }, [ s, ta('div', { class: ''.concat(t, '-message') }, [i]), ta('div', { class: ''.concat(t, '-description') }, [a]), o && ta('div', { class: ''.concat(t, '-btn') }, [o]), ]) } function lq(e, t, n) { var r switch ( ((t = 'number' == typeof t ? ''.concat(t, 'px') : t), (n = 'number' == typeof n ? ''.concat(n, 'px') : n), 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 } } return r } var cq = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 }, hq = ar({ name: 'Holder', inheritAttrs: !1, props: ['prefixCls', 'class', 'type', 'icon', 'content', 'onAllRemoved'], setup: function (e, t) { var n = t.expose, r = yG('notification', e), i = r.getPrefixCls, a = r.getPopupContainer, o = Ea(function () { return e.prefixCls || i('notification') }), s = C(aq(o), 2)[1], u = C( LQ({ prefixCls: o.value, getStyles: function (t) { var n, r return lq( t, null !== (n = e.top) && void 0 !== n ? n : 24, null !== (r = e.bottom) && void 0 !== r ? r : 24 ) }, getClassName: function () { return aV(s.value, M({}, ''.concat(o.value, '-rtl'), e.rtl)) }, motion: function () { return (function (e) { return { name: ''.concat(e, '-fade') } })(o.value) }, closable: !0, closeIcon: oq(o.value), duration: 4.5, getContainer: function () { var t, n return ( (null === (t = e.getPopupContainer) || void 0 === t ? void 0 : t.call(e)) || (null === (n = a.value) || void 0 === n ? void 0 : n.call(a)) || document.body ) }, maxCount: e.maxCount, hashId: s.value, onAllRemoved: e.onAllRemoved, }), 2 ), l = u[0], c = u[1] return (n(eV(eV({}, l), { prefixCls: o.value, hashId: s })), c) }, }) var dq, fq = {}, pq = 4.5, vq = '24px', mq = '24px', gq = '', yq = 'topRight', _q = function () { return document.body }, bq = null, xq = !1 var Sq = { success: Qj, info: eQ, error: iQ, warning: Kj } var Aq = { open: function (e) { var t = e.icon, n = e.type, r = e.description, i = e.message, a = e.btn, o = void 0 === e.duration ? pq : e.duration !(function (e, t) { var n = e.prefixCls, r = e.placement, i = void 0 === r ? yq : r, a = e.getContainer, o = void 0 === a ? _q : a, s = e.top, u = e.bottom, l = e.closeIcon, c = void 0 === l ? bq : l, h = e.appContext, d = (0, Nq().getPrefixCls)('notification', n || gq), f = ''.concat(d, '-').concat(i, '-').concat(xq), p = fq[f] if (p) Promise.resolve(p).then(function (e) { t(e) }) else { var v = aV(''.concat(d, '-').concat(i), M({}, ''.concat(d, '-rtl'), !0 === xq)) MQ.newInstance( { name: 'notification', prefixCls: n || gq, useStyle: aq, class: v, style: lq(i, null != s ? s : vq, null != u ? u : mq), appContext: h, getContainer: o, closeIcon: function (e) { var t = e.prefixCls return ta('span', { class: ''.concat(t, '-close-x') }, [ iV(c, {}, ta(Bj, { class: ''.concat(t, '-close-icon') }, null)), ]) }, maxCount: dq, hasTransitionName: !0, }, function (e) { ;((fq[f] = e), t(e)) } ) } })(e, function (s) { s.notice({ content: function (e) { var o = e.prefixCls, s = ''.concat(o, '-notice'), u = null if (t) u = function () { return ta('span', { class: ''.concat(s, '-icon') }, [iV(t)]) } else if (n) { var l = Sq[n] u = function () { return ta( l, { class: ''.concat(s, '-icon ').concat(s, '-icon-').concat(n) }, null ) } } return ta('div', { class: u ? ''.concat(s, '-with-icon') : '' }, [ u && u(), ta('div', { class: ''.concat(s, '-message') }, [ !r && u ? ta( 'span', { class: ''.concat(s, '-message-single-line-auto-margin') }, null ) : null, iV(i), ]), ta('div', { class: ''.concat(s, '-description') }, [iV(r)]), a ? ta('span', { class: ''.concat(s, '-btn') }, [iV(a)]) : null, ]) }, duration: o, closable: !0, onClose: e.onClose, onClick: e.onClick, key: e.key, style: e.style || {}, class: e.class, }) }) }, close: function (e) { Object.keys(fq).forEach(function (t) { return Promise.resolve(fq[t]).then(function (t) { t.removeNotice(e) }) }) }, config: function (e) { var t = e.duration, n = e.placement, r = e.bottom, i = e.top, a = e.getContainer, o = e.closeIcon, s = e.prefixCls ;(void 0 !== s && (gq = s), void 0 !== t && (pq = t), void 0 !== n && (yq = n), void 0 !== r && (mq = 'number' == typeof r ? ''.concat(r, 'px') : r), void 0 !== i && (vq = 'number' == typeof i ? ''.concat(i, 'px') : i), void 0 !== a && (_q = a), void 0 !== o && (bq = o), void 0 !== e.rtl && (xq = e.rtl), void 0 !== e.maxCount && (dq = e.maxCount)) }, destroy: function () { Object.keys(fq).forEach(function (e) { ;(Promise.resolve(fq[e]).then(function (e) { e.destroy() }), delete fq[e]) }) }, } ;(['success', 'info', 'warning', 'error'].forEach(function (e) { Aq[e] = function (t) { return Aq.open(eV(eV({}, t), { type: e })) } }), (Aq.warn = Aq.warning), (Aq.useNotification = function (e) { return (function (e) { var t = nn(null), n = Symbol('notificationHolderKey'), r = function (e) { if (t.value) { var n = t.value, r = n.open, i = n.prefixCls, a = n.hashId, o = ''.concat(i, '-notice'), s = e.message, u = e.description, l = e.icon, c = e.type, h = e.btn, d = e.class return r( eV( eV( { placement: 'topRight' }, cq(e, ['message', 'description', 'icon', 'type', 'btn', 'class']) ), { content: function () { return ta( uq, { prefixCls: o, icon: 'function' == typeof l ? l() : l, type: c, message: 'function' == typeof s ? s() : s, description: 'function' == typeof u ? u() : u, btn: 'function' == typeof h ? h() : h, }, null ) }, class: aV(c && ''.concat(o, '-').concat(c), a, d), } ) ) } }, i = { open: r, destroy: function (e) { var n, r void 0 !== e ? null === (n = t.value) || void 0 === n || n.close(e) : null === (r = t.value) || void 0 === r || r.destroy() }, } return ( ['success', 'info', 'warning', 'error'].forEach(function (e) { i[e] = function (t) { return r(eV(eV({}, t), { type: e })) } }), [ i, function () { return ta(hq, $z($z({ key: n }, e), {}, { ref: t }), null) }, ] ) })(e) })) var wq = '-ant-'.concat(Date.now(), '-').concat(Math.random()) function Tq(e, t) { var n = (function (e, t) { var n = {}, r = function (e, t) { var n = e.clone() return (n = (null == t ? void 0 : t(n)) || n).toRgbString() }, i = function (e, t) { var i = new wW(e), a = IW(i.toRgbString()) ;((n[''.concat(t, '-color')] = r(i)), (n[''.concat(t, '-color-disabled')] = a[1]), (n[''.concat(t, '-color-hover')] = a[4]), (n[''.concat(t, '-color-active')] = a[6]), (n[''.concat(t, '-color-outline')] = i.clone().setAlpha(0.2).toRgbString()), (n[''.concat(t, '-color-deprecated-bg')] = a[0]), (n[''.concat(t, '-color-deprecated-border')] = a[2])) } if (t.primaryColor) { i(t.primaryColor, 'primary') var a = new wW(t.primaryColor), o = IW(a.toRgbString()) ;(o.forEach(function (e, t) { n['primary-'.concat(t + 1)] = e }), (n['primary-color-deprecated-l-35'] = r(a, function (e) { return e.lighten(35) })), (n['primary-color-deprecated-l-20'] = r(a, function (e) { return e.lighten(20) })), (n['primary-color-deprecated-t-20'] = r(a, function (e) { return e.tint(20) })), (n['primary-color-deprecated-t-50'] = r(a, function (e) { return e.tint(50) })), (n['primary-color-deprecated-f-12'] = r(a, function (e) { return e.setAlpha(0.12 * e.getAlpha()) }))) var s = new wW(o[0]) ;((n['primary-color-active-deprecated-f-30'] = r(s, function (e) { return e.setAlpha(0.3 * e.getAlpha()) })), (n['primary-color-active-deprecated-d-02'] = r(s, function (e) { return e.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 u = Object.keys(n).map(function (t) { return '--'.concat(e, '-').concat(t, ': ').concat(n[t], ';') }) return '\n :root {\n '.concat(u.join('\n'), '\n }\n ').trim() })(e, t) FV() && QV(n, ''.concat(wq, '-dynamic-theme')) } var Mq = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 Eq() { return Iq.prefixCls || 'ant' } function Cq() { return Iq.iconPrefixCls || fV } var kq, Rq = Wt({}), Iq = Wt({}) wi(function () { ;(eV(Iq, Rq), (Iq.prefixCls = Eq()), (Iq.iconPrefixCls = Cq()), (Iq.getPrefixCls = function (e, t) { return t || (e ? ''.concat(Iq.prefixCls, '-').concat(e) : Iq.prefixCls) }), (Iq.getRootPrefixCls = function () { return Iq.prefixCls ? Iq.prefixCls : Eq() })) }) var Nq = function () { return { getPrefixCls: function (e, t) { return t || (e ? ''.concat(Eq(), '-').concat(e) : Eq()) }, getIconPrefixCls: Cq, getRootPrefixCls: function () { return Iq.prefixCls ? Iq.prefixCls : Eq() }, } }, Pq = ar({ compatConfig: { MODE: 3 }, name: 'AConfigProvider', inheritAttrs: !1, props: { iconPrefixCls: String, getTargetContainer: { type: Function }, getPopupContainer: { type: Function }, prefixCls: String, getPrefixCls: { type: Function }, renderEmpty: { type: Function }, transformCellText: { type: Function }, csp: uV(), input: uV(), autoInsertSpaceInButton: { type: Boolean, default: void 0 }, locale: uV(), pageHeader: uV(), componentSize: { type: String }, componentDisabled: { type: Boolean, default: void 0 }, direction: { type: String, default: 'ltr' }, space: uV(), virtual: { type: Boolean, default: void 0 }, dropdownMatchSelectWidth: { type: [Number, Boolean], default: !0 }, form: uV(), pagination: uV(), theme: uV(), select: uV(), wave: uV(), }, setup: function (e, t) { var n, r, i, a, o = t.slots, s = gV(), u = Ea(function () { return e.iconPrefixCls || s.iconPrefixCls.value || fV }), l = Ea(function () { return u.value !== s.iconPrefixCls.value }), c = Ea(function () { var t return e.csp || (null === (t = s.csp) || void 0 === t ? void 0 : t.value) }), h = (function (e) { var t = C(oG(), 2), n = t[0], r = t[1] return rW( Ea(function () { return { theme: n.value, token: r.value, hashId: '', path: ['ant-design-icons', e.value], } }), function () { return [ M( {}, '.'.concat(e.value), eV( eV( {}, { display: 'inline-flex', alignItems: 'center', color: 'inherit', fontStyle: 'normal', lineHeight: 0, textAlign: 'center', textTransform: 'none', verticalAlign: '-0.125em', textRendering: 'optimizeLegibility', '-webkit-font-smoothing': 'antialiased', '-moz-osx-font-smoothing': 'grayscale', '> *': { lineHeight: 1 }, svg: { display: 'inline-block' }, } ), M({}, '.'.concat(e.value, ' .').concat(e.value, '-icon'), { display: 'block', }) ) ), ] } ) })(u), d = ((n = Ea(function () { return e.theme })), (r = Ea(function () { var e return null === (e = s.theme) || void 0 === e ? void 0 : e.value })), (i = Ea(function () { return (null == n ? void 0 : n.value) || {} })), (a = Ea(function () { return !1 !== i.value.inherit && (null == r ? void 0 : r.value) ? r.value : nG })), Ea(function () { if (!(null == n ? void 0 : n.value)) return null == r ? void 0 : r.value var e = eV({}, a.value.components) return ( Object.keys(n.value.components || {}).forEach(function (t) { e[t] = eV(eV({}, e[t]), n.value.components[t]) }), eV(eV(eV({}, a.value), i.value), { token: eV(eV({}, a.value.token), i.value.token), components: e, }) ) })), f = Ea(function () { var t, n return null !== (t = e.autoInsertSpaceInButton) && void 0 !== t ? t : null === (n = s.autoInsertSpaceInButton) || void 0 === n ? void 0 : n.value }), p = Ea(function () { var t return e.locale || (null === (t = s.locale) || void 0 === t ? void 0 : t.value) }) Ti( p, function () { Rq.locale = p.value }, { immediate: !0 } ) var v, m, g, y, _ = Ea(function () { var t return ( e.direction || (null === (t = s.direction) || void 0 === t ? void 0 : t.value) ) }), b = Ea(function () { var t, n return null !== (t = e.space) && void 0 !== t ? t : null === (n = s.space) || void 0 === n ? void 0 : n.value }), x = Ea(function () { var t, n return null !== (t = e.virtual) && void 0 !== t ? t : null === (n = s.virtual) || void 0 === n ? void 0 : n.value }), S = Ea(function () { var t, n return null !== (t = e.dropdownMatchSelectWidth) && void 0 !== t ? t : null === (n = s.dropdownMatchSelectWidth) || void 0 === n ? void 0 : n.value }), A = Ea(function () { var t return void 0 !== e.getTargetContainer ? e.getTargetContainer : null === (t = s.getTargetContainer) || void 0 === t ? void 0 : t.value }), w = Ea(function () { var t return void 0 !== e.getPopupContainer ? e.getPopupContainer : null === (t = s.getPopupContainer) || void 0 === t ? void 0 : t.value }), T = Ea(function () { var t return void 0 !== e.pageHeader ? e.pageHeader : null === (t = s.pageHeader) || void 0 === t ? void 0 : t.value }), E = Ea(function () { var t return void 0 !== e.input ? e.input : null === (t = s.input) || void 0 === t ? void 0 : t.value }), k = Ea(function () { var t return void 0 !== e.pagination ? e.pagination : null === (t = s.pagination) || void 0 === t ? void 0 : t.value }), R = Ea(function () { var t return void 0 !== e.form ? e.form : null === (t = s.form) || void 0 === t ? void 0 : t.value }), I = Ea(function () { var t return void 0 !== e.select ? e.select : null === (t = s.select) || void 0 === t ? void 0 : t.value }), N = Ea(function () { return e.componentSize }), P = Ea(function () { return e.componentDisabled }), L = Ea(function () { var t, n return null !== (t = e.wave) && void 0 !== t ? t : null === (n = s.wave) || void 0 === n ? void 0 : n.value }), D = { csp: c, autoInsertSpaceInButton: f, locale: p, direction: _, space: b, virtual: x, dropdownMatchSelectWidth: S, getPrefixCls: function (t, n) { var r = e.prefixCls if (n) return n var i = (void 0 === r ? 'ant' : r) || s.getPrefixCls('') return t ? ''.concat(i, '-').concat(t) : i }, iconPrefixCls: u, theme: Ea(function () { var e, t return null !== (e = d.value) && void 0 !== e ? e : null === (t = s.theme) || void 0 === t ? void 0 : t.value }), renderEmpty: function (t) { return (e.renderEmpty || o.renderEmpty || s.renderEmpty || vG)(t) }, getTargetContainer: A, getPopupContainer: w, pageHeader: T, input: E, pagination: k, form: R, select: I, componentSize: N, componentDisabled: P, transformCellText: Ea(function () { return e.transformCellText }), wave: L, }, O = Ea(function () { var e = d.value || {}, t = e.algorithm, n = e.token, r = Mq(e, ['algorithm', 'token']), i = t && (!Array.isArray(t) || t.length > 0) ? JV(t) : void 0 return eV(eV({}, r), { theme: i, token: eV(eV({}, FW), n) }) }), F = Ea(function () { var t, n, r = {} return ( p.value && (r = (null === (t = p.value.Form) || void 0 === t ? void 0 : t.defaultValidateMessages) || (null === (n = AV.Form) || void 0 === n ? void 0 : n.defaultValidateMessages) || {}), e.form && e.form.validateMessages && (r = eV(eV({}, r), e.form.validateMessages)), r ) }) ;(!(function (e) { $r(vV, e) })(D), $r(pV, { validateMessages: F }), (v = N), (m = gG()), $r( mG, Ea(function () { return v.value || m.value }) ), (g = P), (y = _V()), $r( yV, Ea(function () { var e return null !== (e = g.value) && void 0 !== e ? e : y.value }) )) return ( wi(function () { _.value && (tq.config({ rtl: 'rtl' === _.value }), Aq.config({ rtl: 'rtl' === _.value })) }), function () { return ta( wV, { children: function (t, n, r) { return (function (t) { var n, r, i = l.value ? h(null === (n = o.default) || void 0 === n ? void 0 : n.call(o)) : null === (r = o.default) || void 0 === r ? void 0 : r.call(o) if (e.theme) { var a = i i = ta( aG, { value: O.value }, { default: function () { return [a] }, } ) } return ta( bQ, { locale: p.value || t, ANT_MARK__: yQ }, { default: function () { return [i] }, } ) })(r) }, }, null ) } ) }, }) function Lq(e, t, n) { var r = {}.atBegin return (function (e, t, n) { var r, i = n || {}, a = i.noTrailing, o = void 0 !== a && a, s = i.noLeading, u = void 0 !== s && s, l = i.debounceMode, c = void 0 === l ? void 0 : l, h = !1, d = 0 function f() { r && clearTimeout(r) } function p() { for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++) i[a] = arguments[a] var s = this, l = Date.now() - d function p() { ;((d = Date.now()), t.apply(s, i)) } function v() { r = void 0 } h || (u || !c || r || p(), f(), void 0 === c && l > e ? u ? ((d = Date.now()), o || (r = setTimeout(c ? v : p, e))) : p() : !0 !== o && (r = setTimeout(c ? v : p, void 0 === c ? e - l : e))) } return ( (p.cancel = function (e) { var t = (e || {}).upcomingOnly, n = void 0 !== t && t ;(f(), (h = !n)) }), p ) })(e, t, { debounceMode: !1 !== (void 0 !== r && r) }) } ;((Pq.config = function (e) { ;(kq && kq(), (kq = wi(function () { ;(eV(Rq, Wt(e)), eV(Iq, Wt(e))) })), e.theme && Tq(Eq(), e.theme)) }), (Pq.install = function (e) { e.component(Pq.name, Pq) })) var Dq = new iW('antSpinMove', { to: { opacity: 1 } }), Oq = new iW('antRotate', { to: { transform: 'rotate(405deg)' } }), Fq = function (e) { return M( {}, ''.concat(e.componentCls), eV( eV({}, qW(e)), M( M( M( M( M( { position: 'absolute', display: 'none', color: e.colorPrimary, textAlign: 'center', verticalAlign: 'middle', opacity: 0, transition: 'transform ' .concat(e.motionDurationSlow, ' ') .concat(e.motionEaseInOutCirc), '&-spinning': { position: 'static', display: 'inline-block', opacity: 1, }, '&-nested-loading': M( M( M( { position: 'relative' }, '> div > '.concat(e.componentCls), M( M( M( M( M( { position: 'absolute', top: 0, insetInlineStart: 0, zIndex: 4, display: 'block', width: '100%', height: '100%', maxHeight: e.contentHeight, }, ''.concat(e.componentCls, '-dot'), { position: 'absolute', top: '50%', insetInlineStart: '50%', margin: -e.spinDotSize / 2, } ), ''.concat(e.componentCls, '-text'), { position: 'absolute', top: '50%', width: '100%', paddingTop: (e.spinDotSize - e.fontSize) / 2 + 2, textShadow: '0 1px 2px '.concat(e.colorBgContainer), } ), '&' .concat(e.componentCls, '-show-text ') .concat(e.componentCls, '-dot'), { marginTop: -e.spinDotSize / 2 - 10 } ), '&-sm', M( M( M({}, ''.concat(e.componentCls, '-dot'), { margin: -e.spinDotSizeSM / 2, }), ''.concat(e.componentCls, '-text'), { paddingTop: (e.spinDotSizeSM - e.fontSize) / 2 + 2 } ), '&' .concat(e.componentCls, '-show-text ') .concat(e.componentCls, '-dot'), { marginTop: -e.spinDotSizeSM / 2 - 10 } ) ), '&-lg', M( M( M({}, ''.concat(e.componentCls, '-dot'), { margin: -e.spinDotSizeLG / 2, }), ''.concat(e.componentCls, '-text'), { paddingTop: (e.spinDotSizeLG - e.fontSize) / 2 + 2 } ), '&' .concat(e.componentCls, '-show-text ') .concat(e.componentCls, '-dot'), { marginTop: -e.spinDotSizeLG / 2 - 10 } ) ) ), ''.concat(e.componentCls, '-container'), { position: 'relative', transition: 'opacity '.concat(e.motionDurationSlow), '&::after': { position: 'absolute', top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0, zIndex: 10, width: '100%', height: '100%', background: e.colorBgContainer, opacity: 0, transition: 'all '.concat(e.motionDurationSlow), content: '""', pointerEvents: 'none', }, } ), ''.concat(e.componentCls, '-blur'), M( { clear: 'both', opacity: 0.5, userSelect: 'none', pointerEvents: 'none', }, '&::after', { opacity: 0.4, pointerEvents: 'auto' } ) ), }, '&-tip', { color: e.spinDotDefault } ), ''.concat(e.componentCls, '-dot'), { position: 'relative', display: 'inline-block', fontSize: e.spinDotSize, width: '1em', height: '1em', '&-item': { position: 'absolute', display: 'block', width: (e.spinDotSize - e.marginXXS / 2) / 2, height: (e.spinDotSize - e.marginXXS / 2) / 2, backgroundColor: e.colorPrimary, borderRadius: '100%', transform: 'scale(0.75)', transformOrigin: '50% 50%', opacity: 0.3, animationName: Dq, animationDuration: '1s', animationIterationCount: 'infinite', animationTimingFunction: 'linear', animationDirection: 'alternate', '&:nth-child(1)': { top: 0, insetInlineStart: 0 }, '&:nth-child(2)': { top: 0, insetInlineEnd: 0, animationDelay: '0.4s', }, '&:nth-child(3)': { insetInlineEnd: 0, bottom: 0, animationDelay: '0.8s', }, '&:nth-child(4)': { bottom: 0, insetInlineStart: 0, animationDelay: '1.2s', }, }, '&-spin': { transform: 'rotate(45deg)', animationName: Oq, animationDuration: '1.2s', animationIterationCount: 'infinite', animationTimingFunction: 'linear', }, } ), '&-sm '.concat(e.componentCls, '-dot'), { fontSize: e.spinDotSizeSM, i: { width: (e.spinDotSizeSM - e.marginXXS / 2) / 2, height: (e.spinDotSizeSM - e.marginXXS / 2) / 2, }, } ), '&-lg '.concat(e.componentCls, '-dot'), { fontSize: e.spinDotSizeLG, i: { width: (e.spinDotSizeLG - e.marginXXS) / 2, height: (e.spinDotSizeLG - e.marginXXS) / 2, }, } ), '&'.concat(e.componentCls, '-show-text ').concat(e.componentCls, '-text'), { display: 'block' } ) ) ) }, Bq = KW( 'Spin', function (e) { var t = $W(e, { spinDotDefault: e.colorTextDescription, spinDotSize: e.controlHeightLG / 2, spinDotSizeSM: 0.35 * e.controlHeightLG, spinDotSizeLG: e.controlHeight, }) return [Fq(t)] }, { contentHeight: 400 } ), Uq = 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 (null != e && 'function' == typeof Object.getOwnPropertySymbols) { var i = 0 for (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 }, zq = null var Vq = ar({ compatConfig: { MODE: 3 }, name: 'ASpin', inheritAttrs: !1, props: (function (e, t) { var n = eV({}, e) return ( Object.keys(t).forEach(function (e) { var r = n[e] if (!r) throw new Error('not have '.concat(e, ' prop')) r.type || r.default ? (r.default = t[e]) : r.def ? r.def(t[e]) : (n[e] = { type: r, default: t[e] }) }), n ) })( { prefixCls: String, spinning: { type: Boolean, default: void 0 }, size: String, wrapperClassName: String, tip: jG.any, delay: Number, indicator: jG.any, }, { size: 'default', spinning: !0, wrapperClassName: '' } ), setup: function (e, t) { var n, r, i, a = t.attrs, o = t.slots, s = yG('spin', e), u = s.prefixCls, l = s.size, c = s.direction, h = C(Bq(u), 2), d = h[0], f = h[1], p = nn( e.spinning && ((n = e.spinning), (r = e.delay), !(n && r && !isNaN(Number(r)))) ) return ( Ti( [ function () { return e.spinning }, function () { return e.delay }, ], function () { ;(null == i || i.cancel(), null == (i = Lq(e.delay, function () { p.value = e.spinning })) || i()) }, { immediate: !0, flush: 'post' } ), xr(function () { null == i || i.cancel() }), function () { var t, n, r = a.class, i = Uq(a, ['class']), s = e.tip, h = void 0 === s ? null === (t = o.tip) || void 0 === t ? void 0 : t.call(o) : s, v = null === (n = o.default) || void 0 === n ? void 0 : n.call(o), m = M( M( M( M( M( M( M(M({}, f.value, !0), u.value, !0), ''.concat(u.value, '-sm'), 'small' === l.value ), ''.concat(u.value, '-lg'), 'large' === l.value ), ''.concat(u.value, '-spinning'), p.value ), ''.concat(u.value, '-show-text'), !!h ), ''.concat(u.value, '-rtl'), 'rtl' === c.value ), r, !!r ) var g = ta( 'div', $z($z({}, i), {}, { class: m, 'aria-live': 'polite', 'aria-busy': p.value }), [ (function (t) { var n = ''.concat(t, '-dot'), r = (function (e, t) { var n, r, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 'default' return null !== (n = t[i]) && void 0 !== n ? n : null === (r = e[i]) || void 0 === r ? void 0 : r.call(e) })(o, e, 'indicator') return null === r ? null : (Array.isArray(r) && (r = 1 === r.length ? r[0] : r), Ki(r) ? na(r, { class: n }) : zq && Ki(zq()) ? na(zq(), { class: n }) : ta('span', { class: ''.concat(n, ' ').concat(t, '-dot-spin') }, [ ta('i', { class: ''.concat(t, '-dot-item') }, null), ta('i', { class: ''.concat(t, '-dot-item') }, null), ta('i', { class: ''.concat(t, '-dot-item') }, null), ta('i', { class: ''.concat(t, '-dot-item') }, null), ])) })(u.value), h ? ta('div', { class: ''.concat(u.value, '-text') }, [h]) : null, ] ) if (v && oV(v).length) { var y = M( M({}, ''.concat(u.value, '-container'), !0), ''.concat(u.value, '-blur'), p.value ) return d( ta( 'div', { class: [ ''.concat(u.value, '-nested-loading'), e.wrapperClassName, f.value, ], }, [ p.value && ta('div', { key: 'loading' }, [g]), ta('div', { class: y, key: 'container' }, [v]), ] ) ) } return d(g) } ) }, }) ;((Vq.setDefaultIndicator = function (e) { var t = e.indicator zq = 'function' == typeof t ? t : function () { return ta(t, null, null) } }), (Vq.install = function (e) { return (e.component(Vq.name, Vq), e) })) var Hq = { icon: { tag: 'svg', attrs: { viewBox: '64 64 896 896', focusable: 'false' }, children: [ { tag: 'path', attrs: { d: 'M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z', }, }, ], }, name: 'video-camera', theme: 'outlined', } function Wq(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? Object(arguments[t]) : {}, r = Object.keys(n) ;('function' == typeof Object.getOwnPropertySymbols && (r = r.concat( Object.getOwnPropertySymbols(n).filter(function (e) { return Object.getOwnPropertyDescriptor(n, e).enumerable }) )), r.forEach(function (t) { Gq(e, t, n[t]) })) } return e } function Gq(e, t, n) { return ( t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0, }) : (e[t] = n), e ) } var jq = function (e, t) { var n = Wq({}, e, t.attrs) return ta(Rj, Wq({}, n, { icon: Hq }), null) } ;((jq.displayName = 'VideoCameraOutlined'), (jq.inheritAttrs = !1)) var Qq, qq = rs('visionStore', { state: function () { return { wrapperRect: { width: 0, height: 0 }, wrapperRef: void 0, localVideoRef: void 0, localVideoContainerRef: void 0, remoteVideoRef: void 0, remoteVideoContainerRef: void 0, isLandscape: !0, showChatRecords: !1, } }, actions: {}, }), Xq = { video: { width: 500, height: 500 }, audio: !0 }, Yq = rs('videoChatStore', { state: function () { return { devices: [], availableVideoDevices: [], availableAudioDevices: [], selectedVideoDevice: null, selectedAudioDevice: null, streamState: ms.closed, stream: null, peerConnection: null, localStream: null, webRTCId: '', webcamAccessed: !1, avatarType: '', avatarWSRoute: '', avatarAssetsPath: '', rtcConfig: void 0, trackConstraints: Xq, gsLoadPercent: 0, volumeMuted: !1, micMuted: !1, cameraOff: !1, hasCamera: !1, hasCameraPermission: !0, hasMic: !1, hasMicPermission: !0, showChatRecords: !1, localAvatarRenderer: null, chatDataChannel: null, replying: !1, chatRecords: [], } }, getters: {}, actions: { accessDevice: function () { var e = this return v( d().m(function t() { var n, r, i, a, o return d().w( function (t) { for (;;) switch (t.n) { case 0: if ( ((t.p = 0), (n = qq()), n.localVideoRef, (e.micMuted = !1), (e.cameraOff = !1), (e.volumeMuted = !1), navigator.mediaDevices) ) { t.n = 1 break } return ( tq.error( '无法获取媒体设备,请确保用localhost访问或https协议访问' ), t.a(2) ) case 1: return ( (t.n = 2), navigator.mediaDevices .getUserMedia({ audio: !0 }) .catch(function () { ;(console.log('no audio permission'), (e.hasMicPermission = !1)) }) ) case 2: return ( (t.n = 3), navigator.mediaDevices .getUserMedia({ video: !0 }) .catch(function () { ;(console.log('no video permission'), (e.hasCameraPermission = !1)) }) ) case 3: return ((t.n = 4), Bz()) case 4: ;((r = t.v), (e.devices = r), console.log('🚀 ~ access_webcam ~ devices:', r), (i = e.selectedVideoDevice && r.some(function (t) { var n return ( t.deviceId === (null === (n = e.selectedVideoDevice) || void 0 === n ? void 0 : n.deviceId) ) }) ? e.selectedVideoDevice.deviceId : ''), (a = e.selectedAudioDevice && r.some(function (t) { var n return ( t.deviceId === (null === (n = e.selectedAudioDevice) || void 0 === n ? void 0 : n.deviceId) ) }) ? e.selectedAudioDevice.deviceId : ''), console.log(i, a, ' access web device'), e.fillStream(a, i), (e.webcamAccessed = !0), (t.n = 6)) break case 5: ;((t.p = 5), (o = t.v), console.log(o), tq.error(o)) case 6: return t.a(2) } }, t, null, [[0, 5]] ) }) )() }, init: function () { var e = this return v( d().m(function t() { return d().w(function (t) { for (;;) switch (t.n) { case 0: fetch('/openavatarchat/initconfig') .then(function (e) { return e.json() }) .then(function (t) { ;(t.rtc_configuration && (e.rtcConfig = t.rtc_configuration), console.log(t), t.avatar_config && ((e.avatarType = t.avatar_config.avatar_type), (e.avatarWSRoute = t.avatar_config.avatar_ws_route), (e.avatarAssetsPath = t.avatar_config.avatar_assets_path)), t.track_constraints && (e.trackConstraints = t.track_constraints)) }) .catch(function () { tq.error( '服务端链接失败,请检查是否能正确访问到 OpenAvatarChat 服务端' ) }) case 1: return t.a(2) } }, t) }) )() }, handleCameraOff: function () { var e, t = this ;((this.cameraOff = !this.cameraOff), null === (e = this.stream) || void 0 === e || e.getTracks().forEach(function (e) { e.kind.includes('video') && (e.enabled = !t.cameraOff) })) }, handleMicMuted: function () { var e, t = this ;((this.micMuted = !this.micMuted), null === (e = this.stream) || void 0 === e || e.getTracks().forEach(function (e) { e.kind.includes('audio') && (e.enabled = !t.micMuted) })) }, handleVolumeMute: function () { var e ;((this.volumeMuted = !this.volumeMuted), 'lam' === this.avatarType) && (null === (e = this.localAvatarRenderer) || void 0 === e || e.setAvatarMute(this.volumeMuted)) }, handleDeviceChange: function (e) { var t = this return v( d().m(function n() { var r, i, a, o return d().w(function (n) { for (;;) switch (n.n) { case 0: return ((r = e), (n.n = 1), Bz()) case 1: ;((i = n.v), (t.devices = i), console.log('🚀 ~ handle_device_change ~ devices:', i), (a = t.selectedVideoDevice && i.some(function (e) { var n return ( e.deviceId === (null === (n = t.selectedVideoDevice) || void 0 === n ? void 0 : n.deviceId) ) }) ? t.selectedVideoDevice.deviceId : ''), (o = t.selectedAudioDevice && i.some(function (e) { var n return ( e.deviceId === (null === (n = t.selectedAudioDevice) || void 0 === n ? void 0 : n.deviceId) ) }) ? t.selectedAudioDevice.deviceId : ''), t.availableVideoDevices.find(function (e) { return e.deviceId === r }) ? ((a = r), (t.cameraOff = !1)) : t.availableAudioDevices.find(function (e) { return e.deviceId === r }) && ((o = r), (t.micMuted = !1)), t.fillStream(o, a)) case 2: return n.a(2) } }, n) }) )() }, handleSubtitleToggle: function () { this.showChatRecords = !this.showChatRecords var e = qq(), t = e.wrapperRef, n = e.wrapperRect ;(console.log(n, t), t && n && (t.getBoundingClientRect(), (n.width = t.clientWidth), (n.height = t.clientHeight), (e.isLandscape = n.width > n.height))) }, updateAvailableDevices: function () { var e = this return v( d().m(function t() { var n return d().w(function (t) { for (;;) switch (t.n) { case 0: return ((t.n = 1), Bz()) case 1: ;((n = t.v), (e.availableVideoDevices = Vz(n, 'videoinput')), (e.availableAudioDevices = Vz(n, 'audioinput'))) case 2: return t.a(2) } }, t) }) )() }, fillStream: function (e, t) { var n = this return v( d().m(function r() { var i, a, o return d().w(function (r) { for (;;) switch (r.n) { case 0: return ( (i = n.devices), (a = qq()), (o = a.localVideoRef), (n.hasMic = i.some(function (e) { return 'audioinput' === e.kind && e.deviceId }) && n.hasMicPermission), (n.hasCamera = i.some(function (e) { return 'videoinput' === e.kind && e.deviceId }) && n.hasCameraPermission), (r.n = 1), Uz( e && 'default' !== e ? { deviceId: { exact: e } } : n.hasMic, t && 'default' !== t ? { deviceId: { exact: t } } : n.hasCamera, n.trackConstraints ) .then( (function () { var e = v( d().m(function e(t) { return d().w(function (e) { for (;;) switch (e.n) { case 0: ;(console.log('local_stream', t), (n.stream = t), n.updateAvailableDevices()) case 1: return e.a(2) } }, e) }) ) return function (t) { return e.apply(this, arguments) } })() ) .then(function () { var e = n.stream.getTracks().map(function (e) { var t return null === (t = e.getSettings()) || void 0 === t ? void 0 : t.deviceId }) ;(e.forEach(function (e) { var t = i.find(function (t) { return t.deviceId === e }) t && null != t && t.kind.includes('video') ? (n.selectedVideoDevice = t) : t && null != t && t.kind.includes('audio') && (n.selectedAudioDevice = t) }), !n.selectedVideoDevice && (n.selectedVideoDevice = n.availableVideoDevices[0])) }) .catch(function (e) { console.error('image.no_webcam_support', e) }) .finally(function () { ;(console.log(n.stream), n.stream || (n.stream = new MediaStream()), console.log(n.stream.getTracks()), n.stream.getTracks().find(function (e) { return 'audio' === e.kind }) || n.stream.addTrack(jz()), n.stream.getTracks().find(function (e) { return 'video' === e.kind }) || n.stream.addTrack(Gz()), console.log(n.hasCamera, n.hasMic), (n.webcamAccessed = !0), (n.localStream = n.stream), o && ((o.srcObject = n.localStream), (o.muted = !0), null == o || o.play())) }) ) case 1: return r.a(2) } }, r) }) )() }, startWebRTC: function () { var e = this return v( d().m(function t() { var n, r return d().w(function (t) { for (;;) switch (t.n) { case 0: if (((n = qq()), 'closed' !== e.streamState)) { t.n = 2 break } return ( (e.chatRecords = []), (e.peerConnection = new RTCPeerConnection(e.rtcConfig)), e.peerConnection.addEventListener( 'connectionstatechange', (function () { var t = v( d().m(function t(n) { var r return d().w(function (t) { for (;;) switch (t.n) { case 0: ;((r = e.peerConnection.connectionState), (t.n = 'connected' === r ? 1 : 'disconnected' === r ? 2 : 3)) break case 1: return ((e.streamState = ms.open), t.a(3, 3)) case 2: return ( (e.streamState = ms.closed), Qz(e.peerConnection), t.a(3, 3) ) case 3: return t.a(2) } }, t) }) ) return function (e) { return t.apply(this, arguments) } })() ), (e.streamState = ms.waiting), (t.n = 1), qz(e.stream, e.peerConnection, n.remoteVideoRef) .then(function (t) { var n = C(t, 2), r = n[0], i = n[1] if ( ((e.streamState = ms.open), (e.webRTCId = i), (e.chatDataChannel = r), e.avatarType && e.avatarWSRoute) ) { var a = e.initWebsocket(e.avatarWSRoute, e.webRTCId) 'lam' === e.avatarType && (e.localAvatarRenderer = e.doGaussianRender(a)) } }) .catch(function (t) { ;(console.info('catching', t), (e.streamState = ms.closed), tq.error(t), tq.error('请检查是否超过数字人并发上限')) }) ) case 1: t.n = 5 break case 2: if ('waiting' !== e.streamState) { t.n = 3 break } t.n = 5 break case 3: return ( Qz(e.peerConnection), (e.streamState = ms.closed), (e.chatRecords = []), (e.chatDataChannel = null), (e.replying = !1), (t.n = 4), e.accessDevice() ) case 4: 'lam' === e.avatarType && (null === (r = e.localAvatarRenderer) || void 0 === r || r.exit(), (e.gsLoadPercent = 0)) case 5: return t.a(2) } }, t) }) )() }, initWebsocket: function (e, t) { var n = new ps( '' .concat(window.location.protocol.includes('https') ? 'wss' : 'ws', '://') .concat(window.location.host) .concat(e, '/') .concat(t) ) return ( n.on(hs.WS_OPEN, function () { console.log('socket opened') }), n.on(hs.WS_CLOSE, function () { console.log('socket closed') }), n.on(hs.WS_ERROR, function (e) { console.log('socket error', e) }), n.on(hs.WS_MESSAGE, function (e) { console.log('socket on message', e) }), n ) }, doGaussianRender: function (e) { var t = this, n = qq(), r = new Fz({ container: n.remoteVideoContainerRef, assetsPath: this.avatarAssetsPath, ws: e, loadProgress: function (e) { ;(console.log('gs loadProgress', e), (t.gsLoadPercent = e)) }, }) return (r.start(), r) }, }, }), Kq = { class: 'icon-wrap' }, Zq = ar({ __name: 'WebcamPermission', emits: ['click'], setup: function (e, t) { t.emit var n = Yq() qq() var r = (function () { var e = v( d().m(function e() { return d().w(function (e) { for (;;) switch (e.n) { case 0: n.accessDevice() case 1: return e.a(2) } }, e) }) ) return function () { return e.apply(this, arguments) } })() return ( yr(function () {}), function (e, t) { return ( Gi(), Xi('div', { class: 'access-wrap', onClick: r }, [ ea('span', Kq, [ta(on(jq))]), ra(' ' + Ie('点击允许访问摄像头和麦克风')), ]) ) } ) }, }), Jq = function (e, t) { var n, r = e.__vccOpts || e, i = L(t) try { for (i.s(); !(n = i.n()).done; ) { var a = C(n.value, 2), o = a[0], s = a[1] r[o] = s } } catch (u) { i.e(u) } finally { i.f() } return r }, $q = Jq(Zq, [['__scopeId', 'data-v-3e18f301']]), eX = 'undefined' != typeof window, tX = function (e) { return arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ? Symbol.for(e) : Symbol(e) }, nX = function (e) { return JSON.stringify(e) .replace(/\u2028/g, '\\u2028') .replace(/\u2029/g, '\\u2029') .replace(/\u0027/g, '\\u0027') }, rX = function (e) { return 'number' == typeof e && isFinite(e) }, iX = function (e) { return '[object RegExp]' === _X(e) }, aX = function (e) { return bX(e) && 0 === Object.keys(e).length }, oX = Object.assign, sX = Object.create, uX = function () { return sX(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null) }, lX = function () { return ( Qq || (Qq = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : uX()) ) } function cX(e) { return e .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') } var hX = Object.prototype.hasOwnProperty function dX(e, t) { return hX.call(e, t) } var fX = Array.isArray, pX = function (e) { return 'function' == typeof e }, vX = function (e) { return 'string' == typeof e }, mX = function (e) { return 'boolean' == typeof e }, gX = function (e) { return null !== e && 'object' === P(e) }, yX = Object.prototype.toString, _X = function (e) { return yX.call(e) }, bX = function (e) { return '[object Object]' === _X(e) } function xX(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '' return e.reduce(function (e, n, r) { return 0 === r ? e + n : e + t + n }, '') } function SX(e, t) { 'undefined' != typeof console && (console.warn('[intlify] ' + e), t && console.warn(t.stack)) } var AX = function (e) { return !gX(e) || fX(e) } function wX(e, t) { if (AX(e) || AX(t)) throw new Error('Invalid value') for ( var n = [{ src: e, des: t }], r = function () { var e = n.pop(), t = e.src, r = e.des Object.keys(t).forEach(function (e) { '__proto__' !== e && (gX(t[e]) && !gX(r[e]) && (r[e] = Array.isArray(t[e]) ? [] : uX()), AX(r[e]) || AX(t[e]) ? (r[e] = t[e]) : n.push({ src: t[e], des: r[e] })) }) }; n.length; ) r() } /*! * message-compiler v11.1.9 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */ function TX(e, t, n) { return { start: e, end: t } } var MX = 1, EX = 2, CX = 3, kX = 4, RX = 5, IX = 6, NX = 7, PX = 8, LX = 9, DX = 10, OX = 11, FX = 12, BX = 13, UX = 14 function zX(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r = n.domain, i = (n.messages, n.args, new SyntaxError(String(e))) return ((i.code = e), t && (i.location = t), (i.domain = r), i) } function VX(e) { throw e } var HX = ' ', WX = '\n', GX = String.fromCharCode(8232), jX = String.fromCharCode(8233) function QX(e) { var t = e, n = 0, r = 1, i = 1, a = 0, o = function (e) { return '\r' === t[e] && t[e + 1] === WX }, s = function (e) { return t[e] === jX }, u = function (e) { return t[e] === GX }, l = function (e) { return ( o(e) || (function (e) { return t[e] === WX })(e) || s(e) || u(e) ) }, c = function (e) { return o(e) || s(e) || u(e) ? WX : t[e] } function h() { return ((a = 0), l(n) && (r++, (i = 0)), o(n) && n++, n++, i++, t[n]) } return { index: function () { return n }, line: function () { return r }, column: function () { return i }, peekOffset: function () { return a }, charAt: c, currentChar: function () { return c(n) }, currentPeek: function () { return c(n + a) }, next: h, peek: function () { return (o(n + a) && a++, a++, t[n + a]) }, reset: function () { ;((n = 0), (r = 1), (i = 1), (a = 0)) }, resetPeek: function () { a = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0 }, skipToPeek: function () { for (var e = n + a; e !== n; ) h() a = 0 }, } } var qX = void 0 function XX(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = !1 !== t.location, r = QX(e), i = function () { return r.index() }, a = function () { return (function (e, t, n) { return { line: e, column: t, offset: n } })(r.line(), r.column(), r.index()) }, o = a(), s = i(), u = { currentType: 13, offset: s, startLoc: o, endLoc: o, lastType: 13, lastOffset: s, lastStartLoc: o, lastEndLoc: o, braceNest: 0, inLinked: !1, text: '', }, l = function () { return u }, c = t.onError function h(e, t, r) { var i = l() if (((t.column += r), (t.offset += r), c)) { for ( var a = n ? TX(i.startLoc, t) : null, o = arguments.length, s = new Array(o > 3 ? o - 3 : 0), u = 3; u < o; u++ ) s[u - 3] = arguments[u] var h = zX(e, a, { domain: 'tokenizer', args: s }) c(h) } } function d(e, t, r) { ;((e.endLoc = a()), (e.currentType = t)) var i = { type: t } return (n && (i.loc = TX(e.startLoc, e.endLoc)), null != r && (i.value = r), i) } var f = function (e) { return d(e, 13) } function p(e, t) { return e.currentChar() === t ? (e.next(), t) : (h(MX, a(), 0, t), '') } function v(e) { for (var t = ''; e.currentPeek() === HX || e.currentPeek() === WX; ) ((t += e.currentPeek()), e.peek()) return t } function m(e) { var t = v(e) return (e.skipToPeek(), t) } function g(e) { if (e === qX) return !1 var t = e.charCodeAt(0) return (t >= 97 && t <= 122) || (t >= 65 && t <= 90) || 95 === t } function y(e, t) { if (2 !== t.currentType) return !1 v(e) var n = (function (e) { if (e === qX) return !1 var t = e.charCodeAt(0) return t >= 48 && t <= 57 })('-' === e.currentPeek() ? e.peek() : e.currentPeek()) return (e.resetPeek(), n) } function _(e) { v(e) var t = '|' === e.currentPeek() return (e.resetPeek(), t) } function b(e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n = function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '', i = e.currentPeek() return '{' === i ? t : '@' !== i && i ? '|' === i ? !(r === HX || r === WX) : i === HX ? (e.peek(), n(!0, HX)) : i !== WX || (e.peek(), n(!0, WX)) : t }, r = n() return (t && e.resetPeek(), r) } function x(e, t) { var n = e.currentChar() return n === qX ? qX : t(n) ? (e.next(), n) : null } function S(e) { var t = e.charCodeAt(0) return ( (t >= 97 && t <= 122) || (t >= 65 && t <= 90) || (t >= 48 && t <= 57) || 95 === t || 36 === t ) } function A(e) { return x(e, S) } function w(e) { var t = e.charCodeAt(0) return ( (t >= 97 && t <= 122) || (t >= 65 && t <= 90) || (t >= 48 && t <= 57) || 95 === t || 36 === t || 45 === t ) } function T(e) { return x(e, w) } function M(e) { var t = e.charCodeAt(0) return t >= 48 && t <= 57 } function E(e) { return x(e, M) } function C(e) { var t = e.charCodeAt(0) return (t >= 48 && t <= 57) || (t >= 65 && t <= 70) || (t >= 97 && t <= 102) } function k(e) { return x(e, C) } function R(e) { for (var t = '', n = ''; (t = E(e)); ) n += t return n } function I(e) { return "'" !== e && e !== WX } function N(e) { var t = e.currentChar() switch (t) { case '\\': case "'": return (e.next(), '\\'.concat(t)) case 'u': return P(e, t, 4) case 'U': return P(e, t, 6) default: return (h(kX, a(), 0, t), '') } } function P(e, t, n) { p(e, t) for (var r = '', i = 0; i < n; i++) { var o = k(e) if (!o) { h(RX, a(), 0, '\\'.concat(t).concat(r).concat(e.currentChar())) break } r += o } return '\\'.concat(t).concat(r) } function L(e) { return '{' !== e && '}' !== e && e !== HX && e !== WX } function D(e) { m(e) var t = p(e, '|') return (m(e), t) } function O(e, t) { var n = null switch (e.currentChar()) { case '{': return ( t.braceNest >= 1 && h(LX, a(), 0), e.next(), (n = d(t, 2, '{')), m(e), t.braceNest++, n ) case '}': return ( t.braceNest > 0 && 2 === t.currentType && h(PX, a(), 0), e.next(), (n = d(t, 3, '}')), t.braceNest--, t.braceNest > 0 && m(e), t.inLinked && 0 === t.braceNest && (t.inLinked = !1), n ) case '@': return ( t.braceNest > 0 && h(NX, a(), 0), (n = F(e, t) || f(t)), (t.braceNest = 0), n ) default: var r, i, o if (_(e)) return ( t.braceNest > 0 && h(NX, a(), 0), (n = d(t, 1, D(e))), (t.braceNest = 0), (t.inLinked = !1), n ) if ( t.braceNest > 0 && (4 === t.currentType || 5 === t.currentType || 6 === t.currentType) ) return (h(NX, a(), 0), (t.braceNest = 0), B(e, t)) if ( (r = (function (e, t) { if (2 !== t.currentType) return !1 v(e) var n = g(e.currentPeek()) return (e.resetPeek(), n) })(e, t)) ) return ( (n = d( t, 4, (function (e) { m(e) for (var t = '', n = ''; (t = T(e)); ) n += t return (e.currentChar() === qX && h(NX, a(), 0), n) })(e) )), m(e), n ) if ((i = y(e, t))) return ( (n = d( t, 5, (function (e) { m(e) var t = '' return ( '-' === e.currentChar() ? (e.next(), (t += '-'.concat(R(e)))) : (t += R(e)), e.currentChar() === qX && h(NX, a(), 0), t ) })(e) )), m(e), n ) if ( (o = (function (e, t) { if (2 !== t.currentType) return !1 v(e) var n = "'" === e.currentPeek() return (e.resetPeek(), n) })(e, t)) ) return ( (n = d( t, 6, (function (e) { ;(m(e), p(e, "'")) for (var t = '', n = ''; (t = x(e, I)); ) n += '\\' === t ? N(e) : t var r = e.currentChar() return r === WX || r === qX ? (h(CX, a(), 0), r === WX && (e.next(), p(e, "'")), n) : (p(e, "'"), n) })(e) )), m(e), n ) if (!r && !i && !o) return ( (n = d( t, 12, (function (e) { m(e) for (var t = '', n = ''; (t = x(e, L)); ) n += t return n })(e) )), h(EX, a(), 0, n.value), m(e), n ) } return n } function F(e, t) { var n = t.currentType, r = null, i = e.currentChar() switch ( ((7 !== n && 8 !== n && 11 !== n && 9 !== n) || (i !== WX && i !== HX) || h(DX, a(), 0), i) ) { case '@': return (e.next(), (r = d(t, 7, '@')), (t.inLinked = !0), r) case '.': return (m(e), e.next(), d(t, 8, '.')) case ':': return (m(e), e.next(), d(t, 9, ':')) default: return _(e) ? ((r = d(t, 1, D(e))), (t.braceNest = 0), (t.inLinked = !1), r) : (function (e, t) { if (7 !== t.currentType) return !1 v(e) var n = '.' === e.currentPeek() return (e.resetPeek(), n) })(e, t) || (function (e, t) { var n = t.currentType if (7 !== n && 11 !== n) return !1 v(e) var r = ':' === e.currentPeek() return (e.resetPeek(), r) })(e, t) ? (m(e), F(e, t)) : (function (e, t) { if (8 !== t.currentType) return !1 v(e) var n = g(e.currentPeek()) return (e.resetPeek(), n) })(e, t) ? (m(e), d( t, 11, (function (e) { for (var t = '', n = ''; (t = A(e)); ) n += t return n })(e) )) : (function (e, t) { if (9 !== t.currentType) return !1 var n = function () { var t = e.currentPeek() return '{' === t ? g(e.peek()) : !( '@' === t || '|' === t || ':' === t || '.' === t || t === HX || !t ) && (t === WX ? (e.peek(), n()) : b(e, !1)) }, r = n() return (e.resetPeek(), r) })(e, t) ? (m(e), '{' === i ? O(e, t) || r : d( t, 10, (function (e) { var t = function (n) { var r = e.currentChar() return '{' !== r && '@' !== r && '|' !== r && '(' !== r && ')' !== r && r ? r === HX ? n : ((n += r), e.next(), t(n)) : n } return t('') })(e) )) : (7 === n && h(DX, a(), 0), (t.braceNest = 0), (t.inLinked = !1), B(e, t)) } } function B(e, t) { var n = { type: 13 } if (t.braceNest > 0) return O(e, t) || f(t) if (t.inLinked) return F(e, t) || f(t) switch (e.currentChar()) { case '{': return O(e, t) || f(t) case '}': return (h(IX, a(), 0), e.next(), d(t, 3, '}')) case '@': return F(e, t) || f(t) default: if (_(e)) return ((n = d(t, 1, D(e))), (t.braceNest = 0), (t.inLinked = !1), n) if (b(e)) return d( t, 0, (function (e) { for (var t = ''; ; ) { var n = e.currentChar() if ('{' === n || '}' === n || '@' === n || '|' === n || !n) break if (n === HX || n === WX) if (b(e)) ((t += n), e.next()) else { if (_(e)) break ;((t += n), e.next()) } else ((t += n), e.next()) } return t })(e) ) } return n } return { nextToken: function () { var e = u.currentType, t = u.offset, n = u.startLoc, o = u.endLoc return ( (u.lastType = e), (u.lastOffset = t), (u.lastStartLoc = n), (u.lastEndLoc = o), (u.offset = i()), (u.startLoc = a()), r.currentChar() === qX ? d(u, 13) : B(r, u) ) }, currentOffset: i, currentPosition: a, context: l, } } var YX = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g function KX(e, t, n) { switch (e) { case '\\\\': return '\\' case "\\'": return "'" default: var r = parseInt(t || n, 16) return r <= 55295 || r >= 57344 ? String.fromCodePoint(r) : '�' } } function ZX() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = !1 !== e.location, n = e.onError function r(e, r, i, a) { var o = e.currentPosition() if (((o.offset += a), (o.column += a), n)) { for ( var s = t ? TX(i, o) : null, u = arguments.length, l = new Array(u > 4 ? u - 4 : 0), c = 4; c < u; c++ ) l[c - 4] = arguments[c] var h = zX(r, s, { domain: 'parser', args: l }) n(h) } } function i(e, n, r) { var i = { type: e } return (t && ((i.start = n), (i.end = n), (i.loc = { start: r, end: r })), i) } function a(e, n, r, i) { t && ((e.end = n), e.loc && (e.loc.end = r)) } function o(e, t) { var n = e.context(), r = i(3, n.offset, n.startLoc) return ((r.value = t), a(r, e.currentOffset(), e.currentPosition()), r) } function s(e, t) { var n = e.context(), r = i(5, n.lastOffset, n.lastStartLoc) return ( (r.index = parseInt(t, 10)), e.nextToken(), a(r, e.currentOffset(), e.currentPosition()), r ) } function u(e, t) { var n = e.context(), r = i(4, n.lastOffset, n.lastStartLoc) return ((r.key = t), e.nextToken(), a(r, e.currentOffset(), e.currentPosition()), r) } function l(e, t) { var n = e.context(), r = i(9, n.lastOffset, n.lastStartLoc) return ( (r.value = t.replace(YX, KX)), e.nextToken(), a(r, e.currentOffset(), e.currentPosition()), r ) } function c(e) { var t = e.context(), n = i(6, t.offset, t.startLoc), o = e.nextToken() if (8 === o.type) { var c = (function (e) { var t = e.nextToken(), n = e.context(), o = n.lastOffset, s = n.lastStartLoc, u = i(8, o, s) return 11 !== t.type ? (r(e, FX, n.lastStartLoc, 0), (u.value = ''), a(u, o, s), { nextConsumeToken: t, node: u }) : (null == t.value && r(e, UX, n.lastStartLoc, 0, JX(t)), (u.value = t.value || ''), a(u, e.currentOffset(), e.currentPosition()), { node: u }) })(e) ;((n.modifier = c.node), (o = c.nextConsumeToken || e.nextToken())) } switch ( (9 !== o.type && r(e, UX, t.lastStartLoc, 0, JX(o)), 2 === (o = e.nextToken()).type && (o = e.nextToken()), o.type) ) { case 10: ;(null == o.value && r(e, UX, t.lastStartLoc, 0, JX(o)), (n.key = (function (e, t) { var n = e.context(), r = i(7, n.offset, n.startLoc) return ((r.value = t), a(r, e.currentOffset(), e.currentPosition()), r) })(e, o.value || ''))) break case 4: ;(null == o.value && r(e, UX, t.lastStartLoc, 0, JX(o)), (n.key = u(e, o.value || ''))) break case 5: ;(null == o.value && r(e, UX, t.lastStartLoc, 0, JX(o)), (n.key = s(e, o.value || ''))) break case 6: ;(null == o.value && r(e, UX, t.lastStartLoc, 0, JX(o)), (n.key = l(e, o.value || ''))) break default: r(e, BX, t.lastStartLoc, 0) var h = e.context(), d = i(7, h.offset, h.startLoc) return ( (d.value = ''), a(d, h.offset, h.startLoc), (n.key = d), a(n, h.offset, h.startLoc), { nextConsumeToken: o, node: n } ) } return (a(n, e.currentOffset(), e.currentPosition()), { node: n }) } function h(e) { var t = e.context(), n = i( 2, 1 === t.currentType ? e.currentOffset() : t.offset, 1 === t.currentType ? t.endLoc : t.startLoc ) n.items = [] var h = null do { var d = h || e.nextToken() switch (((h = null), d.type)) { case 0: ;(null == d.value && r(e, UX, t.lastStartLoc, 0, JX(d)), n.items.push(o(e, d.value || ''))) break case 5: ;(null == d.value && r(e, UX, t.lastStartLoc, 0, JX(d)), n.items.push(s(e, d.value || ''))) break case 4: ;(null == d.value && r(e, UX, t.lastStartLoc, 0, JX(d)), n.items.push(u(e, d.value || ''))) break case 6: ;(null == d.value && r(e, UX, t.lastStartLoc, 0, JX(d)), n.items.push(l(e, d.value || ''))) break case 7: var f = c(e) ;(n.items.push(f.node), (h = f.nextConsumeToken || null)) } } while (13 !== t.currentType && 1 !== t.currentType) return ( a( n, 1 === t.currentType ? t.lastOffset : e.currentOffset(), 1 === t.currentType ? t.lastEndLoc : e.currentPosition() ), n ) } function d(e) { var t = e.context(), n = t.offset, o = t.startLoc, s = h(e) return 13 === t.currentType ? s : (function (e, t, n, o) { var s = e.context(), u = 0 === o.items.length, l = i(1, t, n) ;((l.cases = []), l.cases.push(o)) do { var c = h(e) ;(u || (u = 0 === c.items.length), l.cases.push(c)) } while (13 !== s.currentType) return (u && r(e, OX, n, 0), a(l, e.currentOffset(), e.currentPosition()), l) })(e, n, o, s) } return { parse: function (n) { var o = XX(n, oX({}, e)), s = o.context(), u = i(0, s.offset, s.startLoc) return ( t && u.loc && (u.loc.source = n), (u.body = d(o)), e.onCacheKey && (u.cacheKey = e.onCacheKey(n)), 13 !== s.currentType && r(o, UX, s.lastStartLoc, 0, n[s.offset] || ''), a(u, o.currentOffset(), o.currentPosition()), u ) }, } } function JX(e) { if (13 === e.type) return 'EOF' var t = (e.value || '').replace(/\r?\n/g, '\\n') return t.length > 10 ? t.slice(0, 9) + '…' : t } function $X(e, t) { for (var n = 0; n < e.length; n++) eY(e[n], t) } function eY(e, t) { switch (e.type) { case 1: ;($X(e.cases, t), t.helper('plural')) break case 2: $X(e.items, t) break case 6: ;(eY(e.key, t), t.helper('linked'), t.helper('type')) break case 5: ;(t.helper('interpolate'), t.helper('list')) break case 4: ;(t.helper('interpolate'), t.helper('named')) } } function tY(e) { var t = (function (e) { var t = { ast: e, helpers: new Set() } return { context: function () { return t }, helper: function (e) { return (t.helpers.add(e), e) }, } })(e) ;(t.helper('normalize'), e.body && eY(e.body, t)) var n = t.context() e.helpers = Array.from(n.helpers) } function nY(e) { if (1 === e.items.length) { var t = e.items[0] ;(3 !== t.type && 9 !== t.type) || ((e.static = t.value), delete t.value) } else { for (var n = [], r = 0; r < e.items.length; r++) { var i = e.items[r] if (3 !== i.type && 9 !== i.type) break if (null == i.value) break n.push(i.value) } if (n.length === e.items.length) { e.static = xX(n) for (var a = 0; a < e.items.length; a++) { var o = e.items[a] ;(3 !== o.type && 9 !== o.type) || delete o.value } } } } function rY(e) { switch (((e.t = e.type), e.type)) { case 0: var t = e ;(rY(t.body), (t.b = t.body), delete t.body) break case 1: for (var n = e, r = n.cases, i = 0; i < r.length; i++) rY(r[i]) ;((n.c = r), delete n.cases) break case 2: for (var a = e, o = a.items, s = 0; s < o.length; s++) rY(o[s]) ;((a.i = o), delete a.items, a.static && ((a.s = a.static), delete a.static)) break case 3: case 9: case 8: case 7: var u = e u.value && ((u.v = u.value), delete u.value) break case 6: var l = e ;(rY(l.key), (l.k = l.key), delete l.key, l.modifier && (rY(l.modifier), (l.m = l.modifier), delete l.modifier)) break case 5: var c = e ;((c.i = c.index), delete c.index) break case 4: var h = e ;((h.k = h.key), delete h.key) } delete e.type } function iY(e, t) { var n = e.helper switch (t.type) { case 0: !(function (e, t) { t.body ? iY(e, t.body) : e.push('null') })(e, t) break case 1: !(function (e, t) { var n = e.helper, r = e.needIndent if (t.cases.length > 1) { ;(e.push(''.concat(n('plural'), '([')), e.indent(r())) for ( var i = t.cases.length, a = 0; a < i && (iY(e, t.cases[a]), a !== i - 1); a++ ) e.push(', ') ;(e.deindent(r()), e.push('])')) } })(e, t) break case 2: !(function (e, t) { var n = e.helper, r = e.needIndent ;(e.push(''.concat(n('normalize'), '([')), e.indent(r())) for ( var i = t.items.length, a = 0; a < i && (iY(e, t.items[a]), a !== i - 1); a++ ) e.push(', ') ;(e.deindent(r()), e.push('])')) })(e, t) break case 6: !(function (e, t) { var n = e.helper ;(e.push(''.concat(n('linked'), '(')), iY(e, t.key), t.modifier ? (e.push(', '), iY(e, t.modifier), e.push(', _type')) : e.push(', undefined, _type'), e.push(')')) })(e, t) break case 8: case 7: case 9: case 3: e.push(JSON.stringify(t.value), t) break case 5: e.push( ''.concat(n('interpolate'), '(').concat(n('list'), '(').concat(t.index, '))'), t ) break case 4: e.push( '' .concat(n('interpolate'), '(') .concat(n('named'), '(') .concat(JSON.stringify(t.key), '))'), t ) } } function aY(e) { var t = oX({}, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}), n = !!t.jit, r = !!t.minify, i = null == t.optimize || t.optimize, a = ZX(t).parse(e) return n ? (i && (function (e) { var t = e.body 2 === t.type ? nY(t) : t.cases.forEach(function (e) { return nY(e) }) })(a), r && rY(a), { ast: a, code: '' }) : (tY(a, t), (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = vX(t.mode) ? t.mode : 'normal', r = vX(t.filename) ? t.filename : 'message.intl' t.sourceMap var i = null != t.breakLineCode ? t.breakLineCode : 'arrow' === n ? ';' : '\n', a = t.needIndent ? t.needIndent : 'arrow' !== n, o = e.helpers || [], s = (function (e, t) { var n = t.filename, r = t.breakLineCode, i = t.needIndent, a = !1 !== t.location, o = { filename: n, code: '', column: 1, line: 1, offset: 0, map: void 0, breakLineCode: r, needIndent: i, indentLevel: 0, } function s(e, t) { o.code += e } function u(e) { var t = arguments.length > 1 && void 0 !== arguments[1] && !arguments[1] ? '' : r s(i ? t + ' '.repeat(e) : t) } return ( a && e.loc && (o.source = e.loc.source), { context: function () { return o }, push: s, indent: function () { var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], t = ++o.indentLevel e && u(t) }, deindent: function () { var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], t = --o.indentLevel e && u(t) }, newline: function () { u(o.indentLevel) }, helper: function (e) { return '_'.concat(e) }, needIndent: function () { return o.needIndent }, } ) })(e, { filename: r, breakLineCode: i, needIndent: a }) ;(s.push('normal' === n ? 'function __msg__ (ctx) {' : '(ctx) => {'), s.indent(a), o.length > 0 && (s.push( 'const { '.concat( xX( o.map(function (e) { return ''.concat(e, ': _').concat(e) }), ', ' ), ' } = ctx' ) ), s.newline()), s.push('return '), iY(s, e), s.deindent(a), s.push('}'), delete e.helpers) var u = s.context(), l = u.code, c = u.map return { ast: e, code: l, map: c ? c.toJSON() : void 0 } })(a, t)) } /*! * core-base v11.1.9 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */ function oY(e) { return gX(e) && 0 === dY(e) && (dX(e, 'b') || dX(e, 'body')) } var sY = ['b', 'body'] var uY = ['c', 'cases'] var lY = ['s', 'static'] var cY = ['i', 'items'] var hY = ['t', 'type'] function dY(e) { return gY(e, hY) } var fY = ['v', 'value'] function pY(e, t) { var n = gY(e, fY) if (null != n) return n throw _Y(t) } var vY = ['m', 'modifier'] var mY = ['k', 'key'] function gY(e, t, n) { for (var r = 0; r < t.length; r++) { var i = t[r] if (dX(e, i) && null != e[i]) return e[i] } return n } var yY = [].concat(sY, uY, lY, cY, mY, vY, fY, hY) function _Y(e) { return new Error('unhandled node type: '.concat(e)) } function bY(e) { return function (t) { return (function (e, t) { var n = (function (e) { return gY(e, sY) })(t) if (null == n) throw _Y(0) if (1 === dY(n)) { var r = (function (e) { return gY(e, uY, []) })(n) return e.plural( r.reduce(function (t, n) { return [].concat(I(t), [xY(e, n)]) }, []) ) } return xY(e, n) })(t, e) } } function xY(e, t) { var n = (function (e) { return gY(e, lY) })(t) if (null != n) return 'text' === e.type ? n : e.normalize([n]) var r = (function (e) { return gY(e, cY, []) })(t).reduce(function (t, n) { return [].concat(I(t), [SY(e, n)]) }, []) return e.normalize(r) } function SY(e, t) { var n = dY(t) switch (n) { case 3: case 9: case 7: case 8: return pY(t, n) case 4: var r = t if (dX(r, 'k') && r.k) return e.interpolate(e.named(r.k)) if (dX(r, 'key') && r.key) return e.interpolate(e.named(r.key)) throw _Y(n) case 5: var i = t if (dX(i, 'i') && rX(i.i)) return e.interpolate(e.list(i.i)) if (dX(i, 'index') && rX(i.index)) return e.interpolate(e.list(i.index)) throw _Y(n) case 6: var a = t, o = (function (e) { return gY(e, vY) })(a), s = (function (e) { var t = gY(e, mY) if (t) return t throw _Y(6) })(a) return e.linked(SY(e, s), o ? SY(e, o) : void 0, e.type) default: throw new Error('unhandled node on format message part: '.concat(n)) } } var AY = function (e) { return e }, wY = uX() var TY = null var MY = EY('function:translate') function EY(e) { return function (t) { return TY && TY.emit(e, t) } } var CY, kY = 17, RY = 18, IY = 19, NY = 21, PY = 22, LY = 23 function DY(e) { return zX(e, null, void 0) } function OY(e, t) { return null != t.locale ? FY(t.locale) : FY(e.locale) } function FY(e) { if (vX(e)) return e if (pX(e)) { if (e.resolvedOnce && null != CY) return CY if ('Function' === e.constructor.name) { var t = e() if (gX((n = t)) && pX(n.then) && pX(n.catch)) throw DY(NY) return (CY = t) } throw DY(PY) } throw DY(LY) var n } function BY(e, t, n) { return I(new Set([n].concat(I(fX(t) ? t : gX(t) ? Object.keys(t) : vX(t) ? [t] : [n])))) } function UY(e, t, n) { var r = vX(n) ? n : JY, i = e i.__localeChainCache || (i.__localeChainCache = new Map()) var a = i.__localeChainCache.get(r) if (!a) { a = [] for (var o = [n]; fX(o); ) o = zY(a, o, t) var s = fX(t) || !bX(t) ? t : t.default ? t.default : null ;((o = vX(s) ? [s] : s), fX(o) && zY(a, o, !1), i.__localeChainCache.set(r, a)) } return a } function zY(e, t, n) { for (var r = !0, i = 0; i < t.length && mX(r); i++) { var a = t[i] vX(a) && (r = VY(e, t[i], n)) } return r } function VY(e, t, n) { var r, i = t.split('-') do { ;((r = HY(e, i.join('-'), n)), i.splice(-1, 1)) } while (i.length && !0 === r) return r } function HY(e, t, n) { var r = !1 if (!e.includes(t) && ((r = !0), t)) { r = '!' !== t[t.length - 1] var i = t.replace(/!/g, '') ;(e.push(i), (fX(n) || bX(n)) && n[i] && (r = n[i])) } return r } var WY = [] ;((WY[0] = M(M(M(M({}, 'w', [0]), 'i', [3, 0]), '[', [4]), 'o', [7])), (WY[1] = M(M(M(M({}, 'w', [1]), '.', [2]), '[', [4]), 'o', [7])), (WY[2] = M(M(M({}, 'w', [2]), 'i', [3, 0]), '0', [3, 0])), (WY[3] = M( M(M(M(M(M({}, 'i', [3, 0]), '0', [3, 0]), 'w', [1, 1]), '.', [2, 1]), '[', [4, 1]), 'o', [7, 1] )), (WY[4] = M( M(M(M(M(M({}, "'", [5, 0]), '"', [6, 0]), '[', [4, 2]), ']', [1, 3]), 'o', 8), 'l', [4, 0] )), (WY[5] = M(M(M({}, "'", [4, 0]), 'o', 8), 'l', [5, 0])), (WY[6] = M(M(M({}, '"', [4, 0]), 'o', 8), 'l', [6, 0]))) var GY = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/ function jY(e) { if (null == e) return 'o' switch (e.charCodeAt(0)) { case 91: case 93: case 46: case 34: case 39: return e case 95: case 36: case 45: return 'i' case 9: case 10: case 13: case 160: case 65279: case 8232: case 8233: return 'w' } return 'i' } function QY(e) { var t, n = e.trim() return ( ('0' !== e.charAt(0) || !isNaN(parseInt(e))) && ((t = n), GY.test(t) ? (function (e) { var t = e.charCodeAt(0) return t !== e.charCodeAt(e.length - 1) || (34 !== t && 39 !== t) ? e : e.slice(1, -1) })(n) : '*' + n) ) } var qY = new Map() function XY(e, t) { return gX(e) ? e[t] : null } var YY, KY, ZY, JY = 'en-US', $Y = function (e) { return ''.concat(e.charAt(0).toLocaleUpperCase()).concat(e.substr(1)) } var eK = null, tK = function () { return eK }, nK = null, rK = function (e) { nK = e }, iK = 0 function aK() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = pX(e.onWarn) ? e.onWarn : SX, n = vX(e.version) ? e.version : '11.1.9', r = vX(e.locale) || pX(e.locale) ? e.locale : JY, i = pX(r) ? JY : r, a = fX(e.fallbackLocale) || bX(e.fallbackLocale) || vX(e.fallbackLocale) || !1 === e.fallbackLocale ? e.fallbackLocale : i, o = bX(e.messages) ? e.messages : oK(i), s = bX(e.datetimeFormats) ? e.datetimeFormats : oK(i), u = bX(e.numberFormats) ? e.numberFormats : oK(i), l = oX(uX(), e.modifiers, { upper: function (e, t) { return 'text' === t && vX(e) ? e.toUpperCase() : 'vnode' === t && gX(e) && '__v_isVNode' in e ? e.children.toUpperCase() : e }, lower: function (e, t) { return 'text' === t && vX(e) ? e.toLowerCase() : 'vnode' === t && gX(e) && '__v_isVNode' in e ? e.children.toLowerCase() : e }, capitalize: function (e, t) { return 'text' === t && vX(e) ? $Y(e) : 'vnode' === t && gX(e) && '__v_isVNode' in e ? $Y(e.children) : e }, }), c = e.pluralRules || uX(), h = pX(e.missing) ? e.missing : null, d = (!mX(e.missingWarn) && !iX(e.missingWarn)) || e.missingWarn, f = (!mX(e.fallbackWarn) && !iX(e.fallbackWarn)) || e.fallbackWarn, p = !!e.fallbackFormat, v = !!e.unresolving, m = pX(e.postTranslation) ? e.postTranslation : null, g = bX(e.processor) ? e.processor : null, y = !mX(e.warnHtmlMessage) || e.warnHtmlMessage, _ = !!e.escapeParameter, b = pX(e.messageCompiler) ? e.messageCompiler : YY, x = pX(e.messageResolver) ? e.messageResolver : KY || XY, S = pX(e.localeFallbacker) ? e.localeFallbacker : ZY || BY, A = gX(e.fallbackContext) ? e.fallbackContext : void 0, w = e, T = gX(w.__datetimeFormatters) ? w.__datetimeFormatters : new Map(), M = gX(w.__numberFormatters) ? w.__numberFormatters : new Map(), E = gX(w.__meta) ? w.__meta : {}, C = { version: n, cid: ++iK, locale: r, fallbackLocale: a, messages: o, modifiers: l, pluralRules: c, missing: h, missingWarn: d, fallbackWarn: f, fallbackFormat: p, unresolving: v, postTranslation: m, processor: g, warnHtmlMessage: y, escapeParameter: _, messageCompiler: b, messageResolver: x, localeFallbacker: S, fallbackContext: A, onWarn: t, __meta: E, } return ( (C.datetimeFormats = s), (C.numberFormats = u), (C.__datetimeFormatters = T), (C.__numberFormatters = M), __INTLIFY_PROD_DEVTOOLS__ && (function (e, t, n) { TY && TY.emit('i18n:init', { timestamp: Date.now(), i18n: e, version: t, meta: n }) })(C, n, E), C ) } var oK = function (e) { return M({}, e, uX()) } function sK(e, t, n, r, i) { var a = e.missing e.onWarn if (null !== a) { var o = a(e, n, t, i) return vX(o) ? o : t } return t } function uK(e, t, n) { ;((e.__localeChainCache = new Map()), e.localeFallbacker(e, n, t)) } function lK(e, t) { return e !== t && e.split('-')[0] === t.split('-')[0] } function cK(e, t) { var n = t.indexOf(e) if (-1 === n) return !1 for (var r = n + 1; r < t.length; r++) if (lK(e, t[r])) return !0 return !1 } function hK(e) { for ( var t = e.datetimeFormats, n = e.unresolving, r = e.fallbackLocale, i = (e.onWarn, e.localeFallbacker), a = e.__datetimeFormatters, o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++ ) s[u - 1] = arguments[u] var l = C(fK.apply(void 0, s), 4), c = l[0], h = l[1], d = l[2], f = l[3] mX(d.missingWarn) ? d.missingWarn : e.missingWarn mX(d.fallbackWarn) ? d.fallbackWarn : e.fallbackWarn var p = !!d.part, v = OY(e, d), m = i(e, r, v) if (!vX(c) || '' === c) return new Intl.DateTimeFormat(v, f).format(h) for ( var g, y = null, _ = 0; _ < m.length && ((y = (t[(g = m[_])] || {})[c]), !bX(y)); _++ ) sK(e, c, g, 0, 'datetime format') if (!bX(y) || !vX(g)) return n ? -1 : c var b = ''.concat(g, '__').concat(c) aX(f) || (b = ''.concat(b, '__').concat(JSON.stringify(f))) var x = a.get(b) return ( x || ((x = new Intl.DateTimeFormat(g, oX({}, y, f))), a.set(b, x)), p ? x.formatToParts(h) : x.format(h) ) } var dK = [ 'localeMatcher', 'weekday', 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName', 'formatMatcher', 'hour12', 'timeZone', 'dateStyle', 'timeStyle', 'calendar', 'dayPeriod', 'numberingSystem', 'hourCycle', 'fractionalSecondDigits', ] function fK() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] var r, i = t[0], a = t[1], o = t[2], s = t[3], u = uX(), l = uX() if (vX(i)) { var c = i.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/) if (!c) throw DY(IY) var h = c[3] ? c[3].trim().startsWith('T') ? ''.concat(c[1].trim()).concat(c[3].trim()) : ''.concat(c[1].trim(), 'T').concat(c[3].trim()) : c[1].trim() r = new Date(h) try { r.toISOString() } catch (d) { throw DY(IY) } } else if ('[object Date]' === _X(i)) { if (isNaN(i.getTime())) throw DY(RY) r = i } else { if (!rX(i)) throw DY(kY) r = i } return ( vX(a) ? (u.key = a) : bX(a) && Object.keys(a).forEach(function (e) { dK.includes(e) ? (l[e] = a[e]) : (u[e] = a[e]) }), vX(o) ? (u.locale = o) : bX(o) && (l = o), bX(s) && (l = s), [u.key || '', r, u, l] ) } function pK(e, t, n) { var r = e for (var i in n) { var a = ''.concat(t, '__').concat(i) r.__datetimeFormatters.has(a) && r.__datetimeFormatters.delete(a) } } function vK(e) { for ( var t = e.numberFormats, n = e.unresolving, r = e.fallbackLocale, i = (e.onWarn, e.localeFallbacker), a = e.__numberFormatters, o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++ ) s[u - 1] = arguments[u] var l = C(gK.apply(void 0, s), 4), c = l[0], h = l[1], d = l[2], f = l[3] mX(d.missingWarn) ? d.missingWarn : e.missingWarn mX(d.fallbackWarn) ? d.fallbackWarn : e.fallbackWarn var p = !!d.part, v = OY(e, d), m = i(e, r, v) if (!vX(c) || '' === c) return new Intl.NumberFormat(v, f).format(h) for ( var g, y = null, _ = 0; _ < m.length && ((y = (t[(g = m[_])] || {})[c]), !bX(y)); _++ ) sK(e, c, g, 0, 'number format') if (!bX(y) || !vX(g)) return n ? -1 : c var b = ''.concat(g, '__').concat(c) aX(f) || (b = ''.concat(b, '__').concat(JSON.stringify(f))) var x = a.get(b) return ( x || ((x = new Intl.NumberFormat(g, oX({}, y, f))), a.set(b, x)), p ? x.formatToParts(h) : x.format(h) ) } var mK = [ 'localeMatcher', 'style', 'currency', 'currencyDisplay', 'currencySign', 'useGrouping', 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits', 'minimumSignificantDigits', 'maximumSignificantDigits', 'compactDisplay', 'notation', 'signDisplay', 'unit', 'unitDisplay', 'roundingMode', 'roundingPriority', 'roundingIncrement', 'trailingZeroDisplay', ] function gK() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] var r = t[0], i = t[1], a = t[2], o = t[3], s = uX(), u = uX() if (!rX(r)) throw DY(kY) var l = r return ( vX(i) ? (s.key = i) : bX(i) && Object.keys(i).forEach(function (e) { mK.includes(e) ? (u[e] = i[e]) : (s[e] = i[e]) }), vX(a) ? (s.locale = a) : bX(a) && (u = a), bX(o) && (u = o), [s.key || '', l, s, u] ) } function yK(e, t, n) { var r = e for (var i in n) { var a = ''.concat(t, '__').concat(i) r.__numberFormatters.has(a) && r.__numberFormatters.delete(a) } } var _K = function (e) { return e }, bK = function (e) { return '' }, xK = function (e) { return 0 === e.length ? '' : xX(e) }, SK = function (e) { return null == e ? '' : fX(e) || (bX(e) && e.toString === yX) ? JSON.stringify(e, null, 2) : String(e) } function AK(e, t) { return ((e = Math.abs(e)), 2 === t ? (e ? (e > 1 ? 1 : 0) : 1) : e ? Math.min(e, 2) : 0) } function wK() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.locale, n = (function (e) { var t = rX(e.pluralIndex) ? e.pluralIndex : -1 return e.named && (rX(e.named.count) || rX(e.named.n)) ? rX(e.named.count) ? e.named.count : rX(e.named.n) ? e.named.n : t : t })(e), r = gX(e.pluralRules) && vX(t) && pX(e.pluralRules[t]) ? e.pluralRules[t] : AK, i = gX(e.pluralRules) && vX(t) && pX(e.pluralRules[t]) ? AK : void 0, a = e.list || [], o = e.named || uX() rX(e.pluralIndex) && (function (e, t) { ;(t.count || (t.count = e), t.n || (t.n = e)) })(n, o) function s(t, n) { var r = pX(e.messages) ? e.messages(t, !!n) : !!gX(e.messages) && e.messages[t] return r || (e.parent ? e.parent.message(t) : bK) } var u = bX(e.processor) && pX(e.processor.normalize) ? e.processor.normalize : xK, l = bX(e.processor) && pX(e.processor.interpolate) ? e.processor.interpolate : SK, c = bX(e.processor) && vX(e.processor.type) ? e.processor.type : 'text', h = M( M( M( M( M( M( M( M( M({}, 'list', function (e) { return a[e] }), 'named', function (e) { return o[e] } ), 'plural', function (e) { return e[r(n, e.length, i)] } ), 'linked', function (t) { for ( var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++ ) r[i - 1] = arguments[i] var a = r[0], o = r[1], u = 'text', l = '' 1 === r.length ? gX(a) ? ((l = a.modifier || l), (u = a.type || u)) : vX(a) && (l = a || l) : 2 === r.length && (vX(a) && (l = a || l), vX(o) && (u = o || u)) var c = s(t, !0)(h), d = 'vnode' === u && fX(c) && l ? c[0] : c return l ? (function (t) { return e.modifiers ? e.modifiers[t] : _K })(l)(d, u) : d } ), 'message', s ), 'type', c ), 'interpolate', l ), 'normalize', u ), 'values', oX(uX(), a, o) ) return h } var TK = function () { return '' }, MK = function (e) { return pX(e) } function EK(e) { for ( var t = e.fallbackFormat, n = e.postTranslation, r = e.unresolving, i = e.messageCompiler, a = e.fallbackLocale, o = e.messages, s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), l = 1; l < s; l++ ) u[l - 1] = arguments[l] var c = C(RK.apply(void 0, u), 2), h = c[0], d = c[1], f = mX(d.missingWarn) ? d.missingWarn : e.missingWarn, p = mX(d.fallbackWarn) ? d.fallbackWarn : e.fallbackWarn, v = mX(d.escapeParameter) ? d.escapeParameter : e.escapeParameter, m = !!d.resolvedMessage, g = vX(d.default) || mX(d.default) ? mX(d.default) ? i ? h : function () { return h } : d.default : t ? i ? h : function () { return h } : null, y = t || (null != g && (vX(g) || pX(g))), _ = OY(e, d) v && (function (e) { fX(e.list) ? (e.list = e.list.map(function (e) { return vX(e) ? cX(e) : e })) : gX(e.named) && Object.keys(e.named).forEach(function (t) { vX(e.named[t]) && (e.named[t] = cX(e.named[t])) }) })(d) var b = C(m ? [h, _, o[_] || uX()] : CK(e, h, _, a, p, f), 3), x = b[0], S = b[1], A = b[2], w = x, T = h if ( (m || vX(w) || oY(w) || MK(w) || (y && (T = w = g)), !(m || ((vX(w) || oY(w) || MK(w)) && vX(S)))) ) return r ? -1 : h var M = !1, E = MK(w) ? w : kK(e, h, S, w, T, function () { M = !0 }) if (M) return w var k = (function (e, t, n, r) { var i = e.modifiers, a = e.pluralRules, o = e.messageResolver, s = e.fallbackLocale, u = e.fallbackWarn, l = e.missingWarn, c = e.fallbackContext, h = function (r, i) { var a = o(n, r) if (null == a && (c || i)) { var h = C(CK(c || e, r, t, s, u, l), 3)[2] a = o(h, r) } if (vX(a) || oY(a)) { var d = !1, f = kK(e, r, t, a, r, function () { d = !0 }) return d ? TK : f } return MK(a) ? a : TK }, d = { locale: t, modifiers: i, pluralRules: a, messages: h } e.processor && (d.processor = e.processor) r.list && (d.list = r.list) r.named && (d.named = r.named) rX(r.plural) && (d.pluralIndex = r.plural) return d })(e, S, A, d), R = (function (e, t, n) { var r = t(n) return r })(0, E, wK(k)), I = n ? n(R, h) : R if (__INTLIFY_PROD_DEVTOOLS__) { var N = { timestamp: Date.now(), key: vX(h) ? h : MK(w) ? w.key : '', locale: S || (MK(w) ? w.locale : ''), format: vX(w) ? w : MK(w) ? w.source : '', message: I, } ;((N.meta = oX({}, e.__meta, tK() || {})), MY(N)) } return I } function CK(e, t, n, r, i, a) { for ( var o, s = e.messages, u = (e.onWarn, e.messageResolver), l = (0, e.localeFallbacker)(e, r, n), c = uX(), h = null, d = 0; d < l.length && (null === (h = u((c = s[(o = l[d])] || uX()), t)) && (h = c[t]), !(vX(h) || oY(h) || MK(h))); d++ ) if (!cK(o, l)) { var f = sK(e, t, o, 0, 'translate') f !== t && (h = f) } return [h, o, c] } function kK(e, t, n, r, i, a) { var o = e.messageCompiler, s = e.warnHtmlMessage if (MK(r)) { var u = r return ((u.locale = u.locale || n), (u.key = u.key || t), u) } if (null == o) { var l = function () { return r } return ((l.locale = n), (l.key = t), l) } var c = o( r, (function (e, t, n, r, i, a) { return { locale: t, key: n, warnHtmlMessage: i, onError: function (e) { throw (a && a(e), e) }, onCacheKey: function (e) { return (function (e, t, n) { return nX({ l: e, k: t, s: n }) })(t, n, e) }, } })(0, n, i, 0, s, a) ) return ((c.locale = n), (c.key = t), (c.source = r), c) } function RK() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] var r = t[0], i = t[1], a = t[2], o = uX() if (!(vX(r) || rX(r) || MK(r) || oY(r))) throw DY(kY) var s = rX(r) ? String(r) : (MK(r), r) return ( rX(i) ? (o.plural = i) : vX(i) ? (o.default = i) : bX(i) && !aX(i) ? (o.named = i) : fX(i) && (o.list = i), rX(a) ? (o.plural = a) : vX(a) ? (o.default = a) : bX(a) && oX(o, a), [s, o] ) } ;('boolean' != typeof __INTLIFY_PROD_DEVTOOLS__ && (lX().__INTLIFY_PROD_DEVTOOLS__ = !1), 'boolean' != typeof __INTLIFY_DROP_MESSAGE_COMPILER__ && (lX().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1)) var IK = 24, NK = 25, PK = 26, LK = 27, DK = 28, OK = 29, FK = 31, BK = 32 function UK(e) { return zX(e, null, void 0) } var zK = tX('__translateVNode'), VK = tX('__datetimeParts'), HK = tX('__numberParts'), WK = tX('__setPluralRules'), GK = tX('__injectWithOption'), jK = tX('__dispose') function QK(e) { if (!gX(e)) return e if (oY(e)) return e for (var t in e) if (dX(e, t)) if (t.includes('.')) { for (var n = t.split('.'), r = n.length - 1, i = e, a = !1, o = 0; o < r; o++) { if ('__proto__' === n[o]) throw new Error('unsafe key: '.concat(n[o])) if ((n[o] in i || (i[n[o]] = uX()), !gX(i[n[o]]))) { a = !0 break } i = i[n[o]] } if ( (a || (oY(i) ? yY.includes(n[r]) || delete e[t] : ((i[n[r]] = e[t]), delete e[t])), !oY(i)) ) { var s = i[n[r]] gX(s) && QK(s) } } else gX(e[t]) && QK(e[t]) return e } function qK(e, t) { var n = t.messages, r = t.__i18n, i = t.messageResolver, a = t.flatJson, o = bX(n) ? n : fX(r) ? uX() : M({}, e, uX()) if ( (fX(r) && r.forEach(function (e) { if ('locale' in e && 'resource' in e) { var t = e.locale, n = e.resource t ? ((o[t] = o[t] || uX()), wX(n, o[t])) : wX(n, o) } else vX(e) && wX(JSON.parse(e), o) }), null == i && a) ) for (var s in o) dX(o, s) && QK(o[s]) return o } function XK(e) { return e.type } function YK(e, t, n) { var r = gX(t.messages) ? t.messages : uX() '__i18nGlobal' in n && (r = qK(e.locale.value, { messages: r, __i18n: n.__i18nGlobal })) var i = Object.keys(r) if ( (i.length && i.forEach(function (t) { e.mergeLocaleMessage(t, r[t]) }), gX(t.datetimeFormats)) ) { var a = Object.keys(t.datetimeFormats) a.length && a.forEach(function (n) { e.mergeDateTimeFormat(n, t.datetimeFormats[n]) }) } if (gX(t.numberFormats)) { var o = Object.keys(t.numberFormats) o.length && o.forEach(function (n) { e.mergeNumberFormat(n, t.numberFormats[n]) }) } } function KK(e) { return ta(Ui, null, e, 0) } var ZK = '__INTLIFY_META__', JK = function () { return [] }, $K = function () { return !1 }, eZ = 0 function tZ(e) { return function (t, n, r, i) { return e(n, r, va() || void 0, i) } } var nZ = function () { var e = va(), t = null return e && (t = XK(e)[ZK]) ? M({}, ZK, t) : null } function rZ() { var e, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n = t.__root, r = t.__injectWithOption, i = void 0 === n, a = t.flatJson, o = eX ? tn : nn, s = !mX(t.inheritLocale) || t.inheritLocale, u = o(n && s ? n.locale.value : vX(t.locale) ? t.locale : JY), l = o( n && s ? n.fallbackLocale.value : vX(t.fallbackLocale) || fX(t.fallbackLocale) || bX(t.fallbackLocale) || !1 === t.fallbackLocale ? t.fallbackLocale : u.value ), c = o(qK(u.value, t)), h = o(bX(t.datetimeFormats) ? t.datetimeFormats : M({}, u.value, {})), d = o(bX(t.numberFormats) ? t.numberFormats : M({}, u.value, {})), f = n ? n.missingWarn : (!mX(t.missingWarn) && !iX(t.missingWarn)) || t.missingWarn, p = n ? n.fallbackWarn : (!mX(t.fallbackWarn) && !iX(t.fallbackWarn)) || t.fallbackWarn, v = n ? n.fallbackRoot : !mX(t.fallbackRoot) || t.fallbackRoot, m = !!t.fallbackFormat, g = pX(t.missing) ? t.missing : null, y = pX(t.missing) ? tZ(t.missing) : null, _ = pX(t.postTranslation) ? t.postTranslation : null, b = n ? n.warnHtmlMessage : !mX(t.warnHtmlMessage) || t.warnHtmlMessage, x = !!t.escapeParameter, S = n ? n.modifiers : bX(t.modifiers) ? t.modifiers : {}, A = t.pluralRules || (n && n.pluralRules) uK( (e = (function () { i && rK(null) var n = { version: '11.1.9', locale: u.value, fallbackLocale: l.value, messages: c.value, modifiers: S, pluralRules: A, missing: null === y ? void 0 : y, missingWarn: f, fallbackWarn: p, fallbackFormat: m, unresolving: !0, postTranslation: null === _ ? void 0 : _, warnHtmlMessage: b, escapeParameter: x, messageResolver: t.messageResolver, messageCompiler: t.messageCompiler, __meta: { framework: 'vue' }, } ;((n.datetimeFormats = h.value), (n.numberFormats = d.value), (n.__datetimeFormatters = bX(e) ? e.__datetimeFormatters : void 0), (n.__numberFormatters = bX(e) ? e.__numberFormatters : void 0)) var r = aK(n) return (i && rK(r), r) })()), u.value, l.value ) var w = Ea({ get: function () { return u.value }, set: function (t) { ;((e.locale = t), (u.value = t)) }, }), T = Ea({ get: function () { return l.value }, set: function (t) { ;((e.fallbackLocale = t), (l.value = t), uK(e, u.value, t)) }, }), E = Ea(function () { return c.value }), k = Ea(function () { return h.value }), R = Ea(function () { return d.value }) var I = function (t, r, a, o, s, f) { var p ;(u.value, l.value, c.value, h.value, d.value) try { ;(__INTLIFY_PROD_DEVTOOLS__ && (eK = nZ()), i || (e.fallbackContext = n ? nK : void 0), (p = t(e))) } finally { ;(__INTLIFY_PROD_DEVTOOLS__, i || (e.fallbackContext = void 0)) } if ( ('translate exists' !== a && rX(p) && -1 === p) || ('translate exists' === a && !p) ) { var m = C(r(), 2), g = m[0] m[1] return n && v ? o(n) : s(g) } if (f(p)) return p throw UK(IK) } function N() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { return Reflect.apply(EK, null, [e].concat(t)) }, function () { return RK.apply(void 0, t) }, 'translate', function (e) { return Reflect.apply(e.t, e, [].concat(t)) }, function (e) { return e }, function (e) { return vX(e) } ) } var P = { normalize: function (e) { return e.map(function (e) { return vX(e) || rX(e) || mX(e) ? KK(String(e)) : e }) }, interpolate: function (e) { return e }, type: 'vnode', } function L(e) { return c.value[e] || {} } ;(eZ++, n && eX && (Ti(n.locale, function (t) { s && ((u.value = t), (e.locale = t), uK(e, u.value, l.value)) }), Ti(n.fallbackLocale, function (t) { s && ((l.value = t), (e.fallbackLocale = t), uK(e, u.value, l.value)) }))) var D = M( { id: eZ, locale: w, fallbackLocale: T, get inheritLocale() { return s }, set inheritLocale(t) { ;((s = t), t && n && ((u.value = n.locale.value), (l.value = n.fallbackLocale.value), uK(e, u.value, l.value))) }, get availableLocales() { return Object.keys(c.value).sort() }, messages: E, get modifiers() { return S }, get pluralRules() { return A || {} }, get isGlobal() { return i }, get missingWarn() { return f }, set missingWarn(t) { ;((f = t), (e.missingWarn = f)) }, get fallbackWarn() { return p }, set fallbackWarn(t) { ;((p = t), (e.fallbackWarn = p)) }, get fallbackRoot() { return v }, set fallbackRoot(e) { v = e }, get fallbackFormat() { return m }, set fallbackFormat(t) { ;((m = t), (e.fallbackFormat = m)) }, get warnHtmlMessage() { return b }, set warnHtmlMessage(t) { ;((b = t), (e.warnHtmlMessage = t)) }, get escapeParameter() { return x }, set escapeParameter(t) { ;((x = t), (e.escapeParameter = t)) }, t: N, getLocaleMessage: L, setLocaleMessage: function (t, n) { if (a) { var r = M({}, t, n) for (var i in r) dX(r, i) && QK(r[i]) n = r[t] } ;((c.value[t] = n), (e.messages = c.value)) }, mergeLocaleMessage: function (t, n) { c.value[t] = c.value[t] || {} var r = M({}, t, n) if (a) for (var i in r) dX(r, i) && QK(r[i]) ;(wX((n = r[t]), c.value[t]), (e.messages = c.value)) }, getPostTranslationHandler: function () { return pX(_) ? _ : null }, setPostTranslationHandler: function (t) { ;((_ = t), (e.postTranslation = t)) }, getMissingHandler: function () { return g }, setMissingHandler: function (t) { ;(null !== t && (y = tZ(t)), (g = t), (e.missing = y)) }, }, WK, function (t) { ;((A = t), (e.pluralRules = A)) } ) return ( (D.datetimeFormats = k), (D.numberFormats = R), (D.rt = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] var r = t[0], i = t[1], a = t[2] if (a && !gX(a)) throw UK(NK) return N.apply(void 0, [r, i, oX({ resolvedMessage: !0 }, a || {})]) }), (D.te = function (t, n) { return I( function () { if (!t) return !1 var r = L(vX(n) ? n : u.value), i = e.messageResolver(r, t) return oY(i) || MK(i) || vX(i) }, function () { return [t] }, 'translate exists', function (e) { return Reflect.apply(e.te, e, [t, n]) }, $K, function (e) { return mX(e) } ) }), (D.tm = function (t) { var r = (function (t) { for (var n = null, r = UY(e, l.value, u.value), i = 0; i < r.length; i++) { var a = c.value[r[i]] || {}, o = e.messageResolver(a, t) if (null != o) { n = o break } } return n })(t) return null != r ? r : (n && n.tm(t)) || {} }), (D.d = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { return Reflect.apply(hK, null, [e].concat(t)) }, function () { return fK.apply(void 0, t) }, 'datetime format', function (e) { return Reflect.apply(e.d, e, [].concat(t)) }, function () { return '' }, function (e) { return vX(e) || fX(e) } ) }), (D.n = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { return Reflect.apply(vK, null, [e].concat(t)) }, function () { return gK.apply(void 0, t) }, 'number format', function (e) { return Reflect.apply(e.n, e, [].concat(t)) }, function () { return '' }, function (e) { return vX(e) || fX(e) } ) }), (D.getDateTimeFormat = function (e) { return h.value[e] || {} }), (D.setDateTimeFormat = function (t, n) { ;((h.value[t] = n), (e.datetimeFormats = h.value), pK(e, t, n)) }), (D.mergeDateTimeFormat = function (t, n) { ;((h.value[t] = oX(h.value[t] || {}, n)), (e.datetimeFormats = h.value), pK(e, t, n)) }), (D.getNumberFormat = function (e) { return d.value[e] || {} }), (D.setNumberFormat = function (t, n) { ;((d.value[t] = n), (e.numberFormats = d.value), yK(e, t, n)) }), (D.mergeNumberFormat = function (t, n) { ;((d.value[t] = oX(d.value[t] || {}, n)), (e.numberFormats = d.value), yK(e, t, n)) }), (D[GK] = r), (D[zK] = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { var n, r = e try { ;((r.processor = P), (n = Reflect.apply(EK, null, [r].concat(t)))) } finally { r.processor = null } return n }, function () { return RK.apply(void 0, t) }, 'translate', function (e) { return e[zK].apply(e, t) }, function (e) { return [KK(e)] }, function (e) { return fX(e) } ) }), (D[VK] = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { return Reflect.apply(hK, null, [e].concat(t)) }, function () { return fK.apply(void 0, t) }, 'datetime format', function (e) { return e[VK].apply(e, t) }, JK, function (e) { return vX(e) || fX(e) } ) }), (D[HK] = function () { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n] return I( function (e) { return Reflect.apply(vK, null, [e].concat(t)) }, function () { return gK.apply(void 0, t) }, 'number format', function (e) { return e[HK].apply(e, t) }, JK, function (e) { return vX(e) || fX(e) } ) }), D ) } function iZ() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = rZ( (function (e) { var t = vX(e.locale) ? e.locale : JY, n = vX(e.fallbackLocale) || fX(e.fallbackLocale) || bX(e.fallbackLocale) || !1 === e.fallbackLocale ? e.fallbackLocale : t, r = pX(e.missing) ? e.missing : void 0, i = (!mX(e.silentTranslationWarn) && !iX(e.silentTranslationWarn)) || !e.silentTranslationWarn, a = (!mX(e.silentFallbackWarn) && !iX(e.silentFallbackWarn)) || !e.silentFallbackWarn, o = !mX(e.fallbackRoot) || e.fallbackRoot, s = !!e.formatFallbackMessages, u = bX(e.modifiers) ? e.modifiers : {}, l = e.pluralizationRules, c = pX(e.postTranslation) ? e.postTranslation : void 0, h = !vX(e.warnHtmlInMessage) || 'off' !== e.warnHtmlInMessage, d = !!e.escapeParameterHtml, f = !mX(e.sync) || e.sync, p = e.messages if (bX(e.sharedMessages)) { var v = e.sharedMessages p = Object.keys(v).reduce(function (e, t) { var n = e[t] || (e[t] = {}) return (oX(n, v[t]), e) }, p || {}) } var m = e.__i18n, g = e.__root, y = e.__injectWithOption, _ = e.datetimeFormats, b = e.numberFormats return { locale: t, fallbackLocale: n, messages: p, flatJson: e.flatJson, datetimeFormats: _, numberFormats: b, missing: r, missingWarn: i, fallbackWarn: a, fallbackRoot: o, fallbackFormat: s, modifiers: u, pluralRules: l, postTranslation: c, warnHtmlMessage: h, escapeParameter: d, messageResolver: e.messageResolver, inheritLocale: f, __i18n: m, __root: g, __injectWithOption: y, } })(e) ), n = e.__extender, r = { id: t.id, get locale() { return t.locale.value }, set locale(e) { t.locale.value = e }, get fallbackLocale() { return t.fallbackLocale.value }, set fallbackLocale(e) { t.fallbackLocale.value = e }, get messages() { return t.messages.value }, get datetimeFormats() { return t.datetimeFormats.value }, get numberFormats() { return t.numberFormats.value }, get availableLocales() { return t.availableLocales }, get missing() { return t.getMissingHandler() }, set missing(e) { t.setMissingHandler(e) }, get silentTranslationWarn() { return mX(t.missingWarn) ? !t.missingWarn : t.missingWarn }, set silentTranslationWarn(e) { t.missingWarn = mX(e) ? !e : e }, get silentFallbackWarn() { return mX(t.fallbackWarn) ? !t.fallbackWarn : t.fallbackWarn }, set silentFallbackWarn(e) { t.fallbackWarn = mX(e) ? !e : e }, get modifiers() { return t.modifiers }, get formatFallbackMessages() { return t.fallbackFormat }, set formatFallbackMessages(e) { t.fallbackFormat = e }, get postTranslation() { return t.getPostTranslationHandler() }, set postTranslation(e) { t.setPostTranslationHandler(e) }, get sync() { return t.inheritLocale }, set sync(e) { t.inheritLocale = e }, get warnHtmlInMessage() { return t.warnHtmlMessage ? 'warn' : 'off' }, set warnHtmlInMessage(e) { t.warnHtmlMessage = 'off' !== e }, get escapeParameterHtml() { return t.escapeParameter }, set escapeParameterHtml(e) { t.escapeParameter = e }, get pluralizationRules() { return t.pluralRules || {} }, __composer: t, t: function () { for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r] return Reflect.apply(t.t, t, [].concat(n)) }, rt: function () { for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r] return Reflect.apply(t.rt, t, [].concat(n)) }, te: function (e, n) { return t.te(e, n) }, tm: function (e) { return t.tm(e) }, getLocaleMessage: function (e) { return t.getLocaleMessage(e) }, setLocaleMessage: function (e, n) { t.setLocaleMessage(e, n) }, mergeLocaleMessage: function (e, n) { t.mergeLocaleMessage(e, n) }, d: function () { for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r] return Reflect.apply(t.d, t, [].concat(n)) }, getDateTimeFormat: function (e) { return t.getDateTimeFormat(e) }, setDateTimeFormat: function (e, n) { t.setDateTimeFormat(e, n) }, mergeDateTimeFormat: function (e, n) { t.mergeDateTimeFormat(e, n) }, n: function () { for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r] return Reflect.apply(t.n, t, [].concat(n)) }, getNumberFormat: function (e) { return t.getNumberFormat(e) }, setNumberFormat: function (e, n) { t.setNumberFormat(e, n) }, mergeNumberFormat: function (e, n) { t.mergeNumberFormat(e, n) }, } return ((r.__extender = n), r) } function aZ(e, t, n) { return { beforeCreate: function () { var r = this, i = va() if (!i) throw UK(BK) var a = this.$options if (a.i18n) { var o = a.i18n if ((a.__i18n && (o.__i18n = a.__i18n), (o.__root = t), this === this.$root)) this.$i18n = oZ(e, o) else { ;((o.__injectWithOption = !0), (o.__extender = n.__vueI18nExtend), (this.$i18n = iZ(o))) var s = this.$i18n s.__extender && (s.__disposer = s.__extender(this.$i18n)) } } else if (a.__i18n) if (this === this.$root) this.$i18n = oZ(e, a) else { this.$i18n = iZ({ __i18n: a.__i18n, __injectWithOption: !0, __extender: n.__vueI18nExtend, __root: t, }) var u = this.$i18n u.__extender && (u.__disposer = u.__extender(this.$i18n)) } else this.$i18n = e ;(a.__i18nGlobal && YK(t, a, a), (this.$t = function () { var e return (e = r.$i18n).t.apply(e, arguments) }), (this.$rt = function () { var e return (e = r.$i18n).rt.apply(e, arguments) }), (this.$te = function (e, t) { return r.$i18n.te(e, t) }), (this.$d = function () { var e return (e = r.$i18n).d.apply(e, arguments) }), (this.$n = function () { var e return (e = r.$i18n).n.apply(e, arguments) }), (this.$tm = function (e) { return r.$i18n.tm(e) }), n.__setInstance(i, this.$i18n)) }, mounted: function () {}, unmounted: function () { var e = va() if (!e) throw UK(BK) var t = this.$i18n ;(delete this.$t, delete this.$rt, delete this.$te, delete this.$d, delete this.$n, delete this.$tm, t.__disposer && (t.__disposer(), delete t.__disposer, delete t.__extender), n.__deleteInstance(e), delete this.$i18n) }, } } function oZ(e, t) { ;((e.locale = t.locale || e.locale), (e.fallbackLocale = t.fallbackLocale || e.fallbackLocale), (e.missing = t.missing || e.missing), (e.silentTranslationWarn = t.silentTranslationWarn || e.silentFallbackWarn), (e.silentFallbackWarn = t.silentFallbackWarn || e.silentFallbackWarn), (e.formatFallbackMessages = t.formatFallbackMessages || e.formatFallbackMessages), (e.postTranslation = t.postTranslation || e.postTranslation), (e.warnHtmlInMessage = t.warnHtmlInMessage || e.warnHtmlInMessage), (e.escapeParameterHtml = t.escapeParameterHtml || e.escapeParameterHtml), (e.sync = t.sync || e.sync), e.__composer[WK](t.pluralizationRules || e.pluralizationRules)) var n = qK(e.locale, { messages: t.messages, __i18n: t.__i18n }) return ( Object.keys(n).forEach(function (t) { return e.mergeLocaleMessage(t, n[t]) }), t.datetimeFormats && Object.keys(t.datetimeFormats).forEach(function (n) { return e.mergeDateTimeFormat(n, t.datetimeFormats[n]) }), t.numberFormats && Object.keys(t.numberFormats).forEach(function (n) { return e.mergeNumberFormat(n, t.numberFormats[n]) }), e ) } var sZ = { tag: { type: [String, Object] }, locale: { type: String }, scope: { type: String, validator: function (e) { return 'parent' === e || 'global' === e }, default: 'parent', }, i18n: { type: Object }, } function uZ() { return Bi } var lZ = ar({ name: 'i18n-t', props: oX( { keypath: { type: String, required: !0 }, plural: { type: [Number, String], validator: function (e) { return rX(e) || !isNaN(e) }, }, }, sZ ), setup: function (e, t) { var n = t.slots, r = t.attrs, i = e.i18n || yZ({ useScope: e.scope, __useComponent: !0 }) return function () { var a = Object.keys(n).filter(function (e) { return '_' !== e[0] }), o = uX() ;(e.locale && (o.locale = e.locale), void 0 !== e.plural && (o.plural = vX(e.plural) ? +e.plural : e.plural)) var s = (function (e, t) { var n = e.slots return 1 === t.length && 'default' === t[0] ? (n.default ? n.default() : []).reduce(function (e, t) { return [].concat(I(e), I(t.type === Bi ? t.children : [t])) }, []) : t.reduce(function (e, t) { var r = n[t] return (r && (e[t] = r()), e) }, uX()) })(t, a), u = i[zK](e.keypath, s, o), l = oX(uX(), r) return Ca(vX(e.tag) || gX(e.tag) ? e.tag : uZ(), l, u) } }, }), cZ = lZ function hZ(e, t, n, r) { var i = t.slots, a = t.attrs return function () { var t = { part: !0 }, o = uX() ;(e.locale && (t.locale = e.locale), vX(e.format) ? (t.key = e.format) : gX(e.format) && (vX(e.format.key) && (t.key = e.format.key), (o = Object.keys(e.format).reduce(function (t, r) { return n.includes(r) ? oX(uX(), t, M({}, r, e.format[r])) : t }, uX())))) var s = r.apply(void 0, [e.value, t, o]), u = [t.key] fX(s) ? (u = s.map(function (e, t) { var n = i[e.type], r = n ? n(M(M(M({}, e.type, e.value), 'index', t), 'parts', s)) : [e.value] return ( (function (e) { return fX(e) && !vX(e[0]) })(r) && (r[0].key = ''.concat(e.type, '-').concat(t)), r ) })) : vX(s) && (u = [s]) var l = oX(uX(), a) return Ca(vX(e.tag) || gX(e.tag) ? e.tag : uZ(), l, u) } } var dZ = ar({ name: 'i18n-n', props: oX( { value: { type: Number, required: !0 }, format: { type: [String, Object] } }, sZ ), setup: function (e, t) { var n = e.i18n || yZ({ useScope: e.scope, __useComponent: !0 }) return hZ(e, t, mK, function () { return n[HK].apply(n, arguments) }) }, }), fZ = dZ function pZ(e) { if (vX(e)) return { path: e } if (bX(e)) { if (!('path' in e)) throw UK(DK) return e } throw UK(OK) } function vZ(e) { var t = e.path, n = e.locale, r = e.args, i = e.choice, a = e.plural, o = {}, s = r || {} return ( vX(n) && (o.locale = n), rX(i) && (o.plural = i), rX(a) && (o.plural = a), [t, s, o] ) } function mZ(e, t) { var n = bX(arguments.length <= 2 ? void 0 : arguments[2]) ? arguments.length <= 2 ? void 0 : arguments[2] : {} ;((!mX(n.globalInstall) || n.globalInstall) && ([cZ.name, 'I18nT'].forEach(function (t) { return e.component(t, cZ) }), [fZ.name, 'I18nN'].forEach(function (t) { return e.component(t, fZ) }), [MZ.name, 'I18nD'].forEach(function (t) { return e.component(t, MZ) })), e.directive( 't', (function (e) { var t = function (t) { var n = t.instance, r = t.value if (!n || !n.$) throw UK(BK) var i = (function (e, t) { var n = e if ('composition' === e.mode) return n.__getInstance(t) || e.global var r = n.__getInstance(t) return null != r ? r.__composer : e.global.__composer })(e, n.$), a = pZ(r) return [Reflect.apply(i.t, i, I(vZ(a))), i] } return { created: function (n, r) { var i = C(t(r), 2), a = i[0], o = i[1] ;(eX && e.global === o && (n.__i18nWatcher = Ti(o.locale, function () { r.instance && r.instance.$forceUpdate() })), (n.__composer = o), (n.textContent = a)) }, unmounted: function (e) { ;(eX && e.__i18nWatcher && (e.__i18nWatcher(), (e.__i18nWatcher = void 0), delete e.__i18nWatcher), e.__composer && ((e.__composer = void 0), delete e.__composer)) }, beforeUpdate: function (e, t) { var n = t.value if (e.__composer) { var r = e.__composer, i = pZ(n) e.textContent = Reflect.apply(r.t, r, I(vZ(i))) } }, getSSRProps: function (e) { return { textContent: C(t(e), 1)[0] } }, } })(t) )) } var gZ = tX('global-vue-i18n') function yZ() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = va() if (null == t) throw UK(PK) if (!t.isCE && null != t.appContext.app && !t.appContext.app.__VUE_I18N_SYMBOL__) throw UK(LK) var n = (function (e) { var t = ei(e.isCE ? gZ : e.appContext.app.__VUE_I18N_SYMBOL__) if (!t) throw UK(e.isCE ? FK : BK) return t })(t), r = (function (e) { return 'composition' === e.mode ? e.global : e.global.__composer })(n), i = XK(t), a = (function (e, t) { return aX(e) ? '__i18n' in t ? 'local' : 'global' : e.useScope ? e.useScope : 'local' })(e, i) if ('global' === a) return (YK(r, e, i), r) if ('parent' === a) { var o = (function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = null, i = t.root, a = (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] if (null == e) return null return (t && e.vnode.ctx) || e.parent })(t, n) for (; null != a; ) { var o = e if ('composition' === e.mode) r = o.__getInstance(a) else if (__VUE_I18N_LEGACY_API__) { var s = o.__getInstance(a) null != s && ((r = s.__composer), n && r && !r[GK] && (r = null)) } if (null != r) break if (i === a) break a = a.parent } return r })(n, t, e.__useComponent) return (null == o && (o = r), o) } var s = n, u = s.__getInstance(t) if (null == u) { var l = oX({}, e) ;('__i18n' in i && (l.__i18n = i.__i18n), r && (l.__root = r), (u = rZ(l)), s.__composerExtend && (u[jK] = s.__composerExtend(u)), (function (e, t, n) { ;(yr(function () {}, t), Sr(function () { var r = n e.__deleteInstance(t) var i = r[jK] i && (i(), delete r[jK]) }, t)) })(s, t, u), s.__setInstance(t, u)) } return u } var _Z = ['locale', 'fallbackLocale', 'availableLocales'], bZ = ['t', 'rt', 'd', 'n', 'tm', 'te'] function xZ(e, t) { var n = Object.create(null) ;(_Z.forEach(function (e) { var r = Object.getOwnPropertyDescriptor(t, e) if (!r) throw UK(BK) var i = en(r.value) ? { get: function () { return r.value.value }, set: function (e) { r.value.value = e }, } : { get: function () { return r.get && r.get() }, } Object.defineProperty(n, e, i) }), (e.config.globalProperties.$i18n = n), bZ.forEach(function (n) { var r = Object.getOwnPropertyDescriptor(t, n) if (!r || !r.value) throw UK(BK) Object.defineProperty(e.config.globalProperties, '$'.concat(n), r) })) return function () { ;(delete e.config.globalProperties.$i18n, bZ.forEach(function (t) { delete e.config.globalProperties['$'.concat(t)] })) } } var SZ, AZ, wZ, TZ = ar({ name: 'i18n-d', props: oX( { value: { type: [Number, Date], required: !0 }, format: { type: [String, Object] }, }, sZ ), setup: function (e, t) { var n = e.i18n || yZ({ useScope: e.scope, __useComponent: !0 }) return hZ(e, t, dK, function () { return n[VK].apply(n, arguments) }) }, }), MZ = TZ if ( ('boolean' != typeof __VUE_I18N_FULL_INSTALL__ && (lX().__VUE_I18N_FULL_INSTALL__ = !0), 'boolean' != typeof __VUE_I18N_LEGACY_API__ && (lX().__VUE_I18N_LEGACY_API__ = !0), 'boolean' != typeof __INTLIFY_DROP_MESSAGE_COMPILER__ && (lX().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), 'boolean' != typeof __INTLIFY_PROD_DEVTOOLS__ && (lX().__INTLIFY_PROD_DEVTOOLS__ = !1), (SZ = function (e, t) { if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && vX(e)) { !mX(t.warnHtmlMessage) || t.warnHtmlMessage var n = (t.onCacheKey || AY)(e), r = wY[n] if (r) return r var i = (function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = !1, r = t.onError || VX return ( (t.onError = function (e) { ;((n = !0), r(e)) }), s(s({}, aY(e, t)), {}, { detectError: n }) ) })(e, s(s({}, t), {}, { location: !1, jit: !0 })), a = i.ast, o = i.detectError, u = bY(a) return o ? u : (wY[n] = u) } var l = e.cacheKey if (l) { var c = wY[l] return c || (wY[l] = bY(e)) } return bY(e) }), (YY = SZ), (AZ = function (e, t) { if (!gX(e)) return null var n = qY.get(t) if ( (n || ((n = (function (e) { var t, n, r, i, a, o, s, u = [], l = -1, c = 0, h = 0, d = [] function f() { var t = e[l + 1] if ((5 === c && "'" === t) || (6 === c && '"' === t)) return (l++, (r = '\\' + t), d[0](), !0) } for ( d[0] = function () { void 0 === n ? (n = r) : (n += r) }, d[1] = function () { void 0 !== n && (u.push(n), (n = void 0)) }, d[2] = function () { ;(d[0](), h++) }, d[3] = function () { if (h > 0) (h--, (c = 4), d[0]()) else { if (((h = 0), void 0 === n)) return !1 if (!1 === (n = QY(n))) return !1 d[1]() } }; null !== c; ) if ((l++, '\\' !== (t = e[l]) || !f())) { if (((i = jY(t)), 8 === (a = (s = WY[c])[i] || s.l || 8))) return if (((c = a[0]), void 0 !== a[1] && (o = d[a[1]]) && ((r = t), !1 === o()))) return if (7 === c) return u } })(t)), n && qY.set(t, n)), !n) ) return null for (var r = n.length, i = e, a = 0; a < r; ) { var o = n[a] if (yY.includes(o) && oY(i)) return null var s = i[o] if (void 0 === s) return null if (pX(i)) return null ;((i = s), a++) } return i }), (KY = AZ), (ZY = UY), __INTLIFY_PROD_DEVTOOLS__) ) { var EZ = lX() ;((EZ.__INTLIFY__ = !0), (wZ = EZ.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__), (TY = wZ)) } var CZ = { placeholder: '请选择时间', rangePlaceholder: ['开始时间', '结束时间'] }, kZ = { lang: eV( { placeholder: '请选择日期', yearPlaceholder: '请选择年份', quarterPlaceholder: '请选择季度', monthPlaceholder: '请选择月份', weekPlaceholder: '请选择周', rangePlaceholder: ['开始日期', '结束日期'], rangeYearPlaceholder: ['开始年份', '结束年份'], rangeMonthPlaceholder: ['开始月份', '结束月份'], rangeQuarterPlaceholder: ['开始季度', '结束季度'], rangeWeekPlaceholder: ['开始周', '结束周'], }, { locale: 'zh_CN', today: '今天', now: '此刻', backToToday: '返回今天', ok: '确定', timeSelect: '选择时间', dateSelect: '选择日期', weekSelect: '选择周', clear: '清除', month: '月', year: '年', previousMonth: '上个月 (翻页上键)', nextMonth: '下个月 (翻页下键)', monthSelect: '选择月份', yearSelect: '选择年份', decadeSelect: '选择年代', yearFormat: 'YYYY年', dayFormat: 'D日', dateFormat: 'YYYY年M月D日', dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒', previousYear: '上一年 (Control键加左方向键)', nextYear: '下一年 (Control键加右方向键)', previousDecade: '上一年代', nextDecade: '下一年代', previousCentury: '上一世纪', nextCentury: '下一世纪', } ), timePickerLocale: eV({}, CZ), } kZ.lang.ok = '确定' var RZ = '${label}不是一个有效的${type}', IZ = { locale: 'zh-cn', Pagination: { items_per_page: '条/页', jump_to: '跳至', jump_to_confirm: '确定', page: '页', prev_page: '上一页', next_page: '下一页', prev_5: '向前 5 页', next_5: '向后 5 页', prev_3: '向前 3 页', next_3: '向后 3 页', }, DatePicker: kZ, TimePicker: CZ, Calendar: kZ, global: { placeholder: '请选择' }, Table: { filterTitle: '筛选', filterConfirm: '确定', filterReset: '重置', filterEmptyText: '无筛选项', filterCheckall: '全选', filterSearchPlaceholder: '在筛选项中搜索', selectAll: '全选当页', selectInvert: '反选当页', selectNone: '清空所有', selectionAll: '全选所有', sortTitle: '排序', expand: '展开行', collapse: '关闭行', triggerDesc: '点击降序', triggerAsc: '点击升序', cancelSort: '取消排序', }, Tour: { Next: '下一步', Previous: '上一步', Finish: '结束导览' }, Modal: { okText: '确定', cancelText: '取消', justOkText: '知道了' }, Popconfirm: { cancelText: '取消', okText: '确定' }, Transfer: { searchPlaceholder: '请输入搜索内容', itemUnit: '项', itemsUnit: '项', remove: '删除', selectCurrent: '全选当页', removeCurrent: '删除当页', selectAll: '全选所有', removeAll: '删除全部', selectInvert: '反选当页', }, Upload: { uploading: '文件上传中', removeFile: '删除文件', uploadError: '上传错误', previewFile: '预览文件', downloadFile: '下载文件', }, Empty: { description: '暂无数据' }, Icon: { icon: '图标' }, Text: { edit: '编辑', copy: '复制', copied: '复制成功', expand: '展开' }, PageHeader: { back: '返回' }, Form: { optional: '(可选)', defaultValidateMessages: { default: '字段验证错误${label}', required: '请输入${label}', enum: '${label}必须是其中一个[${enum}]', whitespace: '${label}不能为空字符', date: { format: '${label}日期格式无效', parse: '${label}不能转换为日期', invalid: '${label}是一个无效日期', }, types: { string: RZ, method: RZ, array: RZ, object: RZ, number: RZ, date: RZ, boolean: RZ, integer: RZ, float: RZ, regexp: RZ, email: RZ, url: RZ, hex: RZ, }, string: { len: '${label}须为${len}个字符', min: '${label}最少${min}个字符', max: '${label}最多${max}个字符', range: '${label}须在${min}-${max}字符之间', }, number: { len: '${label}必须等于${len}', min: '${label}最小值为${min}', max: '${label}最大值为${max}', range: '${label}须在${min}-${max}之间', }, array: { len: '须为${len}个${label}', min: '最少${min}个${label}', max: '最多${max}个${label}', range: '${label}数量须在${min}-${max}之间', }, pattern: { mismatch: '${label}与模式不匹配${pattern}' }, }, }, Image: { preview: '预览' }, QRCode: { expired: '二维码已过期', refresh: '点击刷新', scanned: '已扫描' }, }, NZ = tn('zh'), PZ = { zh: IZ, en: AV }, LZ = { en: { message: { hello: 'hello world' } }, zh: { message: { hello: '你好,世界' } }, }, DZ = (function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = __VUE_I18N_LEGACY_API__ && mX(e.legacy) ? e.legacy : __VUE_I18N_LEGACY_API__, n = !mX(e.globalInjection) || e.globalInjection, r = new Map(), i = C( (function (e, t) { var n = De(), r = __VUE_I18N_LEGACY_API__ && t ? n.run(function () { return iZ(e) }) : n.run(function () { return rZ(e) }) if (null == r) throw UK(BK) return [n, r] })(e, t), 2 ), a = i[0], o = i[1], s = tX(''), u = { get mode() { return __VUE_I18N_LEGACY_API__ && t ? 'legacy' : 'composition' }, install: function (e) { var r = arguments return v( d().m(function i() { var a, l, c, h, f, p return d().w(function (i) { for (;;) switch (i.n) { case 0: for ( e.__VUE_I18N_SYMBOL__ = s, e.provide(e.__VUE_I18N_SYMBOL__, u), a = r.length, l = new Array(a > 1 ? a - 1 : 0), c = 1; c < a; c++ ) l[c - 1] = r[c] ;(bX(l[0]) && ((h = l[0]), (u.__composerExtend = h.__composerExtend), (u.__vueI18nExtend = h.__vueI18nExtend)), (f = null), !t && n && (f = xZ(e, u.global)), __VUE_I18N_FULL_INSTALL__ && mZ.apply(void 0, [e, u].concat(l)), __VUE_I18N_LEGACY_API__ && t && e.mixin(aZ(o, o.__composer, u)), (p = e.unmount), (e.unmount = function () { ;(f && f(), u.dispose(), p()) })) case 1: return i.a(2) } }, i) }) )() }, get global() { return o }, dispose: function () { a.stop() }, __instances: r, __getInstance: function (e) { return r.get(e) || null }, __setInstance: function (e, t) { r.set(e, t) }, __deleteInstance: function (e) { r.delete(e) }, } return u })({ legacy: !1, locale: NZ.value, messages: LZ }), OZ = Jq( ar({ __name: 'index', props: { color: {}, fontSize: {}, icon: {} }, emits: [], setup: function (e, t) { t.emit return function (e, t) { return ( Gi(), Yi( ((n = e.icon), $(n) ? kr(Er, n, !1) || n : n || Cr), { class: 'icon', style: be({ fontSize: e.fontSize + 'px', color: e.color }), }, null, 8, ['style'] ) ) var n } }, }), [['__scopeId', 'data-v-91f3cb32']] ), FZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var BZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', FZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), UZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var zZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', UZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), VZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '14.000000357627869', height: '10.000000357627869', viewBox: '0 0 14.000000357627869 10.000000357627869', } var HZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', VZ, t[0] || (t[0] = [ ea( 'g', null, [ ea('path', { d: 'M13.802466686534881,1.1380186865348816Q13.89646668653488,1.0444176865348815,13.947366686534881,0.9218876865348815Q13.998366686534881,0.7993576865348816,13.998366686534881,0.6666666865348816Q13.998366686534881,0.6011698865348816,13.98556668653488,0.5369316865348817Q13.972766686534882,0.4726936865348816,13.947666686534882,0.4121826865348816Q13.922666686534882,0.3516706865348816,13.886266686534881,0.2972126865348816Q13.849866686534881,0.2427536865348816,13.803566686534882,0.19644068653488161Q13.757266686534882,0.15012768653488162,13.702766686534881,0.11373968653488165Q13.648366686534882,0.07735168653488156,13.587866686534882,0.052286686534881555Q13.527266686534881,0.02722268653488158,13.463066686534882,0.014444686534881623Q13.398866686534882,0.0016666865348815563,13.333366686534882,0.0016666865348815563Q13.201466686534882,0.0016666865348815563,13.079566686534882,0.051981686534881555Q12.957666686534882,0.10229768653488158,12.864266686534881,0.1953146865348816L12.863066686534882,0.19413268653488158L4.624996686534882,8.392776686534882L1.1369396865348815,4.921396686534882L1.1357636865348817,4.922586686534881Q1.0422996865348817,4.829566686534881,0.9204146865348816,4.779246686534882Q0.7985286865348816,4.728936686534881,0.6666666865348816,4.728936686534881Q0.6011698865348816,4.728936686534881,0.5369316865348817,4.741706686534882Q0.4726936865348816,4.754486686534881,0.4121826865348816,4.779556686534882Q0.3516706865348816,4.804616686534882,0.2972126865348816,4.8410066865348815Q0.2427536865348816,4.8773966865348815,0.19644068653488161,4.9237066865348815Q0.15012768653488162,4.970016686534882,0.11373968653488165,5.024476686534881Q0.07735168653488156,5.078936686534882,0.052286686534881555,5.139446686534882Q0.02722268653488158,5.199956686534882,0.014444686534881623,5.2641966865348815Q0.0016666865348815563,5.328436686534881,0.0016666865348815563,5.3939366865348815Q0.0016666865348815563,5.526626686534882,0.05259268653488158,5.649156686534882Q0.10351768653488158,5.771686686534881,0.1975696865348816,5.865286686534882L0.1963936865348816,5.866466686534881L4.1547266865348815,9.805866686534882Q4.201126686534882,9.852046686534882,4.255616686534882,9.888306686534882Q4.310106686534882,9.924576686534882,4.3706166865348814,9.949556686534882Q4.431126686534881,9.974536686534881,4.495326686534882,9.987266686534882Q4.559536686534882,9.999996686534882,4.624996686534882,9.999996686534882Q4.690456686534882,9.999996686534882,4.754666686534882,9.987266686534882Q4.818876686534882,9.974536686534881,4.879386686534882,9.949556686534882Q4.939886686534882,9.924576686534882,4.994386686534882,9.888306686534882Q5.048876686534881,9.852046686534882,5.0952766865348815,9.805866686534882L13.803566686534882,1.1392006865348816L13.802466686534881,1.1380186865348816Z', 'fill-rule': 'evenodd', fill: '#E0E0FC', 'fill-opacity': '1', style: { 'mix-blend-mode': 'passthrough' }, }), ], -1 ), ]) ) ) }, ], ]), WZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var GZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', WZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), jZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var QZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', jZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), qZ = { class: 'icon', viewBox: '0 0 1024 1024', version: '1.1', xmlns: 'http://www.w3.org/2000/svg', } var XZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', qZ, t[0] || (t[0] = [ ea( 'path', { d: 'M899.925333 172.080762a48.761905 48.761905 0 0 1 0 28.525714l-207.969523 679.448381a48.761905 48.761905 0 0 1-81.115429 20.187429l-150.552381-150.552381-96.304762 96.329143a24.380952 24.380952 0 0 1-41.593905-17.237334v-214.966857l275.821715-243.370667-355.57181 161.596953-103.253333-103.228953a48.761905 48.761905 0 0 1 20.23619-81.091047L838.997333 139.702857a48.761905 48.761905 0 0 1 60.903619 32.353524z', }, null, -1 ), ]) ) ) }, ], ]), YZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var KZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', YZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), ZZ = { xmlns: 'http://www.w3.org/2000/svg', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', fill: 'none', version: '1.1', width: '20', height: '20', viewBox: '0 0 20 20', } var JZ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', ZZ, t[0] || (t[0] = [ ia( '', 2 ), ]) ) ) }, ], ]), $Z = { t: '1744352112173', class: 'icon', viewBox: '0 0 1024 1024', version: '1.1', xmlns: 'http://www.w3.org/2000/svg', 'p-id': '16533', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', width: '200', height: '200', } var eJ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', $Z, t[0] || (t[0] = [ ea( 'path', { d: 'M824 466.56V213.12q0-13.6512-5.2928-26.1632-5.104-12.064-14.3904-21.3536-9.2864-9.2864-21.3504-14.3872-12.5152-5.2928-26.1664-5.2928H246.4q-13.6512 0-26.1664 5.2928-12.064 5.1008-21.3504 14.3872-9.2864 9.2864-14.3904 21.3536Q179.2 199.4688 179.2 213.12v607.296q0 12.8448 5.0592 24.608 4.8576 11.2896 13.6704 19.9552 8.7616 8.6176 20.1184 13.344Q229.7792 883.2 242.56 883.2h217.6a28.8 28.8 0 0 0 0-57.6h-217.6q-2.528 0-4.2432-1.6864-1.5168-1.4912-1.5168-3.4976V213.12q0-3.9744 2.8128-6.784 2.8096-2.816 6.7872-2.816h510.4q3.9776 0 6.7872 2.816 2.8128 2.8096 2.8128 6.784v253.44a28.8 28.8 0 0 0 28.8 28.8 28.8 28.8 0 0 0 28.8-28.8zM466.0064 338.08l-130.2016 278.784A32 32 0 0 0 364.8 662.4h0.176a31.9904 31.9904 0 0 0 28.8192-18.4576L418.048 592h165.4976l15.2896 32.736q3.1008-3.4144 6.3904-6.704 20.3584-20.3616 45.4816-33.472l-115.1168-246.4832q-4.9408-10.5792-14.8704-16.5952-9.168-5.5552-19.9232-5.5552-10.7552 0-19.9232 5.5552-9.9296 6.016-14.8704 16.5952z m34.7936 76.7456L553.6576 528h-105.7152l52.8576-113.1776zM896 750.4c0 87.4816-70.9184 158.4-158.4 158.4S579.2 837.8816 579.2 750.4s70.9184-158.4 158.4-158.4 158.4 70.9184 158.4 158.4z m-116.3648-82.7648a28.9152 28.9152 0 0 1 7.1648-5.232q-5.8048-3.232-12.096-5.7248Q756.8256 649.6 737.6 649.6q-19.2256 0-37.104 7.0784-19.4112 7.6832-34.1728 22.448-14.7616 14.7616-22.4448 34.1696Q636.8 731.1744 636.8 750.4q0 19.232 7.0784 37.104 2.4896 6.2944 5.7248 12.096a28.7552 28.7552 0 0 1 5.232-7.1648l124.8-124.8zM838.4 750.4q0-19.2256-7.0784-37.104-2.4896-6.2912-5.7248-12.096a28.6944 28.6944 0 0 1-5.232 7.168l-124.8 124.8a28.7552 28.7552 0 0 1-7.1648 5.2288q5.8048 3.2352 12.096 5.728Q718.3744 851.2 737.6 851.2q19.2256 0 37.104-7.072 19.4112-7.6896 34.1728-22.4512 14.7616-14.7616 22.4448-34.1728Q838.4 769.632 838.4 750.4z', 'p-id': '16534', }, null, -1 ), ]) ) ) }, ], ]), tJ = { t: '1744352097285', class: 'icon', viewBox: '0 0 1024 1024', version: '1.1', xmlns: 'http://www.w3.org/2000/svg', 'p-id': '16380', 'data-spm-anchor-id': 'a313x.manage_type_myprojects.0.i0.60b03a81nz0mun', 'xmlns:xlink': 'http://www.w3.org/1999/xlink', width: '200', height: '200', } var nJ = Jq({}, [ [ 'render', function (e, t) { return ( Gi(), Xi( 'svg', tJ, t[0] || (t[0] = [ ea( 'path', { d: 'M833.6 213.12v253.44a28.8 28.8 0 0 1-28.8 28.8 28.8 28.8 0 0 1-28.8-28.8V213.12q0-3.9744-2.8128-6.784-2.8096-2.816-6.7872-2.816H256q-3.9776 0-6.7872 2.816Q246.4 209.1424 246.4 213.12v607.296q0 2.0064 1.5168 3.4976 1.7152 1.6864 4.2432 1.6864h217.6a28.8 28.8 0 0 1 0 57.6h-217.6q-12.7808 0-24.512-4.8768-11.3568-4.7232-20.1184-13.3408-8.8128-8.6656-13.6704-19.9584Q188.8 833.264 188.8 820.416V213.12q0-13.6512 5.2928-26.1632 5.104-12.064 14.3904-21.3536 9.2864-9.2864 21.3504-14.3872Q242.3456 145.92 256 145.92h510.4q13.6512 0 26.1664 5.2928 12.064 5.1008 21.3504 14.3872 9.2864 9.2864 14.3904 21.3536 5.2928 12.512 5.2928 26.1664zM345.408 613.664l130.1984-278.784q4.9408-10.5824 14.8704-16.5984 9.168-5.5552 19.9232-5.5552 10.7552 0 19.9232 5.5552 9.9296 6.016 14.8704 16.5952l130.2016 278.784a32 32 0 0 1-28.672 45.5392l-0.3232 0.0032c-12.4288 0-23.7344-7.2-28.9952-18.4608L593.1488 588.8h-165.4976l-24.256 51.9424a32.0064 32.0064 0 0 1-28.8192 18.4576l-0.176 0.0032a32 32 0 0 1-28.992-45.5424z m164.992-202.0416L457.5424 524.8h105.7152L510.4 411.6224z m120.2784 329.44l61.3216 61.5872 162.1248-162.8256a31.9936 31.9936 0 0 1 22.608-9.424H876.8a32 32 0 0 1 32 31.936v0.064a32 32 0 0 1-9.3216 22.5792l-184.8 185.6-0.0992 0.0992a31.9936 31.9936 0 0 1-45.2544-0.096l-83.984-84.352-0.016-0.016a31.9904 31.9904 0 0 1-9.2896-21.1104l30.496-33.4336c0.4896-0.0224 0.9792-0.032 1.4688-0.032h0.0704a32 32 0 0 1 22.608 9.4208z', 'p-id': '16381', 'data-spm-anchor-id': 'a313x.manage_type_myprojects.0.i1.60b03a81nz0mun', class: 'selected', }, null, -1 ), ]) ) ) }, ], ]), rJ = { class: 'action-group' }, iJ = { key: 0 }, aJ = ['onClick'], oJ = { key: 0, class: 'active-icon' }, sJ = { key: 1 }, uJ = ['onClick'], lJ = { key: 0, class: 'active-icon' }, cJ = { key: 2 }, hJ = ar({ __name: 'ActionGroup', setup: function (e) { var t = Yq(), n = qq(), r = is(t), i = r.hasCamera, a = r.hasMic, o = r.cameraOff, s = r.micMuted, u = r.volumeMuted, l = r.showChatRecords, c = r.streamState, h = r.selectedAudioDevice, d = r.selectedVideoDevice, f = r.availableAudioDevices, p = r.availableVideoDevices, v = t.handleCameraOff, m = t.handleMicMuted, g = t.handleVolumeMute, y = t.handleDeviceChange, _ = t.handleSubtitleToggle, b = is(n), x = b.wrapperRect, S = b.isLandscape, A = tn(!1), w = tn(!1) return function (e, t) { var n = (function (e) { return kr('directives', e) })('click-outside') return ( Gi(), Xi('div', rJ, [ on(i) ? (Gi(), Xi('div', iJ, [ Un( (Gi(), Xi( 'div', { class: 'action', onClick: t[1] || (t[1] = function () { return on(v) && on(v).apply(void 0, arguments) }), }, [ ta(on(OZ), { icon: on(o) ? on(BZ) : on(zZ) }, null, 8, ['icon']), 'closed' === on(c) ? (Gi(), Xi( 'div', { key: 0, class: 'corner', onClick: t[0] || (t[0] = Lo( function () { return (w.value = !w.value) }, ['stop', 'prevent'] )), }, t[6] || (t[6] = [ea('div', { class: 'corner-inner' }, null, -1)]) )) : aa('', !0), Un( ea( 'div', { class: Te(['selectors', { left: on(S) }]) }, [ (Gi(!0), Xi( Bi, null, Ir(on(p), function (e) { return ( Gi(), Xi( 'div', { key: e.deviceId, class: 'selector', onClick: Lo( function () { ;(on(y)(e.deviceId), (w.value = !1)) }, ['stop'] ), }, [ ra(Ie(e.label) + ' ', 1), on(d) && e.deviceId === on(d).deviceId ? (Gi(), Xi('div', oJ, [ta(on(HZ))])) : aa('', !0), ], 8, aJ ) ) }), 128 )), ], 2 ), [[no, w.value && 'closed' === on(c)]] ), ] )), [ [ n, function () { return (w.value = !1) }, ], ] ), ])) : aa('', !0), on(a) ? (Gi(), Xi('div', sJ, [ Un( (Gi(), Xi( 'div', { class: 'action', onClick: t[3] || (t[3] = function () { return on(m) && on(m).apply(void 0, arguments) }), }, [ ta(on(OZ), { icon: on(s) ? on(GZ) : on(QZ) }, null, 8, ['icon']), 'closed' === on(c) ? (Gi(), Xi( 'div', { key: 0, class: 'corner', onClick: t[2] || (t[2] = Lo( function () { return (A.value = !A.value) }, ['stop', 'prevent'] )), }, t[7] || (t[7] = [ea('div', { class: 'corner-inner' }, null, -1)]) )) : aa('', !0), Un( ea( 'div', { class: Te(['selectors', { left: on(S) }]) }, [ (Gi(!0), Xi( Bi, null, Ir(on(f), function (e) { return ( Gi(), Xi( 'div', { key: e.deviceId, class: 'selector', onClick: Lo( function (t) { ;(on(y)(e.deviceId), (A.value = !1)) }, ['stop'] ), }, [ ra(Ie(e.label) + ' ', 1), on(h) && e.deviceId === on(h).deviceId ? (Gi(), Xi('div', lJ, [ta(on(HZ))])) : aa('', !0), ], 8, uJ ) ) }), 128 )), ], 2 ), [[no, A.value && 'closed' === on(c)]] ), ] )), [ [ n, function () { return (A.value = !1) }, ], ] ), ])) : aa('', !0), ea( 'div', { class: 'action', onClick: t[4] || (t[4] = function () { return on(g) && on(g).apply(void 0, arguments) }), }, [ta(on(OZ), { icon: on(u) ? on(KZ) : on(JZ) }, null, 8, ['icon'])] ), on(x).width > 300 ? (Gi(), Xi('div', cJ, [ ea( 'div', { class: 'action', onClick: t[5] || (t[5] = function () { return on(_) && on(_).apply(void 0, arguments) }), }, [ta(on(OZ), { icon: on(l) ? on(nJ) : on(eJ) }, null, 8, ['icon'])] ), ])) : aa('', !0), ]) ) } }, }), dJ = Jq(hJ, [['__scopeId', 'data-v-628a9c05']]), fJ = { class: 'gradio-webrtc-waveContainer' }, pJ = ar({ __name: 'AudioWave', props: { streamState: { default: ms.closed }, audioSourceCallback: {}, numBars: { default: 16 }, icon: {}, iconButtonColor: { default: 'var(--color-accent)' }, pulseColor: { default: 'var(--color-accent)' }, waveColor: { default: 'var(--color-accent)' }, pulseScale: { default: 1 }, }, emits: [], setup: function (e, t) { t.emit var n, r, i, a, o = e, s = Ea(function () { return o.icon ? '128px' : 'calc((var(--boxSize) + var(--gutter)) * '.concat(o.numBars, ' + 80px)') }) function u() { r.getByteFrequencyData(i) for ( var e = document.querySelectorAll( '.gradio-webrtc-waveContainer .gradio-webrtc-box' ), t = 0; t < e.length; t++ ) { var n = i[l(t)] / 255, s = e[t] ;((s.style.transform = 'scaleY('.concat(Math.max(0.1, n), ')')), (s.style.background = o.waveColor), (s.style.opacity = '0.5')) } a = requestAnimationFrame(u) } function l(e) { var t = [0, 2, 4, 6, 8, 10, 12, 14, 15, 13, 11, 9, 7, 5, 3, 1] if (e < 0 || e >= t.length) throw new Error('Index must be between 0 and 15') return t[e] } return ( Ti( function () { return o.streamState }, function () { ;(console.log(111111), 'open' === o.streamState && (function () { ;((n = new (window.AudioContext || window.webkitAudioContext)()), (r = n.createAnalyser())) var e = o.audioSourceCallback() if (!e) return ;(n.createMediaStreamSource(e).connect(r), (r.fftSize = 64), (r.smoothingTimeConstant = 0.8), (i = new Uint8Array(r.frequencyBinCount)), u()) })()) }, { immediate: !0 } ), Sr(function () { ;(a && cancelAnimationFrame(a), n && n.close()) }), function (e, t) { return ( Gi(), Xi('div', fJ, [ ea( 'div', { class: 'gradio-webrtc-boxContainer', style: be({ width: s.value }) }, [ (Gi(!0), Xi( Bi, null, Ir(Array(e.numBars / 2), function (e, t) { return (Gi(), Xi('div', { key: t, class: 'gradio-webrtc-box' })) }), 128 )), t[0] || (t[0] = ea('div', { class: 'split-container' }, null, -1)), (Gi(!0), Xi( Bi, null, Ir(Array(e.numBars / 2), function (e, t) { return (Gi(), Xi('div', { key: t, class: 'gradio-webrtc-box' })) }), 128 )), ], 4 ), ]) ) } ) }, }), vJ = Jq(pJ, [['__scopeId', 'data-v-ba6f2cef']]), mJ = { class: 'player-controls' }, gJ = { key: 0 }, yJ = { key: 1, class: 'waiting-icon-text' }, _J = { class: 'icon', title: 'spinner' }, bJ = { key: 2, class: 'stop-chat-inner' }, xJ = { key: 0, class: 'input-audio-wave' }, SJ = ar({ __name: 'ChatBtn', props: { streamState: { default: ms.closed }, onStartChat: {}, audioSourceCallback: {}, waveColor: {}, }, emits: [], setup: function (e, t) { t.emit return function (e, t) { return ( Gi(), Xi('div', mJ, [ ea( 'div', { class: Te([ 'chat-btn', e.streamState === on(ms).closed && 'start-chat', e.streamState === on(ms).open && 'stop-chat', ]), onClick: t[0] || (t[0] = function () { return e.onStartChat && e.onStartChat.apply(e, arguments) }), }, [ e.streamState === on(ms).closed ? (Gi(), Xi('span', gJ, '点击开始对话')) : e.streamState === on(ms).waiting ? (Gi(), Xi('div', yJ, [ ea('div', _J, [ta(on(Vq), { wrapperClassName: 'spin-icon' })]), t[1] || (t[1] = ea('span', null, '等待中', -1)), ])) : (Gi(), Xi('div', bJ)), ], 2 ), e.streamState === on(ms).open ? (Gi(), Xi('div', xJ, [ ta( vJ, { audioSourceCallback: e.audioSourceCallback, streamState: e.streamState, waveColor: e.waveColor, }, null, 8, ['audioSourceCallback', 'streamState', 'waveColor'] ), ])) : aa('', !0), ]) ) } }, }), AJ = Jq(SJ, [['__scopeId', 'data-v-58c5790e']]) var wJ, TJ = { class: 'chat-input-container' }, MJ = { class: 'chat-input-inner' }, EJ = { class: 'chat-input-wrapper' }, CJ = ar({ __name: 'ChatInput', props: { replying: { type: Boolean } }, emits: ['send', 'stop', 'interrupt'], setup: function (e, t) { var n = t.emit, r = 24, i = sr('rowsDivRef'), a = sr('chatInputRef') function o(e) { var t, n, r 'Enter' === e.key && (e.altKey ? a.value && ((a.value.value = ((t = a.value.value), (n = '\n'), (r = a.value.selectionStart || 0) < 0 || r > t.length ? (console.error('索引超出范围'), t) : t.substring(0, r) + n + t.substring(r))), a.value.dispatchEvent(new InputEvent('input'))) : (e.preventDefault(), s())) } function s() { return u.apply(this, arguments) } function u() { return (u = v( d().m(function e() { return d().w(function (e) { for (;;) switch (e.n) { case 0: a.value && (n('send', a.value.value), (a.value.value = '')) case 1: return e.a(2) } }, e) }) )).apply(this, arguments) } function l(e) { i.value && ((i.value.textContent = e.target.value.replace(/\n$/, '\n\n')), (r = i.value.offsetHeight)) } function c() { n('stop') } function h() { n('interrupt') } return function (e, t) { return ( Gi(), Xi('div', TJ, [ ea('div', { class: 'stop-chat-btn', onClick: c }), ea('div', MJ, [ ea('div', EJ, [ ea( 'textarea', { class: 'chat-input', ref_key: 'chatInputRef', ref: a, onKeydown: o, onInput: l, style: be('height:'.concat(on(r), 'px')), }, null, 36 ), ea( 'div', { class: 'rowsDiv', ref_key: 'rowsDivRef', ref: i }, Ie(on('')), 513 ), ]), e.replying ? (Gi(), Xi('button', { key: 0, class: 'interrupt-btn', onClick: h })) : (Gi(), Xi('button', { key: 1, class: 'send-btn', onClick: s }, [ ta(on(OZ), { icon: on(XZ), color: '#fff' }, null, 8, ['icon']), ])), ]), ]) ) } }, }), kJ = Jq(CJ, [['__scopeId', 'data-v-32a58abc']]), RJ = { class: 'answer-message-text' }, IJ = Jq( ar({ __name: 'ChatMessage', props: { message: {}, role: {}, style: {} }, setup: function (e) { return function (e, t) { return ( Gi(), Xi( 'div', { class: Te(['answer-message-container', e.role]), style: be(e.style) }, [ea('div', RJ, Ie(e.message), 1)], 6 ) ) } }, }), [['__scopeId', 'data-v-dde1c5d3']] ), NJ = { class: 'chat-records-inner' }, PJ = ar({ __name: 'ChatRecords', props: { chatRecords: {} }, setup: function (e, t) { var n = t.expose, r = e, i = sr('containerRef') function a() { i.value && (i.value.scrollTop = i.value.scrollHeight) } return ( Ti( function () { return r.chatRecords }, function (e) { r.chatRecords && Cn().then(function () { a() }) } ), n({ scrollToBottom: a }), function (e, t) { return ( Gi(), Xi( 'div', { class: 'chat-records', ref_key: 'containerRef', ref: i }, [ ea('div', NJ, [ (Gi(!0), Xi( Bi, null, Ir(e.chatRecords, function (e, t) { return ( Gi(), Xi( 'div', { key: e.id, class: Te('chat-message '.concat(e.role)) }, [ ta(IJ, { message: e.message, role: e.role }, null, 8, [ 'message', 'role', ]), ], 2 ) ) }), 128 )), ]), ], 512 ) ) } ) }, }), LJ = { class: 'content-container' }, DJ = ['muted'], OJ = { class: 'actions' }, FJ = { key: 0, class: 'chat-records-container' }, BJ = Jq( ar({ __name: 'index', setup: function (e) { var t = qq(), n = Yq(), r = tn(), i = tn(), a = tn(), o = tn(), s = tn(), u = tn('9 / 16'), l = function () { s.value && (u.value = ''.concat(s.value.videoWidth, ' / ').concat(s.value.videoHeight)) }, c = function () { return n.localStream } yr(function () { var e = r.value ;((t.wrapperRef = e), e.getBoundingClientRect(), (w.value.width = e.clientWidth), (w.value.height = e.clientHeight), (t.isLandscape = w.value.width > w.value.height), console.log(w), (t.remoteVideoContainerRef = a.value), (t.localVideoContainerRef = i.value), (t.localVideoRef = o.value), (t.remoteVideoRef = s.value), (t.wrapperRef = r.value)) }) var h = is(n), d = h.hasCamera, f = h.hasMic, p = h.micMuted, v = h.cameraOff, m = h.webcamAccessed, g = h.streamState, y = h.avatarType, _ = h.volumeMuted, b = h.replying, x = h.showChatRecords, S = h.chatRecords, A = is(t), w = A.wrapperRect, T = A.isLandscape function M() { n.startWebRTC().then(function () { !(function () { if (!n.chatDataChannel) return n.chatDataChannel.addEventListener('message', function (e) { var t = JSON.parse(e.data) if ('chat' === t.type) { var r = n.chatRecords.findIndex(function (e) { return e.id === t.id }) if (-1 !== r) { var i = n.chatRecords[r] ;((i.message += t.message), n.chatRecords.splice(r, 1, i), (n.chatRecords = I(n.chatRecords))) } else n.chatRecords = [].concat(I(n.chatRecords), [ { id: t.id, role: t.role || 'human', message: t.message }, ]) } else 'avatar_end' === t.type && (n.replying = !1) }) })() }) } function E() { n.chatDataChannel && n.chatDataChannel.send(JSON.stringify({ type: 'stop_chat' })) } var C = sr('chatRecordsInstanceRef') function k(e) { var t e && n.chatDataChannel && (n.chatDataChannel.send(JSON.stringify({ type: 'chat', data: e })), (n.replying = !0), null === (t = C.value) || void 0 === t || t.scrollToBottom()) } return function (e, t) { return ( Gi(), Xi( 'div', { class: 'page-container', ref_key: 'wrapRef', ref: r }, [ ea('div', LJ, [ ea( 'div', { class: 'video-container', style: be({ visibility: on(m) ? 'visible' : 'hidden', aspectRatio: u.value, }), }, [ Un( ea( 'div', { class: Te( 'local-video-container '.concat( 'open' === on(g) ? 'scaled' : '' ) ), ref_key: 'localVideoContainerRef', ref: i, }, [ ea( 'video', { class: 'local-video', ref_key: 'localVideoRef', ref: o, autoplay: '', muted: '', playsinline: '', style: be({ visibility: on(v) ? 'hidden' : 'visible', display: !on(d) || on(v) ? 'none' : 'block', }), }, null, 4 ), ], 2 ), [[no, on(d) && !on(v)]] ), ea( 'div', { class: 'remote-video-container', ref_key: 'remoteVideoContainerRef', ref: a, }, [ on(y) ? aa('', !0) : Un( (Gi(), Xi( 'video', { key: 0, class: 'remote-video', onPlaying: l, ref_key: 'remoteVideoRef', ref: s, autoplay: '', playsinline: '', muted: on(_), }, null, 40, DJ )), [[no, 'open' === on(g)]] ), 'open' === on(g) && on(x) && !on(T) ? (Gi(), Xi( 'div', { key: 1, class: Te('chat-records-container inline'), style: be( !on(d) || on(v) ? 'width:80%;padding-bottom:12px;' : 'padding-bottom:12px;' ), }, [ ta( PJ, { ref_key: 'chatRecordsInstanceRef', ref: C, chatRecords: on(S).filter(function (e, t) { return t >= on(S).length - 4 }), }, null, 8, ['chatRecords'] ), ], 4 )) : aa('', !0), ], 512 ), ea('div', OJ, [ta(dJ)]), ], 4 ), (on(f) && !on(p)) || 'open' !== on(g) ? on(m) ? (Gi(), Yi( AJ, { key: 1, onStartChat: M, 'audio-source-callback': c, streamState: on(g), 'wave-color': '#7873F6', }, null, 8, ['streamState'] )) : aa('', !0) : (Gi(), Yi( kJ, { key: 0, replying: on(b), onInterrupt: E, onSend: k, onStop: on(n).startWebRTC, }, null, 8, ['replying', 'onStop'] )), ]), 'open' === on(g) && on(x) && on(T) ? (Gi(), Xi('div', FJ, [ ta( PJ, { ref_key: 'chatRecordsInstanceRef', ref: C, chatRecords: on(S) }, null, 8, ['chatRecords'] ), ])) : aa('', !0), ], 512 ) ) } }, }), [['__scopeId', 'data-v-269b506f']] ), UJ = { class: 'wrap' }, zJ = Jq( ar({ __name: 'App', setup: function (e) { var t = Yq() return ( t.init(), function (e, n) { return ( Gi(), Yi( on(Pq), { locale: on(PZ)[on(NZ)] }, { default: Bn(function () { return [ ea('div', UJ, [ on(t).webcamAccessed ? aa('', !0) : (Gi(), Yi($q, { key: 0 })), ta(BJ), ]), ] }), _: 1, }, 8, ['locale'] ) ) } ) }, }), [['__scopeId', 'data-v-45f9c857']] ), VJ = { exports: {} } var HJ, WJ, GJ, jJ, QJ, qJ = (wJ || ((wJ = 1), (function (e) { e.exports = (function () { var e = '__v-click-outside', t = 'undefined' != typeof window, n = 'undefined' != typeof navigator, r = t && ('ontouchstart' in window || (n && navigator.msMaxTouchPoints > 0)) ? ['touchstart'] : ['click'], i = function (e) { var t = e.event, n = e.handler ;(0, e.middleware)(t) && n(t) }, a = function (t, n) { var a = (function (e) { var t = 'function' == typeof e if (!t && 'object' != P(e)) throw new Error( 'v-click-outside: Binding value must be a function or an object' ) return { handler: t ? e : e.handler, middleware: e.middleware || function (e) { return e }, events: e.events || r, isActive: !(!1 === e.isActive), detectIframe: !(!1 === e.detectIframe), capture: Boolean(e.capture), } })(n.value), o = a.handler, s = a.middleware, u = a.detectIframe, l = a.capture if (a.isActive) { if ( ((t[e] = a.events.map(function (e) { return { event: e, srcTarget: document.documentElement, handler: function (e) { return (function (e) { var t = e.el, n = e.event, r = e.handler, a = e.middleware, o = n.path || (n.composedPath && n.composedPath()) ;(o ? o.indexOf(t) < 0 : !t.contains(n.target)) && i({ event: n, handler: r, middleware: a }) })({ el: t, event: e, handler: o, middleware: s }) }, capture: l, } })), u) ) { var c = { event: 'blur', srcTarget: window, handler: function (e) { return (function (e) { var t = e.el, n = e.event, r = e.handler, a = e.middleware setTimeout(function () { var e = document.activeElement e && 'IFRAME' === e.tagName && !t.contains(e) && i({ event: n, handler: r, middleware: a }) }, 0) })({ el: t, event: e, handler: o, middleware: s }) }, capture: l, } t[e] = [].concat(t[e], [c]) } t[e].forEach(function (n) { var r = n.event, i = n.srcTarget, a = n.handler return setTimeout(function () { t[e] && i.addEventListener(r, a, l) }, 0) }) } }, o = function (t) { ;((t[e] || []).forEach(function (e) { return e.srcTarget.removeEventListener(e.event, e.handler, e.capture) }), delete t[e]) }, s = t ? { beforeMount: a, updated: function (e, t) { var n = t.value, r = t.oldValue JSON.stringify(n) !== JSON.stringify(r) && (o(e), a(e, { value: n })) }, unmounted: o, } : {} return { install: function (e) { e.directive('click-outside', s) }, directive: s, } })() })(VJ)), VJ.exports), XJ = as(qJ), YJ = (function () { var e, t = (e = Oo()).createApp.apply(e, arguments), n = t.mount return ( (t.mount = function (e) { var r = (function (e) { if ($(e)) { return document.querySelector(e) } return e })( /*! * pinia v3.0.3 * (c) 2025 Eduardo San Martin Morote * @license MIT */ e ) if (r) { var i = t._component ;(J(i) || i.render || i.template || (i.template = r.innerHTML), 1 === r.nodeType && (r.textContent = '')) var a = n( r, !1, (function (e) { if (e instanceof SVGElement) return 'svg' if ('function' == typeof MathMLElement && e instanceof MathMLElement) return 'mathml' })(r) ) return ( r instanceof Element && (r.removeAttribute('v-cloak'), r.setAttribute('data-v-app', '')), a ) } }), t ) })(zJ), KJ = ((HJ = De(!0)), (WJ = HJ.run(function () { return tn({}) })), (jJ = []), (QJ = Zt({ install: function (e) { ;(Vo(QJ), (QJ._a = e), e.provide(Ho, QJ), (e.config.globalProperties.$pinia = QJ), jJ.forEach(function (e) { return GJ.push(e) }), (jJ = [])) }, use: function (e) { return (this._a ? GJ.push(e) : jJ.push(e), this) }, _p: (GJ = []), _a: null, _e: HJ, _s: new Map(), state: WJ, })), QJ) ;(YJ.use(KJ), YJ.use(DZ), YJ.use(XJ), YJ.mount('#app')) }, } })) })()